diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index e7a6a191a..12025e1ce 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -376,6 +376,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_argument_nested() + }) + if checksum != 44576 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_argument_nested: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes() }) @@ -997,6 +1006,87 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements() + }) + if checksum != 20773 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag() + }) + if checksum != 31154 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin() + }) + if checksum != 38884 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge() + }) + if checksum != 44350 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_movecall_arguments() + }) + if checksum != 17202 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_movecall_arguments: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_movecall_function() + }) + if checksum != 2751 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_movecall_function: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_movecall_module() + }) + if checksum != 35106 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_movecall_module: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_movecall_package() + }) + if checksum != 24481 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_movecall_package: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments() + }) + if checksum != 46468 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap() }) @@ -1573,6 +1663,42 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands() + }) + if checksum != 49868 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs() + }) + if checksum != 25458 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_publish_dependencies() + }) + if checksum != 57311 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_publish_dependencies: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_publish_modules() + }) + if checksum != 26011 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_publish_modules: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes() }) @@ -1762,6 +1888,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts() + }) + if checksum != 10377 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin() + }) + if checksum != 17278 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_structtag_address() }) @@ -1897,6 +2041,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_transferobjects_address() + }) + if checksum != 37833 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transferobjects_address: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects() + }) + if checksum != 24154 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag() }) @@ -2032,6 +2194,42 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies() + }) + if checksum != 7113 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_upgrade_modules() + }) + if checksum != 62138 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_upgrade_modules: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_upgrade_package() + }) + if checksum != 35757 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_upgrade_package: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket() + }) + if checksum != 11416 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig() }) @@ -2302,6 +2500,42 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas() + }) + if checksum != 14489 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input() + }) + if checksum != 33966 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result() + }) + if checksum != 57666 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result() + }) + if checksum != 44025 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes() }) @@ -2464,6 +2698,69 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector() + }) + if checksum != 54610 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins() + }) + if checksum != 1888 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call() + }) + if checksum != 23161 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish() + }) + if checksum != 7239 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins() + }) + if checksum != 59484 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects() + }) + if checksum != 54265 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade() + }) + if checksum != 48835 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58() }) @@ -2725,6 +3022,69 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned() + }) + if checksum != 33908 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure() + }) + if checksum != 53404 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving() + }) + if checksum != 28060 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared() + }) + if checksum != 61970 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new() + }) + if checksum != 20934 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new() + }) + if checksum != 1506 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_movecall_new() + }) + if checksum != 30411 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_movecall_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() }) @@ -2887,6 +3247,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new() + }) + if checksum != 38638 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_publish_new() + }) + if checksum != 4785 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_publish_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes() }) @@ -2996,16 +3374,25 @@ func uniffiCheckChecksums() { } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() + return C.uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new() }) - if checksum != 13756 { + if checksum != 50321 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin() + return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() + }) + if checksum != 13756 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin() }) if checksum != 37848 { // If this happens try cleaning and rebuilding your project @@ -3184,6 +3571,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new() + }) + if checksum != 22470 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address() }) @@ -3283,6 +3679,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new() + }) + if checksum != 61663 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64() }) @@ -3892,6 +4297,148 @@ func (_ FfiDestroyerAddress) Destroy(value *Address) { +// An argument to a programmable transaction command +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// argument = argument-gas +// =/ argument-input +// =/ argument-result +// =/ argument-nested-result +// +// argument-gas = %x00 +// argument-input = %x01 u16 +// argument-result = %x02 u16 +// argument-nested-result = %x03 u16 u16 +// ``` +type ArgumentInterface interface { + // Turn a Result into a NestedResult. If the argument is not a Result, + // returns None. + Nested(ix uint16) **Argument +} +// An argument to a programmable transaction command +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// argument = argument-gas +// =/ argument-input +// =/ argument-result +// =/ argument-nested-result +// +// argument-gas = %x00 +// argument-input = %x01 u16 +// argument-result = %x02 u16 +// argument-nested-result = %x03 u16 u16 +// ``` +type Argument struct { + ffiObject FfiObject +} + + +// The gas coin. The gas coin can only be used by-ref, except for with +// `TransferObjects`, which can use it by-value. +func ArgumentNewGas() *Argument { + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_argument_new_gas(_uniffiStatus) + })) +} + +// One of the input objects or primitive values (from +// `ProgrammableTransaction` inputs) +func ArgumentNewInput(input uint16) *Argument { + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_argument_new_input(FfiConverterUint16INSTANCE.Lower(input),_uniffiStatus) + })) +} + +// Like a `Result` but it accesses a nested result. Currently, the only +// usage of this is to access a value from a Move call with multiple +// return values. +func ArgumentNewNestedResult(commandIndex uint16, subresultIndex uint16) *Argument { + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_argument_new_nested_result(FfiConverterUint16INSTANCE.Lower(commandIndex), FfiConverterUint16INSTANCE.Lower(subresultIndex),_uniffiStatus) + })) +} + +// The result of another command (from `ProgrammableTransaction` commands) +func ArgumentNewResult(result uint16) *Argument { + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_argument_new_result(FfiConverterUint16INSTANCE.Lower(result),_uniffiStatus) + })) +} + + + +// Turn a Result into a NestedResult. If the argument is not a Result, +// returns None. +func (_self *Argument) Nested(ix uint16) **Argument { + _pointer := _self.ffiObject.incrementPointer("*Argument") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_argument_nested( + _pointer,FfiConverterUint16INSTANCE.Lower(ix),_uniffiStatus), + } + })) +} +func (object *Argument) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterArgument struct {} + +var FfiConverterArgumentINSTANCE = FfiConverterArgument{} + + +func (c FfiConverterArgument) Lift(pointer unsafe.Pointer) *Argument { + result := &Argument { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_argument(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_argument(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Argument).Destroy) + return result +} + +func (c FfiConverterArgument) Read(reader io.Reader) *Argument { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterArgument) Lower(value *Argument) 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("*Argument") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterArgument) Write(writer io.Writer, value *Argument) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerArgument struct {} + +func (_ FfiDestroyerArgument) Destroy(value *Argument) { + value.Destroy() +} + + + type AuthenticatorStateExpireInterface interface { } type AuthenticatorStateExpire struct { @@ -5186,6 +5733,172 @@ func (_ FfiDestroyerCoin) Destroy(value *Coin) { +// A single command in a programmable transaction. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// command = command-move-call +// =/ command-transfer-objects +// =/ command-split-coins +// =/ command-merge-coins +// =/ command-publish +// =/ command-make-move-vector +// =/ command-upgrade +// +// command-move-call = %x00 move-call +// command-transfer-objects = %x01 transfer-objects +// command-split-coins = %x02 split-coins +// command-merge-coins = %x03 merge-coins +// command-publish = %x04 publish +// command-make-move-vector = %x05 make-move-vector +// command-upgrade = %x06 upgrade +// ``` +type CommandInterface interface { +} +// A single command in a programmable transaction. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// command = command-move-call +// =/ command-transfer-objects +// =/ command-split-coins +// =/ command-merge-coins +// =/ command-publish +// =/ command-make-move-vector +// =/ command-upgrade +// +// command-move-call = %x00 move-call +// command-transfer-objects = %x01 transfer-objects +// command-split-coins = %x02 split-coins +// command-merge-coins = %x03 merge-coins +// command-publish = %x04 publish +// command-make-move-vector = %x05 make-move-vector +// command-upgrade = %x06 upgrade +// ``` +type Command struct { + ffiObject FfiObject +} + + +// Given n-values of the same type, it constructs a vector. For non objects +// or an empty vector, the type tag must be specified. +func CommandNewMakeMoveVector(makeMoveVector *MakeMoveVector) *Command { + return FfiConverterCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_command_new_make_move_vector(FfiConverterMakeMoveVectorINSTANCE.Lower(makeMoveVector),_uniffiStatus) + })) +} + +// It merges n-coins into the first coin +func CommandNewMergeCoins(mergeCoins *MergeCoins) *Command { + return FfiConverterCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_command_new_merge_coins(FfiConverterMergeCoinsINSTANCE.Lower(mergeCoins),_uniffiStatus) + })) +} + +// A call to either an entry or a public Move function +func CommandNewMoveCall(moveCall *MoveCall) *Command { + return FfiConverterCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_command_new_move_call(FfiConverterMoveCallINSTANCE.Lower(moveCall),_uniffiStatus) + })) +} + +// Publishes a Move package. It takes the package bytes and a list of the +// package's transitive dependencies to link against on-chain. +func CommandNewPublish(publish *Publish) *Command { + return FfiConverterCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_command_new_publish(FfiConverterPublishINSTANCE.Lower(publish),_uniffiStatus) + })) +} + +// It splits off some amounts into a new coins with those amounts +func CommandNewSplitCoins(splitCoins *SplitCoins) *Command { + return FfiConverterCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_command_new_split_coins(FfiConverterSplitCoinsINSTANCE.Lower(splitCoins),_uniffiStatus) + })) +} + +// It sends n-objects to the specified address. These objects must have +// store (public transfer) and either the previous owner must be an +// address or the object must be newly created. +func CommandNewTransferObjects(transferObjects *TransferObjects) *Command { + return FfiConverterCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_command_new_transfer_objects(FfiConverterTransferObjectsINSTANCE.Lower(transferObjects),_uniffiStatus) + })) +} + +// Upgrades a Move package +// Takes (in order): +// 1. A vector of serialized modules for the package. +// 2. A vector of object ids for the transitive dependencies of the new +// package. +// 3. The object ID of the package being upgraded. +// 4. An argument holding the `UpgradeTicket` that must have been produced +// from an earlier command in the same programmable transaction. +func CommandNewUpgrade(upgrade *Upgrade) *Command { + return FfiConverterCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_command_new_upgrade(FfiConverterUpgradeINSTANCE.Lower(upgrade),_uniffiStatus) + })) +} + + +func (object *Command) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCommand struct {} + +var FfiConverterCommandINSTANCE = FfiConverterCommand{} + + +func (c FfiConverterCommand) Lift(pointer unsafe.Pointer) *Command { + result := &Command { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_command(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_command(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Command).Destroy) + return result +} + +func (c FfiConverterCommand) Read(reader io.Reader) *Command { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCommand) Lower(value *Command) 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("*Command") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCommand) Write(writer io.Writer, value *Command) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCommand struct {} + +func (_ FfiDestroyerCommand) Destroy(value *Command) { + value.Destroy() +} + + + type ConsensusCommitDigestInterface interface { ToBase58() string ToBytes() []byte @@ -8386,149 +9099,658 @@ func (_ FfiDestroyerIdentifier) Destroy(value *Identifier) { -// A move package +// An input to a user transaction // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// object-move-package = object-id u64 move-modules type-origin-table linkage-table +// input = input-pure / input-immutable-or-owned / input-shared / input-receiving // -// move-modules = map (identifier bytes) -// type-origin-table = vector type-origin -// linkage-table = map (object-id upgrade-info) +// input-pure = %x00 bytes +// input-immutable-or-owned = %x01 object-ref +// input-shared = %x02 object-id u64 bool +// input-receiving = %x04 object-ref // ``` -type MovePackageInterface interface { +type InputInterface interface { } -// A move package +// An input to a user transaction // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// object-move-package = object-id u64 move-modules type-origin-table linkage-table +// input = input-pure / input-immutable-or-owned / input-shared / input-receiving // -// move-modules = map (identifier bytes) -// type-origin-table = vector type-origin -// linkage-table = map (object-id upgrade-info) +// input-pure = %x00 bytes +// input-immutable-or-owned = %x01 object-ref +// input-shared = %x02 object-id u64 bool +// input-receiving = %x04 object-ref // ``` -type MovePackage struct { +type Input struct { ffiObject FfiObject } -func NewMovePackage(id *ObjectId, version uint64, modules map[*Identifier][]byte, typeOriginTable []TypeOrigin, linkageTable map[*ObjectId]UpgradeInfo) (*MovePackage, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new(FfiConverterObjectIdINSTANCE.Lower(id), FfiConverterUint64INSTANCE.Lower(version), FfiConverterMapIdentifierBytesINSTANCE.Lower(modules), FfiConverterSequenceTypeOriginINSTANCE.Lower(typeOriginTable), FfiConverterMapObjectIdUpgradeInfoINSTANCE.Lower(linkageTable),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *MovePackage - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterMovePackageINSTANCE.Lift(_uniffiRV), nil - } + + +// A move object that is either immutable or address owned +func InputNewImmutableOrOwned(objectRef ObjectReference) *Input { + return FfiConverterInputINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_input_new_immutable_or_owned(FfiConverterObjectReferenceINSTANCE.Lower(objectRef),_uniffiStatus) + })) } +// For normal operations this is required to be a move primitive type and +// not contain structs or objects. +func InputNewPure(value []byte) *Input { + return FfiConverterInputINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_input_new_pure(FfiConverterBytesINSTANCE.Lower(value),_uniffiStatus) + })) +} +func InputNewReceiving(objectRef ObjectReference) *Input { + return FfiConverterInputINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_input_new_receiving(FfiConverterObjectReferenceINSTANCE.Lower(objectRef),_uniffiStatus) + })) +} -func (object *MovePackage) Destroy() { +// A move object whose owner is "Shared" +func InputNewShared(objectId *ObjectId, initialSharedVersion uint64, mutable bool) *Input { + return FfiConverterInputINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_input_new_shared(FfiConverterObjectIdINSTANCE.Lower(objectId), FfiConverterUint64INSTANCE.Lower(initialSharedVersion), FfiConverterBoolINSTANCE.Lower(mutable),_uniffiStatus) + })) +} + + +func (object *Input) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterMovePackage struct {} +type FfiConverterInput struct {} -var FfiConverterMovePackageINSTANCE = FfiConverterMovePackage{} +var FfiConverterInputINSTANCE = FfiConverterInput{} -func (c FfiConverterMovePackage) Lift(pointer unsafe.Pointer) *MovePackage { - result := &MovePackage { +func (c FfiConverterInput) Lift(pointer unsafe.Pointer) *Input { + result := &Input { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_input(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_movepackage(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_input(pointer, status) }, ), } - runtime.SetFinalizer(result, (*MovePackage).Destroy) + runtime.SetFinalizer(result, (*Input).Destroy) return result } -func (c FfiConverterMovePackage) Read(reader io.Reader) *MovePackage { +func (c FfiConverterInput) Read(reader io.Reader) *Input { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterMovePackage) Lower(value *MovePackage) unsafe.Pointer { +func (c FfiConverterInput) Lower(value *Input) 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("*MovePackage") + pointer := value.ffiObject.incrementPointer("*Input") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterMovePackage) Write(writer io.Writer, value *MovePackage) { +func (c FfiConverterInput) Write(writer io.Writer, value *Input) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerMovePackage struct {} +type FfiDestroyerInput struct {} -func (_ FfiDestroyerMovePackage) Destroy(value *MovePackage) { +func (_ FfiDestroyerInput) Destroy(value *Input) { value.Destroy() } -// Aggregated signature from members of a multisig committee. +// Command to build a move vector out of a set of individual elements // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// multisig-aggregated-signature = (vector multisig-member-signature) -// u16 ; bitmap -// multisig-committee -// ``` -// -// There is also a legacy encoding for this type defined as: -// -// ```text -// legacy-multisig-aggregated-signature = (vector multisig-member-signature) -// roaring-bitmap ; bitmap -// legacy-multisig-committee -// roaring-bitmap = bytes ; where the contents of the bytes are valid -// ; according to the serialized spec for -// ; roaring bitmaps +// make-move-vector = (option type-tag) (vector argument) // ``` -// -// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the -// serialized format of RoaringBitmaps. -type MultisigAggregatedSignatureInterface interface { - // The bitmap that indicates which committee members provided their - // signature. - Bitmap() uint16 - Committee() *MultisigCommittee - // The list of signatures from committee members - Signatures() []*MultisigMemberSignature +type MakeMoveVectorInterface interface { + // The set individual elements to build the vector with + Elements() []*Argument + // Type of the individual elements + // + // This is required to be set when the type can't be inferred, for example + // when the set of provided arguments are all pure input values. + TypeTag() **TypeTag } -// Aggregated signature from members of a multisig committee. +// Command to build a move vector out of a set of individual elements // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// multisig-aggregated-signature = (vector multisig-member-signature) -// u16 ; bitmap -// multisig-committee +// make-move-vector = (option type-tag) (vector argument) // ``` -// -// There is also a legacy encoding for this type defined as: +type MakeMoveVector struct { + ffiObject FfiObject +} +func NewMakeMoveVector(typeTag **TypeTag, elements []*Argument) *MakeMoveVector { + return FfiConverterMakeMoveVectorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_makemovevector_new(FfiConverterOptionalTypeTagINSTANCE.Lower(typeTag), FfiConverterSequenceArgumentINSTANCE.Lower(elements),_uniffiStatus) + })) +} + + + + +// The set individual elements to build the vector with +func (_self *MakeMoveVector) Elements() []*Argument { + _pointer := _self.ffiObject.incrementPointer("*MakeMoveVector") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_makemovevector_elements( + _pointer,_uniffiStatus), + } + })) +} + +// Type of the individual elements +// +// This is required to be set when the type can't be inferred, for example +// when the set of provided arguments are all pure input values. +func (_self *MakeMoveVector) TypeTag() **TypeTag { + _pointer := _self.ffiObject.incrementPointer("*MakeMoveVector") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_makemovevector_type_tag( + _pointer,_uniffiStatus), + } + })) +} +func (object *MakeMoveVector) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterMakeMoveVector struct {} + +var FfiConverterMakeMoveVectorINSTANCE = FfiConverterMakeMoveVector{} + + +func (c FfiConverterMakeMoveVector) Lift(pointer unsafe.Pointer) *MakeMoveVector { + result := &MakeMoveVector { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_makemovevector(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_makemovevector(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*MakeMoveVector).Destroy) + return result +} + +func (c FfiConverterMakeMoveVector) Read(reader io.Reader) *MakeMoveVector { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterMakeMoveVector) Lower(value *MakeMoveVector) 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("*MakeMoveVector") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterMakeMoveVector) Write(writer io.Writer, value *MakeMoveVector) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerMakeMoveVector struct {} + +func (_ FfiDestroyerMakeMoveVector) Destroy(value *MakeMoveVector) { + value.Destroy() +} + + + +// Command to merge multiple coins of the same type into a single coin +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// merge-coins = argument (vector argument) +// ``` +type MergeCoinsInterface interface { + // Coin to merge coins into + Coin() *Argument + // Set of coins to merge into `coin` + // + // All listed coins must be of the same type and be the same type as `coin` + CoinsToMerge() []*Argument +} +// Command to merge multiple coins of the same type into a single coin +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// merge-coins = argument (vector argument) +// ``` +type MergeCoins struct { + ffiObject FfiObject +} +func NewMergeCoins(coin *Argument, coinsToMerge []*Argument) *MergeCoins { + return FfiConverterMergeCoinsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_mergecoins_new(FfiConverterArgumentINSTANCE.Lower(coin), FfiConverterSequenceArgumentINSTANCE.Lower(coinsToMerge),_uniffiStatus) + })) +} + + + + +// Coin to merge coins into +func (_self *MergeCoins) Coin() *Argument { + _pointer := _self.ffiObject.incrementPointer("*MergeCoins") + defer _self.ffiObject.decrementPointer() + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_mergecoins_coin( + _pointer,_uniffiStatus) + })) +} + +// Set of coins to merge into `coin` +// +// All listed coins must be of the same type and be the same type as `coin` +func (_self *MergeCoins) CoinsToMerge() []*Argument { + _pointer := _self.ffiObject.incrementPointer("*MergeCoins") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_mergecoins_coins_to_merge( + _pointer,_uniffiStatus), + } + })) +} +func (object *MergeCoins) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterMergeCoins struct {} + +var FfiConverterMergeCoinsINSTANCE = FfiConverterMergeCoins{} + + +func (c FfiConverterMergeCoins) Lift(pointer unsafe.Pointer) *MergeCoins { + result := &MergeCoins { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_mergecoins(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_mergecoins(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*MergeCoins).Destroy) + return result +} + +func (c FfiConverterMergeCoins) Read(reader io.Reader) *MergeCoins { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterMergeCoins) Lower(value *MergeCoins) 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("*MergeCoins") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterMergeCoins) Write(writer io.Writer, value *MergeCoins) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerMergeCoins struct {} + +func (_ FfiDestroyerMergeCoins) Destroy(value *MergeCoins) { + value.Destroy() +} + + + +// Command to call a move function +// +// Functions that can be called by a `MoveCall` command are those that have a +// function signature that is either `entry` or `public` (which don't have a +// reference return type). +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// move-call = object-id ; package id +// identifier ; module name +// identifier ; function name +// (vector type-tag) ; type arguments, if any +// (vector argument) ; input arguments +// ``` +type MoveCallInterface interface { + // The arguments to the function. + Arguments() []*Argument + // The function to be called. + Function() *Identifier + // The specific module in the package containing the function. + Module() *Identifier + // The package containing the module and function. + Package() *ObjectId + // The type arguments to the function. + TypeArguments() []*TypeTag +} +// Command to call a move function +// +// Functions that can be called by a `MoveCall` command are those that have a +// function signature that is either `entry` or `public` (which don't have a +// reference return type). +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// move-call = object-id ; package id +// identifier ; module name +// identifier ; function name +// (vector type-tag) ; type arguments, if any +// (vector argument) ; input arguments +// ``` +type MoveCall struct { + ffiObject FfiObject +} +func NewMoveCall(varPackage *ObjectId, module *Identifier, function *Identifier, typeArguments []*TypeTag, arguments []*Argument) *MoveCall { + return FfiConverterMoveCallINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_movecall_new(FfiConverterObjectIdINSTANCE.Lower(varPackage), FfiConverterIdentifierINSTANCE.Lower(module), FfiConverterIdentifierINSTANCE.Lower(function), FfiConverterSequenceTypeTagINSTANCE.Lower(typeArguments), FfiConverterSequenceArgumentINSTANCE.Lower(arguments),_uniffiStatus) + })) +} + + + + +// The arguments to the function. +func (_self *MoveCall) Arguments() []*Argument { + _pointer := _self.ffiObject.incrementPointer("*MoveCall") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_movecall_arguments( + _pointer,_uniffiStatus), + } + })) +} + +// The function to be called. +func (_self *MoveCall) Function() *Identifier { + _pointer := _self.ffiObject.incrementPointer("*MoveCall") + defer _self.ffiObject.decrementPointer() + return FfiConverterIdentifierINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_movecall_function( + _pointer,_uniffiStatus) + })) +} + +// The specific module in the package containing the function. +func (_self *MoveCall) Module() *Identifier { + _pointer := _self.ffiObject.incrementPointer("*MoveCall") + defer _self.ffiObject.decrementPointer() + return FfiConverterIdentifierINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_movecall_module( + _pointer,_uniffiStatus) + })) +} + +// The package containing the module and function. +func (_self *MoveCall) Package() *ObjectId { + _pointer := _self.ffiObject.incrementPointer("*MoveCall") + defer _self.ffiObject.decrementPointer() + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_movecall_package( + _pointer,_uniffiStatus) + })) +} + +// The type arguments to the function. +func (_self *MoveCall) TypeArguments() []*TypeTag { + _pointer := _self.ffiObject.incrementPointer("*MoveCall") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_movecall_type_arguments( + _pointer,_uniffiStatus), + } + })) +} +func (object *MoveCall) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterMoveCall struct {} + +var FfiConverterMoveCallINSTANCE = FfiConverterMoveCall{} + + +func (c FfiConverterMoveCall) Lift(pointer unsafe.Pointer) *MoveCall { + result := &MoveCall { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_movecall(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_movecall(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*MoveCall).Destroy) + return result +} + +func (c FfiConverterMoveCall) Read(reader io.Reader) *MoveCall { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterMoveCall) Lower(value *MoveCall) 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("*MoveCall") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterMoveCall) Write(writer io.Writer, value *MoveCall) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerMoveCall struct {} + +func (_ FfiDestroyerMoveCall) Destroy(value *MoveCall) { + value.Destroy() +} + + + +// A move package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// object-move-package = object-id u64 move-modules type-origin-table linkage-table +// +// move-modules = map (identifier bytes) +// type-origin-table = vector type-origin +// linkage-table = map (object-id upgrade-info) +// ``` +type MovePackageInterface interface { +} +// A move package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// object-move-package = object-id u64 move-modules type-origin-table linkage-table +// +// move-modules = map (identifier bytes) +// type-origin-table = vector type-origin +// linkage-table = map (object-id upgrade-info) +// ``` +type MovePackage struct { + ffiObject FfiObject +} +func NewMovePackage(id *ObjectId, version uint64, modules map[*Identifier][]byte, typeOriginTable []TypeOrigin, linkageTable map[*ObjectId]UpgradeInfo) (*MovePackage, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new(FfiConverterObjectIdINSTANCE.Lower(id), FfiConverterUint64INSTANCE.Lower(version), FfiConverterMapIdentifierBytesINSTANCE.Lower(modules), FfiConverterSequenceTypeOriginINSTANCE.Lower(typeOriginTable), FfiConverterMapObjectIdUpgradeInfoINSTANCE.Lower(linkageTable),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *MovePackage + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterMovePackageINSTANCE.Lift(_uniffiRV), nil + } +} + + + +func (object *MovePackage) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterMovePackage struct {} + +var FfiConverterMovePackageINSTANCE = FfiConverterMovePackage{} + + +func (c FfiConverterMovePackage) Lift(pointer unsafe.Pointer) *MovePackage { + result := &MovePackage { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_movepackage(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*MovePackage).Destroy) + return result +} + +func (c FfiConverterMovePackage) Read(reader io.Reader) *MovePackage { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterMovePackage) Lower(value *MovePackage) 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("*MovePackage") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterMovePackage) Write(writer io.Writer, value *MovePackage) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerMovePackage struct {} + +func (_ FfiDestroyerMovePackage) Destroy(value *MovePackage) { + value.Destroy() +} + + + +// Aggregated signature from members of a multisig committee. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-aggregated-signature = (vector multisig-member-signature) +// u16 ; bitmap +// multisig-committee +// ``` +// +// There is also a legacy encoding for this type defined as: +// +// ```text +// legacy-multisig-aggregated-signature = (vector multisig-member-signature) +// roaring-bitmap ; bitmap +// legacy-multisig-committee +// roaring-bitmap = bytes ; where the contents of the bytes are valid +// ; according to the serialized spec for +// ; roaring bitmaps +// ``` +// +// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +// serialized format of RoaringBitmaps. +type MultisigAggregatedSignatureInterface interface { + // The bitmap that indicates which committee members provided their + // signature. + Bitmap() uint16 + Committee() *MultisigCommittee + // The list of signatures from committee members + Signatures() []*MultisigMemberSignature +} +// Aggregated signature from members of a multisig committee. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-aggregated-signature = (vector multisig-member-signature) +// u16 ; bitmap +// multisig-committee +// ``` +// +// There is also a legacy encoding for this type defined as: // // ```text // legacy-multisig-aggregated-signature = (vector multisig-member-signature) @@ -10318,137 +11540,309 @@ func (_self *PasskeyAuthenticator) Challenge() []byte { })) } -// Structured, unparsed, JSON for this passkey signature. -// -// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) -// for more information on this field. -func (_self *PasskeyAuthenticator) ClientDataJson() string { - _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") +// Structured, unparsed, JSON for this passkey signature. +// +// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) +// for more information on this field. +func (_self *PasskeyAuthenticator) ClientDataJson() string { + _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json( + _pointer,_uniffiStatus), + } + })) +} + +// The passkey signature. +func (_self *PasskeyAuthenticator) Signature() *SimpleSignature { + _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") + defer _self.ffiObject.decrementPointer() + return FfiConverterSimpleSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature( + _pointer,_uniffiStatus) + })) +} +func (object *PasskeyAuthenticator) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterPasskeyAuthenticator struct {} + +var FfiConverterPasskeyAuthenticatorINSTANCE = FfiConverterPasskeyAuthenticator{} + + +func (c FfiConverterPasskeyAuthenticator) Lift(pointer unsafe.Pointer) *PasskeyAuthenticator { + result := &PasskeyAuthenticator { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*PasskeyAuthenticator).Destroy) + return result +} + +func (c FfiConverterPasskeyAuthenticator) Read(reader io.Reader) *PasskeyAuthenticator { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterPasskeyAuthenticator) Lower(value *PasskeyAuthenticator) 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("*PasskeyAuthenticator") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterPasskeyAuthenticator) Write(writer io.Writer, value *PasskeyAuthenticator) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerPasskeyAuthenticator struct {} + +func (_ FfiDestroyerPasskeyAuthenticator) Destroy(value *PasskeyAuthenticator) { + value.Destroy() +} + + + +// A user transaction +// +// Contains a series of native commands and move calls where the results of one +// command can be used in future commands. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// ptb = (vector input) (vector command) +// ``` +type ProgrammableTransactionInterface interface { + // The commands to be executed sequentially. A failure in any command will + // result in the failure of the entire transaction. + Commands() []*Command + // Input objects or primitive values + Inputs() []*Input +} +// A user transaction +// +// Contains a series of native commands and move calls where the results of one +// command can be used in future commands. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// ptb = (vector input) (vector command) +// ``` +type ProgrammableTransaction struct { + ffiObject FfiObject +} +func NewProgrammableTransaction(inputs []*Input, commands []*Command) *ProgrammableTransaction { + return FfiConverterProgrammableTransactionINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_programmabletransaction_new(FfiConverterSequenceInputINSTANCE.Lower(inputs), FfiConverterSequenceCommandINSTANCE.Lower(commands),_uniffiStatus) + })) +} + + + + +// The commands to be executed sequentially. A failure in any command will +// result in the failure of the entire transaction. +func (_self *ProgrammableTransaction) Commands() []*Command { + _pointer := _self.ffiObject.incrementPointer("*ProgrammableTransaction") defer _self.ffiObject.decrementPointer() - return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return FfiConverterSequenceCommandINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json( + inner: C.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_commands( _pointer,_uniffiStatus), } })) } -// The passkey signature. -func (_self *PasskeyAuthenticator) Signature() *SimpleSignature { - _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") +// Input objects or primitive values +func (_self *ProgrammableTransaction) Inputs() []*Input { + _pointer := _self.ffiObject.incrementPointer("*ProgrammableTransaction") defer _self.ffiObject.decrementPointer() - return FfiConverterSimpleSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature( - _pointer,_uniffiStatus) + return FfiConverterSequenceInputINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_inputs( + _pointer,_uniffiStatus), + } })) } -func (object *PasskeyAuthenticator) Destroy() { +func (object *ProgrammableTransaction) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterPasskeyAuthenticator struct {} +type FfiConverterProgrammableTransaction struct {} -var FfiConverterPasskeyAuthenticatorINSTANCE = FfiConverterPasskeyAuthenticator{} +var FfiConverterProgrammableTransactionINSTANCE = FfiConverterProgrammableTransaction{} -func (c FfiConverterPasskeyAuthenticator) Lift(pointer unsafe.Pointer) *PasskeyAuthenticator { - result := &PasskeyAuthenticator { +func (c FfiConverterProgrammableTransaction) Lift(pointer unsafe.Pointer) *ProgrammableTransaction { + result := &ProgrammableTransaction { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_programmabletransaction(pointer, status) }, ), } - runtime.SetFinalizer(result, (*PasskeyAuthenticator).Destroy) + runtime.SetFinalizer(result, (*ProgrammableTransaction).Destroy) return result } -func (c FfiConverterPasskeyAuthenticator) Read(reader io.Reader) *PasskeyAuthenticator { +func (c FfiConverterProgrammableTransaction) Read(reader io.Reader) *ProgrammableTransaction { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterPasskeyAuthenticator) Lower(value *PasskeyAuthenticator) unsafe.Pointer { +func (c FfiConverterProgrammableTransaction) Lower(value *ProgrammableTransaction) 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("*PasskeyAuthenticator") + pointer := value.ffiObject.incrementPointer("*ProgrammableTransaction") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterPasskeyAuthenticator) Write(writer io.Writer, value *PasskeyAuthenticator) { +func (c FfiConverterProgrammableTransaction) Write(writer io.Writer, value *ProgrammableTransaction) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerPasskeyAuthenticator struct {} +type FfiDestroyerProgrammableTransaction struct {} -func (_ FfiDestroyerPasskeyAuthenticator) Destroy(value *PasskeyAuthenticator) { +func (_ FfiDestroyerProgrammableTransaction) Destroy(value *ProgrammableTransaction) { value.Destroy() } -type ProgrammableTransactionInterface interface { +// Command to publish a new move package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// publish = (vector bytes) ; the serialized move modules +// (vector object-id) ; the set of package dependencies +// ``` +type PublishInterface interface { + // Set of packages that the to-be published package depends on + Dependencies() []*ObjectId + // The serialized move modules + Modules() [][]byte } -type ProgrammableTransaction struct { +// Command to publish a new move package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// publish = (vector bytes) ; the serialized move modules +// (vector object-id) ; the set of package dependencies +// ``` +type Publish struct { ffiObject FfiObject } +func NewPublish(modules [][]byte, dependencies []*ObjectId) *Publish { + return FfiConverterPublishINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_publish_new(FfiConverterSequenceBytesINSTANCE.Lower(modules), FfiConverterSequenceObjectIdINSTANCE.Lower(dependencies),_uniffiStatus) + })) +} -func (object *ProgrammableTransaction) Destroy() { + +// Set of packages that the to-be published package depends on +func (_self *Publish) Dependencies() []*ObjectId { + _pointer := _self.ffiObject.incrementPointer("*Publish") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_publish_dependencies( + _pointer,_uniffiStatus), + } + })) +} + +// The serialized move modules +func (_self *Publish) Modules() [][]byte { + _pointer := _self.ffiObject.incrementPointer("*Publish") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_publish_modules( + _pointer,_uniffiStatus), + } + })) +} +func (object *Publish) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterProgrammableTransaction struct {} +type FfiConverterPublish struct {} -var FfiConverterProgrammableTransactionINSTANCE = FfiConverterProgrammableTransaction{} +var FfiConverterPublishINSTANCE = FfiConverterPublish{} -func (c FfiConverterProgrammableTransaction) Lift(pointer unsafe.Pointer) *ProgrammableTransaction { - result := &ProgrammableTransaction { +func (c FfiConverterPublish) Lift(pointer unsafe.Pointer) *Publish { + result := &Publish { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_publish(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_programmabletransaction(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_publish(pointer, status) }, ), } - runtime.SetFinalizer(result, (*ProgrammableTransaction).Destroy) + runtime.SetFinalizer(result, (*Publish).Destroy) return result } -func (c FfiConverterProgrammableTransaction) Read(reader io.Reader) *ProgrammableTransaction { +func (c FfiConverterPublish) Read(reader io.Reader) *Publish { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterProgrammableTransaction) Lower(value *ProgrammableTransaction) unsafe.Pointer { +func (c FfiConverterPublish) Lower(value *Publish) 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("*ProgrammableTransaction") + pointer := value.ffiObject.incrementPointer("*Publish") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterProgrammableTransaction) Write(writer io.Writer, value *ProgrammableTransaction) { +func (c FfiConverterPublish) Write(writer io.Writer, value *Publish) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerProgrammableTransaction struct {} +type FfiDestroyerPublish struct {} -func (_ FfiDestroyerProgrammableTransaction) Destroy(value *ProgrammableTransaction) { +func (_ FfiDestroyerPublish) Destroy(value *Publish) { value.Destroy() } @@ -11284,6 +12678,115 @@ func (_ FfiDestroyerSimpleSignature) Destroy(value *SimpleSignature) { +// Command to split a single coin object into multiple coins +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// split-coins = argument (vector argument) +// ``` +type SplitCoinsInterface interface { + // The amounts to split off + Amounts() []*Argument + // The coin to split + Coin() *Argument +} +// Command to split a single coin object into multiple coins +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// split-coins = argument (vector argument) +// ``` +type SplitCoins struct { + ffiObject FfiObject +} +func NewSplitCoins(coin *Argument, amounts []*Argument) *SplitCoins { + return FfiConverterSplitCoinsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_splitcoins_new(FfiConverterArgumentINSTANCE.Lower(coin), FfiConverterSequenceArgumentINSTANCE.Lower(amounts),_uniffiStatus) + })) +} + + + + +// The amounts to split off +func (_self *SplitCoins) Amounts() []*Argument { + _pointer := _self.ffiObject.incrementPointer("*SplitCoins") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_splitcoins_amounts( + _pointer,_uniffiStatus), + } + })) +} + +// The coin to split +func (_self *SplitCoins) Coin() *Argument { + _pointer := _self.ffiObject.incrementPointer("*SplitCoins") + defer _self.ffiObject.decrementPointer() + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_splitcoins_coin( + _pointer,_uniffiStatus) + })) +} +func (object *SplitCoins) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterSplitCoins struct {} + +var FfiConverterSplitCoinsINSTANCE = FfiConverterSplitCoins{} + + +func (c FfiConverterSplitCoins) Lift(pointer unsafe.Pointer) *SplitCoins { + result := &SplitCoins { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_splitcoins(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_splitcoins(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*SplitCoins).Destroy) + return result +} + +func (c FfiConverterSplitCoins) Read(reader io.Reader) *SplitCoins { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterSplitCoins) Lower(value *SplitCoins) 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("*SplitCoins") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterSplitCoins) Write(writer io.Writer, value *SplitCoins) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerSplitCoins struct {} + +func (_ FfiDestroyerSplitCoins) Destroy(value *SplitCoins) { + value.Destroy() +} + + + // Type information for a move struct // // # BCS @@ -12046,73 +13549,182 @@ func TransactionKindEndOfEpoch(tx []*EndOfEpochTransactionKind) *TransactionKind return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch(FfiConverterSequenceEndOfEpochTransactionKindINSTANCE.Lower(tx),_uniffiStatus) })) } - -func TransactionKindGenesis(tx *GenesisTransaction) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis(FfiConverterGenesisTransactionINSTANCE.Lower(tx),_uniffiStatus) + +func TransactionKindGenesis(tx *GenesisTransaction) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis(FfiConverterGenesisTransactionINSTANCE.Lower(tx),_uniffiStatus) + })) +} + +func TransactionKindProgrammableTransaction(tx *ProgrammableTransaction) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction(FfiConverterProgrammableTransactionINSTANCE.Lower(tx),_uniffiStatus) + })) +} + +func TransactionKindRandomnessStateUpdate(tx *RandomnessStateUpdate) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(FfiConverterRandomnessStateUpdateINSTANCE.Lower(tx),_uniffiStatus) + })) +} + + +func (object *TransactionKind) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterTransactionKind struct {} + +var FfiConverterTransactionKindINSTANCE = FfiConverterTransactionKind{} + + +func (c FfiConverterTransactionKind) Lift(pointer unsafe.Pointer) *TransactionKind { + result := &TransactionKind { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_transactionkind(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*TransactionKind).Destroy) + return result +} + +func (c FfiConverterTransactionKind) Read(reader io.Reader) *TransactionKind { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterTransactionKind) Lower(value *TransactionKind) 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("*TransactionKind") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterTransactionKind) Write(writer io.Writer, value *TransactionKind) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerTransactionKind struct {} + +func (_ FfiDestroyerTransactionKind) Destroy(value *TransactionKind) { + value.Destroy() +} + + + +// Command to transfer ownership of a set of objects to an address +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// transfer-objects = (vector argument) argument +// ``` +type TransferObjectsInterface interface { + // The address to transfer ownership to + Address() *Argument + // Set of objects to transfer + Objects() []*Argument +} +// Command to transfer ownership of a set of objects to an address +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// transfer-objects = (vector argument) argument +// ``` +type TransferObjects struct { + ffiObject FfiObject +} +func NewTransferObjects(objects []*Argument, address *Argument) *TransferObjects { + return FfiConverterTransferObjectsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transferobjects_new(FfiConverterSequenceArgumentINSTANCE.Lower(objects), FfiConverterArgumentINSTANCE.Lower(address),_uniffiStatus) })) } -func TransactionKindProgrammableTransaction(tx *ProgrammableTransaction) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction(FfiConverterProgrammableTransactionINSTANCE.Lower(tx),_uniffiStatus) + + + +// The address to transfer ownership to +func (_self *TransferObjects) Address() *Argument { + _pointer := _self.ffiObject.incrementPointer("*TransferObjects") + defer _self.ffiObject.decrementPointer() + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_transferobjects_address( + _pointer,_uniffiStatus) })) } -func TransactionKindRandomnessStateUpdate(tx *RandomnessStateUpdate) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(FfiConverterRandomnessStateUpdateINSTANCE.Lower(tx),_uniffiStatus) +// Set of objects to transfer +func (_self *TransferObjects) Objects() []*Argument { + _pointer := _self.ffiObject.incrementPointer("*TransferObjects") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transferobjects_objects( + _pointer,_uniffiStatus), + } })) } - - -func (object *TransactionKind) Destroy() { +func (object *TransferObjects) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterTransactionKind struct {} +type FfiConverterTransferObjects struct {} -var FfiConverterTransactionKindINSTANCE = FfiConverterTransactionKind{} +var FfiConverterTransferObjectsINSTANCE = FfiConverterTransferObjects{} -func (c FfiConverterTransactionKind) Lift(pointer unsafe.Pointer) *TransactionKind { - result := &TransactionKind { +func (c FfiConverterTransferObjects) Lift(pointer unsafe.Pointer) *TransferObjects { + result := &TransferObjects { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_transferobjects(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_transactionkind(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_transferobjects(pointer, status) }, ), } - runtime.SetFinalizer(result, (*TransactionKind).Destroy) + runtime.SetFinalizer(result, (*TransferObjects).Destroy) return result } -func (c FfiConverterTransactionKind) Read(reader io.Reader) *TransactionKind { +func (c FfiConverterTransferObjects) Read(reader io.Reader) *TransferObjects { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterTransactionKind) Lower(value *TransactionKind) unsafe.Pointer { +func (c FfiConverterTransferObjects) Lower(value *TransferObjects) 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("*TransactionKind") + pointer := value.ffiObject.incrementPointer("*TransferObjects") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterTransactionKind) Write(writer io.Writer, value *TransactionKind) { +func (c FfiConverterTransferObjects) Write(writer io.Writer, value *TransferObjects) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerTransactionKind struct {} +type FfiDestroyerTransferObjects struct {} -func (_ FfiDestroyerTransactionKind) Destroy(value *TransactionKind) { +func (_ FfiDestroyerTransferObjects) Destroy(value *TransferObjects) { value.Destroy() } @@ -12460,6 +14072,147 @@ func (_ FfiDestroyerTypeTag) Destroy(value *TypeTag) { +// Command to upgrade an already published package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// upgrade = (vector bytes) ; move modules +// (vector object-id) ; dependencies +// object-id ; package-id of the package +// argument ; upgrade ticket +// ``` +type UpgradeInterface interface { + // Set of packages that the to-be published package depends on + Dependencies() []*ObjectId + // The serialized move modules + Modules() [][]byte + // Package id of the package to upgrade + Package() *ObjectId + // Ticket authorizing the upgrade + Ticket() *Argument +} +// Command to upgrade an already published package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// upgrade = (vector bytes) ; move modules +// (vector object-id) ; dependencies +// object-id ; package-id of the package +// argument ; upgrade ticket +// ``` +type Upgrade struct { + ffiObject FfiObject +} +func NewUpgrade(modules [][]byte, dependencies []*ObjectId, varPackage *ObjectId, ticket *Argument) *Upgrade { + return FfiConverterUpgradeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_upgrade_new(FfiConverterSequenceBytesINSTANCE.Lower(modules), FfiConverterSequenceObjectIdINSTANCE.Lower(dependencies), FfiConverterObjectIdINSTANCE.Lower(varPackage), FfiConverterArgumentINSTANCE.Lower(ticket),_uniffiStatus) + })) +} + + + + +// Set of packages that the to-be published package depends on +func (_self *Upgrade) Dependencies() []*ObjectId { + _pointer := _self.ffiObject.incrementPointer("*Upgrade") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_upgrade_dependencies( + _pointer,_uniffiStatus), + } + })) +} + +// The serialized move modules +func (_self *Upgrade) Modules() [][]byte { + _pointer := _self.ffiObject.incrementPointer("*Upgrade") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_upgrade_modules( + _pointer,_uniffiStatus), + } + })) +} + +// Package id of the package to upgrade +func (_self *Upgrade) Package() *ObjectId { + _pointer := _self.ffiObject.incrementPointer("*Upgrade") + defer _self.ffiObject.decrementPointer() + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_upgrade_package( + _pointer,_uniffiStatus) + })) +} + +// Ticket authorizing the upgrade +func (_self *Upgrade) Ticket() *Argument { + _pointer := _self.ffiObject.incrementPointer("*Upgrade") + defer _self.ffiObject.decrementPointer() + return FfiConverterArgumentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_upgrade_ticket( + _pointer,_uniffiStatus) + })) +} +func (object *Upgrade) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterUpgrade struct {} + +var FfiConverterUpgradeINSTANCE = FfiConverterUpgrade{} + + +func (c FfiConverterUpgrade) Lift(pointer unsafe.Pointer) *Upgrade { + result := &Upgrade { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_upgrade(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_upgrade(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Upgrade).Destroy) + return result +} + +func (c FfiConverterUpgrade) Read(reader io.Reader) *Upgrade { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterUpgrade) Lower(value *Upgrade) 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("*Upgrade") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterUpgrade) Write(writer io.Writer, value *Upgrade) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerUpgrade struct {} + +func (_ FfiDestroyerUpgrade) Destroy(value *Upgrade) { + value.Destroy() +} + + + // A signature from a user // // A `UserSignature` is most commonly used to authorize the execution and @@ -18779,6 +20532,43 @@ func (_ FfiDestroyerOptionalAddress) Destroy(value **Address) { } } +type FfiConverterOptionalArgument struct{} + +var FfiConverterOptionalArgumentINSTANCE = FfiConverterOptionalArgument{} + +func (c FfiConverterOptionalArgument) Lift(rb RustBufferI) **Argument { + return LiftFromRustBuffer[**Argument](c, rb) +} + +func (_ FfiConverterOptionalArgument) Read(reader io.Reader) **Argument { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterArgumentINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalArgument) Lower(value **Argument) C.RustBuffer { + return LowerIntoRustBuffer[**Argument](c, value) +} + +func (_ FfiConverterOptionalArgument) Write(writer io.Writer, value **Argument) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterArgumentINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalArgument struct {} + +func (_ FfiDestroyerOptionalArgument) Destroy(value **Argument) { + if value != nil { + FfiDestroyerArgument{}.Destroy(*value) + } +} + type FfiConverterOptionalBatchSendStatus struct{} var FfiConverterOptionalBatchSendStatusINSTANCE = FfiConverterOptionalBatchSendStatus{} @@ -20968,6 +22758,92 @@ func (FfiDestroyerSequenceString) Destroy(sequence []string) { } } +type FfiConverterSequenceBytes struct{} + +var FfiConverterSequenceBytesINSTANCE = FfiConverterSequenceBytes{} + +func (c FfiConverterSequenceBytes) Lift(rb RustBufferI) [][]byte { + return LiftFromRustBuffer[[][]byte](c, rb) +} + +func (c FfiConverterSequenceBytes) Read(reader io.Reader) [][]byte { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([][]byte, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterBytesINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceBytes) Lower(value [][]byte) C.RustBuffer { + return LowerIntoRustBuffer[[][]byte](c, value) +} + +func (c FfiConverterSequenceBytes) Write(writer io.Writer, value [][]byte) { + if len(value) > math.MaxInt32 { + panic("[][]byte is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterBytesINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceBytes struct {} + +func (FfiDestroyerSequenceBytes) Destroy(sequence [][]byte) { + for _, value := range sequence { + FfiDestroyerBytes{}.Destroy(value) + } +} + +type FfiConverterSequenceArgument struct{} + +var FfiConverterSequenceArgumentINSTANCE = FfiConverterSequenceArgument{} + +func (c FfiConverterSequenceArgument) Lift(rb RustBufferI) []*Argument { + return LiftFromRustBuffer[[]*Argument](c, rb) +} + +func (c FfiConverterSequenceArgument) Read(reader io.Reader) []*Argument { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*Argument, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterArgumentINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceArgument) Lower(value []*Argument) C.RustBuffer { + return LowerIntoRustBuffer[[]*Argument](c, value) +} + +func (c FfiConverterSequenceArgument) Write(writer io.Writer, value []*Argument) { + if len(value) > math.MaxInt32 { + panic("[]*Argument is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterArgumentINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceArgument struct {} + +func (FfiDestroyerSequenceArgument) Destroy(sequence []*Argument) { + for _, value := range sequence { + FfiDestroyerArgument{}.Destroy(value) + } +} + type FfiConverterSequenceCheckpointCommitment struct{} var FfiConverterSequenceCheckpointCommitmentINSTANCE = FfiConverterSequenceCheckpointCommitment{} @@ -21054,6 +22930,49 @@ func (FfiDestroyerSequenceCoin) Destroy(sequence []*Coin) { } } +type FfiConverterSequenceCommand struct{} + +var FfiConverterSequenceCommandINSTANCE = FfiConverterSequenceCommand{} + +func (c FfiConverterSequenceCommand) Lift(rb RustBufferI) []*Command { + return LiftFromRustBuffer[[]*Command](c, rb) +} + +func (c FfiConverterSequenceCommand) Read(reader io.Reader) []*Command { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*Command, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterCommandINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceCommand) Lower(value []*Command) C.RustBuffer { + return LowerIntoRustBuffer[[]*Command](c, value) +} + +func (c FfiConverterSequenceCommand) Write(writer io.Writer, value []*Command) { + if len(value) > math.MaxInt32 { + panic("[]*Command is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterCommandINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceCommand struct {} + +func (FfiDestroyerSequenceCommand) Destroy(sequence []*Command) { + for _, value := range sequence { + FfiDestroyerCommand{}.Destroy(value) + } +} + type FfiConverterSequenceEndOfEpochTransactionKind struct{} var FfiConverterSequenceEndOfEpochTransactionKindINSTANCE = FfiConverterSequenceEndOfEpochTransactionKind{} @@ -21140,6 +23059,49 @@ func (FfiDestroyerSequenceEpoch) Destroy(sequence []*Epoch) { } } +type FfiConverterSequenceInput struct{} + +var FfiConverterSequenceInputINSTANCE = FfiConverterSequenceInput{} + +func (c FfiConverterSequenceInput) Lift(rb RustBufferI) []*Input { + return LiftFromRustBuffer[[]*Input](c, rb) +} + +func (c FfiConverterSequenceInput) Read(reader io.Reader) []*Input { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*Input, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterInputINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceInput) Lower(value []*Input) C.RustBuffer { + return LowerIntoRustBuffer[[]*Input](c, value) +} + +func (c FfiConverterSequenceInput) Write(writer io.Writer, value []*Input) { + if len(value) > math.MaxInt32 { + panic("[]*Input is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterInputINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceInput struct {} + +func (FfiDestroyerSequenceInput) Destroy(sequence []*Input) { + for _, value := range sequence { + FfiDestroyerInput{}.Destroy(value) + } +} + type FfiConverterSequenceMovePackage struct{} var FfiConverterSequenceMovePackageINSTANCE = FfiConverterSequenceMovePackage{} diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index a0e971718..d42b8fa0d 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -414,6 +414,42 @@ RustBuffer uniffi_iota_sdk_ffi_fn_method_address_to_bytes(void* ptr, RustCallSta RustBuffer uniffi_iota_sdk_ffi_fn_method_address_to_hex(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ARGUMENT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ARGUMENT +void* uniffi_iota_sdk_ffi_fn_clone_argument(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ARGUMENT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ARGUMENT +void uniffi_iota_sdk_ffi_fn_free_argument(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_GAS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_GAS +void* uniffi_iota_sdk_ffi_fn_constructor_argument_new_gas(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_INPUT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_INPUT +void* uniffi_iota_sdk_ffi_fn_constructor_argument_new_input(uint16_t input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_NESTED_RESULT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_NESTED_RESULT +void* uniffi_iota_sdk_ffi_fn_constructor_argument_new_nested_result(uint16_t command_index, uint16_t subresult_index, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_RESULT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ARGUMENT_NEW_RESULT +void* uniffi_iota_sdk_ffi_fn_constructor_argument_new_result(uint16_t result, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ARGUMENT_NESTED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ARGUMENT_NESTED +RustBuffer uniffi_iota_sdk_ffi_fn_method_argument_nested(void* ptr, uint16_t ix, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_AUTHENTICATORSTATEEXPIRE #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_AUTHENTICATORSTATEEXPIRE void* uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(void* ptr, RustCallStatus *out_status @@ -713,6 +749,51 @@ void* uniffi_iota_sdk_ffi_fn_method_coin_coin_type(void* ptr, RustCallStatus *ou void* uniffi_iota_sdk_ffi_fn_method_coin_id(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_COMMAND +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_COMMAND +void* uniffi_iota_sdk_ffi_fn_clone_command(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_COMMAND +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_COMMAND +void uniffi_iota_sdk_ffi_fn_free_command(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_MAKE_MOVE_VECTOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_MAKE_MOVE_VECTOR +void* uniffi_iota_sdk_ffi_fn_constructor_command_new_make_move_vector(void* make_move_vector, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_MERGE_COINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_MERGE_COINS +void* uniffi_iota_sdk_ffi_fn_constructor_command_new_merge_coins(void* merge_coins, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_MOVE_CALL +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_MOVE_CALL +void* uniffi_iota_sdk_ffi_fn_constructor_command_new_move_call(void* move_call, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_PUBLISH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_PUBLISH +void* uniffi_iota_sdk_ffi_fn_constructor_command_new_publish(void* publish, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_SPLIT_COINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_SPLIT_COINS +void* uniffi_iota_sdk_ffi_fn_constructor_command_new_split_coins(void* split_coins, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_TRANSFER_OBJECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_TRANSFER_OBJECTS +void* uniffi_iota_sdk_ffi_fn_constructor_command_new_transfer_objects(void* transfer_objects, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_UPGRADE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_COMMAND_NEW_UPGRADE +void* uniffi_iota_sdk_ffi_fn_constructor_command_new_upgrade(void* upgrade, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CONSENSUSCOMMITDIGEST #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CONSENSUSCOMMITDIGEST void* uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(void* ptr, RustCallStatus *out_status @@ -1291,6 +1372,126 @@ void* uniffi_iota_sdk_ffi_fn_constructor_identifier_new(RustBuffer identifier, R RustBuffer uniffi_iota_sdk_ffi_fn_method_identifier_as_str(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_INPUT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_INPUT +void* uniffi_iota_sdk_ffi_fn_clone_input(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_INPUT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_INPUT +void uniffi_iota_sdk_ffi_fn_free_input(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_IMMUTABLE_OR_OWNED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_IMMUTABLE_OR_OWNED +void* uniffi_iota_sdk_ffi_fn_constructor_input_new_immutable_or_owned(RustBuffer object_ref, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_PURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_PURE +void* uniffi_iota_sdk_ffi_fn_constructor_input_new_pure(RustBuffer value, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_RECEIVING +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_RECEIVING +void* uniffi_iota_sdk_ffi_fn_constructor_input_new_receiving(RustBuffer object_ref, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_SHARED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_INPUT_NEW_SHARED +void* uniffi_iota_sdk_ffi_fn_constructor_input_new_shared(void* object_id, uint64_t initial_shared_version, int8_t mutable, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MAKEMOVEVECTOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MAKEMOVEVECTOR +void* uniffi_iota_sdk_ffi_fn_clone_makemovevector(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MAKEMOVEVECTOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MAKEMOVEVECTOR +void uniffi_iota_sdk_ffi_fn_free_makemovevector(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MAKEMOVEVECTOR_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MAKEMOVEVECTOR_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_makemovevector_new(RustBuffer type_tag, RustBuffer elements, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MAKEMOVEVECTOR_ELEMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MAKEMOVEVECTOR_ELEMENTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_makemovevector_elements(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MAKEMOVEVECTOR_TYPE_TAG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MAKEMOVEVECTOR_TYPE_TAG +RustBuffer uniffi_iota_sdk_ffi_fn_method_makemovevector_type_tag(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MERGECOINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MERGECOINS +void* uniffi_iota_sdk_ffi_fn_clone_mergecoins(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MERGECOINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MERGECOINS +void uniffi_iota_sdk_ffi_fn_free_mergecoins(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MERGECOINS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MERGECOINS_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_mergecoins_new(void* coin, RustBuffer coins_to_merge, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MERGECOINS_COIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MERGECOINS_COIN +void* uniffi_iota_sdk_ffi_fn_method_mergecoins_coin(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MERGECOINS_COINS_TO_MERGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MERGECOINS_COINS_TO_MERGE +RustBuffer uniffi_iota_sdk_ffi_fn_method_mergecoins_coins_to_merge(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVECALL +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVECALL +void* uniffi_iota_sdk_ffi_fn_clone_movecall(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MOVECALL +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MOVECALL +void uniffi_iota_sdk_ffi_fn_free_movecall(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MOVECALL_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MOVECALL_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_movecall_new(void* package, void* module, void* function, RustBuffer type_arguments, RustBuffer arguments, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_ARGUMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_ARGUMENTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_movecall_arguments(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_FUNCTION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_FUNCTION +void* uniffi_iota_sdk_ffi_fn_method_movecall_function(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_MODULE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_MODULE +void* uniffi_iota_sdk_ffi_fn_method_movecall_module(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_PACKAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_PACKAGE +void* uniffi_iota_sdk_ffi_fn_method_movecall_package(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_TYPE_ARGUMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MOVECALL_TYPE_ARGUMENTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_movecall_type_arguments(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVEPACKAGE #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVEPACKAGE void* uniffi_iota_sdk_ffi_fn_clone_movepackage(void* ptr, RustCallStatus *out_status @@ -1844,6 +2045,46 @@ void* uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(void* ptr, RustCallSt void uniffi_iota_sdk_ffi_fn_free_programmabletransaction(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PROGRAMMABLETRANSACTION_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PROGRAMMABLETRANSACTION_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_programmabletransaction_new(RustBuffer inputs, RustBuffer commands, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PROGRAMMABLETRANSACTION_COMMANDS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PROGRAMMABLETRANSACTION_COMMANDS +RustBuffer uniffi_iota_sdk_ffi_fn_method_programmabletransaction_commands(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PROGRAMMABLETRANSACTION_INPUTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PROGRAMMABLETRANSACTION_INPUTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_programmabletransaction_inputs(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PUBLISH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PUBLISH +void* uniffi_iota_sdk_ffi_fn_clone_publish(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PUBLISH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PUBLISH +void uniffi_iota_sdk_ffi_fn_free_publish(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PUBLISH_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PUBLISH_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_publish_new(RustBuffer modules, RustBuffer dependencies, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PUBLISH_DEPENDENCIES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PUBLISH_DEPENDENCIES +RustBuffer uniffi_iota_sdk_ffi_fn_method_publish_dependencies(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PUBLISH_MODULES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PUBLISH_MODULES +RustBuffer uniffi_iota_sdk_ffi_fn_method_publish_modules(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_RANDOMNESSSTATEUPDATE #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_RANDOMNESSSTATEUPDATE void* uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(void* ptr, RustCallStatus *out_status @@ -2073,6 +2314,31 @@ RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt(void* RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SPLITCOINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SPLITCOINS +void* uniffi_iota_sdk_ffi_fn_clone_splitcoins(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SPLITCOINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SPLITCOINS +void uniffi_iota_sdk_ffi_fn_free_splitcoins(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SPLITCOINS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SPLITCOINS_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_splitcoins_new(void* coin, RustBuffer amounts, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SPLITCOINS_AMOUNTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SPLITCOINS_AMOUNTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_splitcoins_amounts(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SPLITCOINS_COIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SPLITCOINS_COIN +void* uniffi_iota_sdk_ffi_fn_method_splitcoins_coin(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_STRUCTTAG #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_STRUCTTAG void* uniffi_iota_sdk_ffi_fn_clone_structtag(void* ptr, RustCallStatus *out_status @@ -2328,6 +2594,31 @@ void* uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transactio void* uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(void* tx, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSFEROBJECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSFEROBJECTS +void* uniffi_iota_sdk_ffi_fn_clone_transferobjects(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_TRANSFEROBJECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_TRANSFEROBJECTS +void uniffi_iota_sdk_ffi_fn_free_transferobjects(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSFEROBJECTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSFEROBJECTS_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_transferobjects_new(RustBuffer objects, void* address, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSFEROBJECTS_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSFEROBJECTS_ADDRESS +void* uniffi_iota_sdk_ffi_fn_method_transferobjects_address(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSFEROBJECTS_OBJECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSFEROBJECTS_OBJECTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_transferobjects_objects(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TYPETAG #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TYPETAG void* uniffi_iota_sdk_ffi_fn_clone_typetag(void* ptr, RustCallStatus *out_status @@ -2477,6 +2768,41 @@ int8_t uniffi_iota_sdk_ffi_fn_method_typetag_is_u8(void* ptr, RustCallStatus *ou int8_t uniffi_iota_sdk_ffi_fn_method_typetag_is_vector(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_UPGRADE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_UPGRADE +void* uniffi_iota_sdk_ffi_fn_clone_upgrade(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_UPGRADE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_UPGRADE +void uniffi_iota_sdk_ffi_fn_free_upgrade(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_UPGRADE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_UPGRADE_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_upgrade_new(RustBuffer modules, RustBuffer dependencies, void* package, void* ticket, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_DEPENDENCIES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_DEPENDENCIES +RustBuffer uniffi_iota_sdk_ffi_fn_method_upgrade_dependencies(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_MODULES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_MODULES +RustBuffer uniffi_iota_sdk_ffi_fn_method_upgrade_modules(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_PACKAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_PACKAGE +void* uniffi_iota_sdk_ffi_fn_method_upgrade_package(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_TICKET +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_UPGRADE_TICKET +void* uniffi_iota_sdk_ffi_fn_method_upgrade_ticket(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_USERSIGNATURE #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_USERSIGNATURE void* uniffi_iota_sdk_ffi_fn_clone_usersignature(void* ptr, RustCallStatus *out_status @@ -2982,6 +3308,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_address_to_bytes(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ADDRESS_TO_HEX uint16_t uniffi_iota_sdk_ffi_checksum_method_address_to_hex(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ARGUMENT_NESTED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ARGUMENT_NESTED +uint16_t uniffi_iota_sdk_ffi_checksum_method_argument_nested(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BLS12381PUBLICKEY_TO_BYTES @@ -3396,6 +3728,60 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects( #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_IDENTIFIER_AS_STR uint16_t uniffi_iota_sdk_ffi_checksum_method_identifier_as_str(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MAKEMOVEVECTOR_ELEMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MAKEMOVEVECTOR_ELEMENTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MAKEMOVEVECTOR_TYPE_TAG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MAKEMOVEVECTOR_TYPE_TAG +uint16_t uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MERGECOINS_COIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MERGECOINS_COIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MERGECOINS_COINS_TO_MERGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MERGECOINS_COINS_TO_MERGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_ARGUMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_ARGUMENTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_movecall_arguments(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_FUNCTION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_FUNCTION +uint16_t uniffi_iota_sdk_ffi_checksum_method_movecall_function(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_MODULE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_MODULE +uint16_t uniffi_iota_sdk_ffi_checksum_method_movecall_module(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_PACKAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_PACKAGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_movecall_package(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_TYPE_ARGUMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MOVECALL_TYPE_ARGUMENTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATEDSIGNATURE_BITMAP @@ -3780,6 +4166,30 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_js #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_SIGNATURE uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PROGRAMMABLETRANSACTION_COMMANDS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PROGRAMMABLETRANSACTION_COMMANDS +uint16_t uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PROGRAMMABLETRANSACTION_INPUTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PROGRAMMABLETRANSACTION_INPUTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PUBLISH_DEPENDENCIES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PUBLISH_DEPENDENCIES +uint16_t uniffi_iota_sdk_ffi_checksum_method_publish_dependencies(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PUBLISH_MODULES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PUBLISH_MODULES +uint16_t uniffi_iota_sdk_ffi_checksum_method_publish_modules(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256K1PUBLICKEY_TO_BYTES @@ -3906,6 +4316,18 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig_opt(v #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_TO_BYTES uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SPLITCOINS_AMOUNTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SPLITCOINS_AMOUNTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SPLITCOINS_COIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SPLITCOINS_COIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_ADDRESS @@ -3996,6 +4418,18 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_base58(v #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTSDIGEST_TO_BYTES uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSFEROBJECTS_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSFEROBJECTS_ADDRESS +uint16_t uniffi_iota_sdk_ffi_checksum_method_transferobjects_address(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSFEROBJECTS_OBJECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSFEROBJECTS_OBJECTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TYPETAG_AS_STRUCT_TAG @@ -4086,6 +4520,30 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TYPETAG_IS_VECTOR uint16_t uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_DEPENDENCIES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_DEPENDENCIES +uint16_t uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_MODULES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_MODULES +uint16_t uniffi_iota_sdk_ffi_checksum_method_upgrade_modules(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_PACKAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_PACKAGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_upgrade_package(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_TICKET +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_UPGRADE_TICKET +uint16_t uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_MULTISIG @@ -4266,6 +4724,30 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_GENERATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_address_generate(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_GAS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_GAS +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_INPUT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_INPUT +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_NESTED_RESULT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_NESTED_RESULT +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_RESULT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ARGUMENT_NEW_RESULT +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381PUBLICKEY_FROM_BYTES @@ -4374,6 +4856,48 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COIN_TRY_FROM_OBJECT uint16_t uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_MAKE_MOVE_VECTOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_MAKE_MOVE_VECTOR +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_MERGE_COINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_MERGE_COINS +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_MOVE_CALL +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_MOVE_CALL +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_PUBLISH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_PUBLISH +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_SPLIT_COINS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_SPLIT_COINS +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_TRANSFER_OBJECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_TRANSFER_OBJECTS +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_UPGRADE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COMMAND_NEW_UPGRADE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BASE58 @@ -4548,6 +5072,48 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_IDENTIFIER_NEW uint16_t uniffi_iota_sdk_ffi_checksum_constructor_identifier_new(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_IMMUTABLE_OR_OWNED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_IMMUTABLE_OR_OWNED +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_PURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_PURE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_RECEIVING +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_RECEIVING +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_SHARED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_INPUT_NEW_SHARED +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MAKEMOVEVECTOR_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MAKEMOVEVECTOR_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MERGECOINS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MERGECOINS_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MOVECALL_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MOVECALL_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_movecall_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MOVEPACKAGE_NEW @@ -4656,6 +5222,18 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_owner_new_object(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OWNER_NEW_SHARED uint16_t uniffi_iota_sdk_ffi_checksum_constructor_owner_new_shared(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PROGRAMMABLETRANSACTION_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PROGRAMMABLETRANSACTION_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PUBLISH_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PUBLISH_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_publish_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1PUBLICKEY_FROM_BYTES @@ -4728,6 +5306,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_str(vo #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1SIGNATURE_GENERATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SPLITCOINS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SPLITCOINS_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_STRUCTTAG_COIN @@ -4854,6 +5438,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_t #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONKIND_RANDOMNESS_STATE_UPDATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSFEROBJECTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSFEROBJECTS_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TYPETAG_ADDRESS @@ -4920,6 +5510,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TYPETAG_VECTOR uint16_t uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_UPGRADE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_UPGRADE_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_USERSIGNATURE_FROM_BASE64 diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index 452ae1d99..1dd6dc8ac 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -1484,6 +1484,116 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1524,6 +1634,8 @@ internal interface IntegrityCheckingUniffiLib : Library { ): Short fun uniffi_iota_sdk_ffi_checksum_method_address_to_hex( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_argument_nested( +): Short fun uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes( ): Short fun uniffi_iota_sdk_ffi_checksum_method_bls12381signature_to_bytes( @@ -1662,6 +1774,24 @@ fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects( ): Short fun uniffi_iota_sdk_ffi_checksum_method_identifier_as_str( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_movecall_arguments( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_movecall_function( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_movecall_module( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_movecall_package( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments( +): Short fun uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap( ): Short fun uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_committee( @@ -1790,6 +1920,14 @@ fun uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json( ): Short fun uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_publish_dependencies( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_publish_modules( +): Short fun uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes( ): Short fun uniffi_iota_sdk_ffi_checksum_method_secp256k1signature_to_bytes( @@ -1832,6 +1970,10 @@ fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig_opt( ): Short fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin( +): Short fun uniffi_iota_sdk_ffi_checksum_method_structtag_address( ): Short fun uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type( @@ -1862,6 +2004,10 @@ fun uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_base58( ): Short fun uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_transferobjects_address( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects( +): Short fun uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag( ): Short fun uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt( @@ -1892,6 +2038,14 @@ fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8( ): Short fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_upgrade_modules( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_upgrade_package( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket( +): Short fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig( ): Short fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig_opt( @@ -1952,6 +2106,14 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_address_generate( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str( @@ -1988,6 +2150,20 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_bytes( @@ -2046,6 +2222,20 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_identifier_new( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_movecall_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new( @@ -2082,6 +2272,10 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_owner_new_object( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_owner_new_shared( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_publish_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str( @@ -2106,6 +2300,8 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_str( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin( @@ -2148,6 +2344,8 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transa ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_address( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool( @@ -2170,6 +2368,8 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_bytes( @@ -2245,6 +2445,20 @@ fun uniffi_iota_sdk_ffi_fn_method_address_to_bytes(`ptr`: Pointer,uniffi_out_err ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_address_to_hex(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_argument(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_argument(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_argument_new_gas(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_argument_new_input(`input`: Short,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_argument_new_nested_result(`commandIndex`: Short,`subresultIndex`: Short,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_argument_new_result(`result`: Short,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_argument_nested(`ptr`: Pointer,`ix`: Short,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -2363,6 +2577,24 @@ fun uniffi_iota_sdk_ffi_fn_method_coin_coin_type(`ptr`: Pointer,uniffi_out_err: ): Pointer fun uniffi_iota_sdk_ffi_fn_method_coin_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_command(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_command(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_command_new_make_move_vector(`makeMoveVector`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_command_new_merge_coins(`mergeCoins`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_command_new_move_call(`moveCall`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_command_new_publish(`publish`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_command_new_split_coins(`splitCoins`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_command_new_transfer_objects(`transferObjects`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_command_new_upgrade(`upgrade`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -2589,6 +2821,54 @@ fun uniffi_iota_sdk_ffi_fn_constructor_identifier_new(`identifier`: RustBuffer.B ): Pointer fun uniffi_iota_sdk_ffi_fn_method_identifier_as_str(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_input(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_input(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_input_new_immutable_or_owned(`objectRef`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_input_new_pure(`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_input_new_receiving(`objectRef`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_input_new_shared(`objectId`: Pointer,`initialSharedVersion`: Long,`mutable`: Byte,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_makemovevector(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_makemovevector(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_makemovevector_new(`typeTag`: RustBuffer.ByValue,`elements`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_makemovevector_elements(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_makemovevector_type_tag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_mergecoins(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_mergecoins(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_mergecoins_new(`coin`: Pointer,`coinsToMerge`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_mergecoins_coin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_mergecoins_coins_to_merge(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_movecall(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_movecall(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_movecall_new(`package`: Pointer,`module`: Pointer,`function`: Pointer,`typeArguments`: RustBuffer.ByValue,`arguments`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_movecall_arguments(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_movecall_function(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_movecall_module(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_movecall_package(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_movecall_type_arguments(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_movepackage(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_movepackage(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -2809,6 +3089,22 @@ fun uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(`ptr`: Pointer,uniffi_o ): Pointer fun uniffi_iota_sdk_ffi_fn_free_programmabletransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_programmabletransaction_new(`inputs`: RustBuffer.ByValue,`commands`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_programmabletransaction_commands(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_programmabletransaction_inputs(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_publish(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_publish(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_publish_new(`modules`: RustBuffer.ByValue,`dependencies`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_publish_dependencies(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_publish_modules(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_randomnessstateupdate(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -2899,6 +3195,16 @@ fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt(`ptr`: Point ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_splitcoins(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_splitcoins(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_splitcoins_new(`coin`: Pointer,`amounts`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_splitcoins_amounts(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_splitcoins_coin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_clone_structtag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_structtag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -2999,6 +3305,16 @@ fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction( ): Pointer fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_transferobjects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_transferobjects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_transferobjects_new(`objects`: RustBuffer.ByValue,`address`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transferobjects_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transferobjects_objects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_typetag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_typetag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3055,6 +3371,20 @@ fun uniffi_iota_sdk_ffi_fn_method_typetag_is_u8(`ptr`: Pointer,uniffi_out_err: U ): Byte fun uniffi_iota_sdk_ffi_fn_method_typetag_is_vector(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte +fun uniffi_iota_sdk_ffi_fn_clone_upgrade(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_upgrade(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_upgrade_new(`modules`: RustBuffer.ByValue,`dependencies`: RustBuffer.ByValue,`package`: Pointer,`ticket`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_upgrade_dependencies(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_upgrade_modules(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_upgrade_package(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_upgrade_ticket(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_clone_usersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_usersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3273,6 +3603,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_address_to_hex() != 22032.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_argument_nested() != 44576.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes() != 9890.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -3480,6 +3813,33 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str() != 63815.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements() != 20773.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag() != 31154.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin() != 38884.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge() != 44350.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_movecall_arguments() != 17202.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_movecall_function() != 2751.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_movecall_module() != 35106.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_movecall_package() != 24481.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments() != 46468.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap() != 41489.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -3672,6 +4032,18 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature() != 5489.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands() != 49868.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs() != 25458.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_publish_dependencies() != 57311.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_publish_modules() != 26011.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes() != 49170.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -3735,6 +4107,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes() != 28081.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts() != 10377.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin() != 17278.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_structtag_address() != 18393.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -3780,6 +4158,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes() != 6773.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_address() != 37833.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects() != 24154.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag() != 1715.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -3825,6 +4209,18 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector() != 49992.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies() != 7113.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_modules() != 62138.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_package() != 35757.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket() != 11416.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig() != 36332.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -3915,6 +4311,18 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_address_generate() != 48865.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas() != 14489.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input() != 33966.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result() != 57666.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result() != 44025.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes() != 6069.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -3969,6 +4377,27 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object() != 35349.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector() != 54610.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins() != 1888.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call() != 23161.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish() != 7239.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins() != 59484.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects() != 54265.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade() != 48835.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58() != 17742.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4056,6 +4485,27 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new() != 9398.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned() != 33908.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure() != 53404.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving() != 28060.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared() != 61970.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new() != 20934.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new() != 1506.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_movecall_new() != 30411.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() != 17506.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4110,6 +4560,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_owner_new_shared() != 36753.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new() != 38638.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_publish_new() != 4785.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes() != 20339.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4146,6 +4602,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate() != 40260.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new() != 50321.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() != 13756.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4209,6 +4668,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update() != 45772.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new() != 22470.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address() != 44901.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4242,6 +4704,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector() != 46548.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new() != 61663.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64() != 8029.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5172,12 +5637,56 @@ public object FfiConverterTypeAddress: FfiConverter { // -public interface AuthenticatorStateExpireInterface { +/** + * An argument to a programmable transaction command + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * argument = argument-gas + * =/ argument-input + * =/ argument-result + * =/ argument-nested-result + * + * argument-gas = %x00 + * argument-input = %x01 u16 + * argument-result = %x02 u16 + * argument-nested-result = %x03 u16 u16 + * ``` + */ +public interface ArgumentInterface { + + /** + * Turn a Result into a NestedResult. If the argument is not a Result, + * returns None. + */ + fun `nested`(`ix`: kotlin.UShort): Argument? companion object } -open class AuthenticatorStateExpire: Disposable, AutoCloseable, AuthenticatorStateExpireInterface +/** + * An argument to a programmable transaction command + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * argument = argument-gas + * =/ argument-input + * =/ argument-result + * =/ argument-nested-result + * + * argument-gas = %x00 + * argument-input = %x01 u16 + * argument-result = %x02 u16 + * argument-nested-result = %x03 u16 u16 + * ``` + */ +open class Argument: Disposable, AutoCloseable, ArgumentInterface { constructor(pointer: Pointer) { @@ -5247,7 +5756,7 @@ open class AuthenticatorStateExpire: Disposable, AutoCloseable, AuthenticatorSta override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_argument(ptr, status) } } } @@ -5255,40 +5764,113 @@ open class AuthenticatorStateExpire: Disposable, AutoCloseable, AuthenticatorSta fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_argument(pointer!!, status) } } + /** + * Turn a Result into a NestedResult. If the argument is not a Result, + * returns None. + */override fun `nested`(`ix`: kotlin.UShort): Argument? { + return FfiConverterOptionalTypeArgument.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_argument_nested( + it, FfiConverterUShort.lower(`ix`),_status) +} + } + ) + } + + - companion object + companion object { + + /** + * The gas coin. The gas coin can only be used by-ref, except for with + * `TransferObjects`, which can use it by-value. + */ fun `newGas`(): Argument { + return FfiConverterTypeArgument.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_argument_new_gas( + _status) +} + ) + } + + + + /** + * One of the input objects or primitive values (from + * `ProgrammableTransaction` inputs) + */ fun `newInput`(`input`: kotlin.UShort): Argument { + return FfiConverterTypeArgument.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_argument_new_input( + FfiConverterUShort.lower(`input`),_status) +} + ) + } + + + + /** + * Like a `Result` but it accesses a nested result. Currently, the only + * usage of this is to access a value from a Move call with multiple + * return values. + */ fun `newNestedResult`(`commandIndex`: kotlin.UShort, `subresultIndex`: kotlin.UShort): Argument { + return FfiConverterTypeArgument.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_argument_new_nested_result( + FfiConverterUShort.lower(`commandIndex`),FfiConverterUShort.lower(`subresultIndex`),_status) +} + ) + } + + + + /** + * The result of another command (from `ProgrammableTransaction` commands) + */ fun `newResult`(`result`: kotlin.UShort): Argument { + return FfiConverterTypeArgument.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_argument_new_result( + FfiConverterUShort.lower(`result`),_status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeAuthenticatorStateExpire: FfiConverter { +public object FfiConverterTypeArgument: FfiConverter { - override fun lower(value: AuthenticatorStateExpire): Pointer { + override fun lower(value: Argument): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): AuthenticatorStateExpire { - return AuthenticatorStateExpire(value) + override fun lift(value: Pointer): Argument { + return Argument(value) } - override fun read(buf: ByteBuffer): AuthenticatorStateExpire { + override fun read(buf: ByteBuffer): Argument { // 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: AuthenticatorStateExpire) = 8UL + override fun allocationSize(value: Argument) = 8UL - override fun write(value: AuthenticatorStateExpire, buf: ByteBuffer) { + override fun write(value: Argument, 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))) @@ -5394,12 +5976,12 @@ public object FfiConverterTypeAuthenticatorStateExpire: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(ptr, status) } } } @@ -5477,7 +6059,7 @@ open class AuthenticatorStateUpdateV1: Disposable, AutoCloseable, AuthenticatorS fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(pointer!!, status) } } @@ -5492,25 +6074,25 @@ open class AuthenticatorStateUpdateV1: Disposable, AutoCloseable, AuthenticatorS /** * @suppress */ -public object FfiConverterTypeAuthenticatorStateUpdateV1: FfiConverter { +public object FfiConverterTypeAuthenticatorStateExpire: FfiConverter { - override fun lower(value: AuthenticatorStateUpdateV1): Pointer { + override fun lower(value: AuthenticatorStateExpire): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): AuthenticatorStateUpdateV1 { - return AuthenticatorStateUpdateV1(value) + override fun lift(value: Pointer): AuthenticatorStateExpire { + return AuthenticatorStateExpire(value) } - override fun read(buf: ByteBuffer): AuthenticatorStateUpdateV1 { + override fun read(buf: ByteBuffer): AuthenticatorStateExpire { // 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: AuthenticatorStateUpdateV1) = 8UL + override fun allocationSize(value: AuthenticatorStateExpire) = 8UL - override fun write(value: AuthenticatorStateUpdateV1, buf: ByteBuffer) { + override fun write(value: AuthenticatorStateExpire, 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))) @@ -5616,12 +6198,12 @@ public object FfiConverterTypeAuthenticatorStateUpdateV1: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_batchsendstatus(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(ptr, status) } } } @@ -5699,7 +6281,7 @@ open class BatchSendStatus: Disposable, AutoCloseable, BatchSendStatusInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(pointer!!, status) } } @@ -5714,25 +6296,25 @@ open class BatchSendStatus: Disposable, AutoCloseable, BatchSendStatusInterface /** * @suppress */ -public object FfiConverterTypeBatchSendStatus: FfiConverter { +public object FfiConverterTypeAuthenticatorStateUpdateV1: FfiConverter { - override fun lower(value: BatchSendStatus): Pointer { + override fun lower(value: AuthenticatorStateUpdateV1): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): BatchSendStatus { - return BatchSendStatus(value) + override fun lift(value: Pointer): AuthenticatorStateUpdateV1 { + return AuthenticatorStateUpdateV1(value) } - override fun read(buf: ByteBuffer): BatchSendStatus { + override fun read(buf: ByteBuffer): AuthenticatorStateUpdateV1 { // 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: BatchSendStatus) = 8UL + override fun allocationSize(value: AuthenticatorStateUpdateV1) = 8UL - override fun write(value: BatchSendStatus, buf: ByteBuffer) { + override fun write(value: AuthenticatorStateUpdateV1, 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))) @@ -5838,46 +6420,12 @@ public object FfiConverterTypeBatchSendStatus: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bls12381publickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_batchsendstatus(ptr, status) } } } @@ -5955,85 +6503,40 @@ open class Bls12381PublicKey: Disposable, AutoCloseable, Bls12381PublicKeyInterf fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes( - it, _status) -} - } - ) - } - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bls12381PublicKey { - return FfiConverterTypeBls12381PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) -} - ) - } - - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bls12381PublicKey { - return FfiConverterTypeBls12381PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str( - FfiConverterString.lower(`s`),_status) -} - ) - } - - - fun `generate`(): Bls12381PublicKey { - return FfiConverterTypeBls12381PublicKey.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate( - _status) -} - ) - } - - - - } + companion object } /** * @suppress */ -public object FfiConverterTypeBls12381PublicKey: FfiConverter { +public object FfiConverterTypeBatchSendStatus: FfiConverter { - override fun lower(value: Bls12381PublicKey): Pointer { + override fun lower(value: BatchSendStatus): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Bls12381PublicKey { - return Bls12381PublicKey(value) + override fun lift(value: Pointer): BatchSendStatus { + return BatchSendStatus(value) } - override fun read(buf: ByteBuffer): Bls12381PublicKey { + override fun read(buf: ByteBuffer): BatchSendStatus { // 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: Bls12381PublicKey) = 8UL + override fun allocationSize(value: BatchSendStatus) = 8UL - override fun write(value: Bls12381PublicKey, buf: ByteBuffer) { + override fun write(value: BatchSendStatus, 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))) @@ -6155,7 +6658,7 @@ public object FfiConverterTypeBls12381PublicKey: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bls12381signature(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bls12381publickey(ptr, status) } } } @@ -6256,7 +6759,7 @@ open class Bls12381Signature: Disposable, AutoCloseable, Bls12381SignatureInterf fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bls12381signature(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(pointer!!, status) } } @@ -6264,7 +6767,7 @@ open class Bls12381Signature: Disposable, AutoCloseable, Bls12381SignatureInterf return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bls12381signature_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes( it, _status) } } @@ -6277,10 +6780,10 @@ open class Bls12381Signature: Disposable, AutoCloseable, Bls12381SignatureInterf companion object { - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bls12381Signature { - return FfiConverterTypeBls12381Signature.lift( + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bls12381PublicKey { + return FfiConverterTypeBls12381PublicKey.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes( FfiConverterByteArray.lower(`bytes`),_status) } ) @@ -6288,20 +6791,20 @@ open class Bls12381Signature: Disposable, AutoCloseable, Bls12381SignatureInterf - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bls12381Signature { - return FfiConverterTypeBls12381Signature.lift( + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bls12381PublicKey { + return FfiConverterTypeBls12381PublicKey.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_str( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str( FfiConverterString.lower(`s`),_status) } ) } - fun `generate`(): Bls12381Signature { - return FfiConverterTypeBls12381Signature.lift( + fun `generate`(): Bls12381PublicKey { + return FfiConverterTypeBls12381PublicKey.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_generate( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate( _status) } ) @@ -6316,25 +6819,25 @@ open class Bls12381Signature: Disposable, AutoCloseable, Bls12381SignatureInterf /** * @suppress */ -public object FfiConverterTypeBls12381Signature: FfiConverter { +public object FfiConverterTypeBls12381PublicKey: FfiConverter { - override fun lower(value: Bls12381Signature): Pointer { + override fun lower(value: Bls12381PublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Bls12381Signature { - return Bls12381Signature(value) + override fun lift(value: Pointer): Bls12381PublicKey { + return Bls12381PublicKey(value) } - override fun read(buf: ByteBuffer): Bls12381Signature { + override fun read(buf: ByteBuffer): Bls12381PublicKey { // 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: Bls12381Signature) = 8UL + override fun allocationSize(value: Bls12381PublicKey) = 8UL - override fun write(value: Bls12381Signature, buf: ByteBuffer) { + override fun write(value: Bls12381PublicKey, 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))) @@ -6441,45 +6944,45 @@ public object FfiConverterTypeBls12381Signature: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bn254fieldelement(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bls12381signature(ptr, status) } } } @@ -6557,27 +7060,15 @@ open class Bn254FieldElement: Disposable, AutoCloseable, Bn254FieldElementInterf fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bn254fieldelement(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bls12381signature(pointer!!, status) } } - override fun `padded`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_padded( - it, _status) -} - } - ) - } - - - override fun `unpadded`(): kotlin.ByteArray { + override fun `toBytes`(): kotlin.ByteArray { return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_unpadded( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bls12381signature_to_bytes( it, _status) } } @@ -6590,10 +7081,10 @@ open class Bn254FieldElement: Disposable, AutoCloseable, Bn254FieldElementInterf companion object { - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bn254FieldElement { - return FfiConverterTypeBn254FieldElement.lift( + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bls12381Signature { + return FfiConverterTypeBls12381Signature.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_bytes( FfiConverterByteArray.lower(`bytes`),_status) } ) @@ -6601,22 +7092,21 @@ open class Bn254FieldElement: Disposable, AutoCloseable, Bn254FieldElementInterf - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bn254FieldElement { - return FfiConverterTypeBn254FieldElement.lift( + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bls12381Signature { + return FfiConverterTypeBls12381Signature.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_str( FfiConverterString.lower(`s`),_status) } ) } - - @Throws(SdkFfiException::class) fun `fromStrRadix10`(`s`: kotlin.String): Bn254FieldElement { - return FfiConverterTypeBn254FieldElement.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str_radix_10( - FfiConverterString.lower(`s`),_status) + fun `generate`(): Bls12381Signature { + return FfiConverterTypeBls12381Signature.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_generate( + _status) } ) } @@ -6630,25 +7120,25 @@ open class Bn254FieldElement: Disposable, AutoCloseable, Bn254FieldElementInterf /** * @suppress */ -public object FfiConverterTypeBn254FieldElement: FfiConverter { +public object FfiConverterTypeBls12381Signature: FfiConverter { - override fun lower(value: Bn254FieldElement): Pointer { + override fun lower(value: Bls12381Signature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Bn254FieldElement { - return Bn254FieldElement(value) + override fun lift(value: Pointer): Bls12381Signature { + return Bls12381Signature(value) } - override fun read(buf: ByteBuffer): Bn254FieldElement { + override fun read(buf: ByteBuffer): Bls12381Signature { // 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: Bn254FieldElement) = 8UL + override fun allocationSize(value: Bls12381Signature) = 8UL - override fun write(value: Bn254FieldElement, buf: ByteBuffer) { + override fun write(value: Bls12381Signature, 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))) @@ -6754,12 +7244,46 @@ public object FfiConverterTypeBn254FieldElement: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepoch(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bn254fieldelement(ptr, status) } } } @@ -6837,40 +7361,98 @@ open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepoch(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bn254fieldelement(pointer!!, status) } } + override fun `padded`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_padded( + it, _status) +} + } + ) + } + override fun `unpadded`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_unpadded( + it, _status) +} + } + ) + } + - companion object + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStrRadix10`(`s`: kotlin.String): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str_radix_10( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeChangeEpoch: FfiConverter { +public object FfiConverterTypeBn254FieldElement: FfiConverter { - override fun lower(value: ChangeEpoch): Pointer { + override fun lower(value: Bn254FieldElement): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ChangeEpoch { - return ChangeEpoch(value) + override fun lift(value: Pointer): Bn254FieldElement { + return Bn254FieldElement(value) } - override fun read(buf: ByteBuffer): ChangeEpoch { + override fun read(buf: ByteBuffer): Bn254FieldElement { // 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: ChangeEpoch) = 8UL + override fun allocationSize(value: Bn254FieldElement) = 8UL - override fun write(value: ChangeEpoch, buf: ByteBuffer) { + override fun write(value: Bn254FieldElement, 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))) @@ -6976,12 +7558,12 @@ public object FfiConverterTypeChangeEpoch: FfiConverter { // -public interface ChangeEpochV2Interface { +public interface ChangeEpochInterface { companion object } -open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface +open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface { constructor(pointer: Pointer) { @@ -7051,7 +7633,7 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepochv2(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepoch(ptr, status) } } } @@ -7059,7 +7641,7 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepochv2(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepoch(pointer!!, status) } } @@ -7074,25 +7656,25 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface /** * @suppress */ -public object FfiConverterTypeChangeEpochV2: FfiConverter { +public object FfiConverterTypeChangeEpoch: FfiConverter { - override fun lower(value: ChangeEpochV2): Pointer { + override fun lower(value: ChangeEpoch): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ChangeEpochV2 { - return ChangeEpochV2(value) + override fun lift(value: Pointer): ChangeEpoch { + return ChangeEpoch(value) } - override fun read(buf: ByteBuffer): ChangeEpochV2 { + override fun read(buf: ByteBuffer): ChangeEpoch { // 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: ChangeEpochV2) = 8UL + override fun allocationSize(value: ChangeEpoch) = 8UL - override fun write(value: ChangeEpochV2, buf: ByteBuffer) { + override fun write(value: ChangeEpoch, 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))) @@ -7198,16 +7780,12 @@ public object FfiConverterTypeChangeEpochV2: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepochv2(ptr, status) } } } @@ -7285,34 +7863,10 @@ open class CheckpointCommitment: Disposable, AutoCloseable, CheckpointCommitment fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepochv2(pointer!!, status) } } - override fun `asEcmhLiveObjectSetDigest`(): Digest { - return FfiConverterTypeDigest.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest( - it, _status) -} - } - ) - } - - - override fun `isEcmhLiveObjectSet`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set( - it, _status) -} - } - ) - } - - @@ -7324,25 +7878,25 @@ open class CheckpointCommitment: Disposable, AutoCloseable, CheckpointCommitment /** * @suppress */ -public object FfiConverterTypeCheckpointCommitment: FfiConverter { +public object FfiConverterTypeChangeEpochV2: FfiConverter { - override fun lower(value: CheckpointCommitment): Pointer { + override fun lower(value: ChangeEpochV2): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): CheckpointCommitment { - return CheckpointCommitment(value) + override fun lift(value: Pointer): ChangeEpochV2 { + return ChangeEpochV2(value) } - override fun read(buf: ByteBuffer): CheckpointCommitment { + override fun read(buf: ByteBuffer): ChangeEpochV2 { // 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: CheckpointCommitment) = 8UL + override fun allocationSize(value: ChangeEpochV2) = 8UL - override fun write(value: CheckpointCommitment, buf: ByteBuffer) { + override fun write(value: ChangeEpochV2, 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))) @@ -7448,16 +8002,16 @@ public object FfiConverterTypeCheckpointCommitment: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(ptr, status) } } } @@ -7535,15 +8089,15 @@ open class CheckpointContentsDigest: Disposable, AutoCloseable, CheckpointConten fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcontentsdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(pointer!!, status) } } - override fun `toBase58`(): kotlin.String { - return FfiConverterString.lift( + override fun `asEcmhLiveObjectSetDigest`(): Digest { + return FfiConverterTypeDigest.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_base58( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest( it, _status) } } @@ -7551,11 +8105,11 @@ open class CheckpointContentsDigest: Disposable, AutoCloseable, CheckpointConten } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `isEcmhLiveObjectSet`(): kotlin.Boolean { + return FfiConverterBoolean.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set( it, _status) } } @@ -7566,66 +8120,33 @@ open class CheckpointContentsDigest: Disposable, AutoCloseable, CheckpointConten - companion object { - - @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): CheckpointContentsDigest { - return FfiConverterTypeCheckpointContentsDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_base58( - FfiConverterString.lower(`base58`),_status) -} - ) - } - - - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): CheckpointContentsDigest { - return FfiConverterTypeCheckpointContentsDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) -} - ) - } - - - fun `generate`(): CheckpointContentsDigest { - return FfiConverterTypeCheckpointContentsDigest.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_generate( - _status) -} - ) - } - - - } + companion object } /** * @suppress */ -public object FfiConverterTypeCheckpointContentsDigest: FfiConverter { +public object FfiConverterTypeCheckpointCommitment: FfiConverter { - override fun lower(value: CheckpointContentsDigest): Pointer { + override fun lower(value: CheckpointCommitment): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): CheckpointContentsDigest { - return CheckpointContentsDigest(value) + override fun lift(value: Pointer): CheckpointCommitment { + return CheckpointCommitment(value) } - override fun read(buf: ByteBuffer): CheckpointContentsDigest { + override fun read(buf: ByteBuffer): CheckpointCommitment { // 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: CheckpointContentsDigest) = 8UL + override fun allocationSize(value: CheckpointCommitment) = 8UL - override fun write(value: CheckpointContentsDigest, buf: ByteBuffer) { + override fun write(value: CheckpointCommitment, 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))) @@ -7731,7 +8252,7 @@ public object FfiConverterTypeCheckpointContentsDigest: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(ptr, status) } } } @@ -7818,7 +8339,7 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcontentsdigest(pointer!!, status) } } @@ -7826,7 +8347,7 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac return FfiConverterString.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_base58( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_base58( it, _status) } } @@ -7838,7 +8359,7 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_bytes( it, _status) } } @@ -7851,10 +8372,10 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac companion object { - @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): CheckpointDigest { - return FfiConverterTypeCheckpointDigest.lift( + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): CheckpointContentsDigest { + return FfiConverterTypeCheckpointContentsDigest.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_base58( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_base58( FfiConverterString.lower(`base58`),_status) } ) @@ -7862,20 +8383,20 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): CheckpointDigest { - return FfiConverterTypeCheckpointDigest.lift( + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): CheckpointContentsDigest { + return FfiConverterTypeCheckpointContentsDigest.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_bytes( FfiConverterByteArray.lower(`bytes`),_status) } ) } - fun `generate`(): CheckpointDigest { - return FfiConverterTypeCheckpointDigest.lift( + fun `generate`(): CheckpointContentsDigest { + return FfiConverterTypeCheckpointContentsDigest.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_generate( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_generate( _status) } ) @@ -7890,25 +8411,25 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac /** * @suppress */ -public object FfiConverterTypeCheckpointDigest: FfiConverter { +public object FfiConverterTypeCheckpointContentsDigest: FfiConverter { - override fun lower(value: CheckpointDigest): Pointer { + override fun lower(value: CheckpointContentsDigest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): CheckpointDigest { - return CheckpointDigest(value) + override fun lift(value: Pointer): CheckpointContentsDigest { + return CheckpointContentsDigest(value) } - override fun read(buf: ByteBuffer): CheckpointDigest { + override fun read(buf: ByteBuffer): CheckpointContentsDigest { // 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: CheckpointDigest) = 8UL + override fun allocationSize(value: CheckpointContentsDigest) = 8UL - override fun write(value: CheckpointDigest, buf: ByteBuffer) { + override fun write(value: CheckpointContentsDigest, 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))) @@ -8014,40 +8535,16 @@ public object FfiConverterTypeCheckpointDigest: FfiConverter - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_circomg1_new( - FfiConverterTypeBn254FieldElement.lower(`el0`),FfiConverterTypeBn254FieldElement.lower(`el1`),FfiConverterTypeBn254FieldElement.lower(`el2`),_status) -} - ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -8124,7 +8614,7 @@ open class CircomG1: Disposable, AutoCloseable, CircomG1Interface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_circomg1(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointdigest(ptr, status) } } } @@ -8132,40 +8622,354 @@ open class CircomG1: Disposable, AutoCloseable, CircomG1Interface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_circomg1(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(pointer!!, status) } } + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_base58( + it, _status) +} + } + ) + } + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_bytes( + it, _status) +} + } + ) + } + - companion object + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): CheckpointDigest { + return FfiConverterTypeCheckpointDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): CheckpointDigest { + return FfiConverterTypeCheckpointDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): CheckpointDigest { + return FfiConverterTypeCheckpointDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeCircomG1: FfiConverter { +public object FfiConverterTypeCheckpointDigest: FfiConverter { - override fun lower(value: CircomG1): Pointer { + override fun lower(value: CheckpointDigest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): CircomG1 { - return CircomG1(value) + override fun lift(value: Pointer): CheckpointDigest { + return CheckpointDigest(value) } - override fun read(buf: ByteBuffer): CircomG1 { + override fun read(buf: ByteBuffer): CheckpointDigest { // 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: CircomG1) = 8UL + override fun allocationSize(value: CheckpointDigest) = 8UL - override fun write(value: CircomG1, buf: ByteBuffer) { + override fun write(value: CheckpointDigest, 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 G1 point + * + * This represents the canonical decimal representation of the projective + * coordinates in Fq. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * circom-g1 = %x03 3(bn254-field-element) + * ``` + */ +public interface CircomG1Interface { + + companion object +} + +/** + * A G1 point + * + * This represents the canonical decimal representation of the projective + * coordinates in Fq. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * circom-g1 = %x03 3(bn254-field-element) + * ``` + */ +open class CircomG1: Disposable, AutoCloseable, CircomG1Interface +{ + + 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(`el0`: Bn254FieldElement, `el1`: Bn254FieldElement, `el2`: Bn254FieldElement) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_circomg1_new( + FfiConverterTypeBn254FieldElement.lower(`el0`),FfiConverterTypeBn254FieldElement.lower(`el1`),FfiConverterTypeBn254FieldElement.lower(`el2`),_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_circomg1(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_circomg1(pointer!!, status) + } + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeCircomG1: FfiConverter { + + override fun lower(value: CircomG1): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): CircomG1 { + return CircomG1(value) + } + + override fun read(buf: ByteBuffer): CircomG1 { + // 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: CircomG1) = 8UL + + override fun write(value: CircomG1, 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))) @@ -8804,6 +9608,381 @@ public object FfiConverterTypeCoin: FfiConverter { // +/** + * A single command in a programmable transaction. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * command = command-move-call + * =/ command-transfer-objects + * =/ command-split-coins + * =/ command-merge-coins + * =/ command-publish + * =/ command-make-move-vector + * =/ command-upgrade + * + * command-move-call = %x00 move-call + * command-transfer-objects = %x01 transfer-objects + * command-split-coins = %x02 split-coins + * command-merge-coins = %x03 merge-coins + * command-publish = %x04 publish + * command-make-move-vector = %x05 make-move-vector + * command-upgrade = %x06 upgrade + * ``` + */ +public interface CommandInterface { + + companion object +} + +/** + * A single command in a programmable transaction. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * command = command-move-call + * =/ command-transfer-objects + * =/ command-split-coins + * =/ command-merge-coins + * =/ command-publish + * =/ command-make-move-vector + * =/ command-upgrade + * + * command-move-call = %x00 move-call + * command-transfer-objects = %x01 transfer-objects + * command-split-coins = %x02 split-coins + * command-merge-coins = %x03 merge-coins + * command-publish = %x04 publish + * command-make-move-vector = %x05 make-move-vector + * command-upgrade = %x06 upgrade + * ``` + */ +open class Command: Disposable, AutoCloseable, CommandInterface +{ + + 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)) + } + + 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_command(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_command(pointer!!, status) + } + } + + + + + companion object { + + /** + * Given n-values of the same type, it constructs a vector. For non objects + * or an empty vector, the type tag must be specified. + */ fun `newMakeMoveVector`(`makeMoveVector`: MakeMoveVector): Command { + return FfiConverterTypeCommand.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_command_new_make_move_vector( + FfiConverterTypeMakeMoveVector.lower(`makeMoveVector`),_status) +} + ) + } + + + + /** + * It merges n-coins into the first coin + */ fun `newMergeCoins`(`mergeCoins`: MergeCoins): Command { + return FfiConverterTypeCommand.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_command_new_merge_coins( + FfiConverterTypeMergeCoins.lower(`mergeCoins`),_status) +} + ) + } + + + + /** + * A call to either an entry or a public Move function + */ fun `newMoveCall`(`moveCall`: MoveCall): Command { + return FfiConverterTypeCommand.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_command_new_move_call( + FfiConverterTypeMoveCall.lower(`moveCall`),_status) +} + ) + } + + + + /** + * Publishes a Move package. It takes the package bytes and a list of the + * package's transitive dependencies to link against on-chain. + */ fun `newPublish`(`publish`: Publish): Command { + return FfiConverterTypeCommand.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_command_new_publish( + FfiConverterTypePublish.lower(`publish`),_status) +} + ) + } + + + + /** + * It splits off some amounts into a new coins with those amounts + */ fun `newSplitCoins`(`splitCoins`: SplitCoins): Command { + return FfiConverterTypeCommand.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_command_new_split_coins( + FfiConverterTypeSplitCoins.lower(`splitCoins`),_status) +} + ) + } + + + + /** + * It sends n-objects to the specified address. These objects must have + * store (public transfer) and either the previous owner must be an + * address or the object must be newly created. + */ fun `newTransferObjects`(`transferObjects`: TransferObjects): Command { + return FfiConverterTypeCommand.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_command_new_transfer_objects( + FfiConverterTypeTransferObjects.lower(`transferObjects`),_status) +} + ) + } + + + + /** + * Upgrades a Move package + * Takes (in order): + * 1. A vector of serialized modules for the package. + * 2. A vector of object ids for the transitive dependencies of the new + * package. + * 3. The object ID of the package being upgraded. + * 4. An argument holding the `UpgradeTicket` that must have been produced + * from an earlier command in the same programmable transaction. + */ fun `newUpgrade`(`upgrade`: Upgrade): Command { + return FfiConverterTypeCommand.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_command_new_upgrade( + FfiConverterTypeUpgrade.lower(`upgrade`),_status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeCommand: FfiConverter { + + override fun lower(value: Command): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): Command { + return Command(value) + } + + override fun read(buf: ByteBuffer): Command { + // 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: Command) = 8UL + + override fun write(value: Command, 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 +// + + public interface ConsensusCommitDigestInterface { fun `toBase58`(): kotlin.String @@ -14157,41 +15336,43 @@ public object FfiConverterTypeIdentifier: FfiConverter { /** - * A move package + * An input to a user transaction * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object-move-package = object-id u64 move-modules type-origin-table linkage-table + * input = input-pure / input-immutable-or-owned / input-shared / input-receiving * - * move-modules = map (identifier bytes) - * type-origin-table = vector type-origin - * linkage-table = map (object-id upgrade-info) + * input-pure = %x00 bytes + * input-immutable-or-owned = %x01 object-ref + * input-shared = %x02 object-id u64 bool + * input-receiving = %x04 object-ref * ``` */ -public interface MovePackageInterface { +public interface InputInterface { companion object } /** - * A move package + * An input to a user transaction * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object-move-package = object-id u64 move-modules type-origin-table linkage-table + * input = input-pure / input-immutable-or-owned / input-shared / input-receiving * - * move-modules = map (identifier bytes) - * type-origin-table = vector type-origin - * linkage-table = map (object-id upgrade-info) + * input-pure = %x00 bytes + * input-immutable-or-owned = %x01 object-ref + * input-shared = %x02 object-id u64 bool + * input-receiving = %x04 object-ref * ``` */ -open class MovePackage: Disposable, AutoCloseable, MovePackageInterface +open class Input: Disposable, AutoCloseable, InputInterface { constructor(pointer: Pointer) { @@ -14209,13 +15390,6 @@ open class MovePackage: Disposable, AutoCloseable, MovePackageInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - constructor(`id`: ObjectId, `version`: kotlin.ULong, `modules`: Map, `typeOriginTable`: List, `linkageTable`: Map) : - this( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new( - FfiConverterTypeObjectId.lower(`id`),FfiConverterULong.lower(`version`),FfiConverterMapTypeIdentifierByteArray.lower(`modules`),FfiConverterSequenceTypeTypeOrigin.lower(`typeOriginTable`),FfiConverterMapTypeObjectIdTypeUpgradeInfo.lower(`linkageTable`),_status) -} - ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -14268,7 +15442,7 @@ open class MovePackage: Disposable, AutoCloseable, MovePackageInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movepackage(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_input(ptr, status) } } } @@ -14276,40 +15450,91 @@ open class MovePackage: Disposable, AutoCloseable, MovePackageInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_input(pointer!!, status) } } + companion object { + + /** + * A move object that is either immutable or address owned + */ fun `newImmutableOrOwned`(`objectRef`: ObjectReference): Input { + return FfiConverterTypeInput.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_input_new_immutable_or_owned( + FfiConverterTypeObjectReference.lower(`objectRef`),_status) +} + ) + } - companion object + + + /** + * For normal operations this is required to be a move primitive type and + * not contain structs or objects. + */ fun `newPure`(`value`: kotlin.ByteArray): Input { + return FfiConverterTypeInput.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_input_new_pure( + FfiConverterByteArray.lower(`value`),_status) +} + ) + } + + + fun `newReceiving`(`objectRef`: ObjectReference): Input { + return FfiConverterTypeInput.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_input_new_receiving( + FfiConverterTypeObjectReference.lower(`objectRef`),_status) +} + ) + } + + + + /** + * A move object whose owner is "Shared" + */ fun `newShared`(`objectId`: ObjectId, `initialSharedVersion`: kotlin.ULong, `mutable`: kotlin.Boolean): Input { + return FfiConverterTypeInput.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_input_new_shared( + FfiConverterTypeObjectId.lower(`objectId`),FfiConverterULong.lower(`initialSharedVersion`),FfiConverterBoolean.lower(`mutable`),_status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeMovePackage: FfiConverter { +public object FfiConverterTypeInput: FfiConverter { - override fun lower(value: MovePackage): Pointer { + override fun lower(value: Input): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MovePackage { - return MovePackage(value) + override fun lift(value: Pointer): Input { + return Input(value) } - override fun read(buf: ByteBuffer): MovePackage { + override fun read(buf: ByteBuffer): Input { // 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: MovePackage) = 8UL + override fun allocationSize(value: Input) = 8UL - override fun write(value: MovePackage, buf: ByteBuffer) { + override fun write(value: Input, 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))) @@ -14416,78 +15641,46 @@ public object FfiConverterTypeMovePackage: FfiConverter { /** - * Aggregated signature from members of a multisig committee. + * Command to build a move vector out of a set of individual elements * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * multisig-aggregated-signature = (vector multisig-member-signature) - * u16 ; bitmap - * multisig-committee - * ``` - * - * There is also a legacy encoding for this type defined as: - * - * ```text - * legacy-multisig-aggregated-signature = (vector multisig-member-signature) - * roaring-bitmap ; bitmap - * legacy-multisig-committee - * roaring-bitmap = bytes ; where the contents of the bytes are valid - * ; according to the serialized spec for - * ; roaring bitmaps + * make-move-vector = (option type-tag) (vector argument) * ``` - * - * See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the - * serialized format of RoaringBitmaps. */ -public interface MultisigAggregatedSignatureInterface { +public interface MakeMoveVectorInterface { /** - * The bitmap that indicates which committee members provided their - * signature. + * The set individual elements to build the vector with */ - fun `bitmap`(): kotlin.UShort - - fun `committee`(): MultisigCommittee + fun `elements`(): List /** - * The list of signatures from committee members + * Type of the individual elements + * + * This is required to be set when the type can't be inferred, for example + * when the set of provided arguments are all pure input values. */ - fun `signatures`(): List + fun `typeTag`(): TypeTag? companion object } /** - * Aggregated signature from members of a multisig committee. + * Command to build a move vector out of a set of individual elements * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * multisig-aggregated-signature = (vector multisig-member-signature) - * u16 ; bitmap - * multisig-committee + * make-move-vector = (option type-tag) (vector argument) * ``` - * - * There is also a legacy encoding for this type defined as: - * - * ```text - * legacy-multisig-aggregated-signature = (vector multisig-member-signature) - * roaring-bitmap ; bitmap - * legacy-multisig-committee - * roaring-bitmap = bytes ; where the contents of the bytes are valid - * ; according to the serialized spec for - * ; roaring bitmaps - * ``` - * - * See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the - * serialized format of RoaringBitmaps. */ -open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggregatedSignatureInterface +open class MakeMoveVector: Disposable, AutoCloseable, MakeMoveVectorInterface { constructor(pointer: Pointer) { @@ -14505,20 +15698,11 @@ open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggre this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Construct a new aggregated multisig signature. - * - * Since the list of signatures doesn't contain sufficient information to - * identify which committee member provided the signature, it is up to - * the caller to ensure that the provided signature list is in the same - * order as it's corresponding member in the provided committee - * and that it's position in the provided bitmap is set. - */ - constructor(`committee`: MultisigCommittee, `signatures`: List, `bitmap`: kotlin.UShort) : + constructor(`typeTag`: TypeTag?, `elements`: List) : this( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigaggregatedsignature_new( - FfiConverterTypeMultisigCommittee.lower(`committee`),FfiConverterSequenceTypeMultisigMemberSignature.lower(`signatures`),FfiConverterUShort.lower(`bitmap`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_makemovevector_new( + FfiConverterOptionalTypeTypeTag.lower(`typeTag`),FfiConverterSequenceTypeArgument.lower(`elements`),_status) } ) @@ -14573,7 +15757,7 @@ open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggre override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigaggregatedsignature(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_makemovevector(ptr, status) } } } @@ -14581,31 +15765,18 @@ open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggre fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigaggregatedsignature(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_makemovevector(pointer!!, status) } } /** - * The bitmap that indicates which committee members provided their - * signature. - */override fun `bitmap`(): kotlin.UShort { - return FfiConverterUShort.lift( + * The set individual elements to build the vector with + */override fun `elements`(): List { + return FfiConverterSequenceTypeArgument.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_bitmap( - it, _status) -} - } - ) - } - - - override fun `committee`(): MultisigCommittee { - return FfiConverterTypeMultisigCommittee.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_committee( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_makemovevector_elements( it, _status) } } @@ -14615,12 +15786,15 @@ open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggre /** - * The list of signatures from committee members - */override fun `signatures`(): List { - return FfiConverterSequenceTypeMultisigMemberSignature.lift( + * Type of the individual elements + * + * This is required to be set when the type can't be inferred, for example + * when the set of provided arguments are all pure input values. + */override fun `typeTag`(): TypeTag? { + return FfiConverterOptionalTypeTypeTag.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_signatures( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_makemovevector_type_tag( it, _status) } } @@ -14639,25 +15813,25 @@ open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggre /** * @suppress */ -public object FfiConverterTypeMultisigAggregatedSignature: FfiConverter { +public object FfiConverterTypeMakeMoveVector: FfiConverter { - override fun lower(value: MultisigAggregatedSignature): Pointer { + override fun lower(value: MakeMoveVector): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MultisigAggregatedSignature { - return MultisigAggregatedSignature(value) + override fun lift(value: Pointer): MakeMoveVector { + return MakeMoveVector(value) } - override fun read(buf: ByteBuffer): MultisigAggregatedSignature { + override fun read(buf: ByteBuffer): MakeMoveVector { // 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: MultisigAggregatedSignature) = 8UL + override fun allocationSize(value: MakeMoveVector) = 8UL - override fun write(value: MultisigAggregatedSignature, buf: ByteBuffer) { + override fun write(value: MakeMoveVector, 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))) @@ -14764,89 +15938,45 @@ public object FfiConverterTypeMultisigAggregatedSignature: FfiConverter= threshold`. + * Command to merge multiple coins of the same type into a single coin * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * multisig-committee = (vector multisig-member) - * u16 ; threshold - * ``` - * - * There is also a legacy encoding for this type defined as: - * - * ```text - * legacy-multisig-committee = (vector legacy-multisig-member) - * u16 ; threshold + * merge-coins = argument (vector argument) * ``` */ -public interface MultisigCommitteeInterface { +public interface MergeCoinsInterface { /** - * Checks if the Committee is valid. - * - * A valid committee is one that: - * - Has a nonzero threshold - * - Has at least one member - * - Has at most ten members - * - No member has weight 0 - * - the sum of the weights of all members must be larger than the - * threshold - * - contains no duplicate members + * Coin to merge coins into */ - fun `isValid`(): kotlin.Boolean + fun `coin`(): Argument /** - * The members of the committee - */ - fun `members`(): List - - /** - * Return the flag for this signature scheme - */ - fun `scheme`(): SignatureScheme - - /** - * The total signature weight required to authorize a transaction for the - * address corresponding to this `MultisigCommittee`. + * Set of coins to merge into `coin` + * + * All listed coins must be of the same type and be the same type as `coin` */ - fun `threshold`(): kotlin.UShort + fun `coinsToMerge`(): List companion object } /** - * A multisig committee - * - * A `MultisigCommittee` is a set of members who collectively control a single - * `Address` on the IOTA blockchain. The number of required signautres to - * authorize the execution of a transaction is determined by - * `(signature_0_weight + signature_1_weight ..) >= threshold`. + * Command to merge multiple coins of the same type into a single coin * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * multisig-committee = (vector multisig-member) - * u16 ; threshold - * ``` - * - * There is also a legacy encoding for this type defined as: - * - * ```text - * legacy-multisig-committee = (vector legacy-multisig-member) - * u16 ; threshold + * merge-coins = argument (vector argument) * ``` */ -open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterface +open class MergeCoins: Disposable, AutoCloseable, MergeCoinsInterface { constructor(pointer: Pointer) { @@ -14864,18 +15994,11 @@ open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterf this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Construct a new committee from a list of `MultisigMember`s and a - * `threshold`. - * - * Note that the order of the members is significant towards deriving the - * `Address` governed by this committee. - */ - constructor(`members`: List, `threshold`: kotlin.UShort) : + constructor(`coin`: Argument, `coinsToMerge`: List) : this( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigcommittee_new( - FfiConverterSequenceTypeMultisigMember.lower(`members`),FfiConverterUShort.lower(`threshold`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_mergecoins_new( + FfiConverterTypeArgument.lower(`coin`),FfiConverterSequenceTypeArgument.lower(`coinsToMerge`),_status) } ) @@ -14930,7 +16053,7 @@ open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterf override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigcommittee(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_mergecoins(ptr, status) } } } @@ -14938,27 +16061,18 @@ open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterf fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigcommittee(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_mergecoins(pointer!!, status) } } /** - * Checks if the Committee is valid. - * - * A valid committee is one that: - * - Has a nonzero threshold - * - Has at least one member - * - Has at most ten members - * - No member has weight 0 - * - the sum of the weights of all members must be larger than the - * threshold - * - contains no duplicate members - */override fun `isValid`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + * Coin to merge coins into + */override fun `coin`(): Argument { + return FfiConverterTypeArgument.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_is_valid( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_mergecoins_coin( it, _status) } } @@ -14968,43 +16082,14 @@ open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterf /** - * The members of the committee - */override fun `members`(): List { - return FfiConverterSequenceTypeMultisigMember.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_members( - it, _status) -} - } - ) - } - - - - /** - * Return the flag for this signature scheme - */override fun `scheme`(): SignatureScheme { - return FfiConverterTypeSignatureScheme.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_scheme( - it, _status) -} - } - ) - } - - - - /** - * The total signature weight required to authorize a transaction for the - * address corresponding to this `MultisigCommittee`. - */override fun `threshold`(): kotlin.UShort { - return FfiConverterUShort.lift( + * Set of coins to merge into `coin` + * + * All listed coins must be of the same type and be the same type as `coin` + */override fun `coinsToMerge`(): List { + return FfiConverterSequenceTypeArgument.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_threshold( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_mergecoins_coins_to_merge( it, _status) } } @@ -15023,25 +16108,25 @@ open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterf /** * @suppress */ -public object FfiConverterTypeMultisigCommittee: FfiConverter { +public object FfiConverterTypeMergeCoins: FfiConverter { - override fun lower(value: MultisigCommittee): Pointer { + override fun lower(value: MergeCoins): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MultisigCommittee { - return MultisigCommittee(value) + override fun lift(value: Pointer): MergeCoins { + return MergeCoins(value) } - override fun read(buf: ByteBuffer): MultisigCommittee { + override fun read(buf: ByteBuffer): MergeCoins { // 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: MultisigCommittee) = 8UL + override fun allocationSize(value: MergeCoins) = 8UL - override fun write(value: MultisigCommittee, buf: ByteBuffer) { + override fun write(value: MergeCoins, 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))) @@ -15148,59 +16233,74 @@ public object FfiConverterTypeMultisigCommittee: FfiConverter /** - * Weight of this member's signature. + * The function to be called. */ - fun `weight`(): kotlin.UByte + fun `function`(): Identifier + + /** + * The specific module in the package containing the function. + */ + fun `module`(): Identifier + + /** + * The package containing the module and function. + */ + fun `package`(): ObjectId + + /** + * The type arguments to the function. + */ + fun `typeArguments`(): List companion object } /** - * A member in a multisig committee + * Command to call a move function + * + * Functions that can be called by a `MoveCall` command are those that have a + * function signature that is either `entry` or `public` (which don't have a + * reference return type). * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * multisig-member = multisig-member-public-key - * u8 ; weight - * ``` - * - * There is also a legacy encoding for this type defined as: - * - * ```text - * legacy-multisig-member = legacy-multisig-member-public-key - * u8 ; weight + * move-call = object-id ; package id + * identifier ; module name + * identifier ; function name + * (vector type-tag) ; type arguments, if any + * (vector argument) ; input arguments * ``` */ -open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface +open class MoveCall: Disposable, AutoCloseable, MoveCallInterface { constructor(pointer: Pointer) { @@ -15218,14 +16318,11 @@ open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Construct a new member from a `MultisigMemberPublicKey` and a `weight`. - */ - constructor(`publicKey`: MultisigMemberPublicKey, `weight`: kotlin.UByte) : + constructor(`package`: ObjectId, `module`: Identifier, `function`: Identifier, `typeArguments`: List, `arguments`: List) : this( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigmember_new( - FfiConverterTypeMultisigMemberPublicKey.lower(`publicKey`),FfiConverterUByte.lower(`weight`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_movecall_new( + FfiConverterTypeObjectId.lower(`package`),FfiConverterTypeIdentifier.lower(`module`),FfiConverterTypeIdentifier.lower(`function`),FfiConverterSequenceTypeTypeTag.lower(`typeArguments`),FfiConverterSequenceTypeArgument.lower(`arguments`),_status) } ) @@ -15280,7 +16377,7 @@ open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmember(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movecall(ptr, status) } } } @@ -15288,18 +16385,18 @@ open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmember(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movecall(pointer!!, status) } } /** - * This member's public key. - */override fun `publicKey`(): MultisigMemberPublicKey { - return FfiConverterTypeMultisigMemberPublicKey.lift( + * The arguments to the function. + */override fun `arguments`(): List { + return FfiConverterSequenceTypeArgument.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmember_public_key( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_movecall_arguments( it, _status) } } @@ -15309,12 +16406,57 @@ open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface /** - * Weight of this member's signature. - */override fun `weight`(): kotlin.UByte { - return FfiConverterUByte.lift( + * The function to be called. + */override fun `function`(): Identifier { + return FfiConverterTypeIdentifier.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmember_weight( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_movecall_function( + it, _status) +} + } + ) + } + + + + /** + * The specific module in the package containing the function. + */override fun `module`(): Identifier { + return FfiConverterTypeIdentifier.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_movecall_module( + it, _status) +} + } + ) + } + + + + /** + * The package containing the module and function. + */override fun `package`(): ObjectId { + return FfiConverterTypeObjectId.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_movecall_package( + it, _status) +} + } + ) + } + + + + /** + * The type arguments to the function. + */override fun `typeArguments`(): List { + return FfiConverterSequenceTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_movecall_type_arguments( it, _status) } } @@ -15333,25 +16475,25 @@ open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface /** * @suppress */ -public object FfiConverterTypeMultisigMember: FfiConverter { +public object FfiConverterTypeMoveCall: FfiConverter { - override fun lower(value: MultisigMember): Pointer { + override fun lower(value: MoveCall): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MultisigMember { - return MultisigMember(value) + override fun lift(value: Pointer): MoveCall { + return MoveCall(value) } - override fun read(buf: ByteBuffer): MultisigMember { + override fun read(buf: ByteBuffer): MoveCall { // 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: MultisigMember) = 8UL + override fun allocationSize(value: MoveCall) = 8UL - override fun write(value: MultisigMember, buf: ByteBuffer) { + override fun write(value: MoveCall, 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))) @@ -15457,36 +16599,42 @@ public object FfiConverterTypeMultisigMember: FfiConverter, `typeOriginTable`: List, `linkageTable`: Map) : + this( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new( + FfiConverterTypeObjectId.lower(`id`),FfiConverterULong.lower(`version`),FfiConverterMapTypeIdentifierByteArray.lower(`modules`),FfiConverterSequenceTypeTypeOrigin.lower(`typeOriginTable`),FfiConverterMapTypeObjectIdTypeUpgradeInfo.lower(`linkageTable`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -15556,7 +16711,7 @@ open class MultisigMemberPublicKey: Disposable, AutoCloseable, MultisigMemberPub override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmemberpublickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movepackage(ptr, status) } } } @@ -15564,154 +16719,10 @@ open class MultisigMemberPublicKey: Disposable, AutoCloseable, MultisigMemberPub fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmemberpublickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer!!, status) } } - override fun `asEd25519`(): Ed25519PublicKey { - return FfiConverterTypeEd25519PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519( - it, _status) -} - } - ) - } - - - override fun `asEd25519Opt`(): Ed25519PublicKey? { - return FfiConverterOptionalTypeEd25519PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519_opt( - it, _status) -} - } - ) - } - - - override fun `asSecp256k1`(): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1( - it, _status) -} - } - ) - } - - - override fun `asSecp256k1Opt`(): Secp256k1PublicKey? { - return FfiConverterOptionalTypeSecp256k1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1_opt( - it, _status) -} - } - ) - } - - - override fun `asSecp256r1`(): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1( - it, _status) -} - } - ) - } - - - override fun `asSecp256r1Opt`(): Secp256r1PublicKey? { - return FfiConverterOptionalTypeSecp256r1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1_opt( - it, _status) -} - } - ) - } - - - override fun `asZklogin`(): ZkLoginPublicIdentifier { - return FfiConverterTypeZkLoginPublicIdentifier.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin( - it, _status) -} - } - ) - } - - - override fun `asZkloginOpt`(): ZkLoginPublicIdentifier? { - return FfiConverterOptionalTypeZkLoginPublicIdentifier.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin_opt( - it, _status) -} - } - ) - } - - - override fun `isEd25519`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_ed25519( - it, _status) -} - } - ) - } - - - override fun `isSecp256k1`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256k1( - it, _status) -} - } - ) - } - - - override fun `isSecp256r1`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256r1( - it, _status) -} - } - ) - } - - - override fun `isZklogin`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_zklogin( - it, _status) -} - } - ) - } - - @@ -15723,25 +16734,25 @@ open class MultisigMemberPublicKey: Disposable, AutoCloseable, MultisigMemberPub /** * @suppress */ -public object FfiConverterTypeMultisigMemberPublicKey: FfiConverter { +public object FfiConverterTypeMovePackage: FfiConverter { - override fun lower(value: MultisigMemberPublicKey): Pointer { + override fun lower(value: MovePackage): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MultisigMemberPublicKey { - return MultisigMemberPublicKey(value) + override fun lift(value: Pointer): MovePackage { + return MovePackage(value) } - override fun read(buf: ByteBuffer): MultisigMemberPublicKey { + override fun read(buf: ByteBuffer): MovePackage { // 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: MultisigMemberPublicKey) = 8UL + override fun allocationSize(value: MovePackage) = 8UL - override fun write(value: MultisigMemberPublicKey, buf: ByteBuffer) { + override fun write(value: MovePackage, 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))) @@ -15848,73 +16859,78 @@ public object FfiConverterTypeMultisigMemberPublicKey: FfiConverter companion object } /** - * A signature from a member of a multisig committee. + * Aggregated signature from members of a multisig committee. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * multisig-member-signature = ed25519-multisig-member-signature / - * secp256k1-multisig-member-signature / - * secp256r1-multisig-member-signature / - * zklogin-multisig-member-signature + * multisig-aggregated-signature = (vector multisig-member-signature) + * u16 ; bitmap + * multisig-committee + * ``` * - * ed25519-multisig-member-signature = %x00 ed25519-signature - * secp256k1-multisig-member-signature = %x01 secp256k1-signature - * secp256r1-multisig-member-signature = %x02 secp256r1-signature - * zklogin-multisig-member-signature = %x03 zklogin-authenticator + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-aggregated-signature = (vector multisig-member-signature) + * roaring-bitmap ; bitmap + * legacy-multisig-committee + * roaring-bitmap = bytes ; where the contents of the bytes are valid + * ; according to the serialized spec for + * ; roaring bitmaps * ``` + * + * See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + * serialized format of RoaringBitmaps. */ -open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSignatureInterface +open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggregatedSignatureInterface { constructor(pointer: Pointer) { @@ -15932,6 +16948,22 @@ open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSig this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + /** + * Construct a new aggregated multisig signature. + * + * Since the list of signatures doesn't contain sufficient information to + * identify which committee member provided the signature, it is up to + * the caller to ensure that the provided signature list is in the same + * order as it's corresponding member in the provided committee + * and that it's position in the provided bitmap is set. + */ + constructor(`committee`: MultisigCommittee, `signatures`: List, `bitmap`: kotlin.UShort) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigaggregatedsignature_new( + FfiConverterTypeMultisigCommittee.lower(`committee`),FfiConverterSequenceTypeMultisigMemberSignature.lower(`signatures`),FfiConverterUShort.lower(`bitmap`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -15984,7 +17016,7 @@ open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSig override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmembersignature(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigaggregatedsignature(ptr, status) } } } @@ -15992,27 +17024,19 @@ open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSig fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmembersignature(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigaggregatedsignature(pointer!!, status) } } - override fun `asEd25519`(): Ed25519Signature { - return FfiConverterTypeEd25519Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519( - it, _status) -} - } - ) - } - - override fun `asEd25519Opt`(): Ed25519Signature? { - return FfiConverterOptionalTypeEd25519Signature.lift( + /** + * The bitmap that indicates which committee members provided their + * signature. + */override fun `bitmap`(): kotlin.UShort { + return FfiConverterUShort.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519_opt( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_bitmap( it, _status) } } @@ -16020,11 +17044,11 @@ open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSig } - override fun `asSecp256k1`(): Secp256k1Signature { - return FfiConverterTypeSecp256k1Signature.lift( + override fun `committee`(): MultisigCommittee { + return FfiConverterTypeMultisigCommittee.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_committee( it, _status) } } @@ -16032,11 +17056,14 @@ open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSig } - override fun `asSecp256k1Opt`(): Secp256k1Signature? { - return FfiConverterOptionalTypeSecp256k1Signature.lift( + + /** + * The list of signatures from committee members + */override fun `signatures`(): List { + return FfiConverterSequenceTypeMultisigMemberSignature.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1_opt( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_signatures( it, _status) } } @@ -16044,132 +17071,36 @@ open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSig } - override fun `asSecp256r1`(): Secp256r1Signature { - return FfiConverterTypeSecp256r1Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1( - it, _status) -} - } - ) - } - override fun `asSecp256r1Opt`(): Secp256r1Signature? { - return FfiConverterOptionalTypeSecp256r1Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1_opt( - it, _status) + + + companion object + } + +/** + * @suppress + */ +public object FfiConverterTypeMultisigAggregatedSignature: FfiConverter { + + override fun lower(value: MultisigAggregatedSignature): Pointer { + return value.uniffiClonePointer() } - ) - } - - override fun `asZklogin`(): ZkLoginAuthenticator { - return FfiConverterTypeZkLoginAuthenticator.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin( - it, _status) -} + override fun lift(value: Pointer): MultisigAggregatedSignature { + return MultisigAggregatedSignature(value) } - ) + + override fun read(buf: ByteBuffer): MultisigAggregatedSignature { + // 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 `asZkloginOpt`(): ZkLoginAuthenticator? { - return FfiConverterOptionalTypeZkLoginAuthenticator.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin_opt( - it, _status) -} - } - ) - } - - - override fun `isEd25519`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_ed25519( - it, _status) -} - } - ) - } - - - override fun `isSecp256k1`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256k1( - it, _status) -} - } - ) - } - - - override fun `isSecp256r1`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256r1( - it, _status) -} - } - ) - } - - - override fun `isZklogin`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_zklogin( - it, _status) -} - } - ) - } - - - - - - - companion object - -} - -/** - * @suppress - */ -public object FfiConverterTypeMultisigMemberSignature: FfiConverter { - - override fun lower(value: MultisigMemberSignature): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): MultisigMemberSignature { - return MultisigMemberSignature(value) - } - - override fun read(buf: ByteBuffer): MultisigMemberSignature { - // 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: MultisigMemberSignature) = 8UL + override fun allocationSize(value: MultisigAggregatedSignature) = 8UL - override fun write(value: MultisigMemberSignature, buf: ByteBuffer) { + override fun write(value: MultisigAggregatedSignature, 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))) @@ -16276,76 +17207,89 @@ public object FfiConverterTypeMultisigMemberSignature: FfiConverter= threshold`. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object = object-data owner digest u64 + * multisig-committee = (vector multisig-member) + * u16 ; threshold + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-committee = (vector legacy-multisig-member) + * u16 ; threshold * ``` */ -public interface ObjectInterface { - - /** - * Try to interpret this object as a move struct - */ - fun `asStruct`(): MoveStruct? - - /** - * Return this object's data - */ - fun `data`(): ObjectData - - /** - * Return this object's id - */ - fun `objectId`(): ObjectId - - /** - * Return this object's type - */ - fun `objectType`(): ObjectType +public interface MultisigCommitteeInterface { /** - * Return this object's owner + * Checks if the Committee is valid. + * + * A valid committee is one that: + * - Has a nonzero threshold + * - Has at least one member + * - Has at most ten members + * - No member has weight 0 + * - the sum of the weights of all members must be larger than the + * threshold + * - contains no duplicate members */ - fun `owner`(): Owner + fun `isValid`(): kotlin.Boolean /** - * Return the digest of the transaction that last modified this object + * The members of the committee */ - fun `previousTransaction`(): TransactionDigest + fun `members`(): List /** - * Return the storage rebate locked in this object - * - * Storage rebates are credited to the gas coin used in a transaction that - * deletes this object. + * Return the flag for this signature scheme */ - fun `storageRebate`(): kotlin.ULong + fun `scheme`(): SignatureScheme /** - * Return this object's version + * The total signature weight required to authorize a transaction for the + * address corresponding to this `MultisigCommittee`. */ - fun `version`(): kotlin.ULong + fun `threshold`(): kotlin.UShort companion object } /** - * An object on the IOTA blockchain + * A multisig committee + * + * A `MultisigCommittee` is a set of members who collectively control a single + * `Address` on the IOTA blockchain. The number of required signautres to + * authorize the execution of a transaction is determined by + * `(signature_0_weight + signature_1_weight ..) >= threshold`. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object = object-data owner digest u64 + * multisig-committee = (vector multisig-member) + * u16 ; threshold + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-committee = (vector legacy-multisig-member) + * u16 ; threshold * ``` */ -open class Object: Disposable, AutoCloseable, ObjectInterface +open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterface { constructor(pointer: Pointer) { @@ -16363,11 +17307,18 @@ open class Object: Disposable, AutoCloseable, ObjectInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - constructor(`data`: ObjectData, `owner`: Owner, `previousTransaction`: TransactionDigest, `storageRebate`: kotlin.ULong) : + /** + * Construct a new committee from a list of `MultisigMember`s and a + * `threshold`. + * + * Note that the order of the members is significant towards deriving the + * `Address` governed by this committee. + */ + constructor(`members`: List, `threshold`: kotlin.UShort) : this( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_object_new( - FfiConverterTypeObjectData.lower(`data`),FfiConverterTypeOwner.lower(`owner`),FfiConverterTypeTransactionDigest.lower(`previousTransaction`),FfiConverterULong.lower(`storageRebate`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigcommittee_new( + FfiConverterSequenceTypeMultisigMember.lower(`members`),FfiConverterUShort.lower(`threshold`),_status) } ) @@ -16422,7 +17373,7 @@ open class Object: Disposable, AutoCloseable, ObjectInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_object(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigcommittee(ptr, status) } } } @@ -16430,78 +17381,27 @@ open class Object: Disposable, AutoCloseable, ObjectInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_object(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigcommittee(pointer!!, status) } } /** - * Try to interpret this object as a move struct - */override fun `asStruct`(): MoveStruct? { - return FfiConverterOptionalTypeMoveStruct.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_as_struct( - it, _status) -} - } - ) - } - - - - /** - * Return this object's data - */override fun `data`(): ObjectData { - return FfiConverterTypeObjectData.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_data( - it, _status) -} - } - ) - } - - - - /** - * Return this object's id - */override fun `objectId`(): ObjectId { - return FfiConverterTypeObjectId.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_id( - it, _status) -} - } - ) - } - - - - /** - * Return this object's type - */override fun `objectType`(): ObjectType { - return FfiConverterTypeObjectType.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_type( - it, _status) -} - } - ) - } - - - - /** - * Return this object's owner - */override fun `owner`(): Owner { - return FfiConverterTypeOwner.lift( + * Checks if the Committee is valid. + * + * A valid committee is one that: + * - Has a nonzero threshold + * - Has at least one member + * - Has at most ten members + * - No member has weight 0 + * - the sum of the weights of all members must be larger than the + * threshold + * - contains no duplicate members + */override fun `isValid`(): kotlin.Boolean { + return FfiConverterBoolean.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_owner( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_is_valid( it, _status) } } @@ -16511,12 +17411,12 @@ open class Object: Disposable, AutoCloseable, ObjectInterface /** - * Return the digest of the transaction that last modified this object - */override fun `previousTransaction`(): TransactionDigest { - return FfiConverterTypeTransactionDigest.lift( + * The members of the committee + */override fun `members`(): List { + return FfiConverterSequenceTypeMultisigMember.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_previous_transaction( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_members( it, _status) } } @@ -16526,15 +17426,12 @@ open class Object: Disposable, AutoCloseable, ObjectInterface /** - * Return the storage rebate locked in this object - * - * Storage rebates are credited to the gas coin used in a transaction that - * deletes this object. - */override fun `storageRebate`(): kotlin.ULong { - return FfiConverterULong.lift( + * Return the flag for this signature scheme + */override fun `scheme`(): SignatureScheme { + return FfiConverterTypeSignatureScheme.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_storage_rebate( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_scheme( it, _status) } } @@ -16544,12 +17441,13 @@ open class Object: Disposable, AutoCloseable, ObjectInterface /** - * Return this object's version - */override fun `version`(): kotlin.ULong { - return FfiConverterULong.lift( + * The total signature weight required to authorize a transaction for the + * address corresponding to this `MultisigCommittee`. + */override fun `threshold`(): kotlin.UShort { + return FfiConverterUShort.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_version( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_threshold( it, _status) } } @@ -16568,25 +17466,25 @@ open class Object: Disposable, AutoCloseable, ObjectInterface /** * @suppress */ -public object FfiConverterTypeObject: FfiConverter { +public object FfiConverterTypeMultisigCommittee: FfiConverter { - override fun lower(value: Object): Pointer { + override fun lower(value: MultisigCommittee): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Object { - return Object(value) + override fun lift(value: Pointer): MultisigCommittee { + return MultisigCommittee(value) } - override fun read(buf: ByteBuffer): Object { + override fun read(buf: ByteBuffer): MultisigCommittee { // 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: Object) = 8UL + override fun allocationSize(value: MultisigCommittee) = 8UL - override fun write(value: Object, buf: ByteBuffer) { + override fun write(value: MultisigCommittee, 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))) @@ -16692,32 +17590,60 @@ public object FfiConverterTypeObject: FfiConverter { // -public interface ObjectDataInterface { - - /** - * Try to interpret this object as a `MovePackage` - */ - fun `asPackageOpt`(): MovePackage? - - /** - * Try to interpret this object as a `MoveStruct` - */ - fun `asStructOpt`(): MoveStruct? +/** + * A member in a multisig committee + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * multisig-member = multisig-member-public-key + * u8 ; weight + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-member = legacy-multisig-member-public-key + * u8 ; weight + * ``` + */ +public interface MultisigMemberInterface { /** - * Return whether this object is a `MovePackage` + * This member's public key. */ - fun `isPackage`(): kotlin.Boolean + fun `publicKey`(): MultisigMemberPublicKey /** - * Return whether this object is a `MoveStruct` + * Weight of this member's signature. */ - fun `isStruct`(): kotlin.Boolean + fun `weight`(): kotlin.UByte companion object } -open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface +/** + * A member in a multisig committee + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * multisig-member = multisig-member-public-key + * u8 ; weight + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-member = legacy-multisig-member-public-key + * u8 ; weight + * ``` + */ +open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface { constructor(pointer: Pointer) { @@ -16735,6 +17661,16 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + /** + * Construct a new member from a `MultisigMemberPublicKey` and a `weight`. + */ + constructor(`publicKey`: MultisigMemberPublicKey, `weight`: kotlin.UByte) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigmember_new( + FfiConverterTypeMultisigMemberPublicKey.lower(`publicKey`),FfiConverterUByte.lower(`weight`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -16787,7 +17723,7 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdata(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmember(ptr, status) } } } @@ -16795,48 +17731,18 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdata(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmember(pointer!!, status) } } /** - * Try to interpret this object as a `MovePackage` - */override fun `asPackageOpt`(): MovePackage? { - return FfiConverterOptionalTypeMovePackage.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_as_package_opt( - it, _status) -} - } - ) - } - - - - /** - * Try to interpret this object as a `MoveStruct` - */override fun `asStructOpt`(): MoveStruct? { - return FfiConverterOptionalTypeMoveStruct.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_as_struct_opt( - it, _status) -} - } - ) - } - - - - /** - * Return whether this object is a `MovePackage` - */override fun `isPackage`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + * This member's public key. + */override fun `publicKey`(): MultisigMemberPublicKey { + return FfiConverterTypeMultisigMemberPublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_is_package( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmember_public_key( it, _status) } } @@ -16846,12 +17752,12 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface /** - * Return whether this object is a `MoveStruct` - */override fun `isStruct`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + * Weight of this member's signature. + */override fun `weight`(): kotlin.UByte { + return FfiConverterUByte.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_is_struct( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmember_weight( it, _status) } } @@ -16862,60 +17768,33 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface - companion object { - - /** - * Create an `ObjectData` from `MovePackage` - */ fun `newMovePackage`(`movePackage`: MovePackage): ObjectData { - return FfiConverterTypeObjectData.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdata_new_move_package( - FfiConverterTypeMovePackage.lower(`movePackage`),_status) -} - ) - } - - - - /** - * Create an `ObjectData` from a `MoveStruct` - */ fun `newMoveStruct`(`moveStruct`: MoveStruct): ObjectData { - return FfiConverterTypeObjectData.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdata_new_move_struct( - FfiConverterTypeMoveStruct.lower(`moveStruct`),_status) -} - ) - } - - - } + companion object } /** * @suppress */ -public object FfiConverterTypeObjectData: FfiConverter { +public object FfiConverterTypeMultisigMember: FfiConverter { - override fun lower(value: ObjectData): Pointer { + override fun lower(value: MultisigMember): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectData { - return ObjectData(value) + override fun lift(value: Pointer): MultisigMember { + return MultisigMember(value) } - override fun read(buf: ByteBuffer): ObjectData { + override fun read(buf: ByteBuffer): MultisigMember { // 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: ObjectData) = 8UL + override fun allocationSize(value: MultisigMember) = 8UL - override fun write(value: ObjectData, buf: ByteBuffer) { + override fun write(value: MultisigMember, 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))) @@ -17021,16 +17900,36 @@ public object FfiConverterTypeObjectData: FfiConverter { // -public interface ObjectDigestInterface { +public interface MultisigMemberPublicKeyInterface { - fun `toBase58`(): kotlin.String + fun `asEd25519`(): Ed25519PublicKey - fun `toBytes`(): kotlin.ByteArray + fun `asEd25519Opt`(): Ed25519PublicKey? + + fun `asSecp256k1`(): Secp256k1PublicKey + + fun `asSecp256k1Opt`(): Secp256k1PublicKey? + + fun `asSecp256r1`(): Secp256r1PublicKey + + fun `asSecp256r1Opt`(): Secp256r1PublicKey? + + fun `asZklogin`(): ZkLoginPublicIdentifier + + fun `asZkloginOpt`(): ZkLoginPublicIdentifier? + + fun `isEd25519`(): kotlin.Boolean + + fun `isSecp256k1`(): kotlin.Boolean + + fun `isSecp256r1`(): kotlin.Boolean + + fun `isZklogin`(): kotlin.Boolean companion object } -open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface +open class MultisigMemberPublicKey: Disposable, AutoCloseable, MultisigMemberPublicKeyInterface { constructor(pointer: Pointer) { @@ -17100,7 +17999,7 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmemberpublickey(ptr, status) } } } @@ -17108,15 +18007,15 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmemberpublickey(pointer!!, status) } } - override fun `toBase58`(): kotlin.String { - return FfiConverterString.lift( + override fun `asEd25519`(): Ed25519PublicKey { + return FfiConverterTypeEd25519PublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_base58( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519( it, _status) } } @@ -17124,11 +18023,11 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `asEd25519Opt`(): Ed25519PublicKey? { + return FfiConverterOptionalTypeEd25519PublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519_opt( it, _status) } } @@ -17136,69 +18035,156 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface } + override fun `asSecp256k1`(): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1( + it, _status) +} + } + ) + } + override fun `asSecp256k1Opt`(): Secp256k1PublicKey? { + return FfiConverterOptionalTypeSecp256k1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1_opt( + it, _status) +} + } + ) + } - companion object { - - @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): ObjectDigest { - return FfiConverterTypeObjectDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_base58( - FfiConverterString.lower(`base58`),_status) + + override fun `asSecp256r1`(): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1( + it, _status) } + } ) } - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectDigest { - return FfiConverterTypeObjectDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + override fun `asSecp256r1Opt`(): Secp256r1PublicKey? { + return FfiConverterOptionalTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1_opt( + it, _status) } + } ) } - fun `generate`(): ObjectDigest { - return FfiConverterTypeObjectDigest.lift( + override fun `asZklogin`(): ZkLoginPublicIdentifier { + return FfiConverterTypeZkLoginPublicIdentifier.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_generate( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin( + it, _status) } + } ) } - + override fun `asZkloginOpt`(): ZkLoginPublicIdentifier? { + return FfiConverterOptionalTypeZkLoginPublicIdentifier.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin_opt( + it, _status) +} + } + ) + } + + + override fun `isEd25519`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_ed25519( + it, _status) +} + } + ) + } + + + override fun `isSecp256k1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256k1( + it, _status) +} + } + ) + } + + + override fun `isSecp256r1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256r1( + it, _status) +} + } + ) + } + + + override fun `isZklogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_zklogin( + it, _status) +} + } + ) } + + + + + + companion object + } /** * @suppress */ -public object FfiConverterTypeObjectDigest: FfiConverter { +public object FfiConverterTypeMultisigMemberPublicKey: FfiConverter { - override fun lower(value: ObjectDigest): Pointer { + override fun lower(value: MultisigMemberPublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectDigest { - return ObjectDigest(value) + override fun lift(value: Pointer): MultisigMemberPublicKey { + return MultisigMemberPublicKey(value) } - override fun read(buf: ByteBuffer): ObjectDigest { + override fun read(buf: ByteBuffer): MultisigMemberPublicKey { // 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: ObjectDigest) = 8UL + override fun allocationSize(value: MultisigMemberPublicKey) = 8UL - override fun write(value: ObjectDigest, buf: ByteBuffer) { + override fun write(value: MultisigMemberPublicKey, 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))) @@ -17305,57 +18291,73 @@ public object FfiConverterTypeObjectDigest: FfiConverter /** - * An `ObjectId` is a 32-byte identifier used to uniquely identify an object on - * the IOTA blockchain. - * - * ## Relationship to Address - * - * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but - * are derived leveraging different domain-separator values to ensure, - * cryptographically, that there won't be any overlap, e.g. there can't be a - * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user - * account. + * A signature from a member of a multisig committee. * * # BCS * - * An `ObjectId`'s BCS serialized form is defined by the following: + * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object-id = 32*OCTET + * multisig-member-signature = ed25519-multisig-member-signature / + * secp256k1-multisig-member-signature / + * secp256r1-multisig-member-signature / + * zklogin-multisig-member-signature + * + * ed25519-multisig-member-signature = %x00 ed25519-signature + * secp256k1-multisig-member-signature = %x01 secp256k1-signature + * secp256r1-multisig-member-signature = %x02 secp256r1-signature + * zklogin-multisig-member-signature = %x03 zklogin-authenticator * ``` */ -public interface ObjectIdInterface { +public interface MultisigMemberSignatureInterface { - fun `toAddress`(): Address + fun `asEd25519`(): Ed25519Signature - fun `toBytes`(): kotlin.ByteArray + fun `asEd25519Opt`(): Ed25519Signature? - fun `toHex`(): kotlin.String + fun `asSecp256k1`(): Secp256k1Signature + + fun `asSecp256k1Opt`(): Secp256k1Signature? + + fun `asSecp256r1`(): Secp256r1Signature + + fun `asSecp256r1Opt`(): Secp256r1Signature? + + fun `asZklogin`(): ZkLoginAuthenticator + + fun `asZkloginOpt`(): ZkLoginAuthenticator? + + fun `isEd25519`(): kotlin.Boolean + + fun `isSecp256k1`(): kotlin.Boolean + + fun `isSecp256r1`(): kotlin.Boolean + + fun `isZklogin`(): kotlin.Boolean companion object } /** - * An `ObjectId` is a 32-byte identifier used to uniquely identify an object on - * the IOTA blockchain. - * - * ## Relationship to Address - * - * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but - * are derived leveraging different domain-separator values to ensure, - * cryptographically, that there won't be any overlap, e.g. there can't be a - * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user - * account. + * A signature from a member of a multisig committee. * * # BCS * - * An `ObjectId`'s BCS serialized form is defined by the following: + * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object-id = 32*OCTET + * multisig-member-signature = ed25519-multisig-member-signature / + * secp256k1-multisig-member-signature / + * secp256r1-multisig-member-signature / + * zklogin-multisig-member-signature + * + * ed25519-multisig-member-signature = %x00 ed25519-signature + * secp256k1-multisig-member-signature = %x01 secp256k1-signature + * secp256r1-multisig-member-signature = %x02 secp256r1-signature + * zklogin-multisig-member-signature = %x03 zklogin-authenticator * ``` */ -open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface +open class MultisigMemberSignature: Disposable, AutoCloseable, MultisigMemberSignatureInterface { constructor(pointer: Pointer) { @@ -17425,7 +18427,7 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectid(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmembersignature(ptr, status) } } } @@ -17433,15 +18435,15 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectid(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmembersignature(pointer!!, status) } } - override fun `toAddress`(): Address { - return FfiConverterTypeAddress.lift( + override fun `asEd25519`(): Ed25519Signature { + return FfiConverterTypeEd25519Signature.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_address( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519( it, _status) } } @@ -17449,11 +18451,11 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `asEd25519Opt`(): Ed25519Signature? { + return FfiConverterOptionalTypeEd25519Signature.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519_opt( it, _status) } } @@ -17461,11 +18463,35 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface } - override fun `toHex`(): kotlin.String { - return FfiConverterString.lift( + override fun `asSecp256k1`(): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_hex( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1( + it, _status) +} + } + ) + } + + + override fun `asSecp256k1Opt`(): Secp256k1Signature? { + return FfiConverterOptionalTypeSecp256k1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1_opt( + it, _status) +} + } + ) + } + + + override fun `asSecp256r1`(): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1( it, _status) } } @@ -17473,59 +18499,120 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface } + override fun `asSecp256r1Opt`(): Secp256r1Signature? { + return FfiConverterOptionalTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1_opt( + it, _status) +} + } + ) + } + override fun `asZklogin`(): ZkLoginAuthenticator { + return FfiConverterTypeZkLoginAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin( + it, _status) +} + } + ) + } - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectId { - return FfiConverterTypeObjectId.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + + override fun `asZkloginOpt`(): ZkLoginAuthenticator? { + return FfiConverterOptionalTypeZkLoginAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin_opt( + it, _status) } + } ) } - - @Throws(SdkFfiException::class) fun `fromHex`(`hex`: kotlin.String): ObjectId { - return FfiConverterTypeObjectId.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex( - FfiConverterString.lower(`hex`),_status) + override fun `isEd25519`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_ed25519( + it, _status) } + } ) } - + override fun `isSecp256k1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256k1( + it, _status) +} } + ) + } + + + override fun `isSecp256r1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256r1( + it, _status) +} + } + ) + } + + + override fun `isZklogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_zklogin( + it, _status) +} + } + ) + } + + + + + + + companion object } /** * @suppress */ -public object FfiConverterTypeObjectId: FfiConverter { +public object FfiConverterTypeMultisigMemberSignature: FfiConverter { - override fun lower(value: ObjectId): Pointer { + override fun lower(value: MultisigMemberSignature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectId { - return ObjectId(value) + override fun lift(value: Pointer): MultisigMemberSignature { + return MultisigMemberSignature(value) } - override fun read(buf: ByteBuffer): ObjectId { + override fun read(buf: ByteBuffer): MultisigMemberSignature { // 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: ObjectId) = 8UL + override fun allocationSize(value: MultisigMemberSignature) = 8UL - override fun write(value: ObjectId, buf: ByteBuffer) { + override fun write(value: MultisigMemberSignature, 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))) @@ -17631,18 +18718,77 @@ public object FfiConverterTypeObjectId: FfiConverter { // -public interface ObjectTypeInterface { +/** + * An object on the IOTA blockchain + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * object = object-data owner digest u64 + * ``` + */ +public interface ObjectInterface { - fun `asStructOpt`(): StructTag? + /** + * Try to interpret this object as a move struct + */ + fun `asStruct`(): MoveStruct? - fun `isPackage`(): kotlin.Boolean + /** + * Return this object's data + */ + fun `data`(): ObjectData - fun `isStruct`(): kotlin.Boolean + /** + * Return this object's id + */ + fun `objectId`(): ObjectId + + /** + * Return this object's type + */ + fun `objectType`(): ObjectType + + /** + * Return this object's owner + */ + fun `owner`(): Owner + + /** + * Return the digest of the transaction that last modified this object + */ + fun `previousTransaction`(): TransactionDigest + + /** + * Return the storage rebate locked in this object + * + * Storage rebates are credited to the gas coin used in a transaction that + * deletes this object. + */ + fun `storageRebate`(): kotlin.ULong + + /** + * Return this object's version + */ + fun `version`(): kotlin.ULong companion object } -open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface +/** + * An object on the IOTA blockchain + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * object = object-data owner digest u64 + * ``` + */ +open class Object: Disposable, AutoCloseable, ObjectInterface { constructor(pointer: Pointer) { @@ -17660,6 +18806,13 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`data`: ObjectData, `owner`: Owner, `previousTransaction`: TransactionDigest, `storageRebate`: kotlin.ULong) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_object_new( + FfiConverterTypeObjectData.lower(`data`),FfiConverterTypeOwner.lower(`owner`),FfiConverterTypeTransactionDigest.lower(`previousTransaction`),FfiConverterULong.lower(`storageRebate`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -17712,7 +18865,7 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objecttype(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_object(ptr, status) } } } @@ -17720,15 +18873,18 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objecttype(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_object(pointer!!, status) } } - override fun `asStructOpt`(): StructTag? { - return FfiConverterOptionalTypeStructTag.lift( + + /** + * Try to interpret this object as a move struct + */override fun `asStruct`(): MoveStruct? { + return FfiConverterOptionalTypeMoveStruct.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objecttype_as_struct_opt( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_as_struct( it, _status) } } @@ -17736,11 +18892,14 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface } - override fun `isPackage`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + + /** + * Return this object's data + */override fun `data`(): ObjectData { + return FfiConverterTypeObjectData.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objecttype_is_package( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_data( it, _status) } } @@ -17748,11 +18907,14 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface } - override fun `isStruct`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + + /** + * Return this object's id + */override fun `objectId`(): ObjectId { + return FfiConverterTypeObjectId.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objecttype_is_struct( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_id( it, _status) } } @@ -17761,56 +18923,113 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface - - - companion object { - fun `newPackage`(): ObjectType { + /** + * Return this object's type + */override fun `objectType`(): ObjectType { return FfiConverterTypeObjectType.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objecttype_new_package( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_type( + it, _status) } + } ) } - fun `newStruct`(`structTag`: StructTag): ObjectType { - return FfiConverterTypeObjectType.lift( + + /** + * Return this object's owner + */override fun `owner`(): Owner { + return FfiConverterTypeOwner.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objecttype_new_struct( - FfiConverterTypeStructTag.lower(`structTag`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_owner( + it, _status) } + } ) } - - } + /** + * Return the digest of the transaction that last modified this object + */override fun `previousTransaction`(): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_previous_transaction( + it, _status) } - -/** + } + ) + } + + + + /** + * Return the storage rebate locked in this object + * + * Storage rebates are credited to the gas coin used in a transaction that + * deletes this object. + */override fun `storageRebate`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_storage_rebate( + it, _status) +} + } + ) + } + + + + /** + * Return this object's version + */override fun `version`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_version( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** * @suppress */ -public object FfiConverterTypeObjectType: FfiConverter { +public object FfiConverterTypeObject: FfiConverter { - override fun lower(value: ObjectType): Pointer { + override fun lower(value: Object): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectType { - return ObjectType(value) + override fun lift(value: Pointer): Object { + return Object(value) } - override fun read(buf: ByteBuffer): ObjectType { + override fun read(buf: ByteBuffer): Object { // 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: ObjectType) = 8UL + override fun allocationSize(value: Object) = 8UL - override fun write(value: ObjectType, buf: ByteBuffer) { + override fun write(value: Object, 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))) @@ -17916,26 +19135,32 @@ public object FfiConverterTypeObjectType: FfiConverter { // -public interface OwnerInterface { - - fun `asAddressOpt`(): Address? - - fun `asObjectOpt`(): ObjectId? - - fun `asSharedOpt`(): kotlin.ULong? +public interface ObjectDataInterface { - fun `isAddress`(): kotlin.Boolean + /** + * Try to interpret this object as a `MovePackage` + */ + fun `asPackageOpt`(): MovePackage? - fun `isImmutable`(): kotlin.Boolean + /** + * Try to interpret this object as a `MoveStruct` + */ + fun `asStructOpt`(): MoveStruct? - fun `isObject`(): kotlin.Boolean + /** + * Return whether this object is a `MovePackage` + */ + fun `isPackage`(): kotlin.Boolean - fun `isShared`(): kotlin.Boolean + /** + * Return whether this object is a `MoveStruct` + */ + fun `isStruct`(): kotlin.Boolean companion object } -open class Owner: Disposable, AutoCloseable, OwnerInterface +open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface { constructor(pointer: Pointer) { @@ -18005,7 +19230,7 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_owner(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdata(ptr, status) } } } @@ -18013,27 +19238,18 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_owner(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdata(pointer!!, status) } } - override fun `asAddressOpt`(): Address? { - return FfiConverterOptionalTypeAddress.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_as_address_opt( - it, _status) -} - } - ) - } - - override fun `asObjectOpt`(): ObjectId? { - return FfiConverterOptionalTypeObjectId.lift( + /** + * Try to interpret this object as a `MovePackage` + */override fun `asPackageOpt`(): MovePackage? { + return FfiConverterOptionalTypeMovePackage.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_as_object_opt( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_as_package_opt( it, _status) } } @@ -18041,23 +19257,14 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface } - override fun `asSharedOpt`(): kotlin.ULong? { - return FfiConverterOptionalULong.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_as_shared_opt( - it, _status) -} - } - ) - } - - override fun `isAddress`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + /** + * Try to interpret this object as a `MoveStruct` + */override fun `asStructOpt`(): MoveStruct? { + return FfiConverterOptionalTypeMoveStruct.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_address( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_as_struct_opt( it, _status) } } @@ -18065,23 +19272,14 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface } - override fun `isImmutable`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_immutable( - it, _status) -} - } - ) - } - - override fun `isObject`(): kotlin.Boolean { + /** + * Return whether this object is a `MovePackage` + */override fun `isPackage`(): kotlin.Boolean { return FfiConverterBoolean.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_object( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_is_package( it, _status) } } @@ -18089,11 +19287,14 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface } - override fun `isShared`(): kotlin.Boolean { + + /** + * Return whether this object is a `MoveStruct` + */override fun `isStruct`(): kotlin.Boolean { return FfiConverterBoolean.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_shared( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdata_is_struct( it, _status) } } @@ -18105,41 +19306,27 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface companion object { - fun `newAddress`(`address`: Address): Owner { - return FfiConverterTypeOwner.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_address( - FfiConverterTypeAddress.lower(`address`),_status) -} - ) - } - - - fun `newImmutable`(): Owner { - return FfiConverterTypeOwner.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_immutable( - _status) -} - ) - } - - - fun `newObject`(`id`: ObjectId): Owner { - return FfiConverterTypeOwner.lift( + + /** + * Create an `ObjectData` from `MovePackage` + */ fun `newMovePackage`(`movePackage`: MovePackage): ObjectData { + return FfiConverterTypeObjectData.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_object( - FfiConverterTypeObjectId.lower(`id`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdata_new_move_package( + FfiConverterTypeMovePackage.lower(`movePackage`),_status) } ) } - fun `newShared`(`version`: kotlin.ULong): Owner { - return FfiConverterTypeOwner.lift( + + /** + * Create an `ObjectData` from a `MoveStruct` + */ fun `newMoveStruct`(`moveStruct`: MoveStruct): ObjectData { + return FfiConverterTypeObjectData.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_shared( - FfiConverterULong.lower(`version`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdata_new_move_struct( + FfiConverterTypeMoveStruct.lower(`moveStruct`),_status) } ) } @@ -18153,25 +19340,25 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface /** * @suppress */ -public object FfiConverterTypeOwner: FfiConverter { +public object FfiConverterTypeObjectData: FfiConverter { - override fun lower(value: Owner): Pointer { + override fun lower(value: ObjectData): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Owner { - return Owner(value) + override fun lift(value: Pointer): ObjectData { + return ObjectData(value) } - override fun read(buf: ByteBuffer): Owner { + override fun read(buf: ByteBuffer): ObjectData { // 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: Owner) = 8UL + override fun allocationSize(value: ObjectData) = 8UL - override fun write(value: Owner, buf: ByteBuffer) { + override fun write(value: ObjectData, 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))) @@ -18277,99 +19464,16 @@ public object FfiConverterTypeOwner: FfiConverter { // -/** - * A passkey authenticator. - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * passkey-bcs = bytes ; where the contents of the bytes are - * ; defined by - * passkey = passkey-flag - * bytes ; passkey authenticator data - * client-data-json ; valid json - * simple-signature ; required to be a secp256r1 signature - * - * client-data-json = string ; valid json - * ``` - * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for - * the required json-schema for the `client-data-json` rule. In addition, IOTA - * currently requires that the `CollectedClientData.type` field is required to - * be `webauthn.get`. - * - * Note: Due to historical reasons, signatures are serialized slightly - * different from the majority of the types in IOTA. In particular if a - * signature is ever embedded in another structure it generally is serialized - * as `bytes` meaning it has a length prefix that defines the length of - * the completely serialized signature. - */ -public interface PasskeyAuthenticatorInterface { - - /** - * Opaque authenticator data for this passkey signature. - * - * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - * more information on this field. - */ - fun `authenticatorData`(): kotlin.ByteArray - - /** - * The parsed challenge message for this passkey signature. - * - * This is parsed by decoding the base64url data from the - * `client_data_json.challenge` field. - */ - fun `challenge`(): kotlin.ByteArray +public interface ObjectDigestInterface { - /** - * Structured, unparsed, JSON for this passkey signature. - * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) - * for more information on this field. - */ - fun `clientDataJson`(): kotlin.String + fun `toBase58`(): kotlin.String - /** - * The passkey signature. - */ - fun `signature`(): SimpleSignature + fun `toBytes`(): kotlin.ByteArray companion object } -/** - * A passkey authenticator. - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * passkey-bcs = bytes ; where the contents of the bytes are - * ; defined by - * passkey = passkey-flag - * bytes ; passkey authenticator data - * client-data-json ; valid json - * simple-signature ; required to be a secp256r1 signature - * - * client-data-json = string ; valid json - * ``` - * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for - * the required json-schema for the `client-data-json` rule. In addition, IOTA - * currently requires that the `CollectedClientData.type` field is required to - * be `webauthn.get`. - * - * Note: Due to historical reasons, signatures are serialized slightly - * different from the majority of the types in IOTA. In particular if a - * signature is ever embedded in another structure it generally is serialized - * as `bytes` meaning it has a length prefix that defines the length of - * the completely serialized signature. - */ -open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticatorInterface +open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface { constructor(pointer: Pointer) { @@ -18439,7 +19543,7 @@ open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticator override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdigest(ptr, status) } } } @@ -18447,21 +19551,15 @@ open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticator fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdigest(pointer!!, status) } } - - /** - * Opaque authenticator data for this passkey signature. - * - * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - * more information on this field. - */override fun `authenticatorData`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_authenticator_data( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_base58( it, _status) } } @@ -18469,17 +19567,11 @@ open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticator } - - /** - * The parsed challenge message for this passkey signature. - * - * This is parsed by decoding the base64url data from the - * `client_data_json.challenge` field. - */override fun `challenge`(): kotlin.ByteArray { + override fun `toBytes`(): kotlin.ByteArray { return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_bytes( it, _status) } } @@ -18488,68 +19580,68 @@ open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticator - /** - * Structured, unparsed, JSON for this passkey signature. - * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) - * for more information on this field. - */override fun `clientDataJson`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json( - it, _status) + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): ObjectDigest { + return FfiConverterTypeObjectDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_base58( + FfiConverterString.lower(`base58`),_status) } - } ) } - - /** - * The passkey signature. - */override fun `signature`(): SimpleSignature { - return FfiConverterTypeSimpleSignature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature( - it, _status) + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectDigest { + return FfiConverterTypeObjectDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } - } ) } + fun `generate`(): ObjectDigest { + return FfiConverterTypeObjectDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_generate( + _status) +} + ) + } - - - companion object + + } } /** * @suppress */ -public object FfiConverterTypePasskeyAuthenticator: FfiConverter { +public object FfiConverterTypeObjectDigest: FfiConverter { - override fun lower(value: PasskeyAuthenticator): Pointer { + override fun lower(value: ObjectDigest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): PasskeyAuthenticator { - return PasskeyAuthenticator(value) + override fun lift(value: Pointer): ObjectDigest { + return ObjectDigest(value) } - override fun read(buf: ByteBuffer): PasskeyAuthenticator { + override fun read(buf: ByteBuffer): ObjectDigest { // 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: PasskeyAuthenticator) = 8UL + override fun allocationSize(value: ObjectDigest) = 8UL - override fun write(value: PasskeyAuthenticator, buf: ByteBuffer) { + override fun write(value: ObjectDigest, 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))) @@ -18655,12 +19747,58 @@ public object FfiConverterTypePasskeyAuthenticator: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_programmabletransaction(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectid(ptr, status) } } } @@ -18738,40 +19876,99 @@ open class ProgrammableTransaction: Disposable, AutoCloseable, ProgrammableTrans fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectid(pointer!!, status) } } + override fun `toAddress`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_address( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes( + it, _status) +} + } + ) + } + + + override fun `toHex`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_hex( + it, _status) +} + } + ) + } + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectId { + return FfiConverterTypeObjectId.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromHex`(`hex`: kotlin.String): ObjectId { + return FfiConverterTypeObjectId.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex( + FfiConverterString.lower(`hex`),_status) +} + ) + } - companion object + + + } } /** * @suppress */ -public object FfiConverterTypeProgrammableTransaction: FfiConverter { +public object FfiConverterTypeObjectId: FfiConverter { - override fun lower(value: ProgrammableTransaction): Pointer { + override fun lower(value: ObjectId): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ProgrammableTransaction { - return ProgrammableTransaction(value) + override fun lift(value: Pointer): ObjectId { + return ObjectId(value) } - override fun read(buf: ByteBuffer): ProgrammableTransaction { + override fun read(buf: ByteBuffer): ObjectId { // 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: ProgrammableTransaction) = 8UL + override fun allocationSize(value: ObjectId) = 8UL - override fun write(value: ProgrammableTransaction, buf: ByteBuffer) { + override fun write(value: ObjectId, 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))) @@ -18877,12 +20074,18 @@ public object FfiConverterTypeProgrammableTransaction: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_randomnessstateupdate(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objecttype(ptr, status) } } } @@ -18960,40 +20163,97 @@ open class RandomnessStateUpdate: Disposable, AutoCloseable, RandomnessStateUpda fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objecttype(pointer!!, status) } } + override fun `asStructOpt`(): StructTag? { + return FfiConverterOptionalTypeStructTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objecttype_as_struct_opt( + it, _status) +} + } + ) + } + + + override fun `isPackage`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objecttype_is_package( + it, _status) +} + } + ) + } + override fun `isStruct`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objecttype_is_struct( + it, _status) +} + } + ) + } + - companion object + + + companion object { + fun `newPackage`(): ObjectType { + return FfiConverterTypeObjectType.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objecttype_new_package( + _status) +} + ) + } + + + fun `newStruct`(`structTag`: StructTag): ObjectType { + return FfiConverterTypeObjectType.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objecttype_new_struct( + FfiConverterTypeStructTag.lower(`structTag`),_status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeRandomnessStateUpdate: FfiConverter { +public object FfiConverterTypeObjectType: FfiConverter { - override fun lower(value: RandomnessStateUpdate): Pointer { + override fun lower(value: ObjectType): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): RandomnessStateUpdate { - return RandomnessStateUpdate(value) + override fun lift(value: Pointer): ObjectType { + return ObjectType(value) } - override fun read(buf: ByteBuffer): RandomnessStateUpdate { + override fun read(buf: ByteBuffer): ObjectType { // 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: RandomnessStateUpdate) = 8UL + override fun allocationSize(value: ObjectType) = 8UL - override fun write(value: RandomnessStateUpdate, buf: ByteBuffer) { + override fun write(value: ObjectType, 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))) @@ -19099,36 +20359,26 @@ public object FfiConverterTypeRandomnessStateUpdate: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256k1publickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_owner(ptr, status) } } } @@ -19206,15 +20456,15 @@ open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256k1publickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_owner(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `asAddressOpt`(): Address? { + return FfiConverterOptionalTypeAddress.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_as_address_opt( it, _status) } } @@ -19222,42 +20472,122 @@ open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInte } + override fun `asObjectOpt`(): ObjectId? { + return FfiConverterOptionalTypeObjectId.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_as_object_opt( + it, _status) +} + } + ) + } + override fun `asSharedOpt`(): kotlin.ULong? { + return FfiConverterOptionalULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_as_shared_opt( + it, _status) +} + } + ) + } - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + + override fun `isAddress`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_address( + it, _status) } + } ) } - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_str( - FfiConverterString.lower(`s`),_status) + override fun `isImmutable`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_immutable( + it, _status) } + } ) } - fun `generate`(): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( + override fun `isObject`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_object( + it, _status) +} + } + ) + } + + + override fun `isShared`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_owner_is_shared( + it, _status) +} + } + ) + } + + + + + + companion object { + fun `newAddress`(`address`: Address): Owner { + return FfiConverterTypeOwner.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_address( + FfiConverterTypeAddress.lower(`address`),_status) +} + ) + } + + + fun `newImmutable`(): Owner { + return FfiConverterTypeOwner.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_immutable( _status) } ) } + fun `newObject`(`id`: ObjectId): Owner { + return FfiConverterTypeOwner.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_object( + FfiConverterTypeObjectId.lower(`id`),_status) +} + ) + } + + + fun `newShared`(`version`: kotlin.ULong): Owner { + return FfiConverterTypeOwner.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_owner_new_shared( + FfiConverterULong.lower(`version`),_status) +} + ) + } + + } @@ -19266,25 +20596,25 @@ open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInte /** * @suppress */ -public object FfiConverterTypeSecp256k1PublicKey: FfiConverter { +public object FfiConverterTypeOwner: FfiConverter { - override fun lower(value: Secp256k1PublicKey): Pointer { + override fun lower(value: Owner): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Secp256k1PublicKey { - return Secp256k1PublicKey(value) + override fun lift(value: Pointer): Owner { + return Owner(value) } - override fun read(buf: ByteBuffer): Secp256k1PublicKey { + override fun read(buf: ByteBuffer): Owner { // 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: Secp256k1PublicKey) = 8UL + override fun allocationSize(value: Owner) = 8UL - override fun write(value: Secp256k1PublicKey, buf: ByteBuffer) { + override fun write(value: Owner, 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))) @@ -19391,35 +20721,98 @@ public object FfiConverterTypeSecp256k1PublicKey: FfiConverter + * passkey = passkey-flag + * bytes ; passkey authenticator data + * client-data-json ; valid json + * simple-signature ; required to be a secp256r1 signature + * + * client-data-json = string ; valid json * ``` + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + * the required json-schema for the `client-data-json` rule. In addition, IOTA + * currently requires that the `CollectedClientData.type` field is required to + * be `webauthn.get`. + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. */ -public interface Secp256k1SignatureInterface { +public interface PasskeyAuthenticatorInterface { - fun `toBytes`(): kotlin.ByteArray + /** + * Opaque authenticator data for this passkey signature. + * + * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for + * more information on this field. + */ + fun `authenticatorData`(): kotlin.ByteArray + + /** + * The parsed challenge message for this passkey signature. + * + * This is parsed by decoding the base64url data from the + * `client_data_json.challenge` field. + */ + fun `challenge`(): kotlin.ByteArray + + /** + * Structured, unparsed, JSON for this passkey signature. + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + * for more information on this field. + */ + fun `clientDataJson`(): kotlin.String + + /** + * The passkey signature. + */ + fun `signature`(): SimpleSignature companion object } /** - * A secp256k1 public key. + * A passkey authenticator. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * secp256k1-public-key = 33OCTECT + * passkey-bcs = bytes ; where the contents of the bytes are + * ; defined by + * passkey = passkey-flag + * bytes ; passkey authenticator data + * client-data-json ; valid json + * simple-signature ; required to be a secp256r1 signature + * + * client-data-json = string ; valid json * ``` + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + * the required json-schema for the `client-data-json` rule. In addition, IOTA + * currently requires that the `CollectedClientData.type` field is required to + * be `webauthn.get`. + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. */ -open class Secp256k1Signature: Disposable, AutoCloseable, Secp256k1SignatureInterface +open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticatorInterface { constructor(pointer: Pointer) { @@ -19489,7 +20882,7 @@ open class Secp256k1Signature: Disposable, AutoCloseable, Secp256k1SignatureInte override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256k1signature(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(ptr, status) } } } @@ -19497,15 +20890,21 @@ open class Secp256k1Signature: Disposable, AutoCloseable, Secp256k1SignatureInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256k1signature(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { + + /** + * Opaque authenticator data for this passkey signature. + * + * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for + * more information on this field. + */override fun `authenticatorData`(): kotlin.ByteArray { return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256k1signature_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_authenticator_data( it, _status) } } @@ -19514,68 +20913,86 @@ open class Secp256k1Signature: Disposable, AutoCloseable, Secp256k1SignatureInte - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256k1Signature { - return FfiConverterTypeSecp256k1Signature.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + /** + * The parsed challenge message for this passkey signature. + * + * This is parsed by decoding the base64url data from the + * `client_data_json.challenge` field. + */override fun `challenge`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge( + it, _status) } + } ) } - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256k1Signature { - return FfiConverterTypeSecp256k1Signature.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_str( - FfiConverterString.lower(`s`),_status) + + /** + * Structured, unparsed, JSON for this passkey signature. + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + * for more information on this field. + */override fun `clientDataJson`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json( + it, _status) } + } ) } - fun `generate`(): Secp256k1Signature { - return FfiConverterTypeSecp256k1Signature.lift( + + /** + * The passkey signature. + */override fun `signature`(): SimpleSignature { + return FfiConverterTypeSimpleSignature.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_generate( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature( + it, _status) } + } ) } - - } + + + + + companion object } /** * @suppress */ -public object FfiConverterTypeSecp256k1Signature: FfiConverter { +public object FfiConverterTypePasskeyAuthenticator: FfiConverter { - override fun lower(value: Secp256k1Signature): Pointer { + override fun lower(value: PasskeyAuthenticator): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Secp256k1Signature { - return Secp256k1Signature(value) + override fun lift(value: Pointer): PasskeyAuthenticator { + return PasskeyAuthenticator(value) } - override fun read(buf: ByteBuffer): Secp256k1Signature { + override fun read(buf: ByteBuffer): PasskeyAuthenticator { // 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: Secp256k1Signature) = 8UL + override fun allocationSize(value: PasskeyAuthenticator) = 8UL - override fun write(value: Secp256k1Signature, buf: ByteBuffer) { + override fun write(value: PasskeyAuthenticator, 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))) @@ -19682,35 +21099,50 @@ public object FfiConverterTypeSecp256k1Signature: FfiConverter + + /** + * Input objects or primitive values + */ + fun `inputs`(): List companion object } /** - * A secp256r1 signature. + * A user transaction + * + * Contains a series of native commands and move calls where the results of one + * command can be used in future commands. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * secp256r1-signature = 64OCTECT + * ptb = (vector input) (vector command) * ``` */ -open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInterface +open class ProgrammableTransaction: Disposable, AutoCloseable, ProgrammableTransactionInterface { constructor(pointer: Pointer) { @@ -19728,6 +21160,13 @@ open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInte this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`inputs`: List, `commands`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_programmabletransaction_new( + FfiConverterSequenceTypeInput.lower(`inputs`),FfiConverterSequenceTypeCommand.lower(`commands`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -19780,7 +21219,7 @@ open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInte override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256r1publickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_programmabletransaction(ptr, status) } } } @@ -19788,15 +21227,19 @@ open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + + /** + * The commands to be executed sequentially. A failure in any command will + * result in the failure of the entire transaction. + */override fun `commands`(): List { + return FfiConverterSequenceTypeCommand.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_commands( it, _status) } } @@ -19805,68 +21248,50 @@ open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInte - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + /** + * Input objects or primitive values + */override fun `inputs`(): List { + return FfiConverterSequenceTypeInput.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_inputs( + it, _status) } - ) } - - - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_str( - FfiConverterString.lower(`s`),_status) -} ) } - fun `generate`(): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate( - _status) -} - ) - } - - } + + + companion object } /** * @suppress */ -public object FfiConverterTypeSecp256r1PublicKey: FfiConverter { +public object FfiConverterTypeProgrammableTransaction: FfiConverter { - override fun lower(value: Secp256r1PublicKey): Pointer { + override fun lower(value: ProgrammableTransaction): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Secp256r1PublicKey { - return Secp256r1PublicKey(value) + override fun lift(value: Pointer): ProgrammableTransaction { + return ProgrammableTransaction(value) } - override fun read(buf: ByteBuffer): Secp256r1PublicKey { + override fun read(buf: ByteBuffer): ProgrammableTransaction { // 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: Secp256r1PublicKey) = 8UL + override fun allocationSize(value: ProgrammableTransaction) = 8UL - override fun write(value: Secp256r1PublicKey, buf: ByteBuffer) { + override fun write(value: ProgrammableTransaction, 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))) @@ -19973,35 +21398,45 @@ public object FfiConverterTypeSecp256r1PublicKey: FfiConverter + + /** + * The serialized move modules + */ + fun `modules`(): List companion object } /** - * A secp256r1 public key. + * Command to publish a new move package * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * secp256r1-public-key = 33OCTECT + * publish = (vector bytes) ; the serialized move modules + * (vector object-id) ; the set of package dependencies * ``` */ -open class Secp256r1Signature: Disposable, AutoCloseable, Secp256r1SignatureInterface +open class Publish: Disposable, AutoCloseable, PublishInterface { constructor(pointer: Pointer) { @@ -20019,6 +21454,13 @@ open class Secp256r1Signature: Disposable, AutoCloseable, Secp256r1SignatureInte this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`modules`: List, `dependencies`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_publish_new( + FfiConverterSequenceByteArray.lower(`modules`),FfiConverterSequenceTypeObjectId.lower(`dependencies`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -20071,7 +21513,7 @@ open class Secp256r1Signature: Disposable, AutoCloseable, Secp256r1SignatureInte override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256r1signature(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_publish(ptr, status) } } } @@ -20079,15 +21521,18 @@ open class Secp256r1Signature: Disposable, AutoCloseable, Secp256r1SignatureInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256r1signature(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_publish(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + + /** + * Set of packages that the to-be published package depends on + */override fun `dependencies`(): List { + return FfiConverterSequenceTypeObjectId.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_publish_dependencies( it, _status) } } @@ -20096,68 +21541,50 @@ open class Secp256r1Signature: Disposable, AutoCloseable, Secp256r1SignatureInte - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256r1Signature { - return FfiConverterTypeSecp256r1Signature.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + /** + * The serialized move modules + */override fun `modules`(): List { + return FfiConverterSequenceByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_publish_modules( + it, _status) } - ) } - - - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256r1Signature { - return FfiConverterTypeSecp256r1Signature.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_str( - FfiConverterString.lower(`s`),_status) -} ) } - fun `generate`(): Secp256r1Signature { - return FfiConverterTypeSecp256r1Signature.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate( - _status) -} - ) - } - - } + + + companion object } /** * @suppress */ -public object FfiConverterTypeSecp256r1Signature: FfiConverter { +public object FfiConverterTypePublish: FfiConverter { - override fun lower(value: Secp256r1Signature): Pointer { + override fun lower(value: Publish): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Secp256r1Signature { - return Secp256r1Signature(value) + override fun lift(value: Pointer): Publish { + return Publish(value) } - override fun read(buf: ByteBuffer): Secp256r1Signature { + override fun read(buf: ByteBuffer): Publish { // 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: Secp256r1Signature) = 8UL + override fun allocationSize(value: Publish) = 8UL - override fun write(value: Secp256r1Signature, buf: ByteBuffer) { + override fun write(value: Publish, 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))) @@ -20263,94 +21690,12 @@ public object FfiConverterTypeSecp256r1Signature: FfiConverter - * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / - * (secp256k1-flag secp256k1-signature secp256k1-public-key) / - * (secp256r1-flag secp256r1-signature secp256r1-public-key) - * ``` - * - * Note: Due to historical reasons, signatures are serialized slightly - * different from the majority of the types in IOTA. In particular if a - * signature is ever embedded in another structure it generally is serialized - * as `bytes` meaning it has a length prefix that defines the length of - * the completely serialized signature. - */ -public interface SimpleSignatureInterface { - - fun `ed25519PubKey`(): Ed25519PublicKey - - fun `ed25519PubKeyOpt`(): Ed25519PublicKey? - - fun `ed25519Sig`(): Ed25519Signature - - fun `ed25519SigOpt`(): Ed25519Signature? - - fun `isEd25519`(): kotlin.Boolean - - fun `isSecp256k1`(): kotlin.Boolean - - fun `isSecp256r1`(): kotlin.Boolean - - fun `scheme`(): SignatureScheme - - fun `secp256k1PubKey`(): Secp256k1PublicKey - - fun `secp256k1PubKeyOpt`(): Secp256k1PublicKey? - - fun `secp256k1Sig`(): Secp256k1Signature - - fun `secp256k1SigOpt`(): Secp256k1Signature? - - fun `secp256r1PubKey`(): Secp256r1PublicKey - - fun `secp256r1PubKeyOpt`(): Secp256r1PublicKey? - - fun `secp256r1Sig`(): Secp256r1Signature - - fun `secp256r1SigOpt`(): Secp256r1Signature? - - fun `toBytes`(): kotlin.ByteArray +public interface RandomnessStateUpdateInterface { companion object } -/** - * A basic signature - * - * This enumeration defines the set of simple or basic signature schemes - * supported by IOTA. Most signature schemes supported by IOTA end up - * comprising of a at least one simple signature scheme. - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * simple-signature-bcs = bytes ; where the contents of the bytes are defined by - * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / - * (secp256k1-flag secp256k1-signature secp256k1-public-key) / - * (secp256r1-flag secp256r1-signature secp256r1-public-key) - * ``` - * - * Note: Due to historical reasons, signatures are serialized slightly - * different from the majority of the types in IOTA. In particular if a - * signature is ever embedded in another structure it generally is serialized - * as `bytes` meaning it has a length prefix that defines the length of - * the completely serialized signature. - */ -open class SimpleSignature: Disposable, AutoCloseable, SimpleSignatureInterface +open class RandomnessStateUpdate: Disposable, AutoCloseable, RandomnessStateUpdateInterface { constructor(pointer: Pointer) { @@ -20420,7 +21765,7 @@ open class SimpleSignature: Disposable, AutoCloseable, SimpleSignatureInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_simplesignature(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_randomnessstateupdate(ptr, status) } } } @@ -20428,214 +21773,10 @@ open class SimpleSignature: Disposable, AutoCloseable, SimpleSignatureInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_simplesignature(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(pointer!!, status) } } - override fun `ed25519PubKey`(): Ed25519PublicKey { - return FfiConverterTypeEd25519PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key( - it, _status) -} - } - ) - } - - - override fun `ed25519PubKeyOpt`(): Ed25519PublicKey? { - return FfiConverterOptionalTypeEd25519PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key_opt( - it, _status) -} - } - ) - } - - - override fun `ed25519Sig`(): Ed25519Signature { - return FfiConverterTypeEd25519Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig( - it, _status) -} - } - ) - } - - - override fun `ed25519SigOpt`(): Ed25519Signature? { - return FfiConverterOptionalTypeEd25519Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig_opt( - it, _status) -} - } - ) - } - - - override fun `isEd25519`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_ed25519( - it, _status) -} - } - ) - } - - - override fun `isSecp256k1`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256k1( - it, _status) -} - } - ) - } - - - override fun `isSecp256r1`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256r1( - it, _status) -} - } - ) - } - - - override fun `scheme`(): SignatureScheme { - return FfiConverterTypeSignatureScheme.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_scheme( - it, _status) -} - } - ) - } - - - override fun `secp256k1PubKey`(): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key( - it, _status) -} - } - ) - } - - - override fun `secp256k1PubKeyOpt`(): Secp256k1PublicKey? { - return FfiConverterOptionalTypeSecp256k1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key_opt( - it, _status) -} - } - ) - } - - - override fun `secp256k1Sig`(): Secp256k1Signature { - return FfiConverterTypeSecp256k1Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig( - it, _status) -} - } - ) - } - - - override fun `secp256k1SigOpt`(): Secp256k1Signature? { - return FfiConverterOptionalTypeSecp256k1Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig_opt( - it, _status) -} - } - ) - } - - - override fun `secp256r1PubKey`(): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key( - it, _status) -} - } - ) - } - - - override fun `secp256r1PubKeyOpt`(): Secp256r1PublicKey? { - return FfiConverterOptionalTypeSecp256r1PublicKey.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt( - it, _status) -} - } - ) - } - - - override fun `secp256r1Sig`(): Secp256r1Signature { - return FfiConverterTypeSecp256r1Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig( - it, _status) -} - } - ) - } - - - override fun `secp256r1SigOpt`(): Secp256r1Signature? { - return FfiConverterOptionalTypeSecp256r1Signature.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt( - it, _status) -} - } - ) - } - - - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes( - it, _status) -} - } - ) - } - - @@ -20647,25 +21788,25 @@ open class SimpleSignature: Disposable, AutoCloseable, SimpleSignatureInterface /** * @suppress */ -public object FfiConverterTypeSimpleSignature: FfiConverter { +public object FfiConverterTypeRandomnessStateUpdate: FfiConverter { - override fun lower(value: SimpleSignature): Pointer { + override fun lower(value: RandomnessStateUpdate): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): SimpleSignature { - return SimpleSignature(value) + override fun lift(value: Pointer): RandomnessStateUpdate { + return RandomnessStateUpdate(value) } - override fun read(buf: ByteBuffer): SimpleSignature { + override fun read(buf: ByteBuffer): RandomnessStateUpdate { // 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: SimpleSignature) = 8UL + override fun allocationSize(value: RandomnessStateUpdate) = 8UL - override fun write(value: SimpleSignature, buf: ByteBuffer) { + override fun write(value: RandomnessStateUpdate, 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))) @@ -20772,51 +21913,35 @@ public object FfiConverterTypeSimpleSignature: FfiConverter) : - this( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_new( - FfiConverterTypeAddress.lower(`address`),FfiConverterTypeIdentifier.lower(`module`),FfiConverterTypeIdentifier.lower(`name`),FfiConverterSequenceTypeTypeTag.lower(`typeParams`),_status) -} - ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -20893,7 +22011,7 @@ open class StructTag: Disposable, AutoCloseable, StructTagInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_structtag(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256k1publickey(ptr, status) } } } @@ -20901,45 +22019,15 @@ open class StructTag: Disposable, AutoCloseable, StructTagInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_structtag(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256k1publickey(pointer!!, status) } } - override fun `address`(): Address { - return FfiConverterTypeAddress.lift( + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_address( - it, _status) -} - } - ) - } - - - - /** - * Checks if this is a Coin type - */override fun `coinType`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type( - it, _status) -} - } - ) - } - - - - /** - * Checks if this is a Coin type - */override fun `coinTypeOpt`(): TypeTag? { - return FfiConverterOptionalTypeTypeTag.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes( it, _status) } } @@ -20951,30 +22039,32 @@ open class StructTag: Disposable, AutoCloseable, StructTagInterface companion object { - fun `coin`(`typeTag`: TypeTag): StructTag { - return FfiConverterTypeStructTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin( - FfiConverterTypeTypeTag.lower(`typeTag`),_status) + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } ) } - fun `gasCoin`(): StructTag { - return FfiConverterTypeStructTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin( - _status) + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_str( + FfiConverterString.lower(`s`),_status) } ) } - fun `stakedIota`(): StructTag { - return FfiConverterTypeStructTag.lift( + fun `generate`(): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate( _status) } ) @@ -20989,25 +22079,25 @@ open class StructTag: Disposable, AutoCloseable, StructTagInterface /** * @suppress */ -public object FfiConverterTypeStructTag: FfiConverter { +public object FfiConverterTypeSecp256k1PublicKey: FfiConverter { - override fun lower(value: StructTag): Pointer { + override fun lower(value: Secp256k1PublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): StructTag { - return StructTag(value) + override fun lift(value: Pointer): Secp256k1PublicKey { + return Secp256k1PublicKey(value) } - override fun read(buf: ByteBuffer): StructTag { + override fun read(buf: ByteBuffer): Secp256k1PublicKey { // 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: StructTag) = 8UL + override fun allocationSize(value: Secp256k1PublicKey) = 8UL - override fun write(value: StructTag, buf: ByteBuffer) { + override fun write(value: Secp256k1PublicKey, 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))) @@ -21114,45 +22204,35 @@ public object FfiConverterTypeStructTag: FfiConverter { /** - * A transaction + * A secp256k1 public key. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * transaction = %x00 transaction-v1 - * - * transaction-v1 = transaction-kind address gas-payment transaction-expiration + * secp256k1-public-key = 33OCTECT * ``` */ -public interface TransactionInterface { - - fun `expiration`(): TransactionExpiration - - fun `gasPayment`(): GasPayment - - fun `kind`(): TransactionKind +public interface Secp256k1SignatureInterface { - fun `sender`(): Address + fun `toBytes`(): kotlin.ByteArray companion object } /** - * A transaction + * A secp256k1 public key. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * transaction = %x00 transaction-v1 - * - * transaction-v1 = transaction-kind address gas-payment transaction-expiration + * secp256k1-public-key = 33OCTECT * ``` */ -open class Transaction: Disposable, AutoCloseable, TransactionInterface +open class Secp256k1Signature: Disposable, AutoCloseable, Secp256k1SignatureInterface { constructor(pointer: Pointer) { @@ -21170,13 +22250,6 @@ open class Transaction: Disposable, AutoCloseable, TransactionInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - constructor(`kind`: TransactionKind, `sender`: Address, `gasPayment`: GasPayment, `expiration`: TransactionExpiration) : - this( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transaction_new( - FfiConverterTypeTransactionKind.lower(`kind`),FfiConverterTypeAddress.lower(`sender`),FfiConverterTypeGasPayment.lower(`gasPayment`),FfiConverterTypeTransactionExpiration.lower(`expiration`),_status) -} - ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -21229,7 +22302,7 @@ open class Transaction: Disposable, AutoCloseable, TransactionInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transaction(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256k1signature(ptr, status) } } } @@ -21237,15 +22310,15 @@ open class Transaction: Disposable, AutoCloseable, TransactionInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transaction(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256k1signature(pointer!!, status) } } - override fun `expiration`(): TransactionExpiration { - return FfiConverterTypeTransactionExpiration.lift( + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_expiration( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256k1signature_to_bytes( it, _status) } } @@ -21253,72 +22326,69 @@ open class Transaction: Disposable, AutoCloseable, TransactionInterface } - override fun `gasPayment`(): GasPayment { - return FfiConverterTypeGasPayment.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment( - it, _status) + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } - } ) } - override fun `kind`(): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_kind( - it, _status) + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_str( + FfiConverterString.lower(`s`),_status) } - } ) } - override fun `sender`(): Address { - return FfiConverterTypeAddress.lift( - callWithPointer { + fun `generate`(): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_sender( - it, _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_generate( + _status) } - } ) } - - - - - companion object + + } } /** * @suppress */ -public object FfiConverterTypeTransaction: FfiConverter { +public object FfiConverterTypeSecp256k1Signature: FfiConverter { - override fun lower(value: Transaction): Pointer { + override fun lower(value: Secp256k1Signature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Transaction { - return Transaction(value) + override fun lift(value: Pointer): Secp256k1Signature { + return Secp256k1Signature(value) } - override fun read(buf: ByteBuffer): Transaction { + override fun read(buf: ByteBuffer): Secp256k1Signature { // 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: Transaction) = 8UL + override fun allocationSize(value: Secp256k1Signature) = 8UL - override fun write(value: Transaction, buf: ByteBuffer) { + override fun write(value: Secp256k1Signature, 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))) @@ -21424,16 +22494,36 @@ public object FfiConverterTypeTransaction: FfiConverter { // -public interface TransactionDigestInterface { - - fun `toBase58`(): kotlin.String +/** + * A secp256r1 signature. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256r1-signature = 64OCTECT + * ``` + */ +public interface Secp256r1PublicKeyInterface { fun `toBytes`(): kotlin.ByteArray companion object } -open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterface +/** + * A secp256r1 signature. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256r1-signature = 64OCTECT + * ``` + */ +open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInterface { constructor(pointer: Pointer) { @@ -21503,7 +22593,7 @@ open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterf override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactiondigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256r1publickey(ptr, status) } } } @@ -21511,27 +22601,15 @@ open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterf fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactiondigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(pointer!!, status) } } - override fun `toBase58`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_base58( - it, _status) -} - } - ) - } - - override fun `toBytes`(): kotlin.ByteArray { return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes( it, _status) } } @@ -21544,31 +22622,31 @@ open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterf companion object { - @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionDigest { - return FfiConverterTypeTransactionDigest.lift( + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_base58( - FfiConverterString.lower(`base58`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } ) } - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionDigest { - return FfiConverterTypeTransactionDigest.lift( + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_str( + FfiConverterString.lower(`s`),_status) } ) } - fun `generate`(): TransactionDigest { - return FfiConverterTypeTransactionDigest.lift( + fun `generate`(): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_generate( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate( _status) } ) @@ -21583,25 +22661,25 @@ open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterf /** * @suppress */ -public object FfiConverterTypeTransactionDigest: FfiConverter { +public object FfiConverterTypeSecp256r1PublicKey: FfiConverter { - override fun lower(value: TransactionDigest): Pointer { + override fun lower(value: Secp256r1PublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): TransactionDigest { - return TransactionDigest(value) + override fun lift(value: Pointer): Secp256r1PublicKey { + return Secp256r1PublicKey(value) } - override fun read(buf: ByteBuffer): TransactionDigest { + override fun read(buf: ByteBuffer): Secp256r1PublicKey { // 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: TransactionDigest) = 8UL + override fun allocationSize(value: Secp256r1PublicKey) = 8UL - override fun write(value: TransactionDigest, buf: ByteBuffer) { + override fun write(value: Secp256r1PublicKey, 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))) @@ -21707,16 +22785,36 @@ public object FfiConverterTypeTransactionDigest: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneffects(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256r1signature(ptr, status) } } } @@ -21794,15 +22892,15 @@ open class TransactionEffects: Disposable, AutoCloseable, TransactionEffectsInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffects(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256r1signature(pointer!!, status) } } - override fun `asV1`(): TransactionEffectsV1 { - return FfiConverterTypeTransactionEffectsV1.lift( + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes( it, _status) } } @@ -21810,27 +22908,37 @@ open class TransactionEffects: Disposable, AutoCloseable, TransactionEffectsInte } - override fun `isV1`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1( - it, _status) + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } - } ) } + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } - - companion object { - fun `newV1`(`effects`: TransactionEffectsV1): TransactionEffects { - return FfiConverterTypeTransactionEffects.lift( + fun `generate`(): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1( - FfiConverterTypeTransactionEffectsV1.lower(`effects`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate( + _status) } ) } @@ -21844,25 +22952,25 @@ open class TransactionEffects: Disposable, AutoCloseable, TransactionEffectsInte /** * @suppress */ -public object FfiConverterTypeTransactionEffects: FfiConverter { +public object FfiConverterTypeSecp256r1Signature: FfiConverter { - override fun lower(value: TransactionEffects): Pointer { + override fun lower(value: Secp256r1Signature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): TransactionEffects { - return TransactionEffects(value) + override fun lift(value: Pointer): Secp256r1Signature { + return Secp256r1Signature(value) } - override fun read(buf: ByteBuffer): TransactionEffects { + override fun read(buf: ByteBuffer): Secp256r1Signature { // 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: TransactionEffects) = 8UL + override fun allocationSize(value: Secp256r1Signature) = 8UL - override fun write(value: TransactionEffects, buf: ByteBuffer) { + override fun write(value: Secp256r1Signature, 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))) @@ -21968,16 +23076,94 @@ public object FfiConverterTypeTransactionEffects: FfiConverter + * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / + * (secp256k1-flag secp256k1-signature secp256k1-public-key) / + * (secp256r1-flag secp256r1-signature secp256r1-public-key) + * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. + */ +public interface SimpleSignatureInterface { - fun `toBase58`(): kotlin.String + fun `ed25519PubKey`(): Ed25519PublicKey + + fun `ed25519PubKeyOpt`(): Ed25519PublicKey? + + fun `ed25519Sig`(): Ed25519Signature + + fun `ed25519SigOpt`(): Ed25519Signature? + + fun `isEd25519`(): kotlin.Boolean + + fun `isSecp256k1`(): kotlin.Boolean + + fun `isSecp256r1`(): kotlin.Boolean + + fun `scheme`(): SignatureScheme + + fun `secp256k1PubKey`(): Secp256k1PublicKey + + fun `secp256k1PubKeyOpt`(): Secp256k1PublicKey? + + fun `secp256k1Sig`(): Secp256k1Signature + + fun `secp256k1SigOpt`(): Secp256k1Signature? + + fun `secp256r1PubKey`(): Secp256r1PublicKey + + fun `secp256r1PubKeyOpt`(): Secp256r1PublicKey? + + fun `secp256r1Sig`(): Secp256r1Signature + + fun `secp256r1SigOpt`(): Secp256r1Signature? fun `toBytes`(): kotlin.ByteArray companion object } -open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffectsDigestInterface +/** + * A basic signature + * + * This enumeration defines the set of simple or basic signature schemes + * supported by IOTA. Most signature schemes supported by IOTA end up + * comprising of a at least one simple signature scheme. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * simple-signature-bcs = bytes ; where the contents of the bytes are defined by + * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / + * (secp256k1-flag secp256k1-signature secp256k1-public-key) / + * (secp256r1-flag secp256r1-signature secp256r1-public-key) + * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. + */ +open class SimpleSignature: Disposable, AutoCloseable, SimpleSignatureInterface { constructor(pointer: Pointer) { @@ -22047,7 +23233,7 @@ open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffec override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneffectsdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_simplesignature(ptr, status) } } } @@ -22055,15 +23241,15 @@ open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffec fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_simplesignature(pointer!!, status) } } - override fun `toBase58`(): kotlin.String { - return FfiConverterString.lift( + override fun `ed25519PubKey`(): Ed25519PublicKey { + return FfiConverterTypeEd25519PublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_base58( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key( it, _status) } } @@ -22071,11 +23257,11 @@ open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffec } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `ed25519PubKeyOpt`(): Ed25519PublicKey? { + return FfiConverterOptionalTypeEd25519PublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key_opt( it, _status) } } @@ -22083,69 +23269,216 @@ open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffec } + override fun `ed25519Sig`(): Ed25519Signature { + return FfiConverterTypeEd25519Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig( + it, _status) +} + } + ) + } + override fun `ed25519SigOpt`(): Ed25519Signature? { + return FfiConverterOptionalTypeEd25519Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig_opt( + it, _status) +} + } + ) + } - companion object { - - @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionEffectsDigest { - return FfiConverterTypeTransactionEffectsDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_base58( - FfiConverterString.lower(`base58`),_status) + + override fun `isEd25519`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_ed25519( + it, _status) } + } ) } - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionEffectsDigest { - return FfiConverterTypeTransactionEffectsDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + override fun `isSecp256k1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256k1( + it, _status) } + } ) } - fun `generate`(): TransactionEffectsDigest { - return FfiConverterTypeTransactionEffectsDigest.lift( + override fun `isSecp256r1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_generate( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256r1( + it, _status) } + } ) } - + override fun `scheme`(): SignatureScheme { + return FfiConverterTypeSignatureScheme.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_scheme( + it, _status) +} + } + ) + } + + + override fun `secp256k1PubKey`(): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key( + it, _status) +} + } + ) + } + + + override fun `secp256k1PubKeyOpt`(): Secp256k1PublicKey? { + return FfiConverterOptionalTypeSecp256k1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key_opt( + it, _status) +} + } + ) + } + + + override fun `secp256k1Sig`(): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig( + it, _status) +} + } + ) + } + + + override fun `secp256k1SigOpt`(): Secp256k1Signature? { + return FfiConverterOptionalTypeSecp256k1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig_opt( + it, _status) +} + } + ) + } + + + override fun `secp256r1PubKey`(): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key( + it, _status) +} + } + ) + } + + + override fun `secp256r1PubKeyOpt`(): Secp256r1PublicKey? { + return FfiConverterOptionalTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt( + it, _status) +} + } + ) + } + + + override fun `secp256r1Sig`(): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig( + it, _status) +} + } + ) + } + + + override fun `secp256r1SigOpt`(): Secp256r1Signature? { + return FfiConverterOptionalTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes( + it, _status) +} + } + ) } + + + + + + companion object + } /** * @suppress */ -public object FfiConverterTypeTransactionEffectsDigest: FfiConverter { +public object FfiConverterTypeSimpleSignature: FfiConverter { - override fun lower(value: TransactionEffectsDigest): Pointer { + override fun lower(value: SimpleSignature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): TransactionEffectsDigest { - return TransactionEffectsDigest(value) + override fun lift(value: Pointer): SimpleSignature { + return SimpleSignature(value) } - override fun read(buf: ByteBuffer): TransactionEffectsDigest { + override fun read(buf: ByteBuffer): SimpleSignature { // 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: TransactionEffectsDigest) = 8UL + override fun allocationSize(value: SimpleSignature) = 8UL - override fun write(value: TransactionEffectsDigest, buf: ByteBuffer) { + override fun write(value: SimpleSignature, 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))) @@ -22251,16 +23584,44 @@ public object FfiConverterTypeTransactionEffectsDigest: FfiConverter - fun `toBytes`(): kotlin.ByteArray + /** + * The coin to split + */ + fun `coin`(): Argument companion object } -open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEventsDigestInterface +/** + * Command to split a single coin object into multiple coins + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * split-coins = argument (vector argument) + * ``` + */ +open class SplitCoins: Disposable, AutoCloseable, SplitCoinsInterface { constructor(pointer: Pointer) { @@ -22278,6 +23639,13 @@ open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEvents this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`coin`: Argument, `amounts`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_splitcoins_new( + FfiConverterTypeArgument.lower(`coin`),FfiConverterSequenceTypeArgument.lower(`amounts`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -22330,7 +23698,7 @@ open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEvents override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneventsdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_splitcoins(ptr, status) } } } @@ -22338,15 +23706,18 @@ open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEvents fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_splitcoins(pointer!!, status) } } - override fun `toBase58`(): kotlin.String { - return FfiConverterString.lift( + + /** + * The amounts to split off + */override fun `amounts`(): List { + return FfiConverterSequenceTypeArgument.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_base58( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_splitcoins_amounts( it, _status) } } @@ -22354,11 +23725,14 @@ open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEvents } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + + /** + * The coin to split + */override fun `coin`(): Argument { + return FfiConverterTypeArgument.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_splitcoins_coin( it, _status) } } @@ -22369,66 +23743,33 @@ open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEvents - companion object { - - @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionEventsDigest { - return FfiConverterTypeTransactionEventsDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_base58( - FfiConverterString.lower(`base58`),_status) -} - ) - } - - - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionEventsDigest { - return FfiConverterTypeTransactionEventsDigest.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) -} - ) - } - - - fun `generate`(): TransactionEventsDigest { - return FfiConverterTypeTransactionEventsDigest.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_generate( - _status) -} - ) - } - - - } + companion object } /** * @suppress */ -public object FfiConverterTypeTransactionEventsDigest: FfiConverter { +public object FfiConverterTypeSplitCoins: FfiConverter { - override fun lower(value: TransactionEventsDigest): Pointer { + override fun lower(value: SplitCoins): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): TransactionEventsDigest { - return TransactionEventsDigest(value) + override fun lift(value: Pointer): SplitCoins { + return SplitCoins(value) } - override fun read(buf: ByteBuffer): TransactionEventsDigest { + override fun read(buf: ByteBuffer): SplitCoins { // 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: TransactionEventsDigest) = 8UL + override fun allocationSize(value: SplitCoins) = 8UL - override fun write(value: TransactionEventsDigest, buf: ByteBuffer) { + override fun write(value: SplitCoins, 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))) @@ -22535,49 +23876,51 @@ public object FfiConverterTypeTransactionEventsDigest: FfiConverter) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_new( + FfiConverterTypeAddress.lower(`address`),FfiConverterTypeIdentifier.lower(`module`),FfiConverterTypeIdentifier.lower(`name`),FfiConverterSequenceTypeTypeTag.lower(`typeParams`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -22647,7 +23997,7 @@ open class TransactionKind: Disposable, AutoCloseable, TransactionKindInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactionkind(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_structtag(ptr, status) } } } @@ -22655,69 +24005,81 @@ open class TransactionKind: Disposable, AutoCloseable, TransactionKindInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_structtag(pointer!!, status) } } - - - - companion object { - fun `authenticatorStateUpdateV1`(`tx`: AuthenticatorStateUpdateV1): TransactionKind { - return FfiConverterTypeTransactionKind.lift( + override fun `address`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_authenticator_state_update_v1( - FfiConverterTypeAuthenticatorStateUpdateV1.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_address( + it, _status) } + } ) } - fun `consensusCommitPrologueV1`(`tx`: ConsensusCommitPrologueV1): TransactionKind { - return FfiConverterTypeTransactionKind.lift( + + /** + * Checks if this is a Coin type + */override fun `coinType`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_consensus_commit_prologue_v1( - FfiConverterTypeConsensusCommitPrologueV1.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type( + it, _status) } + } ) } - fun `endOfEpoch`(`tx`: List): TransactionKind { - return FfiConverterTypeTransactionKind.lift( + + /** + * Checks if this is a Coin type + */override fun `coinTypeOpt`(): TypeTag? { + return FfiConverterOptionalTypeTypeTag.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch( - FfiConverterSequenceTypeEndOfEpochTransactionKind.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt( + it, _status) } + } ) } - fun `genesis`(`tx`: GenesisTransaction): TransactionKind { - return FfiConverterTypeTransactionKind.lift( + + + + companion object { + fun `coin`(`typeTag`: TypeTag): StructTag { + return FfiConverterTypeStructTag.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis( - FfiConverterTypeGenesisTransaction.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin( + FfiConverterTypeTypeTag.lower(`typeTag`),_status) } ) } - fun `programmableTransaction`(`tx`: ProgrammableTransaction): TransactionKind { - return FfiConverterTypeTransactionKind.lift( + fun `gasCoin`(): StructTag { + return FfiConverterTypeStructTag.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction( - FfiConverterTypeProgrammableTransaction.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin( + _status) } ) } - fun `randomnessStateUpdate`(`tx`: RandomnessStateUpdate): TransactionKind { - return FfiConverterTypeTransactionKind.lift( + fun `stakedIota`(): StructTag { + return FfiConverterTypeStructTag.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update( - FfiConverterTypeRandomnessStateUpdate.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota( + _status) } ) } @@ -22731,25 +24093,25 @@ open class TransactionKind: Disposable, AutoCloseable, TransactionKindInterface /** * @suppress */ -public object FfiConverterTypeTransactionKind: FfiConverter { +public object FfiConverterTypeStructTag: FfiConverter { - override fun lower(value: TransactionKind): Pointer { + override fun lower(value: StructTag): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): TransactionKind { - return TransactionKind(value) + override fun lift(value: Pointer): StructTag { + return StructTag(value) } - override fun read(buf: ByteBuffer): TransactionKind { + override fun read(buf: ByteBuffer): StructTag { // 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: TransactionKind) = 8UL + override fun allocationSize(value: StructTag) = 8UL - override fun write(value: TransactionKind, buf: ByteBuffer) { + override fun write(value: StructTag, 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))) @@ -22856,107 +24218,326 @@ public object FfiConverterTypeTransactionKind: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transaction_new( + FfiConverterTypeTransactionKind.lower(`kind`),FfiConverterTypeAddress.lower(`sender`),FfiConverterTypeGasPayment.lower(`gasPayment`),FfiConverterTypeTransactionExpiration.lower(`expiration`),_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_transaction(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transaction(pointer!!, status) + } + } + + override fun `expiration`(): TransactionExpiration { + return FfiConverterTypeTransactionExpiration.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_expiration( + it, _status) +} + } + ) + } - fun `isBool`(): kotlin.Boolean + + override fun `gasPayment`(): GasPayment { + return FfiConverterTypeGasPayment.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment( + it, _status) +} + } + ) + } - fun `isSigner`(): kotlin.Boolean + + override fun `kind`(): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_kind( + it, _status) +} + } + ) + } - fun `isStruct`(): kotlin.Boolean + + override fun `sender`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_sender( + it, _status) +} + } + ) + } - fun `isU128`(): kotlin.Boolean + - fun `isU16`(): kotlin.Boolean + - fun `isU256`(): kotlin.Boolean - fun `isU32`(): kotlin.Boolean + companion object - fun `isU64`(): kotlin.Boolean +} + +/** + * @suppress + */ +public object FfiConverterTypeTransaction: FfiConverter { + + override fun lower(value: Transaction): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): Transaction { + return Transaction(value) + } + + override fun read(buf: ByteBuffer): Transaction { + // 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: Transaction) = 8UL + + override fun write(value: Transaction, 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 +// + + +public interface TransactionDigestInterface { - fun `isU8`(): kotlin.Boolean + fun `toBase58`(): kotlin.String - fun `isVector`(): kotlin.Boolean + fun `toBytes`(): kotlin.ByteArray companion object } -/** - * Type of a move value - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * type-tag = type-tag-u8 \ - * type-tag-u16 \ - * type-tag-u32 \ - * type-tag-u64 \ - * type-tag-u128 \ - * type-tag-u256 \ - * type-tag-bool \ - * type-tag-address \ - * type-tag-signer \ - * type-tag-vector \ - * type-tag-struct - * - * type-tag-u8 = %x01 - * type-tag-u16 = %x08 - * type-tag-u32 = %x09 - * type-tag-u64 = %x02 - * type-tag-u128 = %x03 - * type-tag-u256 = %x0a - * type-tag-bool = %x00 - * type-tag-address = %x04 - * type-tag-signer = %x05 - * type-tag-vector = %x06 type-tag - * type-tag-struct = %x07 struct-tag - * ``` - */ -open class TypeTag: Disposable, AutoCloseable, TypeTagInterface +open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterface { constructor(pointer: Pointer) { @@ -23026,7 +24607,2389 @@ open class TypeTag: Disposable, AutoCloseable, TypeTagInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_typetag(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactiondigest(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactiondigest(pointer!!, status) + } + } + + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_base58( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_bytes( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_generate( + _status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeTransactionDigest: FfiConverter { + + override fun lower(value: TransactionDigest): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TransactionDigest { + return TransactionDigest(value) + } + + override fun read(buf: ByteBuffer): TransactionDigest { + // 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: TransactionDigest) = 8UL + + override fun write(value: TransactionDigest, 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 +// + + +public interface TransactionEffectsInterface { + + fun `asV1`(): TransactionEffectsV1 + + fun `isV1`(): kotlin.Boolean + + companion object +} + +open class TransactionEffects: Disposable, AutoCloseable, TransactionEffectsInterface +{ + + 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)) + } + + 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_transactioneffects(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffects(pointer!!, status) + } + } + + override fun `asV1`(): TransactionEffectsV1 { + return FfiConverterTypeTransactionEffectsV1.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1( + it, _status) +} + } + ) + } + + + override fun `isV1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1( + it, _status) +} + } + ) + } + + + + + + companion object { + fun `newV1`(`effects`: TransactionEffectsV1): TransactionEffects { + return FfiConverterTypeTransactionEffects.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1( + FfiConverterTypeTransactionEffectsV1.lower(`effects`),_status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeTransactionEffects: FfiConverter { + + override fun lower(value: TransactionEffects): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TransactionEffects { + return TransactionEffects(value) + } + + override fun read(buf: ByteBuffer): TransactionEffects { + // 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: TransactionEffects) = 8UL + + override fun write(value: TransactionEffects, 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 +// + + +public interface TransactionEffectsDigestInterface { + + fun `toBase58`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffectsDigestInterface +{ + + 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)) + } + + 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_transactioneffectsdigest(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(pointer!!, status) + } + } + + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_base58( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_bytes( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionEffectsDigest { + return FfiConverterTypeTransactionEffectsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionEffectsDigest { + return FfiConverterTypeTransactionEffectsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): TransactionEffectsDigest { + return FfiConverterTypeTransactionEffectsDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_generate( + _status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeTransactionEffectsDigest: FfiConverter { + + override fun lower(value: TransactionEffectsDigest): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TransactionEffectsDigest { + return TransactionEffectsDigest(value) + } + + override fun read(buf: ByteBuffer): TransactionEffectsDigest { + // 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: TransactionEffectsDigest) = 8UL + + override fun write(value: TransactionEffectsDigest, 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 +// + + +public interface TransactionEventsDigestInterface { + + fun `toBase58`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEventsDigestInterface +{ + + 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)) + } + + 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_transactioneventsdigest(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(pointer!!, status) + } + } + + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_base58( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_bytes( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionEventsDigest { + return FfiConverterTypeTransactionEventsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionEventsDigest { + return FfiConverterTypeTransactionEventsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): TransactionEventsDigest { + return FfiConverterTypeTransactionEventsDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_generate( + _status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeTransactionEventsDigest: FfiConverter { + + override fun lower(value: TransactionEventsDigest): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TransactionEventsDigest { + return TransactionEventsDigest(value) + } + + override fun read(buf: ByteBuffer): TransactionEventsDigest { + // 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: TransactionEventsDigest) = 8UL + + override fun write(value: TransactionEventsDigest, 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 +// + + +/** + * Transaction type + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transaction-kind = %x00 ptb + * =/ %x01 change-epoch + * =/ %x02 genesis-transaction + * =/ %x03 consensus-commit-prologue + * =/ %x04 authenticator-state-update + * =/ %x05 (vector end-of-epoch-transaction-kind) + * =/ %x06 randomness-state-update + * =/ %x07 consensus-commit-prologue-v2 + * =/ %x08 consensus-commit-prologue-v3 + * ``` + */ +public interface TransactionKindInterface { + + companion object +} + +/** + * Transaction type + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transaction-kind = %x00 ptb + * =/ %x01 change-epoch + * =/ %x02 genesis-transaction + * =/ %x03 consensus-commit-prologue + * =/ %x04 authenticator-state-update + * =/ %x05 (vector end-of-epoch-transaction-kind) + * =/ %x06 randomness-state-update + * =/ %x07 consensus-commit-prologue-v2 + * =/ %x08 consensus-commit-prologue-v3 + * ``` + */ +open class TransactionKind: Disposable, AutoCloseable, TransactionKindInterface +{ + + 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)) + } + + 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_transactionkind(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer!!, status) + } + } + + + + + companion object { + fun `authenticatorStateUpdateV1`(`tx`: AuthenticatorStateUpdateV1): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_authenticator_state_update_v1( + FfiConverterTypeAuthenticatorStateUpdateV1.lower(`tx`),_status) +} + ) + } + + + fun `consensusCommitPrologueV1`(`tx`: ConsensusCommitPrologueV1): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_consensus_commit_prologue_v1( + FfiConverterTypeConsensusCommitPrologueV1.lower(`tx`),_status) +} + ) + } + + + fun `endOfEpoch`(`tx`: List): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch( + FfiConverterSequenceTypeEndOfEpochTransactionKind.lower(`tx`),_status) +} + ) + } + + + fun `genesis`(`tx`: GenesisTransaction): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis( + FfiConverterTypeGenesisTransaction.lower(`tx`),_status) +} + ) + } + + + fun `programmableTransaction`(`tx`: ProgrammableTransaction): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction( + FfiConverterTypeProgrammableTransaction.lower(`tx`),_status) +} + ) + } + + + fun `randomnessStateUpdate`(`tx`: RandomnessStateUpdate): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update( + FfiConverterTypeRandomnessStateUpdate.lower(`tx`),_status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeTransactionKind: FfiConverter { + + override fun lower(value: TransactionKind): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TransactionKind { + return TransactionKind(value) + } + + override fun read(buf: ByteBuffer): TransactionKind { + // 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: TransactionKind) = 8UL + + override fun write(value: TransactionKind, 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 +// + + +/** + * Command to transfer ownership of a set of objects to an address + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transfer-objects = (vector argument) argument + * ``` + */ +public interface TransferObjectsInterface { + + /** + * The address to transfer ownership to + */ + fun `address`(): Argument + + /** + * Set of objects to transfer + */ + fun `objects`(): List + + companion object +} + +/** + * Command to transfer ownership of a set of objects to an address + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transfer-objects = (vector argument) argument + * ``` + */ +open class TransferObjects: Disposable, AutoCloseable, TransferObjectsInterface +{ + + 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(`objects`: List, `address`: Argument) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transferobjects_new( + FfiConverterSequenceTypeArgument.lower(`objects`),FfiConverterTypeArgument.lower(`address`),_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_transferobjects(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transferobjects(pointer!!, status) + } + } + + + /** + * The address to transfer ownership to + */override fun `address`(): Argument { + return FfiConverterTypeArgument.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transferobjects_address( + it, _status) +} + } + ) + } + + + + /** + * Set of objects to transfer + */override fun `objects`(): List { + return FfiConverterSequenceTypeArgument.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transferobjects_objects( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeTransferObjects: FfiConverter { + + override fun lower(value: TransferObjects): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TransferObjects { + return TransferObjects(value) + } + + override fun read(buf: ByteBuffer): TransferObjects { + // 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: TransferObjects) = 8UL + + override fun write(value: TransferObjects, 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 +// + + +/** + * Type of a move value + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * type-tag = type-tag-u8 \ + * type-tag-u16 \ + * type-tag-u32 \ + * type-tag-u64 \ + * type-tag-u128 \ + * type-tag-u256 \ + * type-tag-bool \ + * type-tag-address \ + * type-tag-signer \ + * type-tag-vector \ + * type-tag-struct + * + * type-tag-u8 = %x01 + * type-tag-u16 = %x08 + * type-tag-u32 = %x09 + * type-tag-u64 = %x02 + * type-tag-u128 = %x03 + * type-tag-u256 = %x0a + * type-tag-bool = %x00 + * type-tag-address = %x04 + * type-tag-signer = %x05 + * type-tag-vector = %x06 type-tag + * type-tag-struct = %x07 struct-tag + * ``` + */ +public interface TypeTagInterface { + + fun `asStructTag`(): StructTag + + fun `asStructTagOpt`(): StructTag? + + fun `asVectorTypeTag`(): TypeTag + + fun `asVectorTypeTagOpt`(): TypeTag? + + fun `isAddress`(): kotlin.Boolean + + fun `isBool`(): kotlin.Boolean + + fun `isSigner`(): kotlin.Boolean + + fun `isStruct`(): kotlin.Boolean + + fun `isU128`(): kotlin.Boolean + + fun `isU16`(): kotlin.Boolean + + fun `isU256`(): kotlin.Boolean + + fun `isU32`(): kotlin.Boolean + + fun `isU64`(): kotlin.Boolean + + fun `isU8`(): kotlin.Boolean + + fun `isVector`(): kotlin.Boolean + + companion object +} + +/** + * Type of a move value + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * type-tag = type-tag-u8 \ + * type-tag-u16 \ + * type-tag-u32 \ + * type-tag-u64 \ + * type-tag-u128 \ + * type-tag-u256 \ + * type-tag-bool \ + * type-tag-address \ + * type-tag-signer \ + * type-tag-vector \ + * type-tag-struct + * + * type-tag-u8 = %x01 + * type-tag-u16 = %x08 + * type-tag-u32 = %x09 + * type-tag-u64 = %x02 + * type-tag-u128 = %x03 + * type-tag-u256 = %x0a + * type-tag-bool = %x00 + * type-tag-address = %x04 + * type-tag-signer = %x05 + * type-tag-vector = %x06 type-tag + * type-tag-struct = %x07 struct-tag + * ``` + */ +open class TypeTag: Disposable, AutoCloseable, TypeTagInterface +{ + + 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)) + } + + 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_typetag(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_typetag(pointer!!, status) + } + } + + override fun `asStructTag`(): StructTag { + return FfiConverterTypeStructTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag( + it, _status) +} + } + ) + } + + + override fun `asStructTagOpt`(): StructTag? { + return FfiConverterOptionalTypeStructTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt( + it, _status) +} + } + ) + } + + + override fun `asVectorTypeTag`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag( + it, _status) +} + } + ) + } + + + override fun `asVectorTypeTagOpt`(): TypeTag? { + return FfiConverterOptionalTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt( + it, _status) +} + } + ) + } + + + override fun `isAddress`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_address( + it, _status) +} + } + ) + } + + + override fun `isBool`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool( + it, _status) +} + } + ) + } + + + override fun `isSigner`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer( + it, _status) +} + } + ) + } + + + override fun `isStruct`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct( + it, _status) +} + } + ) + } + + + override fun `isU128`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128( + it, _status) +} + } + ) + } + + + override fun `isU16`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16( + it, _status) +} + } + ) + } + + + override fun `isU256`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256( + it, _status) +} + } + ) + } + + + override fun `isU32`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32( + it, _status) +} + } + ) + } + + + override fun `isU64`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64( + it, _status) +} + } + ) + } + + + override fun `isU8`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8( + it, _status) +} + } + ) + } + + + override fun `isVector`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector( + it, _status) +} + } + ) + } + + + + + + companion object { + fun `address`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_address( + _status) +} + ) + } + + + fun `bool`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool( + _status) +} + ) + } + + + fun `signer`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer( + _status) +} + ) + } + + + fun `structTag`(`structTag`: StructTag): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag( + FfiConverterTypeStructTag.lower(`structTag`),_status) +} + ) + } + + + fun `u128`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128( + _status) +} + ) + } + + + fun `u16`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16( + _status) +} + ) + } + + + fun `u256`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256( + _status) +} + ) + } + + + fun `u32`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32( + _status) +} + ) + } + + + fun `u64`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64( + _status) +} + ) + } + + + fun `u8`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8( + _status) +} + ) + } + + + fun `vector`(`typeTag`: TypeTag): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector( + FfiConverterTypeTypeTag.lower(`typeTag`),_status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeTypeTag: FfiConverter { + + override fun lower(value: TypeTag): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TypeTag { + return TypeTag(value) + } + + override fun read(buf: ByteBuffer): TypeTag { + // 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: TypeTag) = 8UL + + override fun write(value: TypeTag, 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 +// + + +/** + * Command to upgrade an already published package + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * upgrade = (vector bytes) ; move modules + * (vector object-id) ; dependencies + * object-id ; package-id of the package + * argument ; upgrade ticket + * ``` + */ +public interface UpgradeInterface { + + /** + * Set of packages that the to-be published package depends on + */ + fun `dependencies`(): List + + /** + * The serialized move modules + */ + fun `modules`(): List + + /** + * Package id of the package to upgrade + */ + fun `package`(): ObjectId + + /** + * Ticket authorizing the upgrade + */ + fun `ticket`(): Argument + + companion object +} + +/** + * Command to upgrade an already published package + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * upgrade = (vector bytes) ; move modules + * (vector object-id) ; dependencies + * object-id ; package-id of the package + * argument ; upgrade ticket + * ``` + */ +open class Upgrade: Disposable, AutoCloseable, UpgradeInterface +{ + + 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(`modules`: List, `dependencies`: List, `package`: ObjectId, `ticket`: Argument) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_upgrade_new( + FfiConverterSequenceByteArray.lower(`modules`),FfiConverterSequenceTypeObjectId.lower(`dependencies`),FfiConverterTypeObjectId.lower(`package`),FfiConverterTypeArgument.lower(`ticket`),_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_upgrade(ptr, status) } } } @@ -23034,111 +26997,18 @@ open class TypeTag: Disposable, AutoCloseable, TypeTagInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_typetag(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_upgrade(pointer!!, status) } } - override fun `asStructTag`(): StructTag { - return FfiConverterTypeStructTag.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag( - it, _status) -} - } - ) - } - - - override fun `asStructTagOpt`(): StructTag? { - return FfiConverterOptionalTypeStructTag.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt( - it, _status) -} - } - ) - } - - - override fun `asVectorTypeTag`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag( - it, _status) -} - } - ) - } - - - override fun `asVectorTypeTagOpt`(): TypeTag? { - return FfiConverterOptionalTypeTypeTag.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt( - it, _status) -} - } - ) - } - - - override fun `isAddress`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_address( - it, _status) -} - } - ) - } - - - override fun `isBool`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool( - it, _status) -} - } - ) - } - - - override fun `isSigner`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer( - it, _status) -} - } - ) - } - - - override fun `isStruct`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct( - it, _status) -} - } - ) - } - - override fun `isU128`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + /** + * Set of packages that the to-be published package depends on + */override fun `dependencies`(): List { + return FfiConverterSequenceTypeObjectId.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_upgrade_dependencies( it, _status) } } @@ -23146,23 +27016,14 @@ open class TypeTag: Disposable, AutoCloseable, TypeTagInterface } - override fun `isU16`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16( - it, _status) -} - } - ) - } - - override fun `isU256`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + /** + * The serialized move modules + */override fun `modules`(): List { + return FfiConverterSequenceByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_upgrade_modules( it, _status) } } @@ -23170,23 +27031,14 @@ open class TypeTag: Disposable, AutoCloseable, TypeTagInterface } - override fun `isU32`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32( - it, _status) -} - } - ) - } - - override fun `isU64`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + /** + * Package id of the package to upgrade + */override fun `package`(): ObjectId { + return FfiConverterTypeObjectId.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_upgrade_package( it, _status) } } @@ -23194,23 +27046,14 @@ open class TypeTag: Disposable, AutoCloseable, TypeTagInterface } - override fun `isU8`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8( - it, _status) -} - } - ) - } - - override fun `isVector`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + /** + * Ticket authorizing the upgrade + */override fun `ticket`(): Argument { + return FfiConverterTypeArgument.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_upgrade_ticket( it, _status) } } @@ -23221,144 +27064,33 @@ open class TypeTag: Disposable, AutoCloseable, TypeTagInterface - companion object { - fun `address`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_address( - _status) -} - ) - } - - - fun `bool`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool( - _status) -} - ) - } - - - fun `signer`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer( - _status) -} - ) - } - - - fun `structTag`(`structTag`: StructTag): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag( - FfiConverterTypeStructTag.lower(`structTag`),_status) -} - ) - } - - - fun `u128`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128( - _status) -} - ) - } - - - fun `u16`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16( - _status) -} - ) - } - - - fun `u256`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256( - _status) -} - ) - } - - - fun `u32`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32( - _status) -} - ) - } - - fun `u64`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64( - _status) -} - ) - } - - - fun `u8`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8( - _status) -} - ) - } - - - fun `vector`(`typeTag`: TypeTag): TypeTag { - return FfiConverterTypeTypeTag.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector( - FfiConverterTypeTypeTag.lower(`typeTag`),_status) -} - ) - } - - - - } + companion object } /** * @suppress */ -public object FfiConverterTypeTypeTag: FfiConverter { +public object FfiConverterTypeUpgrade: FfiConverter { - override fun lower(value: TypeTag): Pointer { + override fun lower(value: Upgrade): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): TypeTag { - return TypeTag(value) + override fun lift(value: Pointer): Upgrade { + return Upgrade(value) } - override fun read(buf: ByteBuffer): TypeTag { + override fun read(buf: ByteBuffer): Upgrade { // 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: TypeTag) = 8UL + override fun allocationSize(value: Upgrade) = 8UL - override fun write(value: TypeTag, buf: ByteBuffer) { + override fun write(value: Upgrade, 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))) @@ -31548,6 +35280,38 @@ public object FfiConverterOptionalTypeAddress: FfiConverterRustBuffer +/** + * @suppress + */ +public object FfiConverterOptionalTypeArgument: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Argument? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeArgument.read(buf) + } + + override fun allocationSize(value: Argument?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeArgument.allocationSize(value) + } + } + + override fun write(value: Argument?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeArgument.write(value, buf) + } + } +} + + + + /** * @suppress */ @@ -33432,6 +37196,62 @@ public object FfiConverterSequenceString: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterByteArray.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterByteArray.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterByteArray.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeArgument: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeArgument.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeArgument.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeArgument.write(it, buf) + } + } +} + + + + /** * @suppress */ @@ -33488,6 +37308,34 @@ public object FfiConverterSequenceTypeCoin: FfiConverterRustBuffer> { +/** + * @suppress + */ +public object FfiConverterSequenceTypeCommand: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeCommand.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeCommand.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeCommand.write(it, buf) + } + } +} + + + + /** * @suppress */ @@ -33544,6 +37392,34 @@ public object FfiConverterSequenceTypeEpoch: FfiConverterRustBuffer> +/** + * @suppress + */ +public object FfiConverterSequenceTypeInput: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeInput.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeInput.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeInput.write(it, buf) + } + } +} + + + + /** * @suppress */ diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 038fb7bf5..4c35210d1 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -465,6 +465,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_method_address_to_hex() != 22032: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_argument_nested() != 44576: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes() != 9890: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_bls12381signature_to_bytes() != 56969: @@ -603,6 +605,24 @@ 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_identifier_as_str() != 63815: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements() != 20773: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag() != 31154: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin() != 38884: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge() != 44350: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_movecall_arguments() != 17202: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_movecall_function() != 2751: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_movecall_module() != 35106: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_movecall_package() != 24481: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments() != 46468: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap() != 41489: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_committee() != 17432: @@ -731,6 +751,14 @@ 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_passkeyauthenticator_signature() != 5489: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands() != 49868: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs() != 25458: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_publish_dependencies() != 57311: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_publish_modules() != 26011: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes() != 49170: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_secp256k1signature_to_bytes() != 49705: @@ -773,6 +801,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_method_simplesignature_to_bytes() != 28081: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts() != 10377: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin() != 17278: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_structtag_address() != 18393: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type() != 37745: @@ -803,6 +835,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_method_transactioneventsdigest_to_bytes() != 6773: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_address() != 37833: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects() != 24154: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag() != 1715: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt() != 15734: @@ -833,6 +869,14 @@ 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_typetag_is_vector() != 49992: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies() != 7113: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_modules() != 62138: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_package() != 35757: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket() != 11416: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig() != 36332: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig_opt() != 21895: @@ -893,6 +937,14 @@ 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_address_generate() != 48865: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas() != 14489: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input() != 33966: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result() != 57666: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result() != 44025: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes() != 6069: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str() != 26128: @@ -929,6 +981,20 @@ 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_coin_try_from_object() != 35349: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector() != 54610: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins() != 1888: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call() != 23161: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish() != 7239: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins() != 59484: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects() != 54265: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade() != 48835: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58() != 17742: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_bytes() != 58221: @@ -987,6 +1053,20 @@ 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_identifier_new() != 9398: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned() != 33908: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure() != 53404: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving() != 28060: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared() != 61970: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new() != 20934: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new() != 1506: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_movecall_new() != 30411: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() != 17506: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new() != 3396: @@ -1023,6 +1103,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_owner_new_shared() != 36753: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new() != 38638: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_publish_new() != 4785: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes() != 20339: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str() != 24158: @@ -1047,6 +1131,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_secp256r1signature_generate() != 40260: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new() != 50321: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() != 13756: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin() != 37848: @@ -1089,6 +1175,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_transactionkind_randomness_state_update() != 45772: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new() != 22470: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address() != 44901: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool() != 19366: @@ -1111,6 +1199,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_typetag_vector() != 46548: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new() != 61663: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64() != 8029: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_bytes() != 37499: @@ -1263,6 +1353,42 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_address_to_hex.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_argument.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_argument.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_argument.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_argument.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_gas.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_gas.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_input.argtypes = ( + ctypes.c_uint16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_input.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_nested_result.argtypes = ( + ctypes.c_uint16, + ctypes.c_uint16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_nested_result.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_result.argtypes = ( + ctypes.c_uint16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_result.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_argument_nested.argtypes = ( + ctypes.c_void_p, + ctypes.c_uint16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_argument_nested.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -1561,6 +1687,51 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_coin_id.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_command.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_command.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_command.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_command.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_make_move_vector.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_make_move_vector.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_merge_coins.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_merge_coins.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_move_call.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_move_call.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_publish.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_publish.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_split_coins.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_split_coins.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_transfer_objects.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_transfer_objects.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_upgrade.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_upgrade.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -2145,6 +2316,134 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_identifier_as_str.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_input.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_input.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_input.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_input.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_immutable_or_owned.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_immutable_or_owned.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_pure.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_pure.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_receiving.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_receiving.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_shared.argtypes = ( + ctypes.c_void_p, + ctypes.c_uint64, + ctypes.c_int8, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_shared.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_makemovevector.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_makemovevector.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_makemovevector.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_makemovevector.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_makemovevector_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_makemovevector_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_makemovevector_elements.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_makemovevector_elements.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_makemovevector_type_tag.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_makemovevector_type_tag.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_mergecoins.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_mergecoins.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_mergecoins.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_mergecoins.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_mergecoins_new.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_mergecoins_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_mergecoins_coin.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_mergecoins_coin.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_mergecoins_coins_to_merge.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_mergecoins_coins_to_merge.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movecall.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movecall.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_movecall.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_movecall.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movecall_new.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movecall_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_arguments.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_arguments.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_function.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_function.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_module.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_module.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_package.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_package.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_type_arguments.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_type_arguments.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movepackage.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -2703,6 +3002,48 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_programmabletransaction.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_programmabletransaction_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_programmabletransaction_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_commands.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_commands.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_inputs.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_inputs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_publish.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_publish.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_publish.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_publish.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_publish_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_publish_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_publish_dependencies.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_publish_dependencies.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_publish_modules.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_publish_modules.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -2924,6 +3265,32 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_splitcoins.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_splitcoins.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_splitcoins.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_splitcoins.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_splitcoins_new.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_splitcoins_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_splitcoins_amounts.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_splitcoins_amounts.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_splitcoins_coin.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_splitcoins_coin.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_structtag.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3175,6 +3542,32 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transferobjects.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transferobjects.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transferobjects.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transferobjects.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transferobjects_new.argtypes = ( + _UniffiRustBuffer, + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transferobjects_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transferobjects_address.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transferobjects_address.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transferobjects_objects.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transferobjects_objects.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_typetag.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3306,6 +3699,44 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_upgrade.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_upgrade.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_upgrade.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_upgrade.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_upgrade_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_void_p, + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_upgrade_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_dependencies.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_dependencies.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_modules.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_modules.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_package.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_package.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_ticket.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_ticket.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_usersignature.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3803,6 +4234,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_address_to_hex.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_address_to_hex.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_argument_nested.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_argument_nested.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes.restype = ctypes.c_uint16 @@ -4010,6 +4444,33 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_elements.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_makemovevector_type_tag.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coin.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_mergecoins_coins_to_merge.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_arguments.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_arguments.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_function.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_function.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_module.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_module.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_package.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_package.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_movecall_type_arguments.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap.restype = ctypes.c_uint16 @@ -4202,6 +4663,18 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_publish_dependencies.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_publish_dependencies.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_publish_modules.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_publish_modules.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes.restype = ctypes.c_uint16 @@ -4265,6 +4738,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_amounts.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_splitcoins_coin.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_address.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_structtag_address.restype = ctypes.c_uint16 @@ -4310,6 +4789,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_address.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag.restype = ctypes.c_uint16 @@ -4355,6 +4840,18 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_dependencies.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_modules.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_modules.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_package.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_package.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_upgrade_ticket.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig.restype = ctypes.c_uint16 @@ -4445,6 +4942,18 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_address_generate.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_address_generate.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_input.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_nested_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_result.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes.restype = ctypes.c_uint16 @@ -4499,6 +5008,27 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_make_move_vector.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_merge_coins.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_move_call.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_publish.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_split_coins.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_transfer_objects.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_command_new_upgrade.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58.restype = ctypes.c_uint16 @@ -4586,6 +5116,27 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_immutable_or_owned.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_pure.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_receiving.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_input_new_shared.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_makemovevector_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_mergecoins_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movecall_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movecall_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new.restype = ctypes.c_uint16 @@ -4640,6 +5191,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_owner_new_shared.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_owner_new_shared.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_publish_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_publish_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes.restype = ctypes.c_uint16 @@ -4676,6 +5233,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_splitcoins_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin.restype = ctypes.c_uint16 @@ -4739,6 +5299,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transferobjects_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address.restype = ctypes.c_uint16 @@ -4772,6 +5335,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_upgrade_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64.restype = ctypes.c_uint16 @@ -5055,6 +5621,26 @@ def write(value, buf): + + + + + + + + + + + + + + + + + + + + @@ -12662,6 +13248,33 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeArgument(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeArgument.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeArgument.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeArgument.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeBatchSendStatus(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -14253,6 +14866,56 @@ def read(cls, buf): +class _UniffiConverterSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterBytes.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterBytes.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterBytes.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeArgument(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeArgument.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeArgument.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeArgument.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeCheckpointCommitment(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -14303,6 +14966,31 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeCommand(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeCommand.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeCommand.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeCommand.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeEndOfEpochTransactionKind(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -14353,6 +15041,31 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeInput(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeInput.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeInput.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeInput.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeMovePackage(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -15547,10 +16260,56 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: AddressProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class AuthenticatorStateExpireProtocol(typing.Protocol): - pass -# AuthenticatorStateExpire is a Rust-only trait - it's a wrapper around a Rust implementation. -class AuthenticatorStateExpire(): +class ArgumentProtocol(typing.Protocol): + """ + An argument to a programmable transaction command + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + argument = argument-gas + =/ argument-input + =/ argument-result + =/ argument-nested-result + + argument-gas = %x00 + argument-input = %x01 u16 + argument-result = %x02 u16 + argument-nested-result = %x03 u16 u16 + ``` + """ + + def nested(self, ix: "int"): + """ + Turn a Result into a NestedResult. If the argument is not a Result, + returns None. + """ + + raise NotImplementedError +# Argument is a Rust-only trait - it's a wrapper around a Rust implementation. +class Argument(): + """ + An argument to a programmable transaction command + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + argument = argument-gas + =/ argument-input + =/ argument-result + =/ argument-nested-result + + argument-gas = %x00 + argument-input = %x01 u16 + argument-result = %x02 u16 + argument-nested-result = %x03 u16 u16 + ``` + """ + _pointer: ctypes.c_void_p def __init__(self, *args, **kwargs): @@ -15560,10 +16319,10 @@ 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_authenticatorstateexpire, pointer) + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_argument, pointer) def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire, self._pointer) + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_argument, self._pointer) # Used by alternative constructors or any methods which return this type. @classmethod @@ -15573,24 +16332,97 @@ def _make_instance_(cls, pointer): inst = cls.__new__(cls) inst._pointer = pointer return inst + @classmethod + def new_gas(cls, ): + """ + The gas coin. The gas coin can only be used by-ref, except for with + `TransferObjects`, which can use it by-value. + """ + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_gas,) + return cls._make_instance_(pointer) + + @classmethod + def new_input(cls, input: "int"): + """ + One of the input objects or primitive values (from + `ProgrammableTransaction` inputs) + """ + + _UniffiConverterUInt16.check_lower(input) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_input, + _UniffiConverterUInt16.lower(input)) + return cls._make_instance_(pointer) + @classmethod + def new_nested_result(cls, command_index: "int",subresult_index: "int"): + """ + Like a `Result` but it accesses a nested result. Currently, the only + usage of this is to access a value from a Move call with multiple + return values. + """ + + _UniffiConverterUInt16.check_lower(command_index) + + _UniffiConverterUInt16.check_lower(subresult_index) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_nested_result, + _UniffiConverterUInt16.lower(command_index), + _UniffiConverterUInt16.lower(subresult_index)) + return cls._make_instance_(pointer) + + @classmethod + def new_result(cls, result: "int"): + """ + The result of another command (from `ProgrammableTransaction` commands) + """ + + _UniffiConverterUInt16.check_lower(result) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_argument_new_result, + _UniffiConverterUInt16.lower(result)) + return cls._make_instance_(pointer) + + + + def nested(self, ix: "int") -> "typing.Optional[Argument]": + """ + Turn a Result into a NestedResult. If the argument is not a Result, + returns None. + """ + + _UniffiConverterUInt16.check_lower(ix) + + return _UniffiConverterOptionalTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_argument_nested,self._uniffi_clone_pointer(), + _UniffiConverterUInt16.lower(ix)) + ) -class _UniffiConverterTypeAuthenticatorStateExpire: + + + + +class _UniffiConverterTypeArgument: @staticmethod def lift(value: int): - return AuthenticatorStateExpire._make_instance_(value) + return Argument._make_instance_(value) @staticmethod - def check_lower(value: AuthenticatorStateExpire): - if not isinstance(value, AuthenticatorStateExpire): - raise TypeError("Expected AuthenticatorStateExpire instance, {} found".format(type(value).__name__)) + def check_lower(value: Argument): + if not isinstance(value, Argument): + raise TypeError("Expected Argument instance, {} found".format(type(value).__name__)) @staticmethod - def lower(value: AuthenticatorStateExpireProtocol): - if not isinstance(value, AuthenticatorStateExpire): - raise TypeError("Expected AuthenticatorStateExpire instance, {} found".format(type(value).__name__)) + def lower(value: ArgumentProtocol): + if not isinstance(value, Argument): + raise TypeError("Expected Argument instance, {} found".format(type(value).__name__)) return value._uniffi_clone_pointer() @classmethod @@ -15601,12 +16433,68 @@ def read(cls, buf: _UniffiRustBuffer): return cls.lift(ptr) @classmethod - def write(cls, value: AuthenticatorStateExpireProtocol, buf: _UniffiRustBuffer): + def write(cls, value: ArgumentProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class AuthenticatorStateUpdateV1Protocol(typing.Protocol): +class AuthenticatorStateExpireProtocol(typing.Protocol): pass -# AuthenticatorStateUpdateV1 is a Rust-only trait - it's a wrapper around a Rust implementation. -class AuthenticatorStateUpdateV1(): +# AuthenticatorStateExpire is a Rust-only trait - it's a wrapper around a Rust implementation. +class AuthenticatorStateExpire(): + _pointer: ctypes.c_void_p + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + 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_authenticatorstateexpire, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire, 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 + + + +class _UniffiConverterTypeAuthenticatorStateExpire: + + @staticmethod + def lift(value: int): + return AuthenticatorStateExpire._make_instance_(value) + + @staticmethod + def check_lower(value: AuthenticatorStateExpire): + if not isinstance(value, AuthenticatorStateExpire): + raise TypeError("Expected AuthenticatorStateExpire instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: AuthenticatorStateExpireProtocol): + if not isinstance(value, AuthenticatorStateExpire): + raise TypeError("Expected AuthenticatorStateExpire 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: AuthenticatorStateExpireProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class AuthenticatorStateUpdateV1Protocol(typing.Protocol): + pass +# AuthenticatorStateUpdateV1 is a Rust-only trait - it's a wrapper around a Rust implementation. +class AuthenticatorStateUpdateV1(): _pointer: ctypes.c_void_p def __init__(self, *args, **kwargs): @@ -16784,6 +17672,216 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: CoinProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class CommandProtocol(typing.Protocol): + """ + A single command in a programmable transaction. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + command = command-move-call + =/ command-transfer-objects + =/ command-split-coins + =/ command-merge-coins + =/ command-publish + =/ command-make-move-vector + =/ command-upgrade + + command-move-call = %x00 move-call + command-transfer-objects = %x01 transfer-objects + command-split-coins = %x02 split-coins + command-merge-coins = %x03 merge-coins + command-publish = %x04 publish + command-make-move-vector = %x05 make-move-vector + command-upgrade = %x06 upgrade + ``` + """ + + pass +# Command is a Rust-only trait - it's a wrapper around a Rust implementation. +class Command(): + """ + A single command in a programmable transaction. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + command = command-move-call + =/ command-transfer-objects + =/ command-split-coins + =/ command-merge-coins + =/ command-publish + =/ command-make-move-vector + =/ command-upgrade + + command-move-call = %x00 move-call + command-transfer-objects = %x01 transfer-objects + command-split-coins = %x02 split-coins + command-merge-coins = %x03 merge-coins + command-publish = %x04 publish + command-make-move-vector = %x05 make-move-vector + command-upgrade = %x06 upgrade + ``` + """ + + _pointer: ctypes.c_void_p + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") + + 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_command, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_command, 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 + @classmethod + def new_make_move_vector(cls, make_move_vector: "MakeMoveVector"): + """ + Given n-values of the same type, it constructs a vector. For non objects + or an empty vector, the type tag must be specified. + """ + + _UniffiConverterTypeMakeMoveVector.check_lower(make_move_vector) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_make_move_vector, + _UniffiConverterTypeMakeMoveVector.lower(make_move_vector)) + return cls._make_instance_(pointer) + + @classmethod + def new_merge_coins(cls, merge_coins: "MergeCoins"): + """ + It merges n-coins into the first coin + """ + + _UniffiConverterTypeMergeCoins.check_lower(merge_coins) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_merge_coins, + _UniffiConverterTypeMergeCoins.lower(merge_coins)) + return cls._make_instance_(pointer) + + @classmethod + def new_move_call(cls, move_call: "MoveCall"): + """ + A call to either an entry or a public Move function + """ + + _UniffiConverterTypeMoveCall.check_lower(move_call) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_move_call, + _UniffiConverterTypeMoveCall.lower(move_call)) + return cls._make_instance_(pointer) + + @classmethod + def new_publish(cls, publish: "Publish"): + """ + Publishes a Move package. It takes the package bytes and a list of the + package's transitive dependencies to link against on-chain. + """ + + _UniffiConverterTypePublish.check_lower(publish) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_publish, + _UniffiConverterTypePublish.lower(publish)) + return cls._make_instance_(pointer) + + @classmethod + def new_split_coins(cls, split_coins: "SplitCoins"): + """ + It splits off some amounts into a new coins with those amounts + """ + + _UniffiConverterTypeSplitCoins.check_lower(split_coins) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_split_coins, + _UniffiConverterTypeSplitCoins.lower(split_coins)) + return cls._make_instance_(pointer) + + @classmethod + def new_transfer_objects(cls, transfer_objects: "TransferObjects"): + """ + It sends n-objects to the specified address. These objects must have + store (public transfer) and either the previous owner must be an + address or the object must be newly created. + """ + + _UniffiConverterTypeTransferObjects.check_lower(transfer_objects) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_transfer_objects, + _UniffiConverterTypeTransferObjects.lower(transfer_objects)) + return cls._make_instance_(pointer) + + @classmethod + def new_upgrade(cls, upgrade: "Upgrade"): + """ + Upgrades a Move package + Takes (in order): + 1. A vector of serialized modules for the package. + 2. A vector of object ids for the transitive dependencies of the new + package. + 3. The object ID of the package being upgraded. + 4. An argument holding the `UpgradeTicket` that must have been produced + from an earlier command in the same programmable transaction. + """ + + _UniffiConverterTypeUpgrade.check_lower(upgrade) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_command_new_upgrade, + _UniffiConverterTypeUpgrade.lower(upgrade)) + return cls._make_instance_(pointer) + + + + +class _UniffiConverterTypeCommand: + + @staticmethod + def lift(value: int): + return Command._make_instance_(value) + + @staticmethod + def check_lower(value: Command): + if not isinstance(value, Command): + raise TypeError("Expected Command instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: CommandProtocol): + if not isinstance(value, Command): + raise TypeError("Expected Command 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: CommandProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class ConsensusCommitDigestProtocol(typing.Protocol): def to_base58(self, ): raise NotImplementedError @@ -19943,69 +21041,57 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: IdentifierProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class MovePackageProtocol(typing.Protocol): +class InputProtocol(typing.Protocol): """ - A move package + An input to a user transaction # BCS The BCS serialized form for this type is defined by the following ABNF: ```text - object-move-package = object-id u64 move-modules type-origin-table linkage-table + input = input-pure / input-immutable-or-owned / input-shared / input-receiving - move-modules = map (identifier bytes) - type-origin-table = vector type-origin - linkage-table = map (object-id upgrade-info) + input-pure = %x00 bytes + input-immutable-or-owned = %x01 object-ref + input-shared = %x02 object-id u64 bool + input-receiving = %x04 object-ref ``` """ pass -# MovePackage is a Rust-only trait - it's a wrapper around a Rust implementation. -class MovePackage(): +# Input is a Rust-only trait - it's a wrapper around a Rust implementation. +class Input(): """ - A move package + An input to a user transaction # BCS The BCS serialized form for this type is defined by the following ABNF: ```text - object-move-package = object-id u64 move-modules type-origin-table linkage-table + input = input-pure / input-immutable-or-owned / input-shared / input-receiving - move-modules = map (identifier bytes) - type-origin-table = vector type-origin - linkage-table = map (object-id upgrade-info) + input-pure = %x00 bytes + input-immutable-or-owned = %x01 object-ref + input-shared = %x02 object-id u64 bool + input-receiving = %x04 object-ref ``` """ _pointer: ctypes.c_void_p - def __init__(self, id: "ObjectId",version: "int",modules: "dict[Identifier, bytes]",type_origin_table: "typing.List[TypeOrigin]",linkage_table: "dict[ObjectId, UpgradeInfo]"): - _UniffiConverterTypeObjectId.check_lower(id) - - _UniffiConverterUInt64.check_lower(version) - - _UniffiConverterMapTypeIdentifierBytes.check_lower(modules) - - _UniffiConverterSequenceTypeTypeOrigin.check_lower(type_origin_table) - - _UniffiConverterMapTypeObjectIdTypeUpgradeInfo.check_lower(linkage_table) - - self._pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new, - _UniffiConverterTypeObjectId.lower(id), - _UniffiConverterUInt64.lower(version), - _UniffiConverterMapTypeIdentifierBytes.lower(modules), - _UniffiConverterSequenceTypeTypeOrigin.lower(type_origin_table), - _UniffiConverterMapTypeObjectIdTypeUpgradeInfo.lower(linkage_table)) + + def __init__(self, *args, **kwargs): + raise ValueError("This class has no default constructor") 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_movepackage, pointer) + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_free_input, pointer) def _uniffi_clone_pointer(self): - return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movepackage, self._pointer) + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_input, self._pointer) # Used by alternative constructors or any methods which return this type. @classmethod @@ -20015,24 +21101,79 @@ def _make_instance_(cls, pointer): inst = cls.__new__(cls) inst._pointer = pointer return inst + @classmethod + def new_immutable_or_owned(cls, object_ref: "ObjectReference"): + """ + A move object that is either immutable or address owned + """ + _UniffiConverterTypeObjectReference.check_lower(object_ref) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_immutable_or_owned, + _UniffiConverterTypeObjectReference.lower(object_ref)) + return cls._make_instance_(pointer) + @classmethod + def new_pure(cls, value: "bytes"): + """ + For normal operations this is required to be a move primitive type and + not contain structs or objects. + """ -class _UniffiConverterTypeMovePackage: + _UniffiConverterBytes.check_lower(value) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_pure, + _UniffiConverterBytes.lower(value)) + return cls._make_instance_(pointer) + + @classmethod + def new_receiving(cls, object_ref: "ObjectReference"): + _UniffiConverterTypeObjectReference.check_lower(object_ref) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_receiving, + _UniffiConverterTypeObjectReference.lower(object_ref)) + return cls._make_instance_(pointer) + + @classmethod + def new_shared(cls, object_id: "ObjectId",initial_shared_version: "int",mutable: "bool"): + """ + A move object whose owner is "Shared" + """ + + _UniffiConverterTypeObjectId.check_lower(object_id) + + _UniffiConverterUInt64.check_lower(initial_shared_version) + + _UniffiConverterBool.check_lower(mutable) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_input_new_shared, + _UniffiConverterTypeObjectId.lower(object_id), + _UniffiConverterUInt64.lower(initial_shared_version), + _UniffiConverterBool.lower(mutable)) + return cls._make_instance_(pointer) + + + + +class _UniffiConverterTypeInput: @staticmethod def lift(value: int): - return MovePackage._make_instance_(value) + return Input._make_instance_(value) @staticmethod - def check_lower(value: MovePackage): - if not isinstance(value, MovePackage): - raise TypeError("Expected MovePackage instance, {} found".format(type(value).__name__)) + def check_lower(value: Input): + if not isinstance(value, Input): + raise TypeError("Expected Input instance, {} found".format(type(value).__name__)) @staticmethod - def lower(value: MovePackageProtocol): - if not isinstance(value, MovePackage): - raise TypeError("Expected MovePackage instance, {} found".format(type(value).__name__)) + def lower(value: InputProtocol): + if not isinstance(value, Input): + raise TypeError("Expected Input instance, {} found".format(type(value).__name__)) return value._uniffi_clone_pointer() @classmethod @@ -20043,18 +21184,578 @@ def read(cls, buf: _UniffiRustBuffer): return cls.lift(ptr) @classmethod - def write(cls, value: MovePackageProtocol, buf: _UniffiRustBuffer): + def write(cls, value: InputProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) -class MultisigAggregatedSignatureProtocol(typing.Protocol): +class MakeMoveVectorProtocol(typing.Protocol): """ - Aggregated signature from members of a multisig committee. + Command to build a move vector out of a set of individual elements # BCS The BCS serialized form for this type is defined by the following ABNF: ```text - multisig-aggregated-signature = (vector multisig-member-signature) + make-move-vector = (option type-tag) (vector argument) + ``` + """ + + def elements(self, ): + """ + The set individual elements to build the vector with + """ + + raise NotImplementedError + def type_tag(self, ): + """ + Type of the individual elements + + This is required to be set when the type can't be inferred, for example + when the set of provided arguments are all pure input values. + """ + + raise NotImplementedError +# MakeMoveVector is a Rust-only trait - it's a wrapper around a Rust implementation. +class MakeMoveVector(): + """ + Command to build a move vector out of a set of individual elements + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + make-move-vector = (option type-tag) (vector argument) + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, type_tag: "typing.Optional[TypeTag]",elements: "typing.List[Argument]"): + _UniffiConverterOptionalTypeTypeTag.check_lower(type_tag) + + _UniffiConverterSequenceTypeArgument.check_lower(elements) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_makemovevector_new, + _UniffiConverterOptionalTypeTypeTag.lower(type_tag), + _UniffiConverterSequenceTypeArgument.lower(elements)) + + 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_makemovevector, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_makemovevector, 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 elements(self, ) -> "typing.List[Argument]": + """ + The set individual elements to build the vector with + """ + + return _UniffiConverterSequenceTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_makemovevector_elements,self._uniffi_clone_pointer(),) + ) + + + + + + def type_tag(self, ) -> "typing.Optional[TypeTag]": + """ + Type of the individual elements + + This is required to be set when the type can't be inferred, for example + when the set of provided arguments are all pure input values. + """ + + return _UniffiConverterOptionalTypeTypeTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_makemovevector_type_tag,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeMakeMoveVector: + + @staticmethod + def lift(value: int): + return MakeMoveVector._make_instance_(value) + + @staticmethod + def check_lower(value: MakeMoveVector): + if not isinstance(value, MakeMoveVector): + raise TypeError("Expected MakeMoveVector instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: MakeMoveVectorProtocol): + if not isinstance(value, MakeMoveVector): + raise TypeError("Expected MakeMoveVector 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: MakeMoveVectorProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class MergeCoinsProtocol(typing.Protocol): + """ + Command to merge multiple coins of the same type into a single coin + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + merge-coins = argument (vector argument) + ``` + """ + + def coin(self, ): + """ + Coin to merge coins into + """ + + raise NotImplementedError + def coins_to_merge(self, ): + """ + Set of coins to merge into `coin` + + All listed coins must be of the same type and be the same type as `coin` + """ + + raise NotImplementedError +# MergeCoins is a Rust-only trait - it's a wrapper around a Rust implementation. +class MergeCoins(): + """ + Command to merge multiple coins of the same type into a single coin + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + merge-coins = argument (vector argument) + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, coin: "Argument",coins_to_merge: "typing.List[Argument]"): + _UniffiConverterTypeArgument.check_lower(coin) + + _UniffiConverterSequenceTypeArgument.check_lower(coins_to_merge) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_mergecoins_new, + _UniffiConverterTypeArgument.lower(coin), + _UniffiConverterSequenceTypeArgument.lower(coins_to_merge)) + + 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_mergecoins, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_mergecoins, 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 coin(self, ) -> "Argument": + """ + Coin to merge coins into + """ + + return _UniffiConverterTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_mergecoins_coin,self._uniffi_clone_pointer(),) + ) + + + + + + def coins_to_merge(self, ) -> "typing.List[Argument]": + """ + Set of coins to merge into `coin` + + All listed coins must be of the same type and be the same type as `coin` + """ + + return _UniffiConverterSequenceTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_mergecoins_coins_to_merge,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeMergeCoins: + + @staticmethod + def lift(value: int): + return MergeCoins._make_instance_(value) + + @staticmethod + def check_lower(value: MergeCoins): + if not isinstance(value, MergeCoins): + raise TypeError("Expected MergeCoins instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: MergeCoinsProtocol): + if not isinstance(value, MergeCoins): + raise TypeError("Expected MergeCoins 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: MergeCoinsProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class MoveCallProtocol(typing.Protocol): + """ + Command to call a move function + + Functions that can be called by a `MoveCall` command are those that have a + function signature that is either `entry` or `public` (which don't have a + reference return type). + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + move-call = object-id ; package id + identifier ; module name + identifier ; function name + (vector type-tag) ; type arguments, if any + (vector argument) ; input arguments + ``` + """ + + def arguments(self, ): + """ + The arguments to the function. + """ + + raise NotImplementedError + def function(self, ): + """ + The function to be called. + """ + + raise NotImplementedError + def module(self, ): + """ + The specific module in the package containing the function. + """ + + raise NotImplementedError + def package(self, ): + """ + The package containing the module and function. + """ + + raise NotImplementedError + def type_arguments(self, ): + """ + The type arguments to the function. + """ + + raise NotImplementedError +# MoveCall is a Rust-only trait - it's a wrapper around a Rust implementation. +class MoveCall(): + """ + Command to call a move function + + Functions that can be called by a `MoveCall` command are those that have a + function signature that is either `entry` or `public` (which don't have a + reference return type). + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + move-call = object-id ; package id + identifier ; module name + identifier ; function name + (vector type-tag) ; type arguments, if any + (vector argument) ; input arguments + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, package: "ObjectId",module: "Identifier",function: "Identifier",type_arguments: "typing.List[TypeTag]",arguments: "typing.List[Argument]"): + _UniffiConverterTypeObjectId.check_lower(package) + + _UniffiConverterTypeIdentifier.check_lower(module) + + _UniffiConverterTypeIdentifier.check_lower(function) + + _UniffiConverterSequenceTypeTypeTag.check_lower(type_arguments) + + _UniffiConverterSequenceTypeArgument.check_lower(arguments) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movecall_new, + _UniffiConverterTypeObjectId.lower(package), + _UniffiConverterTypeIdentifier.lower(module), + _UniffiConverterTypeIdentifier.lower(function), + _UniffiConverterSequenceTypeTypeTag.lower(type_arguments), + _UniffiConverterSequenceTypeArgument.lower(arguments)) + + 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_movecall, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movecall, 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 arguments(self, ) -> "typing.List[Argument]": + """ + The arguments to the function. + """ + + return _UniffiConverterSequenceTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_arguments,self._uniffi_clone_pointer(),) + ) + + + + + + def function(self, ) -> "Identifier": + """ + The function to be called. + """ + + return _UniffiConverterTypeIdentifier.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_function,self._uniffi_clone_pointer(),) + ) + + + + + + def module(self, ) -> "Identifier": + """ + The specific module in the package containing the function. + """ + + return _UniffiConverterTypeIdentifier.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_module,self._uniffi_clone_pointer(),) + ) + + + + + + def package(self, ) -> "ObjectId": + """ + The package containing the module and function. + """ + + return _UniffiConverterTypeObjectId.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_package,self._uniffi_clone_pointer(),) + ) + + + + + + def type_arguments(self, ) -> "typing.List[TypeTag]": + """ + The type arguments to the function. + """ + + return _UniffiConverterSequenceTypeTypeTag.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_movecall_type_arguments,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeMoveCall: + + @staticmethod + def lift(value: int): + return MoveCall._make_instance_(value) + + @staticmethod + def check_lower(value: MoveCall): + if not isinstance(value, MoveCall): + raise TypeError("Expected MoveCall instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: MoveCallProtocol): + if not isinstance(value, MoveCall): + raise TypeError("Expected MoveCall 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: MoveCallProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class MovePackageProtocol(typing.Protocol): + """ + A move package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + object-move-package = object-id u64 move-modules type-origin-table linkage-table + + move-modules = map (identifier bytes) + type-origin-table = vector type-origin + linkage-table = map (object-id upgrade-info) + ``` + """ + + pass +# MovePackage is a Rust-only trait - it's a wrapper around a Rust implementation. +class MovePackage(): + """ + A move package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + object-move-package = object-id u64 move-modules type-origin-table linkage-table + + move-modules = map (identifier bytes) + type-origin-table = vector type-origin + linkage-table = map (object-id upgrade-info) + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, id: "ObjectId",version: "int",modules: "dict[Identifier, bytes]",type_origin_table: "typing.List[TypeOrigin]",linkage_table: "dict[ObjectId, UpgradeInfo]"): + _UniffiConverterTypeObjectId.check_lower(id) + + _UniffiConverterUInt64.check_lower(version) + + _UniffiConverterMapTypeIdentifierBytes.check_lower(modules) + + _UniffiConverterSequenceTypeTypeOrigin.check_lower(type_origin_table) + + _UniffiConverterMapTypeObjectIdTypeUpgradeInfo.check_lower(linkage_table) + + self._pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new, + _UniffiConverterTypeObjectId.lower(id), + _UniffiConverterUInt64.lower(version), + _UniffiConverterMapTypeIdentifierBytes.lower(modules), + _UniffiConverterSequenceTypeTypeOrigin.lower(type_origin_table), + _UniffiConverterMapTypeObjectIdTypeUpgradeInfo.lower(linkage_table)) + + 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_movepackage, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_movepackage, 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 + + + +class _UniffiConverterTypeMovePackage: + + @staticmethod + def lift(value: int): + return MovePackage._make_instance_(value) + + @staticmethod + def check_lower(value: MovePackage): + if not isinstance(value, MovePackage): + raise TypeError("Expected MovePackage instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: MovePackageProtocol): + if not isinstance(value, MovePackage): + raise TypeError("Expected MovePackage 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: MovePackageProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class MultisigAggregatedSignatureProtocol(typing.Protocol): + """ + Aggregated signature from members of a multisig committee. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + multisig-aggregated-signature = (vector multisig-member-signature) u16 ; bitmap multisig-committee ``` @@ -22127,13 +23828,60 @@ def read(cls, buf: _UniffiRustBuffer): def write(cls, value: PasskeyAuthenticatorProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class ProgrammableTransactionProtocol(typing.Protocol): - pass + """ + A user transaction + + Contains a series of native commands and move calls where the results of one + command can be used in future commands. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + ptb = (vector input) (vector command) + ``` + """ + + def commands(self, ): + """ + The commands to be executed sequentially. A failure in any command will + result in the failure of the entire transaction. + """ + + raise NotImplementedError + def inputs(self, ): + """ + Input objects or primitive values + """ + + raise NotImplementedError # ProgrammableTransaction is a Rust-only trait - it's a wrapper around a Rust implementation. class ProgrammableTransaction(): + """ + A user transaction + + Contains a series of native commands and move calls where the results of one + command can be used in future commands. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + ptb = (vector input) (vector command) + ``` + """ + _pointer: ctypes.c_void_p - - def __init__(self, *args, **kwargs): - raise ValueError("This class has no default constructor") + def __init__(self, inputs: "typing.List[Input]",commands: "typing.List[Command]"): + _UniffiConverterSequenceTypeInput.check_lower(inputs) + + _UniffiConverterSequenceTypeCommand.check_lower(commands) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_programmabletransaction_new, + _UniffiConverterSequenceTypeInput.lower(inputs), + _UniffiConverterSequenceTypeCommand.lower(commands)) def __del__(self): # In case of partial initialization of instances. @@ -22154,6 +23902,33 @@ def _make_instance_(cls, pointer): return inst + def commands(self, ) -> "typing.List[Command]": + """ + The commands to be executed sequentially. A failure in any command will + result in the failure of the entire transaction. + """ + + return _UniffiConverterSequenceTypeCommand.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_commands,self._uniffi_clone_pointer(),) + ) + + + + + + def inputs(self, ) -> "typing.List[Input]": + """ + Input objects or primitive values + """ + + return _UniffiConverterSequenceTypeInput.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_programmabletransaction_inputs,self._uniffi_clone_pointer(),) + ) + + + + + class _UniffiConverterTypeProgrammableTransaction: @@ -22182,6 +23957,130 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: ProgrammableTransactionProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class PublishProtocol(typing.Protocol): + """ + Command to publish a new move package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + publish = (vector bytes) ; the serialized move modules + (vector object-id) ; the set of package dependencies + ``` + """ + + def dependencies(self, ): + """ + Set of packages that the to-be published package depends on + """ + + raise NotImplementedError + def modules(self, ): + """ + The serialized move modules + """ + + raise NotImplementedError +# Publish is a Rust-only trait - it's a wrapper around a Rust implementation. +class Publish(): + """ + Command to publish a new move package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + publish = (vector bytes) ; the serialized move modules + (vector object-id) ; the set of package dependencies + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, modules: "typing.List[bytes]",dependencies: "typing.List[ObjectId]"): + _UniffiConverterSequenceBytes.check_lower(modules) + + _UniffiConverterSequenceTypeObjectId.check_lower(dependencies) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_publish_new, + _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_publish, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_publish, 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]": + """ + Set of packages that the to-be published package depends on + """ + + return _UniffiConverterSequenceTypeObjectId.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_publish_dependencies,self._uniffi_clone_pointer(),) + ) + + + + + + def modules(self, ) -> "typing.List[bytes]": + """ + The serialized move modules + """ + + return _UniffiConverterSequenceBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_publish_modules,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypePublish: + + @staticmethod + def lift(value: int): + return Publish._make_instance_(value) + + @staticmethod + def check_lower(value: Publish): + if not isinstance(value, Publish): + raise TypeError("Expected Publish instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: PublishProtocol): + if not isinstance(value, Publish): + raise TypeError("Expected Publish 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: PublishProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class RandomnessStateUpdateProtocol(typing.Protocol): pass # RandomnessStateUpdate is a Rust-only trait - it's a wrapper around a Rust implementation. @@ -22922,36 +24821,158 @@ def secp256r1_pub_key(self, ) -> "Secp256r1PublicKey": - def secp256r1_pub_key_opt(self, ) -> "typing.Optional[Secp256r1PublicKey]": - return _UniffiConverterOptionalTypeSecp256r1PublicKey.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt,self._uniffi_clone_pointer(),) - ) + def secp256r1_pub_key_opt(self, ) -> "typing.Optional[Secp256r1PublicKey]": + return _UniffiConverterOptionalTypeSecp256r1PublicKey.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt,self._uniffi_clone_pointer(),) + ) + + + + + + def secp256r1_sig(self, ) -> "Secp256r1Signature": + return _UniffiConverterTypeSecp256r1Signature.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig,self._uniffi_clone_pointer(),) + ) + + + + + + def secp256r1_sig_opt(self, ) -> "typing.Optional[Secp256r1Signature]": + return _UniffiConverterOptionalTypeSecp256r1Signature.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt,self._uniffi_clone_pointer(),) + ) + + + + + + def to_bytes(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeSimpleSignature: + + @staticmethod + def lift(value: int): + return SimpleSignature._make_instance_(value) + + @staticmethod + def check_lower(value: SimpleSignature): + if not isinstance(value, SimpleSignature): + raise TypeError("Expected SimpleSignature instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: SimpleSignatureProtocol): + if not isinstance(value, SimpleSignature): + raise TypeError("Expected SimpleSignature 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: SimpleSignatureProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class SplitCoinsProtocol(typing.Protocol): + """ + Command to split a single coin object into multiple coins + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + split-coins = argument (vector argument) + ``` + """ + + def amounts(self, ): + """ + The amounts to split off + """ + + raise NotImplementedError + def coin(self, ): + """ + The coin to split + """ + + raise NotImplementedError +# SplitCoins is a Rust-only trait - it's a wrapper around a Rust implementation. +class SplitCoins(): + """ + Command to split a single coin object into multiple coins + # BCS + The BCS serialized form for this type is defined by the following ABNF: + ```text + split-coins = argument (vector argument) + ``` + """ + _pointer: ctypes.c_void_p + def __init__(self, coin: "Argument",amounts: "typing.List[Argument]"): + _UniffiConverterTypeArgument.check_lower(coin) + + _UniffiConverterSequenceTypeArgument.check_lower(amounts) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_splitcoins_new, + _UniffiConverterTypeArgument.lower(coin), + _UniffiConverterSequenceTypeArgument.lower(amounts)) - def secp256r1_sig(self, ) -> "Secp256r1Signature": - return _UniffiConverterTypeSecp256r1Signature.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig,self._uniffi_clone_pointer(),) - ) + 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_splitcoins, pointer) + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_splitcoins, 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 amounts(self, ) -> "typing.List[Argument]": + """ + The amounts to split off + """ - def secp256r1_sig_opt(self, ) -> "typing.Optional[Secp256r1Signature]": - return _UniffiConverterOptionalTypeSecp256r1Signature.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt,self._uniffi_clone_pointer(),) + return _UniffiConverterSequenceTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_splitcoins_amounts,self._uniffi_clone_pointer(),) ) - def to_bytes(self, ) -> "bytes": - return _UniffiConverterBytes.lift( - _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes,self._uniffi_clone_pointer(),) + def coin(self, ) -> "Argument": + """ + The coin to split + """ + + return _UniffiConverterTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_splitcoins_coin,self._uniffi_clone_pointer(),) ) @@ -22959,21 +24980,21 @@ def to_bytes(self, ) -> "bytes": -class _UniffiConverterTypeSimpleSignature: +class _UniffiConverterTypeSplitCoins: @staticmethod def lift(value: int): - return SimpleSignature._make_instance_(value) + return SplitCoins._make_instance_(value) @staticmethod - def check_lower(value: SimpleSignature): - if not isinstance(value, SimpleSignature): - raise TypeError("Expected SimpleSignature instance, {} found".format(type(value).__name__)) + def check_lower(value: SplitCoins): + if not isinstance(value, SplitCoins): + raise TypeError("Expected SplitCoins instance, {} found".format(type(value).__name__)) @staticmethod - def lower(value: SimpleSignatureProtocol): - if not isinstance(value, SimpleSignature): - raise TypeError("Expected SimpleSignature instance, {} found".format(type(value).__name__)) + def lower(value: SplitCoinsProtocol): + if not isinstance(value, SplitCoins): + raise TypeError("Expected SplitCoins instance, {} found".format(type(value).__name__)) return value._uniffi_clone_pointer() @classmethod @@ -22984,7 +25005,7 @@ def read(cls, buf: _UniffiRustBuffer): return cls.lift(ptr) @classmethod - def write(cls, value: SimpleSignatureProtocol, buf: _UniffiRustBuffer): + def write(cls, value: SplitCoinsProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class StructTagProtocol(typing.Protocol): """ @@ -23829,6 +25850,128 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: TransactionKindProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class TransferObjectsProtocol(typing.Protocol): + """ + Command to transfer ownership of a set of objects to an address + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + transfer-objects = (vector argument) argument + ``` + """ + + def address(self, ): + """ + The address to transfer ownership to + """ + + raise NotImplementedError + def objects(self, ): + """ + Set of objects to transfer + """ + + raise NotImplementedError +# TransferObjects is a Rust-only trait - it's a wrapper around a Rust implementation. +class TransferObjects(): + """ + Command to transfer ownership of a set of objects to an address + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + transfer-objects = (vector argument) argument + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, objects: "typing.List[Argument]",address: "Argument"): + _UniffiConverterSequenceTypeArgument.check_lower(objects) + + _UniffiConverterTypeArgument.check_lower(address) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transferobjects_new, + _UniffiConverterSequenceTypeArgument.lower(objects), + _UniffiConverterTypeArgument.lower(address)) + + 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_transferobjects, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transferobjects, 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 address(self, ) -> "Argument": + """ + The address to transfer ownership to + """ + + return _UniffiConverterTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transferobjects_address,self._uniffi_clone_pointer(),) + ) + + + + + + def objects(self, ) -> "typing.List[Argument]": + """ + Set of objects to transfer + """ + + return _UniffiConverterSequenceTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transferobjects_objects,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeTransferObjects: + + @staticmethod + def lift(value: int): + return TransferObjects._make_instance_(value) + + @staticmethod + def check_lower(value: TransferObjects): + if not isinstance(value, TransferObjects): + raise TypeError("Expected TransferObjects instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransferObjectsProtocol): + if not isinstance(value, TransferObjects): + raise TypeError("Expected TransferObjects 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: TransferObjectsProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class TypeTagProtocol(typing.Protocol): """ Type of a move value @@ -24189,6 +26332,178 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: TypeTagProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class UpgradeProtocol(typing.Protocol): + """ + Command to upgrade an already published package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + upgrade = (vector bytes) ; move modules + (vector object-id) ; dependencies + object-id ; package-id of the package + argument ; upgrade ticket + ``` + """ + + def dependencies(self, ): + """ + Set of packages that the to-be published package depends on + """ + + raise NotImplementedError + def modules(self, ): + """ + The serialized move modules + """ + + raise NotImplementedError + def package(self, ): + """ + Package id of the package to upgrade + """ + + raise NotImplementedError + def ticket(self, ): + """ + Ticket authorizing the upgrade + """ + + raise NotImplementedError +# Upgrade is a Rust-only trait - it's a wrapper around a Rust implementation. +class Upgrade(): + """ + Command to upgrade an already published package + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + upgrade = (vector bytes) ; move modules + (vector object-id) ; dependencies + object-id ; package-id of the package + argument ; upgrade ticket + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, modules: "typing.List[bytes]",dependencies: "typing.List[ObjectId]",package: "ObjectId",ticket: "Argument"): + _UniffiConverterSequenceBytes.check_lower(modules) + + _UniffiConverterSequenceTypeObjectId.check_lower(dependencies) + + _UniffiConverterTypeObjectId.check_lower(package) + + _UniffiConverterTypeArgument.check_lower(ticket) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_upgrade_new, + _UniffiConverterSequenceBytes.lower(modules), + _UniffiConverterSequenceTypeObjectId.lower(dependencies), + _UniffiConverterTypeObjectId.lower(package), + _UniffiConverterTypeArgument.lower(ticket)) + + 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_upgrade, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_upgrade, 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]": + """ + Set of packages that the to-be published package depends on + """ + + return _UniffiConverterSequenceTypeObjectId.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_dependencies,self._uniffi_clone_pointer(),) + ) + + + + + + def modules(self, ) -> "typing.List[bytes]": + """ + The serialized move modules + """ + + return _UniffiConverterSequenceBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_modules,self._uniffi_clone_pointer(),) + ) + + + + + + def package(self, ) -> "ObjectId": + """ + Package id of the package to upgrade + """ + + return _UniffiConverterTypeObjectId.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_package,self._uniffi_clone_pointer(),) + ) + + + + + + def ticket(self, ) -> "Argument": + """ + Ticket authorizing the upgrade + """ + + return _UniffiConverterTypeArgument.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_upgrade_ticket,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeUpgrade: + + @staticmethod + def lift(value: int): + return Upgrade._make_instance_(value) + + @staticmethod + def check_lower(value: Upgrade): + if not isinstance(value, Upgrade): + raise TypeError("Expected Upgrade instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: UpgradeProtocol): + if not isinstance(value, Upgrade): + raise TypeError("Expected Upgrade 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: UpgradeProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class UserSignatureProtocol(typing.Protocol): """ A signature from a user @@ -25226,6 +27541,7 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "ValidatorSet", "ZkLoginClaim", "Address", + "Argument", "AuthenticatorStateExpire", "AuthenticatorStateUpdateV1", "BatchSendStatus", @@ -25240,6 +27556,7 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "CircomG1", "CircomG2", "Coin", + "Command", "ConsensusCommitDigest", "ConsensusCommitPrologueV1", "Digest", @@ -25254,6 +27571,10 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "GenesisTransaction", "GraphQlClient", "Identifier", + "Input", + "MakeMoveVector", + "MergeCoins", + "MoveCall", "MovePackage", "MultisigAggregatedSignature", "MultisigCommittee", @@ -25268,12 +27589,14 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "Owner", "PasskeyAuthenticator", "ProgrammableTransaction", + "Publish", "RandomnessStateUpdate", "Secp256k1PublicKey", "Secp256k1Signature", "Secp256r1PublicKey", "Secp256r1Signature", "SimpleSignature", + "SplitCoins", "StructTag", "Transaction", "TransactionDigest", @@ -25281,7 +27604,9 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "TransactionEffectsDigest", "TransactionEventsDigest", "TransactionKind", + "TransferObjects", "TypeTag", + "Upgrade", "UserSignature", "ZkLoginAuthenticator", "ZkLoginInputs", diff --git a/crates/iota-sdk-ffi/src/types/transaction/mod.rs b/crates/iota-sdk-ffi/src/types/transaction/mod.rs index 4199a9984..24698e5d4 100644 --- a/crates/iota-sdk-ffi/src/types/transaction/mod.rs +++ b/crates/iota-sdk-ffi/src/types/transaction/mod.rs @@ -9,9 +9,11 @@ use crate::types::{ address::Address, digest::{CheckpointDigest, TransactionDigest, TransactionEventsDigest}, execution_status::ExecutionStatus, - object::ObjectReference, + object::{ObjectId, ObjectReference}, signature::UserSignature, + struct_tag::Identifier, transaction::v1::TransactionEffectsV1, + type_tag::TypeTag, }; pub mod v1; @@ -156,9 +158,457 @@ impl TransactionKind { } } +/// A user transaction +/// +/// Contains a series of native commands and move calls where the results of one +/// command can be used in future commands. +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// ptb = (vector input) (vector command) +/// ``` #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ProgrammableTransaction(pub iota_types::ProgrammableTransaction); +#[uniffi::export] +impl ProgrammableTransaction { + #[uniffi::constructor] + pub fn new(inputs: Vec>, commands: Vec>) -> Self { + Self(iota_types::ProgrammableTransaction { + inputs: inputs + .iter() + .cloned() + .map(|input| input.0.clone()) + .collect(), + commands: commands + .iter() + .cloned() + .map(|command| command.0.clone()) + .collect(), + }) + } + + /// Input objects or primitive values + pub fn inputs(&self) -> Vec> { + self.0 + .inputs + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } + + /// The commands to be executed sequentially. A failure in any command will + /// result in the failure of the entire transaction. + pub fn commands(&self) -> Vec> { + self.0 + .commands + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + +/// An input to a user transaction +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// input = input-pure / input-immutable-or-owned / input-shared / input-receiving +/// +/// input-pure = %x00 bytes +/// input-immutable-or-owned = %x01 object-ref +/// input-shared = %x02 object-id u64 bool +/// input-receiving = %x04 object-ref +/// ``` +#[derive(Clone, Debug, derive_more::From, uniffi::Object)] +pub struct Input(pub iota_types::Input); + +#[uniffi::export] +impl Input { + /// For normal operations this is required to be a move primitive type and + /// not contain structs or objects. + #[uniffi::constructor] + pub fn new_pure(value: Vec) -> Self { + Self(iota_types::Input::Pure { value }) + } + + /// A move object that is either immutable or address owned + #[uniffi::constructor] + pub fn new_immutable_or_owned(object_ref: ObjectReference) -> Self { + Self(iota_types::Input::ImmutableOrOwned(object_ref.into())) + } + + /// A move object whose owner is "Shared" + #[uniffi::constructor] + pub fn new_shared(object_id: &ObjectId, initial_shared_version: u64, mutable: bool) -> Self { + Self(iota_types::Input::Shared { + object_id: object_id.0, + initial_shared_version, + mutable, + }) + } + + #[uniffi::constructor] + pub fn new_receiving(object_ref: ObjectReference) -> Self { + Self(iota_types::Input::Receiving(object_ref.into())) + } +} + +/// A single command in a programmable transaction. +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// command = command-move-call +/// =/ command-transfer-objects +/// =/ command-split-coins +/// =/ command-merge-coins +/// =/ command-publish +/// =/ command-make-move-vector +/// =/ command-upgrade +/// +/// command-move-call = %x00 move-call +/// command-transfer-objects = %x01 transfer-objects +/// command-split-coins = %x02 split-coins +/// command-merge-coins = %x03 merge-coins +/// command-publish = %x04 publish +/// command-make-move-vector = %x05 make-move-vector +/// command-upgrade = %x06 upgrade +/// ``` +#[derive(Clone, Debug, derive_more::From, uniffi::Object)] +pub struct Command(pub iota_types::Command); + +#[uniffi::export] +impl Command { + /// A call to either an entry or a public Move function + #[uniffi::constructor] + pub fn new_move_call(move_call: &MoveCall) -> Self { + Self(iota_types::Command::MoveCall(move_call.0.clone())) + } + + /// It sends n-objects to the specified address. These objects must have + /// store (public transfer) and either the previous owner must be an + /// address or the object must be newly created. + #[uniffi::constructor] + pub fn new_transfer_objects(transfer_objects: &TransferObjects) -> Self { + Self(iota_types::Command::TransferObjects( + transfer_objects.0.clone(), + )) + } + + /// It splits off some amounts into a new coins with those amounts + #[uniffi::constructor] + pub fn new_split_coins(split_coins: &SplitCoins) -> Self { + Self(iota_types::Command::SplitCoins(split_coins.0.clone())) + } + + /// It merges n-coins into the first coin + #[uniffi::constructor] + pub fn new_merge_coins(merge_coins: &MergeCoins) -> Self { + Self(iota_types::Command::MergeCoins(merge_coins.0.clone())) + } + + /// Publishes a Move package. It takes the package bytes and a list of the + /// package's transitive dependencies to link against on-chain. + #[uniffi::constructor] + pub fn new_publish(publish: &Publish) -> Self { + Self(iota_types::Command::Publish(publish.0.clone())) + } + + /// Given n-values of the same type, it constructs a vector. For non objects + /// or an empty vector, the type tag must be specified. + #[uniffi::constructor] + pub fn new_make_move_vector(make_move_vector: &MakeMoveVector) -> Self { + Self(iota_types::Command::MakeMoveVector( + make_move_vector.0.clone(), + )) + } + + /// Upgrades a Move package + /// Takes (in order): + /// 1. A vector of serialized modules for the package. + /// 2. A vector of object ids for the transitive dependencies of the new + /// package. + /// 3. The object ID of the package being upgraded. + /// 4. An argument holding the `UpgradeTicket` that must have been produced + /// from an earlier command in the same programmable transaction. + #[uniffi::constructor] + pub fn new_upgrade(upgrade: &Upgrade) -> Self { + Self(iota_types::Command::Upgrade(upgrade.0.clone())) + } +} + +/// Command to transfer ownership of a set of objects to an address +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// transfer-objects = (vector argument) argument +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct TransferObjects(pub iota_types::TransferObjects); + +#[uniffi::export] +impl TransferObjects { + #[uniffi::constructor] + pub fn new(objects: Vec>, address: Arc) -> Self { + Self(iota_types::TransferObjects { + objects: objects.iter().map(|argument| argument.0).collect(), + address: address.0, + }) + } + + /// Set of objects to transfer + pub fn objects(&self) -> Vec> { + self.0 + .objects + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } + + /// The address to transfer ownership to + pub fn address(&self) -> Argument { + self.0.address.into() + } +} + +/// Command to split a single coin object into multiple coins +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// split-coins = argument (vector argument) +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct SplitCoins(pub iota_types::SplitCoins); + +#[uniffi::export] +impl SplitCoins { + #[uniffi::constructor] + pub fn new(coin: &Argument, amounts: Vec>) -> Self { + Self(iota_types::SplitCoins { + coin: coin.0, + amounts: amounts.iter().map(|amount| amount.0).collect(), + }) + } + + /// The coin to split + pub fn coin(&self) -> Argument { + self.0.coin.into() + } + + /// The amounts to split off + pub fn amounts(&self) -> Vec> { + self.0 + .amounts + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + +/// Command to merge multiple coins of the same type into a single coin +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// merge-coins = argument (vector argument) +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct MergeCoins(pub iota_types::MergeCoins); + +#[uniffi::export] +impl MergeCoins { + #[uniffi::constructor] + pub fn new(coin: &Argument, coins_to_merge: Vec>) -> Self { + Self(iota_types::MergeCoins { + coin: coin.0, + coins_to_merge: coins_to_merge.iter().map(|coin| coin.0).collect(), + }) + } + + /// Coin to merge coins into + pub fn coin(&self) -> Argument { + self.0.coin.into() + } + + /// Set of coins to merge into `coin` + /// + /// All listed coins must be of the same type and be the same type as `coin` + pub fn coins_to_merge(&self) -> Vec> { + self.0 + .coins_to_merge + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + +/// Command to publish a new move package +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// publish = (vector bytes) ; the serialized move modules +/// (vector object-id) ; the set of package dependencies +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct Publish(pub iota_types::Publish); + +#[uniffi::export] +impl Publish { + #[uniffi::constructor] + pub fn new(modules: Vec>, dependencies: Vec>) -> Self { + Self(iota_types::Publish { + modules, + dependencies: dependencies.iter().map(|object_id| object_id.0).collect(), + }) + } + + /// The serialized move modules + pub fn modules(&self) -> Vec> { + self.0.modules.clone() + } + + /// Set of packages that the to-be published package depends on + pub fn dependencies(&self) -> Vec> { + self.0 + .dependencies + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + +/// Command to build a move vector out of a set of individual elements +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// make-move-vector = (option type-tag) (vector argument) +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct MakeMoveVector(pub iota_types::MakeMoveVector); + +#[uniffi::export] +impl MakeMoveVector { + #[uniffi::constructor] + pub fn new(type_tag: Option>, elements: Vec>) -> Self { + Self(iota_types::MakeMoveVector { + type_: type_tag.map(|type_tag| type_tag.0.clone()), + elements: elements.iter().map(|element| element.0).collect(), + }) + } + + /// Type of the individual elements + /// + /// This is required to be set when the type can't be inferred, for example + /// when the set of provided arguments are all pure input values. + pub fn type_tag(&self) -> Option> { + self.0.type_.clone().map(Into::into).map(Arc::new) + } + + /// The set individual elements to build the vector with + pub fn elements(&self) -> Vec> { + self.0 + .elements + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +} + +/// Command to upgrade an already published package +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// upgrade = (vector bytes) ; move modules +/// (vector object-id) ; dependencies +/// object-id ; package-id of the package +/// argument ; upgrade ticket +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct Upgrade(pub iota_types::Upgrade); + +#[uniffi::export] +impl Upgrade { + #[uniffi::constructor] + pub fn new( + modules: Vec>, + dependencies: Vec>, + package: Arc, + ticket: Arc, + ) -> Self { + Self(iota_types::Upgrade { + modules, + dependencies: dependencies.iter().map(|dependency| dependency.0).collect(), + package: package.0, + ticket: ticket.0, + }) + } + + /// The serialized move modules + pub fn modules(&self) -> Vec> { + self.0.modules.clone() + } + + /// Set of packages that the to-be published package depends on + pub fn dependencies(&self) -> Vec> { + self.0 + .dependencies + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } + + /// Package id of the package to upgrade + pub fn package(&self) -> ObjectId { + self.0.package.into() + } + + /// Ticket authorizing the upgrade + pub fn ticket(&self) -> Argument { + self.0.ticket.into() + } +} + #[derive(Clone, Debug, derive_more::From, uniffi::Object)] pub struct ConsensusCommitPrologueV1(pub iota_types::ConsensusCommitPrologueV1); @@ -305,3 +755,148 @@ pub enum TransactionExpiration { None, Epoch(u64), } + +/// An argument to a programmable transaction command +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// argument = argument-gas +/// =/ argument-input +/// =/ argument-result +/// =/ argument-nested-result +/// +/// argument-gas = %x00 +/// argument-input = %x01 u16 +/// argument-result = %x02 u16 +/// argument-nested-result = %x03 u16 u16 +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct Argument(iota_types::Argument); + +#[uniffi::export] +impl Argument { + /// The gas coin. The gas coin can only be used by-ref, except for with + /// `TransferObjects`, which can use it by-value. + #[uniffi::constructor] + pub fn new_gas() -> Self { + Self(iota_types::Argument::Gas) + } + + /// One of the input objects or primitive values (from + /// `ProgrammableTransaction` inputs) + #[uniffi::constructor] + pub fn new_input(input: u16) -> Self { + Self(iota_types::Argument::Input(input)) + } + + /// The result of another command (from `ProgrammableTransaction` commands) + #[uniffi::constructor] + pub fn new_result(result: u16) -> Self { + Self(iota_types::Argument::Result(result)) + } + + /// Like a `Result` but it accesses a nested result. Currently, the only + /// usage of this is to access a value from a Move call with multiple + /// return values. + // (command index, subresult index) + #[uniffi::constructor] + pub fn new_nested_result(command_index: u16, subresult_index: u16) -> Self { + Self(iota_types::Argument::NestedResult( + command_index, + subresult_index, + )) + } + + /// Turn a Result into a NestedResult. If the argument is not a Result, + /// returns None. + pub fn nested(&self, ix: u16) -> Option> { + self.0.nested(ix).map(Self).map(Arc::new) + } +} + +/// Command to call a move function +/// +/// Functions that can be called by a `MoveCall` command are those that have a +/// function signature that is either `entry` or `public` (which don't have a +/// reference return type). +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// move-call = object-id ; package id +/// identifier ; module name +/// identifier ; function name +/// (vector type-tag) ; type arguments, if any +/// (vector argument) ; input arguments +/// ``` +#[derive(Clone, Debug, PartialEq, Eq, derive_more::From, uniffi::Object)] +pub struct MoveCall(iota_types::MoveCall); + +#[uniffi::export] +impl MoveCall { + #[uniffi::constructor] + pub fn new( + package: &ObjectId, + module: &Identifier, + function: &Identifier, + type_arguments: Vec>, + arguments: Vec>, + ) -> Self { + Self(iota_types::MoveCall { + package: package.0, + module: module.0.clone(), + function: function.0.clone(), + type_arguments: type_arguments + .iter() + .map(|type_argument| type_argument.0.clone()) + .collect(), + arguments: arguments + .iter() + .cloned() + .map(|argument| argument.0) + .collect(), + }) + } + + /// The package containing the module and function. + pub fn package(&self) -> ObjectId { + self.0.package.into() + } + + /// The specific module in the package containing the function. + pub fn module(&self) -> Identifier { + self.0.module.clone().into() + } + + /// The function to be called. + pub fn function(&self) -> Identifier { + self.0.function.clone().into() + } + + /// The type arguments to the function. + pub fn type_arguments(&self) -> Vec> { + self.0 + .type_arguments + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } + + /// The arguments to the function. + pub fn arguments(&self) -> Vec> { + self.0 + .arguments + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } +}