diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index d2beab125..816458c04 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -521,6 +521,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs() + }) + if checksum != 591 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs() + }) + if checksum != 11338 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_from_bcs() }) @@ -1043,6 +1061,78 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs() + }) + if checksum != 10273 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs() + }) + if checksum != 28969 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs() + }) + if checksum != 7849 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs() + }) + if checksum != 52773 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs() + }) + if checksum != 17714 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs() + }) + if checksum != 38028 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs() + }) + if checksum != 21810 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs() + }) + if checksum != 57592 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_func_id_operation_from_bcs() }) @@ -1673,6 +1763,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_string_from_bcs() + }) + if checksum != 53853 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_string_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_string_to_bcs() + }) + if checksum != 54804 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_string_to_bcs: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_func_struct_tag_from_bcs() }) @@ -1907,6 +2015,78 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs() + }) + if checksum != 3653 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs() + }) + if checksum != 13254 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs() + }) + if checksum != 335 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs() + }) + if checksum != 36384 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs() + }) + if checksum != 63829 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs() + }) + if checksum != 2947 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs() + }) + if checksum != 34764 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs() + }) + if checksum != 59020 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_from_bcs() }) @@ -9008,6 +9188,30 @@ type FfiDestroyerUint8 struct {} func (FfiDestroyerUint8) Destroy(_ uint8) {} +type FfiConverterInt8 struct{} + +var FfiConverterInt8INSTANCE = FfiConverterInt8{} + +func (FfiConverterInt8) Lower(value int8) C.int8_t { + return C.int8_t(value) +} + +func (FfiConverterInt8) Write(writer io.Writer, value int8) { + writeInt8(writer, value) +} + +func (FfiConverterInt8) Lift(value C.int8_t) int8 { + return int8(value) +} + +func (FfiConverterInt8) Read(reader io.Reader) int8 { + return readInt8(reader) +} + +type FfiDestroyerInt8 struct {} + +func (FfiDestroyerInt8) Destroy(_ int8) {} + type FfiConverterUint16 struct{} var FfiConverterUint16INSTANCE = FfiConverterUint16{} @@ -9032,6 +9236,30 @@ type FfiDestroyerUint16 struct {} func (FfiDestroyerUint16) Destroy(_ uint16) {} +type FfiConverterInt16 struct{} + +var FfiConverterInt16INSTANCE = FfiConverterInt16{} + +func (FfiConverterInt16) Lower(value int16) C.int16_t { + return C.int16_t(value) +} + +func (FfiConverterInt16) Write(writer io.Writer, value int16) { + writeInt16(writer, value) +} + +func (FfiConverterInt16) Lift(value C.int16_t) int16 { + return int16(value) +} + +func (FfiConverterInt16) Read(reader io.Reader) int16 { + return readInt16(reader) +} + +type FfiDestroyerInt16 struct {} + +func (FfiDestroyerInt16) Destroy(_ int16) {} + type FfiConverterUint32 struct{} var FfiConverterUint32INSTANCE = FfiConverterUint32{} @@ -39789,6 +40017,34 @@ func Bn254FieldElementToBcs(data *Bn254FieldElement) ([]byte, error) { } } +// Create a bool from BCS encoded bytes. +func BoolFromBcs(input []byte) (bool, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_func_bool_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue bool + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBoolINSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this bool to BCS encoded bytes. +func BoolToBcs(input bool) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_bool_to_bcs(FfiConverterBoolINSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + // Create this type from BCS encoded bytes. func CancelledTransactionFromBcs(bcs []byte) (*CancelledTransaction, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { @@ -40611,6 +40867,118 @@ func HexEncode(input []byte) string { })) } +// Create a i16 from BCS encoded bytes. +func I16FromBcs(input []byte) (int16, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.int16_t { + return C.uniffi_iota_sdk_ffi_fn_func_i16_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue int16 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterInt16INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this i16 to BCS encoded bytes. +func I16ToBcs(input int16) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_i16_to_bcs(FfiConverterInt16INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + +// Create a i32 from BCS encoded bytes. +func I32FromBcs(input []byte) (int32, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.int32_t { + return C.uniffi_iota_sdk_ffi_fn_func_i32_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue int32 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterInt32INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this i32 to BCS encoded bytes. +func I32ToBcs(input int32) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_i32_to_bcs(FfiConverterInt32INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + +// Create a i64 from BCS encoded bytes. +func I64FromBcs(input []byte) (int64, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.int64_t { + return C.uniffi_iota_sdk_ffi_fn_func_i64_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue int64 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterInt64INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this i64 to BCS encoded bytes. +func I64ToBcs(input int64) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_i64_to_bcs(FfiConverterInt64INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + +// Create a i8 from BCS encoded bytes. +func I8FromBcs(input []byte) (int8, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_func_i8_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue int8 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterInt8INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this i8 to BCS encoded bytes. +func I8ToBcs(input int8) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_i8_to_bcs(FfiConverterInt8INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + // Create this type from BCS encoded bytes. func IdOperationFromBcs(bcs []byte) (IdOperation, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { @@ -41613,6 +41981,36 @@ func SplitCoinsToBcs(data *SplitCoins) ([]byte, error) { } } +// Create a String from BCS encoded bytes. +func StringFromBcs(input []byte) (string, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_string_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue string + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterStringINSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this String to BCS encoded bytes. +func StringToBcs(input string) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_string_to_bcs(FfiConverterStringINSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + // Create this type from BCS encoded bytes. func StructTagFromBcs(bcs []byte) (*StructTag, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { @@ -41985,6 +42383,118 @@ func TypeTagToBcs(data *TypeTag) ([]byte, error) { } } +// Create a u16 from BCS encoded bytes. +func U16FromBcs(input []byte) (uint16, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_fn_func_u16_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue uint16 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterUint16INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this u16 to BCS encoded bytes. +func U16ToBcs(input uint16) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_u16_to_bcs(FfiConverterUint16INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + +// Create a u32 from BCS encoded bytes. +func U32FromBcs(input []byte) (uint32, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.uint32_t { + return C.uniffi_iota_sdk_ffi_fn_func_u32_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue uint32 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterUint32INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this u32 to BCS encoded bytes. +func U32ToBcs(input uint32) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_u32_to_bcs(FfiConverterUint32INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + +// Create a u64 from BCS encoded bytes. +func U64FromBcs(input []byte) (uint64, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_func_u64_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue uint64 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterUint64INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this u64 to BCS encoded bytes. +func U64ToBcs(input uint64) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_u64_to_bcs(FfiConverterUint64INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + +// Create a u8 from BCS encoded bytes. +func U8FromBcs(input []byte) (uint8, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) C.uint8_t { + return C.uniffi_iota_sdk_ffi_fn_func_u8_from_bcs(FfiConverterBytesINSTANCE.Lower(input),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue uint8 + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterUint8INSTANCE.Lift(_uniffiRV), nil + } +} + +// Convert this u8 to BCS encoded bytes. +func U8ToBcs(input uint8) ([]byte, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_func_u8_to_bcs(FfiConverterUint8INSTANCE.Lower(input),_uniffiStatus), + } + }) + if _uniffiErr != nil { + var _uniffiDefaultValue []byte + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBytesINSTANCE.Lift(_uniffiRV), nil + } +} + // Create this type from BCS encoded bytes. func UnchangedSharedKindFromBcs(bcs []byte) (UnchangedSharedKind, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) RustBufferI { diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index 02c0aa14f..8fce6247e 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -5384,6 +5384,16 @@ void* uniffi_iota_sdk_ffi_fn_func_bn254_field_element_from_bcs(RustBuffer bcs, R RustBuffer uniffi_iota_sdk_ffi_fn_func_bn254_field_element_to_bcs(void* data, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_BOOL_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_BOOL_FROM_BCS +int8_t uniffi_iota_sdk_ffi_fn_func_bool_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_BOOL_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_BOOL_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_bool_to_bcs(int8_t input, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_CANCELLED_TRANSACTION_FROM_BCS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_CANCELLED_TRANSACTION_FROM_BCS void* uniffi_iota_sdk_ffi_fn_func_cancelled_transaction_from_bcs(RustBuffer bcs, RustCallStatus *out_status @@ -5674,6 +5684,46 @@ RustBuffer uniffi_iota_sdk_ffi_fn_func_hex_decode(RustBuffer input, RustCallStat RustBuffer uniffi_iota_sdk_ffi_fn_func_hex_encode(RustBuffer input, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I16_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I16_FROM_BCS +int16_t uniffi_iota_sdk_ffi_fn_func_i16_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I16_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I16_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_i16_to_bcs(int16_t input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I32_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I32_FROM_BCS +int32_t uniffi_iota_sdk_ffi_fn_func_i32_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I32_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I32_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_i32_to_bcs(int32_t input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I64_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I64_FROM_BCS +int64_t uniffi_iota_sdk_ffi_fn_func_i64_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I64_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I64_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_i64_to_bcs(int64_t input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I8_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I8_FROM_BCS +int8_t uniffi_iota_sdk_ffi_fn_func_i8_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I8_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_I8_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_i8_to_bcs(int8_t input, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_ID_OPERATION_FROM_BCS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_ID_OPERATION_FROM_BCS RustBuffer uniffi_iota_sdk_ffi_fn_func_id_operation_from_bcs(RustBuffer bcs, RustCallStatus *out_status @@ -6024,6 +6074,16 @@ void* uniffi_iota_sdk_ffi_fn_func_split_coins_from_bcs(RustBuffer bcs, RustCallS RustBuffer uniffi_iota_sdk_ffi_fn_func_split_coins_to_bcs(void* data, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_STRING_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_STRING_FROM_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_string_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_STRING_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_STRING_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_string_to_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_STRUCT_TAG_FROM_BCS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_STRUCT_TAG_FROM_BCS void* uniffi_iota_sdk_ffi_fn_func_struct_tag_from_bcs(RustBuffer bcs, RustCallStatus *out_status @@ -6154,6 +6214,46 @@ void* uniffi_iota_sdk_ffi_fn_func_type_tag_from_bcs(RustBuffer bcs, RustCallStat RustBuffer uniffi_iota_sdk_ffi_fn_func_type_tag_to_bcs(void* data, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U16_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U16_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_fn_func_u16_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U16_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U16_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_u16_to_bcs(uint16_t input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U32_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U32_FROM_BCS +uint32_t uniffi_iota_sdk_ffi_fn_func_u32_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U32_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U32_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_u32_to_bcs(uint32_t input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U64_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U64_FROM_BCS +uint64_t uniffi_iota_sdk_ffi_fn_func_u64_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U64_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U64_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_u64_to_bcs(uint64_t input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U8_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U8_FROM_BCS +uint8_t uniffi_iota_sdk_ffi_fn_func_u8_from_bcs(RustBuffer input, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U8_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_U8_TO_BCS +RustBuffer uniffi_iota_sdk_ffi_fn_func_u8_to_bcs(uint8_t input, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_UNCHANGED_SHARED_KIND_FROM_BCS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FUNC_UNCHANGED_SHARED_KIND_FROM_BCS RustBuffer uniffi_iota_sdk_ffi_fn_func_unchanged_shared_kind_from_bcs(RustBuffer bcs, RustCallStatus *out_status @@ -6690,6 +6790,18 @@ uint16_t uniffi_iota_sdk_ffi_checksum_func_bn254_field_element_from_bcs(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_BN254_FIELD_ELEMENT_TO_BCS uint16_t uniffi_iota_sdk_ffi_checksum_func_bn254_field_element_to_bcs(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_BOOL_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_BOOL_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_BOOL_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_BOOL_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_CANCELLED_TRANSACTION_FROM_BCS @@ -7038,6 +7150,54 @@ uint16_t uniffi_iota_sdk_ffi_checksum_func_hex_decode(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_HEX_ENCODE uint16_t uniffi_iota_sdk_ffi_checksum_func_hex_encode(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I16_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I16_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I16_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I16_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I32_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I32_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I32_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I32_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I64_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I64_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I64_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I64_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I8_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I8_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I8_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_I8_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_ID_OPERATION_FROM_BCS @@ -7458,6 +7618,18 @@ uint16_t uniffi_iota_sdk_ffi_checksum_func_split_coins_from_bcs(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_SPLIT_COINS_TO_BCS uint16_t uniffi_iota_sdk_ffi_checksum_func_split_coins_to_bcs(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_STRING_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_STRING_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_string_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_STRING_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_STRING_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_string_to_bcs(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_STRUCT_TAG_FROM_BCS @@ -7614,6 +7786,54 @@ uint16_t uniffi_iota_sdk_ffi_checksum_func_type_tag_from_bcs(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_TYPE_TAG_TO_BCS uint16_t uniffi_iota_sdk_ffi_checksum_func_type_tag_to_bcs(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U16_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U16_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U16_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U16_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U32_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U32_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U32_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U32_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U64_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U64_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U64_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U64_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U8_FROM_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U8_FROM_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U8_TO_BCS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_U8_TO_BCS +uint16_t uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_FUNC_UNCHANGED_SHARED_KIND_FROM_BCS diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index b6b9ea4f0..9c1cae999 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -2829,6 +2829,46 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2901,6 +2941,10 @@ fun uniffi_iota_sdk_ffi_checksum_func_bn254_field_element_from_bcs( ): Short fun uniffi_iota_sdk_ffi_checksum_func_bn254_field_element_to_bcs( ): Short +fun uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs( +): Short fun uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_from_bcs( ): Short fun uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_to_bcs( @@ -3017,6 +3061,22 @@ fun uniffi_iota_sdk_ffi_checksum_func_hex_decode( ): Short fun uniffi_iota_sdk_ffi_checksum_func_hex_encode( ): Short +fun uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs( +): Short fun uniffi_iota_sdk_ffi_checksum_func_id_operation_from_bcs( ): Short fun uniffi_iota_sdk_ffi_checksum_func_id_operation_to_bcs( @@ -3157,6 +3217,10 @@ fun uniffi_iota_sdk_ffi_checksum_func_split_coins_from_bcs( ): Short fun uniffi_iota_sdk_ffi_checksum_func_split_coins_to_bcs( ): Short +fun uniffi_iota_sdk_ffi_checksum_func_string_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_string_to_bcs( +): Short fun uniffi_iota_sdk_ffi_checksum_func_struct_tag_from_bcs( ): Short fun uniffi_iota_sdk_ffi_checksum_func_struct_tag_to_bcs( @@ -3209,6 +3273,22 @@ fun uniffi_iota_sdk_ffi_checksum_func_type_tag_from_bcs( ): Short fun uniffi_iota_sdk_ffi_checksum_func_type_tag_to_bcs( ): Short +fun uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs( +): Short fun uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_from_bcs( ): Short fun uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_to_bcs( @@ -6808,6 +6888,10 @@ fun uniffi_iota_sdk_ffi_fn_func_bn254_field_element_from_bcs(`bcs`: RustBuffer.B ): Pointer fun uniffi_iota_sdk_ffi_fn_func_bn254_field_element_to_bcs(`data`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_bool_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_func_bool_to_bcs(`input`: Byte,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_func_cancelled_transaction_from_bcs(`bcs`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_func_cancelled_transaction_to_bcs(`data`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -6924,6 +7008,22 @@ fun uniffi_iota_sdk_ffi_fn_func_hex_decode(`input`: RustBuffer.ByValue,uniffi_ou ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_func_hex_encode(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_i16_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Short +fun uniffi_iota_sdk_ffi_fn_func_i16_to_bcs(`input`: Short,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_i32_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Int +fun uniffi_iota_sdk_ffi_fn_func_i32_to_bcs(`input`: Int,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_i64_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_func_i64_to_bcs(`input`: Long,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_i8_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_func_i8_to_bcs(`input`: Byte,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_func_id_operation_from_bcs(`bcs`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_func_id_operation_to_bcs(`data`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, @@ -7064,6 +7164,10 @@ fun uniffi_iota_sdk_ffi_fn_func_split_coins_from_bcs(`bcs`: RustBuffer.ByValue,u ): Pointer fun uniffi_iota_sdk_ffi_fn_func_split_coins_to_bcs(`data`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_string_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_string_to_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_func_struct_tag_from_bcs(`bcs`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_func_struct_tag_to_bcs(`data`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -7116,6 +7220,22 @@ fun uniffi_iota_sdk_ffi_fn_func_type_tag_from_bcs(`bcs`: RustBuffer.ByValue,unif ): Pointer fun uniffi_iota_sdk_ffi_fn_func_type_tag_to_bcs(`data`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_u16_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Short +fun uniffi_iota_sdk_ffi_fn_func_u16_to_bcs(`input`: Short,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_u32_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Int +fun uniffi_iota_sdk_ffi_fn_func_u32_to_bcs(`input`: Int,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_u64_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_func_u64_to_bcs(`input`: Long,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_func_u8_from_bcs(`input`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_func_u8_to_bcs(`input`: Byte,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_func_unchanged_shared_kind_from_bcs(`bcs`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_func_unchanged_shared_kind_to_bcs(`data`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, @@ -7356,6 +7476,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_func_bn254_field_element_to_bcs() != 3863.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs() != 591.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs() != 11338.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_from_bcs() != 3386.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -7530,6 +7656,30 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_func_hex_encode() != 34343.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs() != 10273.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs() != 28969.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs() != 7849.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs() != 52773.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs() != 17714.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs() != 38028.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs() != 21810.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs() != 57592.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_func_id_operation_from_bcs() != 10384.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -7740,6 +7890,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_func_split_coins_to_bcs() != 30667.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_func_string_from_bcs() != 53853.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_string_to_bcs() != 54804.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_func_struct_tag_from_bcs() != 24910.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -7818,6 +7974,30 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_func_type_tag_to_bcs() != 57365.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs() != 3653.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs() != 13254.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs() != 335.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs() != 36384.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs() != 63829.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs() != 2947.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs() != 34764.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs() != 59020.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_from_bcs() != 6308.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -10382,6 +10562,29 @@ public object FfiConverterUByte: FfiConverter { } } +/** + * @suppress + */ +public object FfiConverterByte: FfiConverter { + override fun lift(value: Byte): Byte { + return value + } + + override fun read(buf: ByteBuffer): Byte { + return buf.get() + } + + override fun lower(value: Byte): Byte { + return value + } + + override fun allocationSize(value: Byte) = 1UL + + override fun write(value: Byte, buf: ByteBuffer) { + buf.put(value) + } +} + /** * @suppress */ @@ -10405,6 +10608,29 @@ public object FfiConverterUShort: FfiConverter { } } +/** + * @suppress + */ +public object FfiConverterShort: FfiConverter { + override fun lift(value: Short): Short { + return value + } + + override fun read(buf: ByteBuffer): Short { + return buf.getShort() + } + + override fun lower(value: Short): Short { + return value + } + + override fun allocationSize(value: Short) = 2UL + + override fun write(value: Short, buf: ByteBuffer) { + buf.putShort(value) + } +} + /** * @suppress */ @@ -60158,6 +60384,32 @@ public typealias FfiConverterTypeValue = FfiConverterString } + /** + * Create a bool from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `boolFromBcs`(`input`: kotlin.ByteArray): kotlin.Boolean { + return FfiConverterBoolean.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_bool_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this bool to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `boolToBcs`(`input`: kotlin.Boolean): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_bool_to_bcs( + FfiConverterBoolean.lower(`input`),_status) +} + ) + } + + /** * Create this type from BCS encoded bytes. */ @@ -60905,6 +61157,110 @@ public typealias FfiConverterTypeValue = FfiConverterString } + /** + * Create a i16 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i16FromBcs`(`input`: kotlin.ByteArray): kotlin.Short { + return FfiConverterShort.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i16_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this i16 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i16ToBcs`(`input`: kotlin.Short): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i16_to_bcs( + FfiConverterShort.lower(`input`),_status) +} + ) + } + + + /** + * Create a i32 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i32FromBcs`(`input`: kotlin.ByteArray): kotlin.Int { + return FfiConverterInt.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i32_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this i32 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i32ToBcs`(`input`: kotlin.Int): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i32_to_bcs( + FfiConverterInt.lower(`input`),_status) +} + ) + } + + + /** + * Create a i64 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i64FromBcs`(`input`: kotlin.ByteArray): kotlin.Long { + return FfiConverterLong.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i64_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this i64 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i64ToBcs`(`input`: kotlin.Long): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i64_to_bcs( + FfiConverterLong.lower(`input`),_status) +} + ) + } + + + /** + * Create a i8 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i8FromBcs`(`input`: kotlin.ByteArray): kotlin.Byte { + return FfiConverterByte.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i8_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this i8 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `i8ToBcs`(`input`: kotlin.Byte): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_i8_to_bcs( + FfiConverterByte.lower(`input`),_status) +} + ) + } + + /** * Create this type from BCS encoded bytes. */ @@ -61815,6 +62171,32 @@ public typealias FfiConverterTypeValue = FfiConverterString } + /** + * Create a String from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `stringFromBcs`(`input`: kotlin.ByteArray): kotlin.String { + return FfiConverterString.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_string_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this String to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `stringToBcs`(`input`: kotlin.String): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_string_to_bcs( + FfiConverterString.lower(`input`),_status) +} + ) + } + + /** * Create this type from BCS encoded bytes. */ @@ -62153,6 +62535,110 @@ public typealias FfiConverterTypeValue = FfiConverterString } + /** + * Create a u16 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u16FromBcs`(`input`: kotlin.ByteArray): kotlin.UShort { + return FfiConverterUShort.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u16_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this u16 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u16ToBcs`(`input`: kotlin.UShort): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u16_to_bcs( + FfiConverterUShort.lower(`input`),_status) +} + ) + } + + + /** + * Create a u32 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u32FromBcs`(`input`: kotlin.ByteArray): kotlin.UInt { + return FfiConverterUInt.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u32_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this u32 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u32ToBcs`(`input`: kotlin.UInt): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u32_to_bcs( + FfiConverterUInt.lower(`input`),_status) +} + ) + } + + + /** + * Create a u64 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u64FromBcs`(`input`: kotlin.ByteArray): kotlin.ULong { + return FfiConverterULong.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u64_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this u64 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u64ToBcs`(`input`: kotlin.ULong): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u64_to_bcs( + FfiConverterULong.lower(`input`),_status) +} + ) + } + + + /** + * Create a u8 from BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u8FromBcs`(`input`: kotlin.ByteArray): kotlin.UByte { + return FfiConverterUByte.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u8_from_bcs( + FfiConverterByteArray.lower(`input`),_status) +} + ) + } + + + /** + * Convert this u8 to BCS encoded bytes. + */ + @Throws(SdkFfiException::class) fun `u8ToBcs`(`input`: kotlin.UByte): kotlin.ByteArray { + return FfiConverterByteArray.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_func_u8_to_bcs( + FfiConverterUByte.lower(`input`),_status) +} + ) + } + + /** * Create this type from BCS encoded bytes. */ diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index a336ae7a0..846cefc34 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -497,6 +497,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_func_bn254_field_element_to_bcs() != 3863: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs() != 591: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs() != 11338: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_from_bcs() != 3386: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_to_bcs() != 32242: @@ -613,6 +617,22 @@ 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_func_hex_encode() != 34343: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs() != 10273: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs() != 28969: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs() != 7849: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs() != 52773: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs() != 17714: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs() != 38028: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs() != 21810: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs() != 57592: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_id_operation_from_bcs() != 10384: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_id_operation_to_bcs() != 62670: @@ -753,6 +773,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_func_split_coins_to_bcs() != 30667: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_string_from_bcs() != 53853: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_string_to_bcs() != 54804: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_struct_tag_from_bcs() != 24910: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_struct_tag_to_bcs() != 23529: @@ -805,6 +829,22 @@ 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_func_type_tag_to_bcs() != 57365: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs() != 3653: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs() != 13254: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs() != 335: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs() != 36384: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs() != 63829: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs() != 2947: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs() != 34764: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs() != 59020: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_from_bcs() != 6308: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_to_bcs() != 46464: @@ -7614,6 +7654,16 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_func_bn254_field_element_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_bool_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_bool_from_bcs.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_bool_to_bcs.argtypes = ( + ctypes.c_int8, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_bool_to_bcs.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_func_cancelled_transaction_from_bcs.argtypes = ( _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), @@ -7904,6 +7954,46 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_func_hex_encode.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i16_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i16_from_bcs.restype = ctypes.c_int16 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i16_to_bcs.argtypes = ( + ctypes.c_int16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i16_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i32_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i32_from_bcs.restype = ctypes.c_int32 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i32_to_bcs.argtypes = ( + ctypes.c_int32, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i32_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i64_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i64_from_bcs.restype = ctypes.c_int64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i64_to_bcs.argtypes = ( + ctypes.c_int64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i64_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i8_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i8_from_bcs.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i8_to_bcs.argtypes = ( + ctypes.c_int8, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i8_to_bcs.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_func_id_operation_from_bcs.argtypes = ( _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), @@ -8254,6 +8344,16 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_func_split_coins_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_string_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_string_from_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_string_to_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_string_to_bcs.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_func_struct_tag_from_bcs.argtypes = ( _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), @@ -8384,6 +8484,46 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_func_type_tag_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u16_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u16_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u16_to_bcs.argtypes = ( + ctypes.c_uint16, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u16_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u32_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u32_from_bcs.restype = ctypes.c_uint32 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u32_to_bcs.argtypes = ( + ctypes.c_uint32, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u32_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u64_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u64_from_bcs.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u64_to_bcs.argtypes = ( + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u64_to_bcs.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u8_from_bcs.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u8_from_bcs.restype = ctypes.c_uint8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u8_to_bcs.argtypes = ( + ctypes.c_uint8, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u8_to_bcs.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_func_unchanged_shared_kind_from_bcs.argtypes = ( _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), @@ -8856,6 +8996,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_bn254_field_element_to_bcs.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_bn254_field_element_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_bool_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_bool_to_bcs.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_from_bcs.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_cancelled_transaction_from_bcs.restype = ctypes.c_uint16 @@ -9030,6 +9176,30 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_hex_encode.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_hex_encode.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i16_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i16_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i32_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i32_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i64_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i64_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i8_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_i8_to_bcs.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_id_operation_from_bcs.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_id_operation_from_bcs.restype = ctypes.c_uint16 @@ -9240,6 +9410,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_split_coins_to_bcs.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_split_coins_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_string_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_string_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_string_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_string_to_bcs.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_struct_tag_from_bcs.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_struct_tag_from_bcs.restype = ctypes.c_uint16 @@ -9318,6 +9494,30 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_type_tag_to_bcs.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_type_tag_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u16_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u16_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u32_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u32_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u64_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u64_to_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u8_from_bcs.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_func_u8_to_bcs.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_from_bcs.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_func_unchanged_shared_kind_from_bcs.restype = ctypes.c_uint16 @@ -11699,6 +11899,19 @@ def read(buf): def write(value, buf): buf.write_u8(value) +class _UniffiConverterInt8(_UniffiConverterPrimitiveInt): + CLASS_NAME = "i8" + VALUE_MIN = -2**7 + VALUE_MAX = 2**7 + + @staticmethod + def read(buf): + return buf.read_i8() + + @staticmethod + def write(value, buf): + buf.write_i8(value) + class _UniffiConverterUInt16(_UniffiConverterPrimitiveInt): CLASS_NAME = "u16" VALUE_MIN = 0 @@ -11712,6 +11925,19 @@ def read(buf): def write(value, buf): buf.write_u16(value) +class _UniffiConverterInt16(_UniffiConverterPrimitiveInt): + CLASS_NAME = "i16" + VALUE_MIN = -2**15 + VALUE_MAX = 2**15 + + @staticmethod + def read(buf): + return buf.read_i16() + + @staticmethod + def write(value, buf): + buf.write_i16(value) + class _UniffiConverterUInt32(_UniffiConverterPrimitiveInt): CLASS_NAME = "u32" VALUE_MIN = 0 @@ -44665,6 +44891,28 @@ def bn254_field_element_to_bcs(data: "Bn254FieldElement") -> "bytes": _UniffiConverterTypeBn254FieldElement.lower(data))) +def bool_from_bcs(input: "bytes") -> "bool": + """ + Create a bool from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterBool.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_bool_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def bool_to_bcs(input: "bool") -> "bytes": + """ + Convert this bool to BCS encoded bytes. + """ + + _UniffiConverterBool.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_bool_to_bcs, + _UniffiConverterBool.lower(input))) + + def cancelled_transaction_from_bcs(bcs: "bytes") -> "CancelledTransaction": """ Create this type from BCS encoded bytes. @@ -45295,6 +45543,94 @@ def hex_encode(input: "bytes") -> "str": _UniffiConverterBytes.lower(input))) +def i16_from_bcs(input: "bytes") -> "int": + """ + Create a i16 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterInt16.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i16_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def i16_to_bcs(input: "int") -> "bytes": + """ + Convert this i16 to BCS encoded bytes. + """ + + _UniffiConverterInt16.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i16_to_bcs, + _UniffiConverterInt16.lower(input))) + + +def i32_from_bcs(input: "bytes") -> "int": + """ + Create a i32 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterInt32.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i32_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def i32_to_bcs(input: "int") -> "bytes": + """ + Convert this i32 to BCS encoded bytes. + """ + + _UniffiConverterInt32.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i32_to_bcs, + _UniffiConverterInt32.lower(input))) + + +def i64_from_bcs(input: "bytes") -> "int": + """ + Create a i64 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterInt64.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i64_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def i64_to_bcs(input: "int") -> "bytes": + """ + Convert this i64 to BCS encoded bytes. + """ + + _UniffiConverterInt64.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i64_to_bcs, + _UniffiConverterInt64.lower(input))) + + +def i8_from_bcs(input: "bytes") -> "int": + """ + Create a i8 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterInt8.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i8_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def i8_to_bcs(input: "int") -> "bytes": + """ + Convert this i8 to BCS encoded bytes. + """ + + _UniffiConverterInt8.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_i8_to_bcs, + _UniffiConverterInt8.lower(input))) + + def id_operation_from_bcs(bcs: "bytes") -> "IdOperation": """ Create this type from BCS encoded bytes. @@ -46065,6 +46401,28 @@ def split_coins_to_bcs(data: "SplitCoins") -> "bytes": _UniffiConverterTypeSplitCoins.lower(data))) +def string_from_bcs(input: "bytes") -> "str": + """ + Create a String from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_string_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def string_to_bcs(input: "str") -> "bytes": + """ + Convert this String to BCS encoded bytes. + """ + + _UniffiConverterString.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_string_to_bcs, + _UniffiConverterString.lower(input))) + + def struct_tag_from_bcs(bcs: "bytes") -> "StructTag": """ Create this type from BCS encoded bytes. @@ -46351,6 +46709,94 @@ def type_tag_to_bcs(data: "TypeTag") -> "bytes": _UniffiConverterTypeTypeTag.lower(data))) +def u16_from_bcs(input: "bytes") -> "int": + """ + Create a u16 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterUInt16.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u16_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def u16_to_bcs(input: "int") -> "bytes": + """ + Convert this u16 to BCS encoded bytes. + """ + + _UniffiConverterUInt16.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u16_to_bcs, + _UniffiConverterUInt16.lower(input))) + + +def u32_from_bcs(input: "bytes") -> "int": + """ + Create a u32 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterUInt32.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u32_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def u32_to_bcs(input: "int") -> "bytes": + """ + Convert this u32 to BCS encoded bytes. + """ + + _UniffiConverterUInt32.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u32_to_bcs, + _UniffiConverterUInt32.lower(input))) + + +def u64_from_bcs(input: "bytes") -> "int": + """ + Create a u64 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterUInt64.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u64_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def u64_to_bcs(input: "int") -> "bytes": + """ + Convert this u64 to BCS encoded bytes. + """ + + _UniffiConverterUInt64.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u64_to_bcs, + _UniffiConverterUInt64.lower(input))) + + +def u8_from_bcs(input: "bytes") -> "int": + """ + Create a u8 from BCS encoded bytes. + """ + + _UniffiConverterBytes.check_lower(input) + + return _UniffiConverterUInt8.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u8_from_bcs, + _UniffiConverterBytes.lower(input))) + + +def u8_to_bcs(input: "int") -> "bytes": + """ + Convert this u8 to BCS encoded bytes. + """ + + _UniffiConverterUInt8.check_lower(input) + + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkFfiError,_UniffiLib.uniffi_iota_sdk_ffi_fn_func_u8_to_bcs, + _UniffiConverterUInt8.lower(input))) + + def unchanged_shared_kind_from_bcs(bcs: "bytes") -> "UnchangedSharedKind": """ Create this type from BCS encoded bytes. @@ -46800,6 +47246,8 @@ def zk_login_public_identifier_to_bcs(data: "ZkLoginPublicIdentifier") -> "bytes "bls12381_signature_to_bcs", "bn254_field_element_from_bcs", "bn254_field_element_to_bcs", + "bool_from_bcs", + "bool_to_bcs", "cancelled_transaction_from_bcs", "cancelled_transaction_to_bcs", "change_epoch_from_bcs", @@ -46858,6 +47306,14 @@ def zk_login_public_identifier_to_bcs(data: "ZkLoginPublicIdentifier") -> "bytes "genesis_transaction_to_bcs", "hex_decode", "hex_encode", + "i16_from_bcs", + "i16_to_bcs", + "i32_from_bcs", + "i32_to_bcs", + "i64_from_bcs", + "i64_to_bcs", + "i8_from_bcs", + "i8_to_bcs", "id_operation_from_bcs", "id_operation_to_bcs", "identifier_from_bcs", @@ -46928,6 +47384,8 @@ def zk_login_public_identifier_to_bcs(data: "ZkLoginPublicIdentifier") -> "bytes "simple_signature_to_bcs", "split_coins_from_bcs", "split_coins_to_bcs", + "string_from_bcs", + "string_to_bcs", "struct_tag_from_bcs", "struct_tag_to_bcs", "system_package_from_bcs", @@ -46954,6 +47412,14 @@ def zk_login_public_identifier_to_bcs(data: "ZkLoginPublicIdentifier") -> "bytes "type_origin_to_bcs", "type_tag_from_bcs", "type_tag_to_bcs", + "u16_from_bcs", + "u16_to_bcs", + "u32_from_bcs", + "u32_to_bcs", + "u64_from_bcs", + "u64_to_bcs", + "u8_from_bcs", + "u8_to_bcs", "unchanged_shared_kind_from_bcs", "unchanged_shared_kind_to_bcs", "unchanged_shared_object_from_bcs", diff --git a/crates/iota-sdk-ffi/src/lib.rs b/crates/iota-sdk-ffi/src/lib.rs index e37a0cb2a..891a3c777 100644 --- a/crates/iota-sdk-ffi/src/lib.rs +++ b/crates/iota-sdk-ffi/src/lib.rs @@ -9,6 +9,7 @@ )] use base64ct::Encoding; +use serde::Deserialize; mod macros; @@ -43,3 +44,23 @@ pub fn hex_encode(input: &[u8]) -> String { pub fn hex_decode(input: String) -> crate::error::Result> { Ok(hex::decode(input)?) } + +macro_rules! export_primitive_types_bcs_conversion { + ($($name:ty),+ $(,)?) => { + paste::paste!{$( + #[doc = "Create a " $name " from BCS encoded bytes."] + #[uniffi::export] + pub fn [< $name:snake _from_bcs >](input: &[u8]) -> crate::error::Result<$name> { + Ok(bcs::from_bytes(input)?) + } + + #[doc = "Convert this " $name " to BCS encoded bytes."] + #[uniffi::export] + pub fn [< $name:snake _to_bcs >](input: $name) -> crate::error::Result> { + Ok(bcs::to_bytes(&input)?) + } + )+} + }; +} + +export_primitive_types_bcs_conversion!(u8, u16, u32, u64, i8, i16, i32, i64, bool, String);