diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index 3df67933d..ff4829e66 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -611,6 +611,159 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest() + }) + if checksum != 22345 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info() + }) + if checksum != 56465 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments() + }) + if checksum != 61600 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest() + }) + if checksum != 31627 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest() + }) + if checksum != 14291 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data() + }) + if checksum != 49930 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch() + }) + if checksum != 35840 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary() + }) + if checksum != 10205 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions() + }) + if checksum != 50558 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest() + }) + if checksum != 933 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number() + }) + if checksum != 33896 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message() + }) + if checksum != 59962 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms() + }) + if checksum != 62474 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data() + }) + if checksum != 43828 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects() + }) + if checksum != 54822 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures() + }) + if checksum != 36925 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction() + }) + if checksum != 58570 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_coin_balance() }) @@ -1010,7 +1163,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() }) - if checksum != 13597 { + if checksum != 11584 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint: UniFFI API checksum mismatch") } @@ -1529,6 +1682,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() + }) + if checksum != 12725 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid() }) @@ -1844,6 +2006,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_object_digest() + }) + if checksum != 48655 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_digest: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_object_object_id() }) @@ -1934,6 +2105,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id() + }) + if checksum != 47819 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_objectid_to_address() }) @@ -2078,6 +2258,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key() + }) + if checksum != 18555 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature() }) @@ -2087,6 +2276,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_derive_address() + }) + if checksum != 61803 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_derive_address: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner() + }) + if checksum != 65008 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_passkeyverifier_verify() }) @@ -2096,6 +2303,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes() + }) + if checksum != 347 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest() + }) + if checksum != 39344 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands() }) @@ -2789,6 +3014,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_transaction_digest() + }) + if checksum != 52429 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_digest: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() }) @@ -2825,6 +3059,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest() + }) + if checksum != 36608 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_add_gas_objects() }) @@ -2978,6 +3221,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest() + }) + if checksum != 46963 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1() }) @@ -2987,6 +3239,24 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest() + }) + if checksum != 55750 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_transactionevents_events() + }) + if checksum != 36651 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactionevents_events: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_transferobjects_address() }) @@ -3563,6 +3833,33 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address() + }) + if checksum != 14353 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded() + }) + if checksum != 45141 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded() + }) + if checksum != 51424 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss() }) @@ -3770,6 +4067,33 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new() + }) + if checksum != 27130 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new() + }) + if checksum != 16062 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new() + }) + if checksum != 65327 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new() }) @@ -4400,6 +4724,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id() + }) + if checksum != 16970 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes() }) @@ -4472,6 +4805,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_passkeypublickey_new() + }) + if checksum != 30856 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_passkeypublickey_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_passkeyverifier_new() }) @@ -4481,6 +4823,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new() + }) + if checksum != 3617 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new() }) @@ -4904,6 +5255,15 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new() + }) + if checksum != 1310 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_authenticator_state_update_v1() }) @@ -7089,38 +7449,577 @@ func (_ FfiDestroyerCheckpointCommitment) Destroy(value *CheckpointCommitment) { -// A G1 point +// The committed to contents of a checkpoint. // -// This represents the canonical decimal representation of the projective -// coordinates in Fq. +// `CheckpointContents` contains a list of digests of Transactions, their +// effects, and the user signatures that authorized their execution included in +// a checkpoint. // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// circom-g1 = %x03 3(bn254-field-element) +// checkpoint-contents = %x00 checkpoint-contents-v1 ; variant 0 +// +// checkpoint-contents-v1 = (vector (digest digest)) ; vector of transaction and effect digests +// (vector (vector bcs-user-signature)) ; set of user signatures for each +// ; transaction. MUST be the same +// ; length as the vector of digests // ``` -type CircomG1Interface interface { +type CheckpointContentsInterface interface { + Digest() *Digest + TransactionInfo() []*CheckpointTransactionInfo } -// A G1 point +// The committed to contents of a checkpoint. // -// This represents the canonical decimal representation of the projective -// coordinates in Fq. +// `CheckpointContents` contains a list of digests of Transactions, their +// effects, and the user signatures that authorized their execution included in +// a checkpoint. // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// circom-g1 = %x03 3(bn254-field-element) +// checkpoint-contents = %x00 checkpoint-contents-v1 ; variant 0 +// +// checkpoint-contents-v1 = (vector (digest digest)) ; vector of transaction and effect digests +// (vector (vector bcs-user-signature)) ; set of user signatures for each +// ; transaction. MUST be the same +// ; length as the vector of digests // ``` -type CircomG1 struct { +type CheckpointContents struct { ffiObject FfiObject } -func NewCircomG1(el0 *Bn254FieldElement, el1 *Bn254FieldElement, el2 *Bn254FieldElement) *CircomG1 { - return FfiConverterCircomG1INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_circomg1_new(FfiConverterBn254FieldElementINSTANCE.Lower(el0), FfiConverterBn254FieldElementINSTANCE.Lower(el1), FfiConverterBn254FieldElementINSTANCE.Lower(el2),_uniffiStatus) +func NewCheckpointContents(transactionInfo []*CheckpointTransactionInfo) *CheckpointContents { + return FfiConverterCheckpointContentsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontents_new(FfiConverterSequenceCheckpointTransactionInfoINSTANCE.Lower(transactionInfo),_uniffiStatus) + })) +} + + + + +func (_self *CheckpointContents) Digest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*CheckpointContents") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_digest( + _pointer,_uniffiStatus) + })) +} + +func (_self *CheckpointContents) TransactionInfo() []*CheckpointTransactionInfo { + _pointer := _self.ffiObject.incrementPointer("*CheckpointContents") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceCheckpointTransactionInfoINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_transaction_info( + _pointer,_uniffiStatus), + } + })) +} +func (object *CheckpointContents) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCheckpointContents struct {} + +var FfiConverterCheckpointContentsINSTANCE = FfiConverterCheckpointContents{} + + +func (c FfiConverterCheckpointContents) Lift(pointer unsafe.Pointer) *CheckpointContents { + result := &CheckpointContents { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_checkpointcontents(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_checkpointcontents(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CheckpointContents).Destroy) + return result +} + +func (c FfiConverterCheckpointContents) Read(reader io.Reader) *CheckpointContents { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCheckpointContents) Lower(value *CheckpointContents) 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("*CheckpointContents") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCheckpointContents) Write(writer io.Writer, value *CheckpointContents) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCheckpointContents struct {} + +func (_ FfiDestroyerCheckpointContents) Destroy(value *CheckpointContents) { + value.Destroy() +} + + + +// A header for a Checkpoint on the IOTA blockchain. +// +// On the IOTA network, checkpoints define the history of the blockchain. They +// are quite similar to the concept of blocks used by other blockchains like +// Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after +// transaction execution has already happened to provide a certified history of +// the chain, instead of being formed before execution. +// +// Checkpoints commit to a variety of state including but not limited to: +// - The hash of the previous checkpoint. +// - The set of transaction digests, their corresponding effects digests, as +// well as the set of user signatures which authorized its execution. +// - The object's produced by a transaction. +// - The set of live objects that make up the current state of the chain. +// - On epoch transitions, the next validator committee. +// +// `CheckpointSummary`s themselves don't directly include all of the above +// information but they are the top-level type by which all the above are +// committed to transitively via cryptographic hashes included in the summary. +// `CheckpointSummary`s are signed and certified by a quorum of the validator +// committee in a given epoch in order to allow verification of the chain's +// state. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// checkpoint-summary = u64 ; epoch +// u64 ; sequence_number +// u64 ; network_total_transactions +// digest ; content_digest +// (option digest) ; previous_digest +// gas-cost-summary ; epoch_rolling_gas_cost_summary +// u64 ; timestamp_ms +// (vector checkpoint-commitment) ; checkpoint_commitments +// (option end-of-epoch-data) ; end_of_epoch_data +// bytes ; version_specific_data +// ``` +type CheckpointSummaryInterface interface { + // Commitments to checkpoint-specific state. + CheckpointCommitments() []*CheckpointCommitment + // The hash of the `CheckpointContents` for this checkpoint. + ContentDigest() *Digest + Digest() *Digest + // Extra data only present in the final checkpoint of an epoch. + EndOfEpochData() *EndOfEpochData + // Epoch that this checkpoint belongs to. + Epoch() uint64 + // The running total gas costs of all transactions included in the current + // epoch so far until this checkpoint. + EpochRollingGasCostSummary() GasCostSummary + // Total number of transactions committed since genesis, including those in + // this checkpoint. + NetworkTotalTransactions() uint64 + // The hash of the previous `CheckpointSummary`. + // + // This will be only be `None` for the first, or genesis checkpoint. + PreviousDigest() **Digest + // The height of this checkpoint. + SequenceNumber() uint64 + SigningMessage() []byte + // Timestamp of the checkpoint - number of milliseconds from the Unix epoch + // Checkpoint timestamps are monotonic, but not strongly monotonic - + // subsequent checkpoints can have same timestamp if they originate + // from the same underlining consensus commit + TimestampMs() uint64 + // CheckpointSummary is not an evolvable structure - it must be readable by + // any version of the code. Therefore, in order to allow extensions to + // be added to CheckpointSummary, we allow opaque data to be added to + // checkpoints which can be deserialized based on the current + // protocol version. + VersionSpecificData() []byte +} +// A header for a Checkpoint on the IOTA blockchain. +// +// On the IOTA network, checkpoints define the history of the blockchain. They +// are quite similar to the concept of blocks used by other blockchains like +// Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after +// transaction execution has already happened to provide a certified history of +// the chain, instead of being formed before execution. +// +// Checkpoints commit to a variety of state including but not limited to: +// - The hash of the previous checkpoint. +// - The set of transaction digests, their corresponding effects digests, as +// well as the set of user signatures which authorized its execution. +// - The object's produced by a transaction. +// - The set of live objects that make up the current state of the chain. +// - On epoch transitions, the next validator committee. +// +// `CheckpointSummary`s themselves don't directly include all of the above +// information but they are the top-level type by which all the above are +// committed to transitively via cryptographic hashes included in the summary. +// `CheckpointSummary`s are signed and certified by a quorum of the validator +// committee in a given epoch in order to allow verification of the chain's +// state. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// checkpoint-summary = u64 ; epoch +// u64 ; sequence_number +// u64 ; network_total_transactions +// digest ; content_digest +// (option digest) ; previous_digest +// gas-cost-summary ; epoch_rolling_gas_cost_summary +// u64 ; timestamp_ms +// (vector checkpoint-commitment) ; checkpoint_commitments +// (option end-of-epoch-data) ; end_of_epoch_data +// bytes ; version_specific_data +// ``` +type CheckpointSummary struct { + ffiObject FfiObject +} +func NewCheckpointSummary(epoch uint64, sequenceNumber uint64, networkTotalTransactions uint64, contentDigest *Digest, previousDigest **Digest, epochRollingGasCostSummary GasCostSummary, timestampMs uint64, checkpointCommitments []*CheckpointCommitment, endOfEpochData *EndOfEpochData, versionSpecificData []byte) *CheckpointSummary { + return FfiConverterCheckpointSummaryINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointsummary_new(FfiConverterUint64INSTANCE.Lower(epoch), FfiConverterUint64INSTANCE.Lower(sequenceNumber), FfiConverterUint64INSTANCE.Lower(networkTotalTransactions), FfiConverterDigestINSTANCE.Lower(contentDigest), FfiConverterOptionalDigestINSTANCE.Lower(previousDigest), FfiConverterGasCostSummaryINSTANCE.Lower(epochRollingGasCostSummary), FfiConverterUint64INSTANCE.Lower(timestampMs), FfiConverterSequenceCheckpointCommitmentINSTANCE.Lower(checkpointCommitments), FfiConverterOptionalEndOfEpochDataINSTANCE.Lower(endOfEpochData), FfiConverterBytesINSTANCE.Lower(versionSpecificData),_uniffiStatus) + })) +} + + + + +// Commitments to checkpoint-specific state. +func (_self *CheckpointSummary) CheckpointCommitments() []*CheckpointCommitment { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceCheckpointCommitmentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_checkpoint_commitments( + _pointer,_uniffiStatus), + } + })) +} + +// The hash of the `CheckpointContents` for this checkpoint. +func (_self *CheckpointSummary) ContentDigest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_content_digest( + _pointer,_uniffiStatus) + })) +} + +func (_self *CheckpointSummary) Digest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_digest( + _pointer,_uniffiStatus) + })) +} + +// Extra data only present in the final checkpoint of an epoch. +func (_self *CheckpointSummary) EndOfEpochData() *EndOfEpochData { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalEndOfEpochDataINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_end_of_epoch_data( + _pointer,_uniffiStatus), + } + })) +} + +// Epoch that this checkpoint belongs to. +func (_self *CheckpointSummary) Epoch() uint64 { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch( + _pointer,_uniffiStatus) + })) +} + +// The running total gas costs of all transactions included in the current +// epoch so far until this checkpoint. +func (_self *CheckpointSummary) EpochRollingGasCostSummary() GasCostSummary { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterGasCostSummaryINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch_rolling_gas_cost_summary( + _pointer,_uniffiStatus), + } + })) +} + +// Total number of transactions committed since genesis, including those in +// this checkpoint. +func (_self *CheckpointSummary) NetworkTotalTransactions() uint64 { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_network_total_transactions( + _pointer,_uniffiStatus) + })) +} + +// The hash of the previous `CheckpointSummary`. +// +// This will be only be `None` for the first, or genesis checkpoint. +func (_self *CheckpointSummary) PreviousDigest() **Digest { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_previous_digest( + _pointer,_uniffiStatus), + } + })) +} + +// The height of this checkpoint. +func (_self *CheckpointSummary) SequenceNumber() uint64 { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_sequence_number( + _pointer,_uniffiStatus) + })) +} + +func (_self *CheckpointSummary) SigningMessage() []byte { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_signing_message( + _pointer,_uniffiStatus), + } + })) +} + +// Timestamp of the checkpoint - number of milliseconds from the Unix epoch +// Checkpoint timestamps are monotonic, but not strongly monotonic - +// subsequent checkpoints can have same timestamp if they originate +// from the same underlining consensus commit +func (_self *CheckpointSummary) TimestampMs() uint64 { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_timestamp_ms( + _pointer,_uniffiStatus) + })) +} + +// CheckpointSummary is not an evolvable structure - it must be readable by +// any version of the code. Therefore, in order to allow extensions to +// be added to CheckpointSummary, we allow opaque data to be added to +// checkpoints which can be deserialized based on the current +// protocol version. +func (_self *CheckpointSummary) VersionSpecificData() []byte { + _pointer := _self.ffiObject.incrementPointer("*CheckpointSummary") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_version_specific_data( + _pointer,_uniffiStatus), + } + })) +} +func (object *CheckpointSummary) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCheckpointSummary struct {} + +var FfiConverterCheckpointSummaryINSTANCE = FfiConverterCheckpointSummary{} + + +func (c FfiConverterCheckpointSummary) Lift(pointer unsafe.Pointer) *CheckpointSummary { + result := &CheckpointSummary { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_checkpointsummary(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_checkpointsummary(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CheckpointSummary).Destroy) + return result +} + +func (c FfiConverterCheckpointSummary) Read(reader io.Reader) *CheckpointSummary { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCheckpointSummary) Lower(value *CheckpointSummary) 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("*CheckpointSummary") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCheckpointSummary) Write(writer io.Writer, value *CheckpointSummary) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCheckpointSummary struct {} + +func (_ FfiDestroyerCheckpointSummary) Destroy(value *CheckpointSummary) { + value.Destroy() +} + + + +// Transaction information committed to in a checkpoint +type CheckpointTransactionInfoInterface interface { + Effects() *Digest + Signatures() []*UserSignature + Transaction() *Digest +} +// Transaction information committed to in a checkpoint +type CheckpointTransactionInfo struct { + ffiObject FfiObject +} +func NewCheckpointTransactionInfo(transaction *Digest, effects *Digest, signatures []*UserSignature) *CheckpointTransactionInfo { + return FfiConverterCheckpointTransactionInfoINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointtransactioninfo_new(FfiConverterDigestINSTANCE.Lower(transaction), FfiConverterDigestINSTANCE.Lower(effects), FfiConverterSequenceUserSignatureINSTANCE.Lower(signatures),_uniffiStatus) + })) +} + + + + +func (_self *CheckpointTransactionInfo) Effects() *Digest { + _pointer := _self.ffiObject.incrementPointer("*CheckpointTransactionInfo") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_effects( + _pointer,_uniffiStatus) + })) +} + +func (_self *CheckpointTransactionInfo) Signatures() []*UserSignature { + _pointer := _self.ffiObject.incrementPointer("*CheckpointTransactionInfo") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceUserSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_signatures( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *CheckpointTransactionInfo) Transaction() *Digest { + _pointer := _self.ffiObject.incrementPointer("*CheckpointTransactionInfo") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_transaction( + _pointer,_uniffiStatus) + })) +} +func (object *CheckpointTransactionInfo) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCheckpointTransactionInfo struct {} + +var FfiConverterCheckpointTransactionInfoINSTANCE = FfiConverterCheckpointTransactionInfo{} + + +func (c FfiConverterCheckpointTransactionInfo) Lift(pointer unsafe.Pointer) *CheckpointTransactionInfo { + result := &CheckpointTransactionInfo { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_checkpointtransactioninfo(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_checkpointtransactioninfo(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CheckpointTransactionInfo).Destroy) + return result +} + +func (c FfiConverterCheckpointTransactionInfo) Read(reader io.Reader) *CheckpointTransactionInfo { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCheckpointTransactionInfo) Lower(value *CheckpointTransactionInfo) 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("*CheckpointTransactionInfo") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCheckpointTransactionInfo) Write(writer io.Writer, value *CheckpointTransactionInfo) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCheckpointTransactionInfo struct {} + +func (_ FfiDestroyerCheckpointTransactionInfo) Destroy(value *CheckpointTransactionInfo) { + value.Destroy() +} + + + +// 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) +// ``` +type CircomG1Interface interface { +} +// 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) +// ``` +type CircomG1 struct { + ffiObject FfiObject +} +func NewCircomG1(el0 *Bn254FieldElement, el1 *Bn254FieldElement, el2 *Bn254FieldElement) *CircomG1 { + return FfiConverterCircomG1INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_circomg1_new(FfiConverterBn254FieldElementINSTANCE.Lower(el0), FfiConverterBn254FieldElementINSTANCE.Lower(el1), FfiConverterBn254FieldElementINSTANCE.Lower(el2),_uniffiStatus) })) } @@ -9680,7 +10579,7 @@ type GraphQlClientInterface interface { // Get the [`CheckpointSummary`] for a given checkpoint digest or // checkpoint id. If none is provided, it will use the last known // checkpoint id. - Checkpoint(digest **Digest, seqNum *uint64) (*CheckpointSummary, error) + Checkpoint(digest **Digest, seqNum *uint64) (**CheckpointSummary, error) // Get a page of [`CheckpointSummary`] for the provided parameters. Checkpoints(paginationFilter PaginationFilter) (CheckpointSummaryPage, error) // Get the coin metadata for the coin type. @@ -10030,7 +10929,7 @@ func (_self *GraphQlClient) ChainId() (string, error) { // Get the [`CheckpointSummary`] for a given checkpoint digest or // checkpoint id. If none is provided, it will use the last known // checkpoint id. -func (_self *GraphQlClient) Checkpoint(digest **Digest, seqNum *uint64) (*CheckpointSummary, error) { +func (_self *GraphQlClient) Checkpoint(digest **Digest, seqNum *uint64) (**CheckpointSummary, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() res, err :=uniffiRustCallAsync[SdkFfiError]( @@ -10043,7 +10942,7 @@ func (_self *GraphQlClient) Checkpoint(digest **Digest, seqNum *uint64) (*Checkp } }, // liftFn - func(ffi RustBufferI) *CheckpointSummary { + func(ffi RustBufferI) **CheckpointSummary { return FfiConverterOptionalCheckpointSummaryINSTANCE.Lift(ffi) }, C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoint( @@ -12532,6 +13431,24 @@ func (_ FfiDestroyerMultisigAggregator) Destroy(value *MultisigAggregator) { // u16 ; threshold // ``` type MultisigCommitteeInterface interface { + // Derive an `Address` from this MultisigCommittee. + // + // A MultiSig address + // is defined as the 32-byte Blake2b hash of serializing the + // `SignatureScheme` flag (0x03), the threshold (in little endian), and + // the concatenation of all n flag, public keys and its weight. + // + // `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 + // || ... || flag_n || pk_n || weight_n)`. + // + // When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + // refers to the same input used when deriving the address using the + // [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + // full 32-byte `address_seed` value). + // + // [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier + // [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded + DeriveAddress() *Address // Checks if the Committee is valid. // // A valid committee is one that: @@ -12590,6 +13507,32 @@ func NewMultisigCommittee(members []*MultisigMember, threshold uint16) *Multisig +// Derive an `Address` from this MultisigCommittee. +// +// A MultiSig address +// is defined as the 32-byte Blake2b hash of serializing the +// `SignatureScheme` flag (0x03), the threshold (in little endian), and +// the concatenation of all n flag, public keys and its weight. +// +// `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 +// || ... || flag_n || pk_n || weight_n)`. +// +// When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] +// refers to the same input used when deriving the address using the +// [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the +// full 32-byte `address_seed` value). +// +// [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier +// [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded +func (_self *MultisigCommittee) DeriveAddress() *Address { + _pointer := _self.ffiObject.incrementPointer("*MultisigCommittee") + defer _self.ffiObject.decrementPointer() + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_derive_address( + _pointer,_uniffiStatus) + })) +} + // Checks if the Committee is valid. // // A valid committee is one that: @@ -13398,6 +14341,10 @@ type ObjectInterface interface { AsStruct() *MoveStruct // Return this object's data Data() *ObjectData + // Calculate the digest of this `Object` + // + // This is done by hashing the BCS bytes of this `Object` prefixed + Digest() *Digest // Return this object's id ObjectId() *ObjectId // Return this object's type @@ -13457,6 +14404,18 @@ func (_self *Object) Data() *ObjectData { })) } +// Calculate the digest of this `Object` +// +// This is done by hashing the BCS bytes of this `Object` prefixed +func (_self *Object) Digest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_object_digest( + _pointer,_uniffiStatus) + })) +} + // Return this object's id func (_self *Object) ObjectId() *ObjectId { _pointer := _self.ffiObject.incrementPointer("*Object") @@ -13740,6 +14699,10 @@ func (_ FfiDestroyerObjectData) Destroy(value *ObjectData) { // object-id = 32*OCTET // ``` type ObjectIdInterface interface { + // Derive an ObjectId for a Dynamic Child Object. + // + // hash(parent || len(key) || key || key_type_tag) + DeriveDynamicChildId(keyTypeTag *TypeTag, keyBytes []byte) *ObjectId ToAddress() *Address ToBytes() []byte ToHex() string @@ -13767,6 +14730,14 @@ type ObjectId struct { } +// Create an ObjectId from a transaction digest and the number of objects +// that have been created during a transactions. +func ObjectIdDeriveId(digest *Digest, count uint64) *ObjectId { + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_derive_id(FfiConverterDigestINSTANCE.Lower(digest), FfiConverterUint64INSTANCE.Lower(count),_uniffiStatus) + })) +} + func ObjectIdFromBytes(bytes []byte) (*ObjectId, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) @@ -13793,6 +14764,18 @@ func ObjectIdFromHex(hex string) (*ObjectId, error) { +// Derive an ObjectId for a Dynamic Child Object. +// +// hash(parent || len(key) || key || key_type_tag) +func (_self *ObjectId) DeriveDynamicChildId(keyTypeTag *TypeTag, keyBytes []byte) *ObjectId { + _pointer := _self.ffiObject.incrementPointer("*ObjectId") + defer _self.ffiObject.decrementPointer() + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_objectid_derive_dynamic_child_id( + _pointer,FfiConverterTypeTagINSTANCE.Lower(keyTypeTag), FfiConverterBytesINSTANCE.Lower(keyBytes),_uniffiStatus) + })) +} + func (_self *ObjectId) ToAddress() *Address { _pointer := _self.ffiObject.incrementPointer("*ObjectId") defer _self.ffiObject.decrementPointer() @@ -14223,6 +15206,8 @@ type PasskeyAuthenticatorInterface interface { // See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) // for more information on this field. ClientDataJson() string + // The passkey public key + PublicKey() *PasskeyPublicKey // The passkey signature. Signature() *SimpleSignature } @@ -14305,6 +15290,16 @@ func (_self *PasskeyAuthenticator) ClientDataJson() string { })) } +// The passkey public key +func (_self *PasskeyAuthenticator) PublicKey() *PasskeyPublicKey { + _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") + defer _self.ffiObject.decrementPointer() + return FfiConverterPasskeyPublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_public_key( + _pointer,_uniffiStatus) + })) +} + // The passkey signature. func (_self *PasskeyAuthenticator) Signature() *SimpleSignature { _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") @@ -14366,6 +15361,127 @@ func (_ FfiDestroyerPasskeyAuthenticator) Destroy(value *PasskeyAuthenticator) { +// Public key of a `PasskeyAuthenticator`. +// +// This is used to derive the onchain `Address` for a `PasskeyAuthenticator`. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// passkey-public-key = passkey-flag secp256r1-public-key +// ``` +type PasskeyPublicKeyInterface interface { + // Derive an `Address` from this Passkey Public Key + // + // An `Address` can be derived from a `PasskeyPublicKey` by hashing the + // bytes of the `Secp256r1PublicKey` that corresponds to this passkey + // prefixed with the Passkey `SignatureScheme` flag (`0x06`). + // + // `hash( 0x06 || 33-byte secp256r1 public key)` + DeriveAddress() *Address + Inner() *Secp256r1PublicKey +} +// Public key of a `PasskeyAuthenticator`. +// +// This is used to derive the onchain `Address` for a `PasskeyAuthenticator`. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// passkey-public-key = passkey-flag secp256r1-public-key +// ``` +type PasskeyPublicKey struct { + ffiObject FfiObject +} +func NewPasskeyPublicKey(publicKey *Secp256r1PublicKey) *PasskeyPublicKey { + return FfiConverterPasskeyPublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_passkeypublickey_new(FfiConverterSecp256r1PublicKeyINSTANCE.Lower(publicKey),_uniffiStatus) + })) +} + + + + +// Derive an `Address` from this Passkey Public Key +// +// An `Address` can be derived from a `PasskeyPublicKey` by hashing the +// bytes of the `Secp256r1PublicKey` that corresponds to this passkey +// prefixed with the Passkey `SignatureScheme` flag (`0x06`). +// +// `hash( 0x06 || 33-byte secp256r1 public key)` +func (_self *PasskeyPublicKey) DeriveAddress() *Address { + _pointer := _self.ffiObject.incrementPointer("*PasskeyPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_derive_address( + _pointer,_uniffiStatus) + })) +} + +func (_self *PasskeyPublicKey) Inner() *Secp256r1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*PasskeyPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_inner( + _pointer,_uniffiStatus) + })) +} +func (object *PasskeyPublicKey) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterPasskeyPublicKey struct {} + +var FfiConverterPasskeyPublicKeyINSTANCE = FfiConverterPasskeyPublicKey{} + + +func (c FfiConverterPasskeyPublicKey) Lift(pointer unsafe.Pointer) *PasskeyPublicKey { + result := &PasskeyPublicKey { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_passkeypublickey(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_passkeypublickey(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*PasskeyPublicKey).Destroy) + return result +} + +func (c FfiConverterPasskeyPublicKey) Read(reader io.Reader) *PasskeyPublicKey { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterPasskeyPublicKey) Lower(value *PasskeyPublicKey) 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("*PasskeyPublicKey") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterPasskeyPublicKey) Write(writer io.Writer, value *PasskeyPublicKey) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerPasskeyPublicKey struct {} + +func (_ FfiDestroyerPasskeyPublicKey) Destroy(value *PasskeyPublicKey) { + value.Destroy() +} + + + type PasskeyVerifierInterface interface { Verify(message []byte, authenticator *PasskeyAuthenticator) error } @@ -14381,63 +15497,152 @@ func NewPasskeyVerifier() *PasskeyVerifier { -func (_self *PasskeyVerifier) Verify(message []byte, authenticator *PasskeyAuthenticator) error { - _pointer := _self.ffiObject.incrementPointer("*PasskeyVerifier") +func (_self *PasskeyVerifier) Verify(message []byte, authenticator *PasskeyAuthenticator) error { + _pointer := _self.ffiObject.incrementPointer("*PasskeyVerifier") + defer _self.ffiObject.decrementPointer() + _, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) bool { + C.uniffi_iota_sdk_ffi_fn_method_passkeyverifier_verify( + _pointer,FfiConverterBytesINSTANCE.Lower(message), FfiConverterPasskeyAuthenticatorINSTANCE.Lower(authenticator),_uniffiStatus) + return false + }) + return _uniffiErr.AsError() +} +func (object *PasskeyVerifier) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterPasskeyVerifier struct {} + +var FfiConverterPasskeyVerifierINSTANCE = FfiConverterPasskeyVerifier{} + + +func (c FfiConverterPasskeyVerifier) Lift(pointer unsafe.Pointer) *PasskeyVerifier { + result := &PasskeyVerifier { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_passkeyverifier(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_passkeyverifier(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*PasskeyVerifier).Destroy) + return result +} + +func (c FfiConverterPasskeyVerifier) Read(reader io.Reader) *PasskeyVerifier { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterPasskeyVerifier) Lower(value *PasskeyVerifier) 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("*PasskeyVerifier") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterPasskeyVerifier) Write(writer io.Writer, value *PasskeyVerifier) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerPasskeyVerifier struct {} + +func (_ FfiDestroyerPasskeyVerifier) Destroy(value *PasskeyVerifier) { + value.Destroy() +} + + + +type PersonalMessageInterface interface { + MessageBytes() []byte + SigningDigest() []byte +} +type PersonalMessage struct { + ffiObject FfiObject +} +func NewPersonalMessage(messageBytes []byte) *PersonalMessage { + return FfiConverterPersonalMessageINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_personalmessage_new(FfiConverterBytesINSTANCE.Lower(messageBytes),_uniffiStatus) + })) +} + + + + +func (_self *PersonalMessage) MessageBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*PersonalMessage") defer _self.ffiObject.decrementPointer() - _, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) bool { - C.uniffi_iota_sdk_ffi_fn_method_passkeyverifier_verify( - _pointer,FfiConverterBytesINSTANCE.Lower(message), FfiConverterPasskeyAuthenticatorINSTANCE.Lower(authenticator),_uniffiStatus) - return false - }) - return _uniffiErr.AsError() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_personalmessage_message_bytes( + _pointer,_uniffiStatus), + } + })) } -func (object *PasskeyVerifier) Destroy() { + +func (_self *PersonalMessage) SigningDigest() []byte { + _pointer := _self.ffiObject.incrementPointer("*PersonalMessage") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_personalmessage_signing_digest( + _pointer,_uniffiStatus), + } + })) +} +func (object *PersonalMessage) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterPasskeyVerifier struct {} +type FfiConverterPersonalMessage struct {} -var FfiConverterPasskeyVerifierINSTANCE = FfiConverterPasskeyVerifier{} +var FfiConverterPersonalMessageINSTANCE = FfiConverterPersonalMessage{} -func (c FfiConverterPasskeyVerifier) Lift(pointer unsafe.Pointer) *PasskeyVerifier { - result := &PasskeyVerifier { +func (c FfiConverterPersonalMessage) Lift(pointer unsafe.Pointer) *PersonalMessage { + result := &PersonalMessage { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_passkeyverifier(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_personalmessage(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_passkeyverifier(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_personalmessage(pointer, status) }, ), } - runtime.SetFinalizer(result, (*PasskeyVerifier).Destroy) + runtime.SetFinalizer(result, (*PersonalMessage).Destroy) return result } -func (c FfiConverterPasskeyVerifier) Read(reader io.Reader) *PasskeyVerifier { +func (c FfiConverterPersonalMessage) Read(reader io.Reader) *PersonalMessage { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterPasskeyVerifier) Lower(value *PasskeyVerifier) unsafe.Pointer { +func (c FfiConverterPersonalMessage) Lower(value *PersonalMessage) 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("*PasskeyVerifier") + pointer := value.ffiObject.incrementPointer("*PersonalMessage") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterPasskeyVerifier) Write(writer io.Writer, value *PasskeyVerifier) { +func (c FfiConverterPersonalMessage) Write(writer io.Writer, value *PersonalMessage) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerPasskeyVerifier struct {} +type FfiDestroyerPersonalMessage struct {} -func (_ FfiDestroyerPasskeyVerifier) Destroy(value *PasskeyVerifier) { +func (_ FfiDestroyerPersonalMessage) Destroy(value *PersonalMessage) { value.Destroy() } @@ -17262,10 +18467,12 @@ func (_ FfiDestroyerSystemPackage) Destroy(value *SystemPackage) { // transaction-v1 = transaction-kind address gas-payment transaction-expiration // ``` type TransactionInterface interface { + Digest() *Digest Expiration() TransactionExpiration GasPayment() GasPayment Kind() *TransactionKind Sender() *Address + SigningDigest() []byte } // A transaction // @@ -17290,6 +18497,15 @@ func NewTransaction(kind *TransactionKind, sender *Address, gasPayment GasPaymen +func (_self *Transaction) Digest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*Transaction") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_transaction_digest( + _pointer,_uniffiStatus) + })) +} + func (_self *Transaction) Expiration() TransactionExpiration { _pointer := _self.ffiObject.incrementPointer("*Transaction") defer _self.ffiObject.decrementPointer() @@ -17329,6 +18545,17 @@ func (_self *Transaction) Sender() *Address { _pointer,_uniffiStatus) })) } + +func (_self *Transaction) SigningDigest() []byte { + _pointer := _self.ffiObject.incrementPointer("*Transaction") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transaction_signing_digest( + _pointer,_uniffiStatus), + } + })) +} func (object *Transaction) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() @@ -17861,6 +19088,7 @@ func (_ FfiDestroyerTransactionBuilder) Destroy(value *TransactionBuilder) { // ``` type TransactionEffectsInterface interface { AsV1() TransactionEffectsV1 + Digest() *Digest IsV1() bool } // The output or effects of executing a transaction @@ -17897,6 +19125,15 @@ func (_self *TransactionEffects) AsV1() TransactionEffectsV1 { })) } +func (_self *TransactionEffects) Digest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*TransactionEffects") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_transactioneffects_digest( + _pointer,_uniffiStatus) + })) +} + func (_self *TransactionEffects) IsV1() bool { _pointer := _self.ffiObject.incrementPointer("*TransactionEffects") defer _self.ffiObject.decrementPointer() @@ -17957,6 +19194,111 @@ func (_ FfiDestroyerTransactionEffects) Destroy(value *TransactionEffects) { +// Events emitted during the successful execution of a transaction +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// transaction-events = vector event +// ``` +type TransactionEventsInterface interface { + Digest() *Digest + Events() []Event +} +// Events emitted during the successful execution of a transaction +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// transaction-events = vector event +// ``` +type TransactionEvents struct { + ffiObject FfiObject +} +func NewTransactionEvents(events []Event) *TransactionEvents { + return FfiConverterTransactionEventsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionevents_new(FfiConverterSequenceEventINSTANCE.Lower(events),_uniffiStatus) + })) +} + + + + +func (_self *TransactionEvents) Digest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*TransactionEvents") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_transactionevents_digest( + _pointer,_uniffiStatus) + })) +} + +func (_self *TransactionEvents) Events() []Event { + _pointer := _self.ffiObject.incrementPointer("*TransactionEvents") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceEventINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transactionevents_events( + _pointer,_uniffiStatus), + } + })) +} +func (object *TransactionEvents) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterTransactionEvents struct {} + +var FfiConverterTransactionEventsINSTANCE = FfiConverterTransactionEvents{} + + +func (c FfiConverterTransactionEvents) Lift(pointer unsafe.Pointer) *TransactionEvents { + result := &TransactionEvents { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_transactionevents(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_transactionevents(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*TransactionEvents).Destroy) + return result +} + +func (c FfiConverterTransactionEvents) Read(reader io.Reader) *TransactionEvents { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterTransactionEvents) Lower(value *TransactionEvents) 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("*TransactionEvents") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterTransactionEvents) Write(writer io.Writer, value *TransactionEvents) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerTransactionEvents struct {} + +func (_ FfiDestroyerTransactionEvents) Destroy(value *TransactionEvents) { + value.Destroy() +} + + + // Transaction type // // # BCS @@ -19996,6 +21338,29 @@ func (_ FfiDestroyerZkLoginProof) Destroy(value *ZkLoginProof) { // [`Address`]: crate::Address type ZkLoginPublicIdentifierInterface interface { AddressSeed() *Bn254FieldElement + // Provides an iterator over the addresses that correspond to this zklogin + // authenticator. + // + // In the majority of instances this will only yield a single address, + // except for the instances where the `address_seed` value has a + // leading zero-byte, in such cases the returned iterator will yield + // two addresses. + DeriveAddress() []*Address + // Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + // byte length of the `iss` followed by the `iss` bytes themselves and + // the full 32 byte `address_seed` value, all prefixed with the zklogin + // `SignatureScheme` flag (`0x05`). + // + // `hash( 0x05 || iss_bytes_len || iss_bytes || 32_byte_address_seed )` + DeriveAddressPadded() *Address + // Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + // byte length of the `iss` followed by the `iss` bytes themselves and + // the `address_seed` bytes with any leading zero-bytes stripped, all + // prefixed with the zklogin `SignatureScheme` flag (`0x05`). + // + // `hash( 0x05 || iss_bytes_len || iss_bytes || + // unpadded_32_byte_address_seed )` + DeriveAddressUnpadded() *Address Iss() string } // Public Key equivalent for Zklogin authenticators @@ -20077,6 +21442,55 @@ func (_self *ZkLoginPublicIdentifier) AddressSeed() *Bn254FieldElement { })) } +// Provides an iterator over the addresses that correspond to this zklogin +// authenticator. +// +// In the majority of instances this will only yield a single address, +// except for the instances where the `address_seed` value has a +// leading zero-byte, in such cases the returned iterator will yield +// two addresses. +func (_self *ZkLoginPublicIdentifier) DeriveAddress() []*Address { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginPublicIdentifier") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address( + _pointer,_uniffiStatus), + } + })) +} + +// Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the +// byte length of the `iss` followed by the `iss` bytes themselves and +// the full 32 byte `address_seed` value, all prefixed with the zklogin +// `SignatureScheme` flag (`0x05`). +// +// `hash( 0x05 || iss_bytes_len || iss_bytes || 32_byte_address_seed )` +func (_self *ZkLoginPublicIdentifier) DeriveAddressPadded() *Address { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginPublicIdentifier") + defer _self.ffiObject.decrementPointer() + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_padded( + _pointer,_uniffiStatus) + })) +} + +// Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the +// byte length of the `iss` followed by the `iss` bytes themselves and +// the `address_seed` bytes with any leading zero-bytes stripped, all +// prefixed with the zklogin `SignatureScheme` flag (`0x05`). +// +// `hash( 0x05 || iss_bytes_len || iss_bytes || +// unpadded_32_byte_address_seed )` +func (_self *ZkLoginPublicIdentifier) DeriveAddressUnpadded() *Address { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginPublicIdentifier") + defer _self.ffiObject.decrementPointer() + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_unpadded( + _pointer,_uniffiStatus) + })) +} + func (_self *ZkLoginPublicIdentifier) Iss() string { _pointer := _self.ffiObject.incrementPointer("*ZkLoginPublicIdentifier") defer _self.ffiObject.decrementPointer() @@ -20423,188 +21837,57 @@ func (_ FfiDestroyerAuthenticatorStateUpdateV1) Destroy(value AuthenticatorState // ```text // changed-object = object-id object-in object-out id-operation // ``` -type ChangedObject struct { - // Id of the object - ObjectId *ObjectId - // State of the object in the store prior to this transaction. - InputState ObjectIn - // State of the object in the store after this transaction. - OutputState ObjectOut - // Whether this object ID is created or deleted in this transaction. - // This information isn't required by the protocol but is useful for - // providing more detailed semantics on object changes. - IdOperation IdOperation -} - -func (r *ChangedObject) Destroy() { - FfiDestroyerObjectId{}.Destroy(r.ObjectId); - FfiDestroyerObjectIn{}.Destroy(r.InputState); - FfiDestroyerObjectOut{}.Destroy(r.OutputState); - FfiDestroyerIdOperation{}.Destroy(r.IdOperation); -} - -type FfiConverterChangedObject struct {} - -var FfiConverterChangedObjectINSTANCE = FfiConverterChangedObject{} - -func (c FfiConverterChangedObject) Lift(rb RustBufferI) ChangedObject { - return LiftFromRustBuffer[ChangedObject](c, rb) -} - -func (c FfiConverterChangedObject) Read(reader io.Reader) ChangedObject { - return ChangedObject { - FfiConverterObjectIdINSTANCE.Read(reader), - FfiConverterObjectInINSTANCE.Read(reader), - FfiConverterObjectOutINSTANCE.Read(reader), - FfiConverterIdOperationINSTANCE.Read(reader), - } -} - -func (c FfiConverterChangedObject) Lower(value ChangedObject) C.RustBuffer { - return LowerIntoRustBuffer[ChangedObject](c, value) -} - -func (c FfiConverterChangedObject) Write(writer io.Writer, value ChangedObject) { - FfiConverterObjectIdINSTANCE.Write(writer, value.ObjectId); - FfiConverterObjectInINSTANCE.Write(writer, value.InputState); - FfiConverterObjectOutINSTANCE.Write(writer, value.OutputState); - FfiConverterIdOperationINSTANCE.Write(writer, value.IdOperation); -} - -type FfiDestroyerChangedObject struct {} - -func (_ FfiDestroyerChangedObject) Destroy(value ChangedObject) { - value.Destroy() -} -// A header for a Checkpoint on the IOTA blockchain. -// -// On the IOTA network, checkpoints define the history of the blockchain. They -// are quite similar to the concept of blocks used by other blockchains like -// Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after -// transaction execution has already happened to provide a certified history of -// the chain, instead of being formed before execution. -// -// Checkpoints commit to a variety of state including but not limited to: -// - The hash of the previous checkpoint. -// - The set of transaction digests, their corresponding effects digests, as -// well as the set of user signatures which authorized its execution. -// - The object's produced by a transaction. -// - The set of live objects that make up the current state of the chain. -// - On epoch transitions, the next validator committee. -// -// `CheckpointSummary`s themselves don't directly include all of the above -// information but they are the top-level type by which all the above are -// committed to transitively via cryptographic hashes included in the summary. -// `CheckpointSummary`s are signed and certified by a quorum of the validator -// committee in a given epoch in order to allow verification of the chain's -// state. -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// checkpoint-summary = u64 ; epoch -// u64 ; sequence_number -// u64 ; network_total_transactions -// digest ; content_digest -// (option digest) ; previous_digest -// gas-cost-summary ; epoch_rolling_gas_cost_summary -// u64 ; timestamp_ms -// (vector checkpoint-commitment) ; checkpoint_commitments -// (option end-of-epoch-data) ; end_of_epoch_data -// bytes ; version_specific_data -// ``` -type CheckpointSummary struct { - // Epoch that this checkpoint belongs to. - Epoch uint64 - // The height of this checkpoint. - SequenceNumber uint64 - // Total number of transactions committed since genesis, including those in - // this checkpoint. - NetworkTotalTransactions uint64 - // The hash of the `CheckpointContents` for this checkpoint. - ContentDigest *Digest - // The hash of the previous `CheckpointSummary`. - // - // This will be only be `None` for the first, or genesis checkpoint. - PreviousDigest **Digest - // The running total gas costs of all transactions included in the current - // epoch so far until this checkpoint. - EpochRollingGasCostSummary GasCostSummary - // Timestamp of the checkpoint - number of milliseconds from the Unix epoch - // Checkpoint timestamps are monotonic, but not strongly monotonic - - // subsequent checkpoints can have same timestamp if they originate - // from the same underlining consensus commit - TimestampMs uint64 - // Commitments to checkpoint-specific state. - CheckpointCommitments []*CheckpointCommitment - // Extra data only present in the final checkpoint of an epoch. - EndOfEpochData *EndOfEpochData - // CheckpointSummary is not an evolvable structure - it must be readable by - // any version of the code. Therefore, in order to allow extensions to - // be added to CheckpointSummary, we allow opaque data to be added to - // checkpoints which can be deserialized based on the current - // protocol version. - VersionSpecificData []byte +type ChangedObject struct { + // Id of the object + ObjectId *ObjectId + // State of the object in the store prior to this transaction. + InputState ObjectIn + // State of the object in the store after this transaction. + OutputState ObjectOut + // Whether this object ID is created or deleted in this transaction. + // This information isn't required by the protocol but is useful for + // providing more detailed semantics on object changes. + IdOperation IdOperation } -func (r *CheckpointSummary) Destroy() { - FfiDestroyerUint64{}.Destroy(r.Epoch); - FfiDestroyerUint64{}.Destroy(r.SequenceNumber); - FfiDestroyerUint64{}.Destroy(r.NetworkTotalTransactions); - FfiDestroyerDigest{}.Destroy(r.ContentDigest); - FfiDestroyerOptionalDigest{}.Destroy(r.PreviousDigest); - FfiDestroyerGasCostSummary{}.Destroy(r.EpochRollingGasCostSummary); - FfiDestroyerUint64{}.Destroy(r.TimestampMs); - FfiDestroyerSequenceCheckpointCommitment{}.Destroy(r.CheckpointCommitments); - FfiDestroyerOptionalEndOfEpochData{}.Destroy(r.EndOfEpochData); - FfiDestroyerBytes{}.Destroy(r.VersionSpecificData); +func (r *ChangedObject) Destroy() { + FfiDestroyerObjectId{}.Destroy(r.ObjectId); + FfiDestroyerObjectIn{}.Destroy(r.InputState); + FfiDestroyerObjectOut{}.Destroy(r.OutputState); + FfiDestroyerIdOperation{}.Destroy(r.IdOperation); } -type FfiConverterCheckpointSummary struct {} +type FfiConverterChangedObject struct {} -var FfiConverterCheckpointSummaryINSTANCE = FfiConverterCheckpointSummary{} +var FfiConverterChangedObjectINSTANCE = FfiConverterChangedObject{} -func (c FfiConverterCheckpointSummary) Lift(rb RustBufferI) CheckpointSummary { - return LiftFromRustBuffer[CheckpointSummary](c, rb) +func (c FfiConverterChangedObject) Lift(rb RustBufferI) ChangedObject { + return LiftFromRustBuffer[ChangedObject](c, rb) } -func (c FfiConverterCheckpointSummary) Read(reader io.Reader) CheckpointSummary { - return CheckpointSummary { - FfiConverterUint64INSTANCE.Read(reader), - FfiConverterUint64INSTANCE.Read(reader), - FfiConverterUint64INSTANCE.Read(reader), - FfiConverterDigestINSTANCE.Read(reader), - FfiConverterOptionalDigestINSTANCE.Read(reader), - FfiConverterGasCostSummaryINSTANCE.Read(reader), - FfiConverterUint64INSTANCE.Read(reader), - FfiConverterSequenceCheckpointCommitmentINSTANCE.Read(reader), - FfiConverterOptionalEndOfEpochDataINSTANCE.Read(reader), - FfiConverterBytesINSTANCE.Read(reader), +func (c FfiConverterChangedObject) Read(reader io.Reader) ChangedObject { + return ChangedObject { + FfiConverterObjectIdINSTANCE.Read(reader), + FfiConverterObjectInINSTANCE.Read(reader), + FfiConverterObjectOutINSTANCE.Read(reader), + FfiConverterIdOperationINSTANCE.Read(reader), } } -func (c FfiConverterCheckpointSummary) Lower(value CheckpointSummary) C.RustBuffer { - return LowerIntoRustBuffer[CheckpointSummary](c, value) +func (c FfiConverterChangedObject) Lower(value ChangedObject) C.RustBuffer { + return LowerIntoRustBuffer[ChangedObject](c, value) } -func (c FfiConverterCheckpointSummary) Write(writer io.Writer, value CheckpointSummary) { - FfiConverterUint64INSTANCE.Write(writer, value.Epoch); - FfiConverterUint64INSTANCE.Write(writer, value.SequenceNumber); - FfiConverterUint64INSTANCE.Write(writer, value.NetworkTotalTransactions); - FfiConverterDigestINSTANCE.Write(writer, value.ContentDigest); - FfiConverterOptionalDigestINSTANCE.Write(writer, value.PreviousDigest); - FfiConverterGasCostSummaryINSTANCE.Write(writer, value.EpochRollingGasCostSummary); - FfiConverterUint64INSTANCE.Write(writer, value.TimestampMs); - FfiConverterSequenceCheckpointCommitmentINSTANCE.Write(writer, value.CheckpointCommitments); - FfiConverterOptionalEndOfEpochDataINSTANCE.Write(writer, value.EndOfEpochData); - FfiConverterBytesINSTANCE.Write(writer, value.VersionSpecificData); +func (c FfiConverterChangedObject) Write(writer io.Writer, value ChangedObject) { + FfiConverterObjectIdINSTANCE.Write(writer, value.ObjectId); + FfiConverterObjectInINSTANCE.Write(writer, value.InputState); + FfiConverterObjectOutINSTANCE.Write(writer, value.OutputState); + FfiConverterIdOperationINSTANCE.Write(writer, value.IdOperation); } -type FfiDestroyerCheckpointSummary struct {} +type FfiDestroyerChangedObject struct {} -func (_ FfiDestroyerCheckpointSummary) Destroy(value CheckpointSummary) { +func (_ FfiDestroyerChangedObject) Destroy(value ChangedObject) { value.Destroy() } // A page of items returned by the GraphQL server. @@ -20613,7 +21896,7 @@ type CheckpointSummaryPage struct { // more pages. PageInfo PageInfo // The data returned by the server. - Data []CheckpointSummary + Data []*CheckpointSummary } func (r *CheckpointSummaryPage) Destroy() { @@ -26340,6 +27623,43 @@ func (_ FfiDestroyerOptionalBatchSendStatus) Destroy(value **BatchSendStatus) { } } +type FfiConverterOptionalCheckpointSummary struct{} + +var FfiConverterOptionalCheckpointSummaryINSTANCE = FfiConverterOptionalCheckpointSummary{} + +func (c FfiConverterOptionalCheckpointSummary) Lift(rb RustBufferI) **CheckpointSummary { + return LiftFromRustBuffer[**CheckpointSummary](c, rb) +} + +func (_ FfiConverterOptionalCheckpointSummary) Read(reader io.Reader) **CheckpointSummary { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterCheckpointSummaryINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalCheckpointSummary) Lower(value **CheckpointSummary) C.RustBuffer { + return LowerIntoRustBuffer[**CheckpointSummary](c, value) +} + +func (_ FfiConverterOptionalCheckpointSummary) Write(writer io.Writer, value **CheckpointSummary) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterCheckpointSummaryINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalCheckpointSummary struct {} + +func (_ FfiDestroyerOptionalCheckpointSummary) Destroy(value **CheckpointSummary) { + if value != nil { + FfiDestroyerCheckpointSummary{}.Destroy(*value) + } +} + type FfiConverterOptionalDigest struct{} var FfiConverterOptionalDigestINSTANCE = FfiConverterOptionalDigest{} @@ -27117,43 +28437,6 @@ func (_ FfiDestroyerOptionalZkloginVerifier) Destroy(value **ZkloginVerifier) { } } -type FfiConverterOptionalCheckpointSummary struct{} - -var FfiConverterOptionalCheckpointSummaryINSTANCE = FfiConverterOptionalCheckpointSummary{} - -func (c FfiConverterOptionalCheckpointSummary) Lift(rb RustBufferI) *CheckpointSummary { - return LiftFromRustBuffer[*CheckpointSummary](c, rb) -} - -func (_ FfiConverterOptionalCheckpointSummary) Read(reader io.Reader) *CheckpointSummary { - if readInt8(reader) == 0 { - return nil - } - temp := FfiConverterCheckpointSummaryINSTANCE.Read(reader) - return &temp -} - -func (c FfiConverterOptionalCheckpointSummary) Lower(value *CheckpointSummary) C.RustBuffer { - return LowerIntoRustBuffer[*CheckpointSummary](c, value) -} - -func (_ FfiConverterOptionalCheckpointSummary) Write(writer io.Writer, value *CheckpointSummary) { - if value == nil { - writeInt8(writer, 0) - } else { - writeInt8(writer, 1) - FfiConverterCheckpointSummaryINSTANCE.Write(writer, *value) - } -} - -type FfiDestroyerOptionalCheckpointSummary struct {} - -func (_ FfiDestroyerOptionalCheckpointSummary) Destroy(value *CheckpointSummary) { - if value != nil { - FfiDestroyerCheckpointSummary{}.Destroy(*value) - } -} - type FfiConverterOptionalCoinMetadata struct{} var FfiConverterOptionalCoinMetadataINSTANCE = FfiConverterOptionalCoinMetadata{} @@ -28461,6 +29744,49 @@ func (FfiDestroyerSequenceBytes) Destroy(sequence [][]byte) { } } +type FfiConverterSequenceAddress struct{} + +var FfiConverterSequenceAddressINSTANCE = FfiConverterSequenceAddress{} + +func (c FfiConverterSequenceAddress) Lift(rb RustBufferI) []*Address { + return LiftFromRustBuffer[[]*Address](c, rb) +} + +func (c FfiConverterSequenceAddress) Read(reader io.Reader) []*Address { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*Address, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterAddressINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceAddress) Lower(value []*Address) C.RustBuffer { + return LowerIntoRustBuffer[[]*Address](c, value) +} + +func (c FfiConverterSequenceAddress) Write(writer io.Writer, value []*Address) { + if len(value) > math.MaxInt32 { + panic("[]*Address is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterAddressINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceAddress struct {} + +func (FfiDestroyerSequenceAddress) Destroy(sequence []*Address) { + for _, value := range sequence { + FfiDestroyerAddress{}.Destroy(value) + } +} + type FfiConverterSequenceArgument struct{} var FfiConverterSequenceArgumentINSTANCE = FfiConverterSequenceArgument{} @@ -28590,6 +29916,92 @@ func (FfiDestroyerSequenceCheckpointCommitment) Destroy(sequence []*CheckpointCo } } +type FfiConverterSequenceCheckpointSummary struct{} + +var FfiConverterSequenceCheckpointSummaryINSTANCE = FfiConverterSequenceCheckpointSummary{} + +func (c FfiConverterSequenceCheckpointSummary) Lift(rb RustBufferI) []*CheckpointSummary { + return LiftFromRustBuffer[[]*CheckpointSummary](c, rb) +} + +func (c FfiConverterSequenceCheckpointSummary) Read(reader io.Reader) []*CheckpointSummary { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*CheckpointSummary, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterCheckpointSummaryINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceCheckpointSummary) Lower(value []*CheckpointSummary) C.RustBuffer { + return LowerIntoRustBuffer[[]*CheckpointSummary](c, value) +} + +func (c FfiConverterSequenceCheckpointSummary) Write(writer io.Writer, value []*CheckpointSummary) { + if len(value) > math.MaxInt32 { + panic("[]*CheckpointSummary is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterCheckpointSummaryINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceCheckpointSummary struct {} + +func (FfiDestroyerSequenceCheckpointSummary) Destroy(sequence []*CheckpointSummary) { + for _, value := range sequence { + FfiDestroyerCheckpointSummary{}.Destroy(value) + } +} + +type FfiConverterSequenceCheckpointTransactionInfo struct{} + +var FfiConverterSequenceCheckpointTransactionInfoINSTANCE = FfiConverterSequenceCheckpointTransactionInfo{} + +func (c FfiConverterSequenceCheckpointTransactionInfo) Lift(rb RustBufferI) []*CheckpointTransactionInfo { + return LiftFromRustBuffer[[]*CheckpointTransactionInfo](c, rb) +} + +func (c FfiConverterSequenceCheckpointTransactionInfo) Read(reader io.Reader) []*CheckpointTransactionInfo { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*CheckpointTransactionInfo, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterCheckpointTransactionInfoINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceCheckpointTransactionInfo) Lower(value []*CheckpointTransactionInfo) C.RustBuffer { + return LowerIntoRustBuffer[[]*CheckpointTransactionInfo](c, value) +} + +func (c FfiConverterSequenceCheckpointTransactionInfo) Write(writer io.Writer, value []*CheckpointTransactionInfo) { + if len(value) > math.MaxInt32 { + panic("[]*CheckpointTransactionInfo is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterCheckpointTransactionInfoINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceCheckpointTransactionInfo struct {} + +func (FfiDestroyerSequenceCheckpointTransactionInfo) Destroy(sequence []*CheckpointTransactionInfo) { + for _, value := range sequence { + FfiDestroyerCheckpointTransactionInfo{}.Destroy(value) + } +} + type FfiConverterSequenceCoin struct{} var FfiConverterSequenceCoinINSTANCE = FfiConverterSequenceCoin{} @@ -29536,49 +30948,6 @@ func (FfiDestroyerSequenceChangedObject) Destroy(sequence []ChangedObject) { } } -type FfiConverterSequenceCheckpointSummary struct{} - -var FfiConverterSequenceCheckpointSummaryINSTANCE = FfiConverterSequenceCheckpointSummary{} - -func (c FfiConverterSequenceCheckpointSummary) Lift(rb RustBufferI) []CheckpointSummary { - return LiftFromRustBuffer[[]CheckpointSummary](c, rb) -} - -func (c FfiConverterSequenceCheckpointSummary) Read(reader io.Reader) []CheckpointSummary { - length := readInt32(reader) - if length == 0 { - return nil - } - result := make([]CheckpointSummary, 0, length) - for i := int32(0); i < length; i++ { - result = append(result, FfiConverterCheckpointSummaryINSTANCE.Read(reader)) - } - return result -} - -func (c FfiConverterSequenceCheckpointSummary) Lower(value []CheckpointSummary) C.RustBuffer { - return LowerIntoRustBuffer[[]CheckpointSummary](c, value) -} - -func (c FfiConverterSequenceCheckpointSummary) Write(writer io.Writer, value []CheckpointSummary) { - if len(value) > math.MaxInt32 { - panic("[]CheckpointSummary is too large to fit into Int32") - } - - writeInt32(writer, int32(len(value))) - for _, item := range value { - FfiConverterCheckpointSummaryINSTANCE.Write(writer, item) - } -} - -type FfiDestroyerSequenceCheckpointSummary struct {} - -func (FfiDestroyerSequenceCheckpointSummary) Destroy(sequence []CheckpointSummary) { - for _, value := range sequence { - FfiDestroyerCheckpointSummary{}.Destroy(value) - } -} - type FfiConverterSequenceDynamicFieldOutput struct{} var FfiConverterSequenceDynamicFieldOutputINSTANCE = FfiConverterSequenceDynamicFieldOutput{} diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index fa865d665..106ae1795 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -717,6 +717,136 @@ void* uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set int8_t uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTCONTENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTCONTENTS +void* uniffi_iota_sdk_ffi_fn_clone_checkpointcontents(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CHECKPOINTCONTENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CHECKPOINTCONTENTS +void uniffi_iota_sdk_ffi_fn_free_checkpointcontents(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTS_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointcontents_new(RustBuffer transaction_info, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTS_DIGEST +void* uniffi_iota_sdk_ffi_fn_method_checkpointcontents_digest(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTS_TRANSACTION_INFO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTS_TRANSACTION_INFO +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointcontents_transaction_info(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTSUMMARY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTSUMMARY +void* uniffi_iota_sdk_ffi_fn_clone_checkpointsummary(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CHECKPOINTSUMMARY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CHECKPOINTSUMMARY +void uniffi_iota_sdk_ffi_fn_free_checkpointsummary(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTSUMMARY_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTSUMMARY_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointsummary_new(uint64_t epoch, uint64_t sequence_number, uint64_t network_total_transactions, void* content_digest, RustBuffer previous_digest, RustBuffer epoch_rolling_gas_cost_summary, uint64_t timestamp_ms, RustBuffer checkpoint_commitments, RustBuffer end_of_epoch_data, RustBuffer version_specific_data, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_CHECKPOINT_COMMITMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_CHECKPOINT_COMMITMENTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointsummary_checkpoint_commitments(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_CONTENT_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_CONTENT_DIGEST +void* uniffi_iota_sdk_ffi_fn_method_checkpointsummary_content_digest(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_DIGEST +void* uniffi_iota_sdk_ffi_fn_method_checkpointsummary_digest(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_END_OF_EPOCH_DATA +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_END_OF_EPOCH_DATA +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointsummary_end_of_epoch_data(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_EPOCH +uint64_t uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_EPOCH_ROLLING_GAS_COST_SUMMARY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_EPOCH_ROLLING_GAS_COST_SUMMARY +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch_rolling_gas_cost_summary(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_NETWORK_TOTAL_TRANSACTIONS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_NETWORK_TOTAL_TRANSACTIONS +uint64_t uniffi_iota_sdk_ffi_fn_method_checkpointsummary_network_total_transactions(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_PREVIOUS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_PREVIOUS_DIGEST +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointsummary_previous_digest(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_SEQUENCE_NUMBER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_SEQUENCE_NUMBER +uint64_t uniffi_iota_sdk_ffi_fn_method_checkpointsummary_sequence_number(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_SIGNING_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_SIGNING_MESSAGE +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointsummary_signing_message(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_TIMESTAMP_MS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_TIMESTAMP_MS +uint64_t uniffi_iota_sdk_ffi_fn_method_checkpointsummary_timestamp_ms(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_VERSION_SPECIFIC_DATA +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTSUMMARY_VERSION_SPECIFIC_DATA +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointsummary_version_specific_data(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTTRANSACTIONINFO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTTRANSACTIONINFO +void* uniffi_iota_sdk_ffi_fn_clone_checkpointtransactioninfo(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CHECKPOINTTRANSACTIONINFO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CHECKPOINTTRANSACTIONINFO +void uniffi_iota_sdk_ffi_fn_free_checkpointtransactioninfo(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTTRANSACTIONINFO_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTTRANSACTIONINFO_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointtransactioninfo_new(void* transaction, void* effects, RustBuffer signatures, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTTRANSACTIONINFO_EFFECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTTRANSACTIONINFO_EFFECTS +void* uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_effects(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTTRANSACTIONINFO_SIGNATURES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTTRANSACTIONINFO_SIGNATURES +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_signatures(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTTRANSACTIONINFO_TRANSACTION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTTRANSACTIONINFO_TRANSACTION +void* uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_transaction(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CIRCOMG1 #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CIRCOMG1 void* uniffi_iota_sdk_ffi_fn_clone_circomg1(void* ptr, RustCallStatus *out_status @@ -1885,6 +2015,11 @@ void uniffi_iota_sdk_ffi_fn_free_multisigcommittee(void* ptr, RustCallStatus *ou void* uniffi_iota_sdk_ffi_fn_constructor_multisigcommittee_new(RustBuffer members, uint16_t threshold, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_DERIVE_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_DERIVE_ADDRESS +void* uniffi_iota_sdk_ffi_fn_method_multisigcommittee_derive_address(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_IS_VALID #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_IS_VALID int8_t uniffi_iota_sdk_ffi_fn_method_multisigcommittee_is_valid(void* ptr, RustCallStatus *out_status @@ -2126,6 +2261,11 @@ RustBuffer uniffi_iota_sdk_ffi_fn_method_object_as_struct(void* ptr, RustCallSta void* uniffi_iota_sdk_ffi_fn_method_object_data(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECT_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECT_DIGEST +void* uniffi_iota_sdk_ffi_fn_method_object_digest(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECT_OBJECT_ID #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECT_OBJECT_ID void* uniffi_iota_sdk_ffi_fn_method_object_object_id(void* ptr, RustCallStatus *out_status @@ -2206,6 +2346,11 @@ void* uniffi_iota_sdk_ffi_fn_clone_objectid(void* ptr, RustCallStatus *out_statu void uniffi_iota_sdk_ffi_fn_free_objectid(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_DERIVE_ID +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_DERIVE_ID +void* uniffi_iota_sdk_ffi_fn_constructor_objectid_derive_id(void* digest, uint64_t count, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_FROM_BYTES #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTID_FROM_BYTES void* uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes(RustBuffer bytes, RustCallStatus *out_status @@ -2216,6 +2361,11 @@ void* uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes(RustBuffer bytes, R void* uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex(RustBuffer hex, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTID_DERIVE_DYNAMIC_CHILD_ID +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTID_DERIVE_DYNAMIC_CHILD_ID +void* uniffi_iota_sdk_ffi_fn_method_objectid_derive_dynamic_child_id(void* ptr, void* key_type_tag, RustBuffer key_bytes, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTID_TO_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTID_TO_ADDRESS void* uniffi_iota_sdk_ffi_fn_method_objectid_to_address(void* ptr, RustCallStatus *out_status @@ -2363,11 +2513,41 @@ RustBuffer uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge(void* pt RustBuffer uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_PUBLIC_KEY +void* uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_public_key(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_SIGNATURE #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_SIGNATURE void* uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PASSKEYPUBLICKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PASSKEYPUBLICKEY +void* uniffi_iota_sdk_ffi_fn_clone_passkeypublickey(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PASSKEYPUBLICKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PASSKEYPUBLICKEY +void uniffi_iota_sdk_ffi_fn_free_passkeypublickey(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PASSKEYPUBLICKEY_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PASSKEYPUBLICKEY_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_passkeypublickey_new(void* public_key, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYPUBLICKEY_DERIVE_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYPUBLICKEY_DERIVE_ADDRESS +void* uniffi_iota_sdk_ffi_fn_method_passkeypublickey_derive_address(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYPUBLICKEY_INNER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYPUBLICKEY_INNER +void* uniffi_iota_sdk_ffi_fn_method_passkeypublickey_inner(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PASSKEYVERIFIER #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PASSKEYVERIFIER void* uniffi_iota_sdk_ffi_fn_clone_passkeyverifier(void* ptr, RustCallStatus *out_status @@ -2389,6 +2569,31 @@ void* uniffi_iota_sdk_ffi_fn_constructor_passkeyverifier_new(RustCallStatus *out void uniffi_iota_sdk_ffi_fn_method_passkeyverifier_verify(void* ptr, RustBuffer message, void* authenticator, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PERSONALMESSAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PERSONALMESSAGE +void* uniffi_iota_sdk_ffi_fn_clone_personalmessage(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PERSONALMESSAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PERSONALMESSAGE +void uniffi_iota_sdk_ffi_fn_free_personalmessage(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PERSONALMESSAGE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_PERSONALMESSAGE_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_personalmessage_new(RustBuffer message_bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PERSONALMESSAGE_MESSAGE_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PERSONALMESSAGE_MESSAGE_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_personalmessage_message_bytes(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PERSONALMESSAGE_SIGNING_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PERSONALMESSAGE_SIGNING_DIGEST +RustBuffer uniffi_iota_sdk_ffi_fn_method_personalmessage_signing_digest(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PROGRAMMABLETRANSACTION #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PROGRAMMABLETRANSACTION void* uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(void* ptr, RustCallStatus *out_status @@ -3210,6 +3415,11 @@ void uniffi_iota_sdk_ffi_fn_free_transaction(void* ptr, RustCallStatus *out_stat void* uniffi_iota_sdk_ffi_fn_constructor_transaction_new(void* kind, void* sender, RustBuffer gas_payment, RustBuffer expiration, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTION_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTION_DIGEST +void* uniffi_iota_sdk_ffi_fn_method_transaction_digest(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTION_EXPIRATION #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTION_EXPIRATION RustBuffer uniffi_iota_sdk_ffi_fn_method_transaction_expiration(void* ptr, RustCallStatus *out_status @@ -3230,6 +3440,11 @@ void* uniffi_iota_sdk_ffi_fn_method_transaction_kind(void* ptr, RustCallStatus * void* uniffi_iota_sdk_ffi_fn_method_transaction_sender(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTION_SIGNING_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTION_SIGNING_DIGEST +RustBuffer uniffi_iota_sdk_ffi_fn_method_transaction_signing_digest(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONBUILDER #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONBUILDER void* uniffi_iota_sdk_ffi_fn_clone_transactionbuilder(void* ptr, RustCallStatus *out_status @@ -3346,11 +3561,41 @@ void* uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1(RustBuffer ef RustBuffer uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTS_DIGEST +void* uniffi_iota_sdk_ffi_fn_method_transactioneffects_digest(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTS_IS_V1 #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTS_IS_V1 int8_t uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONEVENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONEVENTS +void* uniffi_iota_sdk_ffi_fn_clone_transactionevents(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_TRANSACTIONEVENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_TRANSACTIONEVENTS +void uniffi_iota_sdk_ffi_fn_free_transactionevents(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTS_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_transactionevents_new(RustBuffer events, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTS_DIGEST +void* uniffi_iota_sdk_ffi_fn_method_transactionevents_digest(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTS_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTS_EVENTS +RustBuffer uniffi_iota_sdk_ffi_fn_method_transactionevents_events(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONKIND #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONKIND void* uniffi_iota_sdk_ffi_fn_clone_transactionkind(void* ptr, RustCallStatus *out_status @@ -4006,6 +4251,21 @@ void* uniffi_iota_sdk_ffi_fn_constructor_zkloginpublicidentifier_new(RustBuffer void* uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_address_seed(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS +RustBuffer uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_PADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_PADDED +void* uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_padded(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_UNPADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_UNPADDED +void* uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_unpadded(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_ISS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_ISS RustBuffer uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_iss(void* ptr, RustCallStatus *out_status @@ -4494,6 +4754,108 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_o #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCOMMITMENT_IS_ECMH_LIVE_OBJECT_SET uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCONTENTS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCONTENTS_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCONTENTS_TRANSACTION_INFO +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCONTENTS_TRANSACTION_INFO +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_CHECKPOINT_COMMITMENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_CHECKPOINT_COMMITMENTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_CONTENT_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_CONTENT_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_END_OF_EPOCH_DATA +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_END_OF_EPOCH_DATA +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_EPOCH +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_EPOCH_ROLLING_GAS_COST_SUMMARY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_EPOCH_ROLLING_GAS_COST_SUMMARY +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_NETWORK_TOTAL_TRANSACTIONS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_NETWORK_TOTAL_TRANSACTIONS +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_PREVIOUS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_PREVIOUS_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_SEQUENCE_NUMBER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_SEQUENCE_NUMBER +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_SIGNING_MESSAGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_SIGNING_MESSAGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_TIMESTAMP_MS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_TIMESTAMP_MS +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_VERSION_SPECIFIC_DATA +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTSUMMARY_VERSION_SPECIFIC_DATA +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTTRANSACTIONINFO_EFFECTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTTRANSACTIONINFO_EFFECTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTTRANSACTIONINFO_SIGNATURES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTTRANSACTIONINFO_SIGNATURES +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTTRANSACTIONINFO_TRANSACTION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTTRANSACTIONINFO_TRANSACTION +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_COIN_BALANCE @@ -5106,6 +5468,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_signature(v #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATOR_WITH_VERIFIER uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_verifier(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_DERIVE_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_DERIVE_ADDRESS +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_IS_VALID @@ -5316,6 +5684,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_object_as_struct(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_DATA uint16_t uniffi_iota_sdk_ffi_checksum_method_object_data(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_digest(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_ID @@ -5376,6 +5750,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_objectdata_is_package(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTDATA_IS_STRUCT uint16_t uniffi_iota_sdk_ffi_checksum_method_objectdata_is_struct(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_DERIVE_DYNAMIC_CHILD_ID +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_DERIVE_DYNAMIC_CHILD_ID +uint16_t uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_ADDRESS @@ -5472,18 +5852,48 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_CLIENT_DATA_JSON uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_PUBLIC_KEY +uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_SIGNATURE #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_PASSKEYPUBLICKEY_DERIVE_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYPUBLICKEY_DERIVE_ADDRESS +uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_derive_address(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYPUBLICKEY_INNER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYPUBLICKEY_INNER +uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYVERIFIER_VERIFY #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYVERIFIER_VERIFY uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyverifier_verify(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PERSONALMESSAGE_MESSAGE_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PERSONALMESSAGE_MESSAGE_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PERSONALMESSAGE_SIGNING_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PERSONALMESSAGE_SIGNING_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PROGRAMMABLETRANSACTION_COMMANDS @@ -5946,6 +6356,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_systempackage_modules(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SYSTEMPACKAGE_VERSION uint16_t uniffi_iota_sdk_ffi_checksum_method_systempackage_version(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_digest(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_EXPIRATION @@ -5970,6 +6386,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_kind(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_SENDER uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_sender(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_SIGNING_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_SIGNING_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONBUILDER_ADD_GAS_OBJECTS @@ -6072,12 +6494,30 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_upgrade(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTS_AS_V1 uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTS_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTS_IS_V1 #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTS_IS_V1 uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTS_DIGEST +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTS_DIGEST +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTS_EVENTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTS_EVENTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactionevents_events(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSFEROBJECTS_ADDRESS @@ -6462,6 +6902,24 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginproof_c(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_ADDRESS_SEED uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_PADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_PADDED +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_UNPADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_DERIVE_ADDRESS_UNPADDED +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_ISS @@ -6600,6 +7058,24 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHANGEEPOCHV2_NEW uint16_t uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTS_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTSUMMARY_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTSUMMARY_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTTRANSACTIONINFO_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTTRANSACTIONINFO_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CIRCOMG1_NEW @@ -7020,6 +7496,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_package(vo #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDATA_NEW_MOVE_STRUCT uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_struct(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_DERIVE_ID +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_DERIVE_ID +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_FROM_BYTES @@ -7068,12 +7550,24 @@ 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_PASSKEYPUBLICKEY_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PASSKEYPUBLICKEY_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_passkeypublickey_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PASSKEYVERIFIER_NEW #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PASSKEYVERIFIER_NEW uint16_t uniffi_iota_sdk_ffi_checksum_constructor_passkeyverifier_new(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PERSONALMESSAGE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PERSONALMESSAGE_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_PROGRAMMABLETRANSACTION_NEW @@ -7356,6 +7850,12 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactionbuilder_new(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEFFECTS_NEW_V1 uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTS_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONKIND_NEW_AUTHENTICATOR_STATE_UPDATE_V1 diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index 8fce5174a..673bde718 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -1968,6 +1968,98 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2060,6 +2152,40 @@ fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object ): Short fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction( +): Short fun uniffi_iota_sdk_ffi_checksum_method_coin_balance( ): Short fun uniffi_iota_sdk_ffi_checksum_method_coin_coin_type( @@ -2264,6 +2390,8 @@ fun uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_signature( ): Short fun uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_verifier( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address( +): Short fun uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid( ): Short fun uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_members( @@ -2334,6 +2462,8 @@ fun uniffi_iota_sdk_ffi_checksum_method_object_as_struct( ): Short fun uniffi_iota_sdk_ffi_checksum_method_object_data( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_object_digest( +): Short fun uniffi_iota_sdk_ffi_checksum_method_object_object_id( ): Short fun uniffi_iota_sdk_ffi_checksum_method_object_object_type( @@ -2354,6 +2484,8 @@ fun uniffi_iota_sdk_ffi_checksum_method_objectdata_is_package( ): Short fun uniffi_iota_sdk_ffi_checksum_method_objectdata_is_struct( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id( +): Short fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_address( ): Short fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes( @@ -2386,10 +2518,20 @@ fun uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge( ): Short fun uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key( +): Short fun uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_derive_address( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner( +): Short fun uniffi_iota_sdk_ffi_checksum_method_passkeyverifier_verify( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest( +): Short fun uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_commands( ): Short fun uniffi_iota_sdk_ffi_checksum_method_programmabletransaction_inputs( @@ -2544,6 +2686,8 @@ fun uniffi_iota_sdk_ffi_checksum_method_systempackage_modules( ): Short fun uniffi_iota_sdk_ffi_checksum_method_systempackage_version( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_transaction_digest( +): Short fun uniffi_iota_sdk_ffi_checksum_method_transaction_expiration( ): Short fun uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment( @@ -2552,6 +2696,8 @@ fun uniffi_iota_sdk_ffi_checksum_method_transaction_kind( ): Short fun uniffi_iota_sdk_ffi_checksum_method_transaction_sender( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest( +): Short fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_add_gas_objects( ): Short fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_finish( @@ -2586,8 +2732,14 @@ fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_upgrade( ): Short fun uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest( +): Short fun uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactionevents_events( +): Short fun uniffi_iota_sdk_ffi_checksum_method_transferobjects_address( ): Short fun uniffi_iota_sdk_ffi_checksum_method_transferobjects_objects( @@ -2716,6 +2868,12 @@ fun uniffi_iota_sdk_ffi_checksum_method_zkloginproof_c( ): Short fun uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed( ): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded( +): Short fun uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss( ): Short fun uniffi_iota_sdk_ffi_checksum_method_zkloginverifier_jwks( @@ -2762,6 +2920,12 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_changeepoch_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new( @@ -2902,6 +3066,8 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_package( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_struct( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex( @@ -2918,8 +3084,12 @@ 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_passkeypublickey_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_passkeyverifier_new( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_programmabletransaction_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_publish_new( @@ -3014,6 +3184,8 @@ fun uniffi_iota_sdk_ffi_checksum_constructor_transactionbuilder_new( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1( ): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new( +): Short fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_authenticator_state_update_v1( ): Short fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_consensus_commit_prologue_v1( @@ -3279,6 +3451,58 @@ fun uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_d ): Pointer fun uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte +fun uniffi_iota_sdk_ffi_fn_clone_checkpointcontents(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_checkpointcontents(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointcontents_new(`transactionInfo`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointcontents_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointcontents_transaction_info(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_checkpointsummary(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_checkpointsummary(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointsummary_new(`epoch`: Long,`sequenceNumber`: Long,`networkTotalTransactions`: Long,`contentDigest`: Pointer,`previousDigest`: RustBuffer.ByValue,`epochRollingGasCostSummary`: RustBuffer.ByValue,`timestampMs`: Long,`checkpointCommitments`: RustBuffer.ByValue,`endOfEpochData`: RustBuffer.ByValue,`versionSpecificData`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_checkpoint_commitments(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_content_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_end_of_epoch_data(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch_rolling_gas_cost_summary(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_network_total_transactions(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_previous_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_sequence_number(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_signing_message(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_timestamp_ms(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_checkpointsummary_version_specific_data(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_checkpointtransactioninfo(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_checkpointtransactioninfo(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointtransactioninfo_new(`transaction`: Pointer,`effects`: Pointer,`signatures`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_effects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_signatures(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_transaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_clone_circomg1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_circomg1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3739,6 +3963,8 @@ fun uniffi_iota_sdk_ffi_fn_free_multisigcommittee(`ptr`: Pointer,uniffi_out_err: ): Unit fun uniffi_iota_sdk_ffi_fn_constructor_multisigcommittee_new(`members`: RustBuffer.ByValue,`threshold`: Short,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigcommittee_derive_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_method_multisigcommittee_is_valid(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte fun uniffi_iota_sdk_ffi_fn_method_multisigcommittee_members(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3835,6 +4061,8 @@ fun uniffi_iota_sdk_ffi_fn_method_object_as_struct(`ptr`: Pointer,uniffi_out_err ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_object_data(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_method_object_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_method_object_object_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_method_object_object_type(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3867,10 +4095,14 @@ fun uniffi_iota_sdk_ffi_fn_clone_objectid(`ptr`: Pointer,uniffi_out_err: UniffiR ): Pointer fun uniffi_iota_sdk_ffi_fn_free_objectid(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_objectid_derive_id(`digest`: Pointer,`count`: Long,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex(`hex`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_method_objectid_derive_dynamic_child_id(`ptr`: Pointer,`keyTypeTag`: Pointer,`keyBytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_method_objectid_to_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3929,8 +4161,20 @@ fun uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge(`ptr`: Pointer, ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_public_key(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_passkeypublickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_passkeypublickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_passkeypublickey_new(`publicKey`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_passkeypublickey_derive_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_passkeypublickey_inner(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_clone_passkeyverifier(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_passkeyverifier(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3939,6 +4183,16 @@ fun uniffi_iota_sdk_ffi_fn_constructor_passkeyverifier_new(uniffi_out_err: Uniff ): Pointer fun uniffi_iota_sdk_ffi_fn_method_passkeyverifier_verify(`ptr`: Pointer,`message`: RustBuffer.ByValue,`authenticator`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_clone_personalmessage(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_personalmessage(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_personalmessage_new(`messageBytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_personalmessage_message_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_personalmessage_signing_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_programmabletransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4263,6 +4517,8 @@ fun uniffi_iota_sdk_ffi_fn_free_transaction(`ptr`: Pointer,uniffi_out_err: Uniff ): Unit fun uniffi_iota_sdk_ffi_fn_constructor_transaction_new(`kind`: Pointer,`sender`: Pointer,`gasPayment`: RustBuffer.ByValue,`expiration`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transaction_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_method_transaction_expiration(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4271,6 +4527,8 @@ fun uniffi_iota_sdk_ffi_fn_method_transaction_kind(`ptr`: Pointer,uniffi_out_err ): Pointer fun uniffi_iota_sdk_ffi_fn_method_transaction_sender(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transaction_signing_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_transactionbuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_transactionbuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4317,8 +4575,20 @@ fun uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1(`effects`: Rust ): Pointer fun uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_transactioneffects_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte +fun uniffi_iota_sdk_ffi_fn_clone_transactionevents(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_transactionevents(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_transactionevents_new(`events`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transactionevents_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transactionevents_events(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_transactionkind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_transactionkind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4577,6 +4847,12 @@ fun uniffi_iota_sdk_ffi_fn_constructor_zkloginpublicidentifier_new(`iss`: RustBu ): Pointer fun uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_address_seed(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_padded(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_unpadded(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_iss(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_zkloginverifier(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4803,6 +5079,57 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set() != 22589.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest() != 22345.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info() != 56465.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments() != 61600.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest() != 31627.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest() != 14291.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data() != 49930.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch() != 35840.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary() != 10205.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions() != 50558.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest() != 933.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number() != 33896.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message() != 59962.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms() != 62474.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data() != 43828.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects() != 54822.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures() != 36925.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction() != 58570.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_coin_balance() != 29928.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4935,7 +5262,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_chain_id() != 45619.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 13597.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 11584.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 8422.toShort()) { @@ -5109,6 +5436,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_verifier() != 10820.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() != 12725.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid() != 45468.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5214,6 +5544,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_object_data() != 4330.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_object_digest() != 48655.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_object_object_id() != 6575.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5244,6 +5577,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_objectdata_is_struct() != 58579.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id() != 47819.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_address() != 21880.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5292,12 +5628,27 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json() != 20272.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key() != 18555.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } 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_passkeypublickey_derive_address() != 61803.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner() != 65008.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyverifier_verify() != 19101.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes() != 347.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest() != 39344.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") } @@ -5529,6 +5880,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_systempackage_version() != 39738.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_digest() != 52429.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() != 47752.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5541,6 +5895,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_sender() != 38190.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest() != 36608.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_add_gas_objects() != 33983.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5592,9 +5949,18 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1() != 48710.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest() != 46963.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1() != 39808.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest() != 55750.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_events() != 36651.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") } @@ -5787,6 +6153,15 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed() != 3936.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address() != 14353.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded() != 45141.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded() != 51424.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss() != 58864.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5856,6 +6231,15 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new() != 52433.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new() != 27130.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new() != 16062.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new() != 65327.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new() != 39786.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6066,6 +6450,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_struct() != 1861.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id() != 16970.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes() != 41789.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6090,9 +6477,15 @@ 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_passkeypublickey_new() != 30856.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_passkeyverifier_new() != 23457.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new() != 3617.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") } @@ -6234,6 +6627,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1() != 63561.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new() != 1310.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_authenticator_state_update_v1() != 29264.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -10219,296 +10615,55 @@ public object FfiConverterTypeCheckpointCommitment: 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 - - 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) - } - } - +public interface CheckpointContentsInterface { - + fun `digest`(): Digest + fun `transactionInfo`(): List 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))) - } -} - - -// 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 G2 point + * The committed to contents of a checkpoint. * - * This represents the canonical decimal representation of the coefficients of - * the projective coordinates in Fq2. + * `CheckpointContents` contains a list of digests of Transactions, their + * effects, and the user signatures that authorized their execution included in + * a checkpoint. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * circom-g2 = %x03 3(%x02 2(bn254-field-element)) - * ``` - */ -public interface CircomG2Interface { - - companion object -} - -/** - * A G2 point - * - * This represents the canonical decimal representation of the coefficients of - * the projective coordinates in Fq2. - * - * # BCS + * checkpoint-contents = %x00 checkpoint-contents-v1 ; variant 0 * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * circom-g2 = %x03 3(%x02 2(bn254-field-element)) + * checkpoint-contents-v1 = (vector (digest digest)) ; vector of transaction and effect digests + * (vector (vector bcs-user-signature)) ; set of user signatures for each + * ; transaction. MUST be the same + * ; length as the vector of digests * ``` */ -open class CircomG2: Disposable, AutoCloseable, CircomG2Interface +open class CheckpointContents: Disposable, AutoCloseable, CheckpointContentsInterface { constructor(pointer: Pointer) { @@ -10526,11 +10681,1387 @@ open class CircomG2: Disposable, AutoCloseable, CircomG2Interface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - constructor(`el00`: Bn254FieldElement, `el01`: Bn254FieldElement, `el10`: Bn254FieldElement, `el11`: Bn254FieldElement, `el20`: Bn254FieldElement, `el21`: Bn254FieldElement) : + constructor(`transactionInfo`: List) : this( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_circomg2_new( - FfiConverterTypeBn254FieldElement.lower(`el00`),FfiConverterTypeBn254FieldElement.lower(`el01`),FfiConverterTypeBn254FieldElement.lower(`el10`),FfiConverterTypeBn254FieldElement.lower(`el11`),FfiConverterTypeBn254FieldElement.lower(`el20`),FfiConverterTypeBn254FieldElement.lower(`el21`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontents_new( + FfiConverterSequenceTypeCheckpointTransactionInfo.lower(`transactionInfo`),_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_checkpointcontents(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcontents(pointer!!, status) + } + } + + override fun `digest`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_digest( + it, _status) +} + } + ) + } + + + override fun `transactionInfo`(): List { + return FfiConverterSequenceTypeCheckpointTransactionInfo.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_transaction_info( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeCheckpointContents: FfiConverter { + + override fun lower(value: CheckpointContents): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): CheckpointContents { + return CheckpointContents(value) + } + + override fun read(buf: ByteBuffer): CheckpointContents { + // 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: CheckpointContents) = 8UL + + override fun write(value: CheckpointContents, 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 header for a Checkpoint on the IOTA blockchain. + * + * On the IOTA network, checkpoints define the history of the blockchain. They + * are quite similar to the concept of blocks used by other blockchains like + * Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after + * transaction execution has already happened to provide a certified history of + * the chain, instead of being formed before execution. + * + * Checkpoints commit to a variety of state including but not limited to: + * - The hash of the previous checkpoint. + * - The set of transaction digests, their corresponding effects digests, as + * well as the set of user signatures which authorized its execution. + * - The object's produced by a transaction. + * - The set of live objects that make up the current state of the chain. + * - On epoch transitions, the next validator committee. + * + * `CheckpointSummary`s themselves don't directly include all of the above + * information but they are the top-level type by which all the above are + * committed to transitively via cryptographic hashes included in the summary. + * `CheckpointSummary`s are signed and certified by a quorum of the validator + * committee in a given epoch in order to allow verification of the chain's + * state. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * checkpoint-summary = u64 ; epoch + * u64 ; sequence_number + * u64 ; network_total_transactions + * digest ; content_digest + * (option digest) ; previous_digest + * gas-cost-summary ; epoch_rolling_gas_cost_summary + * u64 ; timestamp_ms + * (vector checkpoint-commitment) ; checkpoint_commitments + * (option end-of-epoch-data) ; end_of_epoch_data + * bytes ; version_specific_data + * ``` + */ +public interface CheckpointSummaryInterface { + + /** + * Commitments to checkpoint-specific state. + */ + fun `checkpointCommitments`(): List + + /** + * The hash of the `CheckpointContents` for this checkpoint. + */ + fun `contentDigest`(): Digest + + fun `digest`(): Digest + + /** + * Extra data only present in the final checkpoint of an epoch. + */ + fun `endOfEpochData`(): EndOfEpochData? + + /** + * Epoch that this checkpoint belongs to. + */ + fun `epoch`(): kotlin.ULong + + /** + * The running total gas costs of all transactions included in the current + * epoch so far until this checkpoint. + */ + fun `epochRollingGasCostSummary`(): GasCostSummary + + /** + * Total number of transactions committed since genesis, including those in + * this checkpoint. + */ + fun `networkTotalTransactions`(): kotlin.ULong + + /** + * The hash of the previous `CheckpointSummary`. + * + * This will be only be `None` for the first, or genesis checkpoint. + */ + fun `previousDigest`(): Digest? + + /** + * The height of this checkpoint. + */ + fun `sequenceNumber`(): kotlin.ULong + + fun `signingMessage`(): kotlin.ByteArray + + /** + * Timestamp of the checkpoint - number of milliseconds from the Unix epoch + * Checkpoint timestamps are monotonic, but not strongly monotonic - + * subsequent checkpoints can have same timestamp if they originate + * from the same underlining consensus commit + */ + fun `timestampMs`(): kotlin.ULong + + /** + * CheckpointSummary is not an evolvable structure - it must be readable by + * any version of the code. Therefore, in order to allow extensions to + * be added to CheckpointSummary, we allow opaque data to be added to + * checkpoints which can be deserialized based on the current + * protocol version. + */ + fun `versionSpecificData`(): kotlin.ByteArray + + companion object +} + +/** + * A header for a Checkpoint on the IOTA blockchain. + * + * On the IOTA network, checkpoints define the history of the blockchain. They + * are quite similar to the concept of blocks used by other blockchains like + * Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after + * transaction execution has already happened to provide a certified history of + * the chain, instead of being formed before execution. + * + * Checkpoints commit to a variety of state including but not limited to: + * - The hash of the previous checkpoint. + * - The set of transaction digests, their corresponding effects digests, as + * well as the set of user signatures which authorized its execution. + * - The object's produced by a transaction. + * - The set of live objects that make up the current state of the chain. + * - On epoch transitions, the next validator committee. + * + * `CheckpointSummary`s themselves don't directly include all of the above + * information but they are the top-level type by which all the above are + * committed to transitively via cryptographic hashes included in the summary. + * `CheckpointSummary`s are signed and certified by a quorum of the validator + * committee in a given epoch in order to allow verification of the chain's + * state. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * checkpoint-summary = u64 ; epoch + * u64 ; sequence_number + * u64 ; network_total_transactions + * digest ; content_digest + * (option digest) ; previous_digest + * gas-cost-summary ; epoch_rolling_gas_cost_summary + * u64 ; timestamp_ms + * (vector checkpoint-commitment) ; checkpoint_commitments + * (option end-of-epoch-data) ; end_of_epoch_data + * bytes ; version_specific_data + * ``` + */ +open class CheckpointSummary: Disposable, AutoCloseable, CheckpointSummaryInterface +{ + + 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(`epoch`: kotlin.ULong, `sequenceNumber`: kotlin.ULong, `networkTotalTransactions`: kotlin.ULong, `contentDigest`: Digest, `previousDigest`: Digest?, `epochRollingGasCostSummary`: GasCostSummary, `timestampMs`: kotlin.ULong, `checkpointCommitments`: List, `endOfEpochData`: EndOfEpochData?, `versionSpecificData`: kotlin.ByteArray) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointsummary_new( + FfiConverterULong.lower(`epoch`),FfiConverterULong.lower(`sequenceNumber`),FfiConverterULong.lower(`networkTotalTransactions`),FfiConverterTypeDigest.lower(`contentDigest`),FfiConverterOptionalTypeDigest.lower(`previousDigest`),FfiConverterTypeGasCostSummary.lower(`epochRollingGasCostSummary`),FfiConverterULong.lower(`timestampMs`),FfiConverterSequenceTypeCheckpointCommitment.lower(`checkpointCommitments`),FfiConverterOptionalTypeEndOfEpochData.lower(`endOfEpochData`),FfiConverterByteArray.lower(`versionSpecificData`),_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_checkpointsummary(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointsummary(pointer!!, status) + } + } + + + /** + * Commitments to checkpoint-specific state. + */override fun `checkpointCommitments`(): List { + return FfiConverterSequenceTypeCheckpointCommitment.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_checkpoint_commitments( + it, _status) +} + } + ) + } + + + + /** + * The hash of the `CheckpointContents` for this checkpoint. + */override fun `contentDigest`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_content_digest( + it, _status) +} + } + ) + } + + + override fun `digest`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_digest( + it, _status) +} + } + ) + } + + + + /** + * Extra data only present in the final checkpoint of an epoch. + */override fun `endOfEpochData`(): EndOfEpochData? { + return FfiConverterOptionalTypeEndOfEpochData.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_end_of_epoch_data( + it, _status) +} + } + ) + } + + + + /** + * Epoch that this checkpoint belongs to. + */override fun `epoch`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch( + it, _status) +} + } + ) + } + + + + /** + * The running total gas costs of all transactions included in the current + * epoch so far until this checkpoint. + */override fun `epochRollingGasCostSummary`(): GasCostSummary { + return FfiConverterTypeGasCostSummary.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch_rolling_gas_cost_summary( + it, _status) +} + } + ) + } + + + + /** + * Total number of transactions committed since genesis, including those in + * this checkpoint. + */override fun `networkTotalTransactions`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_network_total_transactions( + it, _status) +} + } + ) + } + + + + /** + * The hash of the previous `CheckpointSummary`. + * + * This will be only be `None` for the first, or genesis checkpoint. + */override fun `previousDigest`(): Digest? { + return FfiConverterOptionalTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_previous_digest( + it, _status) +} + } + ) + } + + + + /** + * The height of this checkpoint. + */override fun `sequenceNumber`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_sequence_number( + it, _status) +} + } + ) + } + + + override fun `signingMessage`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_signing_message( + it, _status) +} + } + ) + } + + + + /** + * Timestamp of the checkpoint - number of milliseconds from the Unix epoch + * Checkpoint timestamps are monotonic, but not strongly monotonic - + * subsequent checkpoints can have same timestamp if they originate + * from the same underlining consensus commit + */override fun `timestampMs`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_timestamp_ms( + it, _status) +} + } + ) + } + + + + /** + * CheckpointSummary is not an evolvable structure - it must be readable by + * any version of the code. Therefore, in order to allow extensions to + * be added to CheckpointSummary, we allow opaque data to be added to + * checkpoints which can be deserialized based on the current + * protocol version. + */override fun `versionSpecificData`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_version_specific_data( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeCheckpointSummary: FfiConverter { + + override fun lower(value: CheckpointSummary): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): CheckpointSummary { + return CheckpointSummary(value) + } + + override fun read(buf: ByteBuffer): CheckpointSummary { + // 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: CheckpointSummary) = 8UL + + override fun write(value: CheckpointSummary, 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 information committed to in a checkpoint + */ +public interface CheckpointTransactionInfoInterface { + + fun `effects`(): Digest + + fun `signatures`(): List + + fun `transaction`(): Digest + + companion object +} + +/** + * Transaction information committed to in a checkpoint + */ +open class CheckpointTransactionInfo: Disposable, AutoCloseable, CheckpointTransactionInfoInterface +{ + + 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(`transaction`: Digest, `effects`: Digest, `signatures`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointtransactioninfo_new( + FfiConverterTypeDigest.lower(`transaction`),FfiConverterTypeDigest.lower(`effects`),FfiConverterSequenceTypeUserSignature.lower(`signatures`),_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_checkpointtransactioninfo(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointtransactioninfo(pointer!!, status) + } + } + + override fun `effects`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_effects( + it, _status) +} + } + ) + } + + + override fun `signatures`(): List { + return FfiConverterSequenceTypeUserSignature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_signatures( + it, _status) +} + } + ) + } + + + override fun `transaction`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_transaction( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeCheckpointTransactionInfo: FfiConverter { + + override fun lower(value: CheckpointTransactionInfo): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): CheckpointTransactionInfo { + return CheckpointTransactionInfo(value) + } + + override fun read(buf: ByteBuffer): CheckpointTransactionInfo { + // 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: CheckpointTransactionInfo) = 8UL + + override fun write(value: CheckpointTransactionInfo, 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))) + } +} + + +// 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 G2 point + * + * This represents the canonical decimal representation of the coefficients of + * the projective coordinates in Fq2. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * circom-g2 = %x03 3(%x02 2(bn254-field-element)) + * ``` + */ +public interface CircomG2Interface { + + companion object +} + +/** + * A G2 point + * + * This represents the canonical decimal representation of the coefficients of + * the projective coordinates in Fq2. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * circom-g2 = %x03 3(%x02 2(bn254-field-element)) + * ``` + */ +open class CircomG2: Disposable, AutoCloseable, CircomG2Interface +{ + + 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(`el00`: Bn254FieldElement, `el01`: Bn254FieldElement, `el10`: Bn254FieldElement, `el11`: Bn254FieldElement, `el20`: Bn254FieldElement, `el21`: Bn254FieldElement) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_circomg2_new( + FfiConverterTypeBn254FieldElement.lower(`el00`),FfiConverterTypeBn254FieldElement.lower(`el01`),FfiConverterTypeBn254FieldElement.lower(`el10`),FfiConverterTypeBn254FieldElement.lower(`el11`),FfiConverterTypeBn254FieldElement.lower(`el20`),FfiConverterTypeBn254FieldElement.lower(`el21`),_status) } ) @@ -20788,6 +22319,27 @@ public object FfiConverterTypeMultisigAggregator: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_derive_address( + it, _status) +} + } + ) + } + + + /** * Checks if the Committee is valid. * @@ -22422,7 +24005,344 @@ open class MultisigVerifier: Disposable, AutoCloseable, MultisigVerifierInterfac override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigverifier(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigverifier(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigverifier(pointer!!, status) + } + } + + + @Throws(SdkFfiException::class)override fun `verify`(`message`: kotlin.ByteArray, `signature`: MultisigAggregatedSignature) + = + callWithPointer { + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigverifier_verify( + it, FfiConverterByteArray.lower(`message`),FfiConverterTypeMultisigAggregatedSignature.lower(`signature`),_status) +} + } + + + + override fun `withZkloginVerifier`(`zkloginVerifier`: ZkloginVerifier): MultisigVerifier { + return FfiConverterTypeMultisigVerifier.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigverifier_with_zklogin_verifier( + it, FfiConverterTypeZkloginVerifier.lower(`zkloginVerifier`),_status) +} + } + ) + } + + + override fun `zkloginVerifier`(): ZkloginVerifier? { + return FfiConverterOptionalTypeZkloginVerifier.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigverifier_zklogin_verifier( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeMultisigVerifier: FfiConverter { + + override fun lower(value: MultisigVerifier): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): MultisigVerifier { + return MultisigVerifier(value) + } + + override fun read(buf: ByteBuffer): MultisigVerifier { + // 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: MultisigVerifier) = 8UL + + override fun write(value: MultisigVerifier, 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 +// + + +/** + * 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 { + + /** + * Try to interpret this object as a move struct + */ + fun `asStruct`(): MoveStruct? + + /** + * Return this object's data + */ + fun `data`(): ObjectData + + /** + * Calculate the digest of this `Object` + * + * This is done by hashing the BCS bytes of this `Object` prefixed + */ + fun `digest`(): Digest + + /** + * 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`(): Digest + + /** + * 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 +} + +/** + * 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) { + 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(`data`: ObjectData, `owner`: Owner, `previousTransaction`: Digest, `storageRebate`: kotlin.ULong) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_object_new( + FfiConverterTypeObjectData.lower(`data`),FfiConverterTypeOwner.lower(`owner`),FfiConverterTypeDigest.lower(`previousTransaction`),FfiConverterULong.lower(`storageRebate`),_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_object(ptr, status) } } } @@ -22430,39 +24350,18 @@ open class MultisigVerifier: Disposable, AutoCloseable, MultisigVerifierInterfac fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigverifier(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_object(pointer!!, status) } } - @Throws(SdkFfiException::class)override fun `verify`(`message`: kotlin.ByteArray, `signature`: MultisigAggregatedSignature) - = - callWithPointer { - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigverifier_verify( - it, FfiConverterByteArray.lower(`message`),FfiConverterTypeMultisigAggregatedSignature.lower(`signature`),_status) -} - } - - - - override fun `withZkloginVerifier`(`zkloginVerifier`: ZkloginVerifier): MultisigVerifier { - return FfiConverterTypeMultisigVerifier.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigverifier_with_zklogin_verifier( - it, FfiConverterTypeZkloginVerifier.lower(`zkloginVerifier`),_status) -} - } - ) - } - - - override fun `zkloginVerifier`(): ZkloginVerifier? { - return FfiConverterOptionalTypeZkloginVerifier.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_multisigverifier_zklogin_verifier( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_as_struct( it, _status) } } @@ -22471,307 +24370,13 @@ open class MultisigVerifier: Disposable, AutoCloseable, MultisigVerifierInterfac - - - - companion object - -} - -/** - * @suppress - */ -public object FfiConverterTypeMultisigVerifier: FfiConverter { - - override fun lower(value: MultisigVerifier): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): MultisigVerifier { - return MultisigVerifier(value) - } - - override fun read(buf: ByteBuffer): MultisigVerifier { - // 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: MultisigVerifier) = 8UL - - override fun write(value: MultisigVerifier, 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 -// - - -/** - * 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 { - - /** - * 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 - - /** - * Return this object's owner - */ - fun `owner`(): Owner - - /** - * Return the digest of the transaction that last modified this object - */ - fun `previousTransaction`(): Digest - - /** - * 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 -} - -/** - * 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) { - 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(`data`: ObjectData, `owner`: Owner, `previousTransaction`: Digest, `storageRebate`: kotlin.ULong) : - this( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_object_new( - FfiConverterTypeObjectData.lower(`data`),FfiConverterTypeOwner.lower(`owner`),FfiConverterTypeDigest.lower(`previousTransaction`),FfiConverterULong.lower(`storageRebate`),_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_object(ptr, status) - } - } - } - } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_object(pointer!!, status) - } - } - - - /** - * Try to interpret this object as a move struct - */override fun `asStruct`(): MoveStruct? { - return FfiConverterOptionalTypeMoveStruct.lift( + */override fun `data`(): ObjectData { + return FfiConverterTypeObjectData.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_as_struct( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_data( it, _status) } } @@ -22781,12 +24386,14 @@ open class Object: Disposable, AutoCloseable, ObjectInterface /** - * Return this object's data - */override fun `data`(): ObjectData { - return FfiConverterTypeObjectData.lift( + * Calculate the digest of this `Object` + * + * This is done by hashing the BCS bytes of this `Object` prefixed + */override fun `digest`(): Digest { + return FfiConverterTypeDigest.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_data( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_digest( it, _status) } } @@ -23401,6 +25008,13 @@ public object FfiConverterTypeObjectData: FfiConverter { */ public interface ObjectIdInterface { + /** + * Derive an ObjectId for a Dynamic Child Object. + * + * hash(parent || len(key) || key || key_type_tag) + */ + fun `deriveDynamicChildId`(`keyTypeTag`: TypeTag, `keyBytes`: kotlin.ByteArray): ObjectId + fun `toAddress`(): Address fun `toBytes`(): kotlin.ByteArray @@ -23512,6 +25126,23 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface } } + + /** + * Derive an ObjectId for a Dynamic Child Object. + * + * hash(parent || len(key) || key || key_type_tag) + */override fun `deriveDynamicChildId`(`keyTypeTag`: TypeTag, `keyBytes`: kotlin.ByteArray): ObjectId { + return FfiConverterTypeObjectId.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_derive_dynamic_child_id( + it, FfiConverterTypeTypeTag.lower(`keyTypeTag`),FfiConverterByteArray.lower(`keyBytes`),_status) +} + } + ) + } + + override fun `toAddress`(): Address { return FfiConverterTypeAddress.lift( callWithPointer { @@ -23563,6 +25194,20 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface companion object { + /** + * Create an ObjectId from a transaction digest and the number of objects + * that have been created during a transactions. + */ fun `deriveId`(`digest`: Digest, `count`: kotlin.ULong): ObjectId { + return FfiConverterTypeObjectId.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_derive_id( + FfiConverterTypeDigest.lower(`digest`),FfiConverterULong.lower(`count`),_status) +} + ) + } + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectId { return FfiConverterTypeObjectId.lift( uniffiRustCallWithError(SdkFfiException) { _status -> @@ -24455,6 +26100,11 @@ public interface PasskeyAuthenticatorInterface { */ fun `clientDataJson`(): kotlin.String + /** + * The passkey public key + */ + fun `publicKey`(): PasskeyPublicKey + /** * The passkey signature. */ @@ -24629,6 +26279,21 @@ open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticator + /** + * The passkey public key + */override fun `publicKey`(): PasskeyPublicKey { + return FfiConverterTypePasskeyPublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_public_key( + it, _status) +} + } + ) + } + + + /** * The passkey signature. */override fun `signature`(): SimpleSignature { @@ -24778,6 +26443,307 @@ public object FfiConverterTypePasskeyAuthenticator: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_passkeypublickey_new( + FfiConverterTypeSecp256r1PublicKey.lower(`publicKey`),_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_passkeypublickey(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_passkeypublickey(pointer!!, status) + } + } + + + /** + * Derive an `Address` from this Passkey Public Key + * + * An `Address` can be derived from a `PasskeyPublicKey` by hashing the + * bytes of the `Secp256r1PublicKey` that corresponds to this passkey + * prefixed with the Passkey `SignatureScheme` flag (`0x06`). + * + * `hash( 0x06 || 33-byte secp256r1 public key)` + */override fun `deriveAddress`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_derive_address( + it, _status) +} + } + ) + } + + + override fun `inner`(): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_inner( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypePasskeyPublicKey: FfiConverter { + + override fun lower(value: PasskeyPublicKey): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): PasskeyPublicKey { + return PasskeyPublicKey(value) + } + + override fun read(buf: ByteBuffer): PasskeyPublicKey { + // 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: PasskeyPublicKey) = 8UL + + override fun write(value: PasskeyPublicKey, 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 PasskeyVerifierInterface { fun `verify`(`message`: kotlin.ByteArray, `authenticator`: PasskeyAuthenticator) @@ -25021,6 +26987,263 @@ public object FfiConverterTypePasskeyVerifier: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_personalmessage_new( + FfiConverterByteArray.lower(`messageBytes`),_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_personalmessage(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_personalmessage(pointer!!, status) + } + } + + override fun `messageBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_personalmessage_message_bytes( + it, _status) +} + } + ) + } + + + override fun `signingDigest`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_personalmessage_signing_digest( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypePersonalMessage: FfiConverter { + + override fun lower(value: PersonalMessage): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): PersonalMessage { + return PersonalMessage(value) + } + + override fun read(buf: ByteBuffer): PersonalMessage { + // 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: PersonalMessage) = 8UL + + override fun write(value: PersonalMessage, 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 user transaction * @@ -31240,6 +33463,8 @@ public object FfiConverterTypeSystemPackage: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_digest( + it, _status) +} + } + ) + } + + override fun `expiration`(): TransactionExpiration { return FfiConverterTypeTransactionExpiration.lift( callWithPointer { @@ -31401,6 +33640,18 @@ open class Transaction: Disposable, AutoCloseable, TransactionInterface } + override fun `signingDigest`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_signing_digest( + it, _status) +} + } + ) + } + + @@ -32297,6 +34548,8 @@ public interface TransactionEffectsInterface { fun `asV1`(): TransactionEffectsV1 + fun `digest`(): Digest + fun `isV1`(): kotlin.Boolean companion object @@ -32408,6 +34661,18 @@ open class TransactionEffects: Disposable, AutoCloseable, TransactionEffectsInte } + override fun `digest`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffects_digest( + it, _status) +} + } + ) + } + + override fun `isV1`(): kotlin.Boolean { return FfiConverterBoolean.lift( callWithPointer { @@ -32566,6 +34831,285 @@ public object FfiConverterTypeTransactionEffects: FfiConverter + + companion object +} + +/** + * Events emitted during the successful execution of a transaction + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transaction-events = vector event + * ``` + */ +open class TransactionEvents: Disposable, AutoCloseable, TransactionEventsInterface +{ + + 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(`events`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionevents_new( + FfiConverterSequenceTypeEvent.lower(`events`),_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_transactionevents(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactionevents(pointer!!, status) + } + } + + override fun `digest`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactionevents_digest( + it, _status) +} + } + ) + } + + + override fun `events`(): List { + return FfiConverterSequenceTypeEvent.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactionevents_events( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeTransactionEvents: FfiConverter { + + override fun lower(value: TransactionEvents): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): TransactionEvents { + return TransactionEvents(value) + } + + override fun read(buf: ByteBuffer): TransactionEvents { + // 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: TransactionEvents) = 8UL + + override fun write(value: TransactionEvents, 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 * @@ -37021,6 +39565,38 @@ public interface ZkLoginPublicIdentifierInterface { fun `addressSeed`(): Bn254FieldElement + /** + * Provides an iterator over the addresses that correspond to this zklogin + * authenticator. + * + * In the majority of instances this will only yield a single address, + * except for the instances where the `address_seed` value has a + * leading zero-byte, in such cases the returned iterator will yield + * two addresses. + */ + fun `deriveAddress`(): List
+ + /** + * Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + * byte length of the `iss` followed by the `iss` bytes themselves and + * the full 32 byte `address_seed` value, all prefixed with the zklogin + * `SignatureScheme` flag (`0x05`). + * + * `hash( 0x05 || iss_bytes_len || iss_bytes || 32_byte_address_seed )` + */ + fun `deriveAddressPadded`(): Address + + /** + * Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + * byte length of the `iss` followed by the `iss` bytes themselves and + * the `address_seed` bytes with any leading zero-bytes stripped, all + * prefixed with the zklogin `SignatureScheme` flag (`0x05`). + * + * `hash( 0x05 || iss_bytes_len || iss_bytes || + * unpadded_32_byte_address_seed )` + */ + fun `deriveAddressUnpadded`(): Address + fun `iss`(): kotlin.String companion object @@ -37181,6 +39757,68 @@ open class ZkLoginPublicIdentifier: Disposable, AutoCloseable, ZkLoginPublicIden } + + /** + * Provides an iterator over the addresses that correspond to this zklogin + * authenticator. + * + * In the majority of instances this will only yield a single address, + * except for the instances where the `address_seed` value has a + * leading zero-byte, in such cases the returned iterator will yield + * two addresses. + */override fun `deriveAddress`(): List
{ + return FfiConverterSequenceTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address( + it, _status) +} + } + ) + } + + + + /** + * Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + * byte length of the `iss` followed by the `iss` bytes themselves and + * the full 32 byte `address_seed` value, all prefixed with the zklogin + * `SignatureScheme` flag (`0x05`). + * + * `hash( 0x05 || iss_bytes_len || iss_bytes || 32_byte_address_seed )` + */override fun `deriveAddressPadded`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_padded( + it, _status) +} + } + ) + } + + + + /** + * Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + * byte length of the `iss` followed by the `iss` bytes themselves and + * the `address_seed` bytes with any leading zero-bytes stripped, all + * prefixed with the zklogin `SignatureScheme` flag (`0x05`). + * + * `hash( 0x05 || iss_bytes_len || iss_bytes || + * unpadded_32_byte_address_seed )` + */override fun `deriveAddressUnpadded`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_unpadded( + it, _status) +} + } + ) + } + + override fun `iss`(): kotlin.String { return FfiConverterString.lift( callWithPointer { @@ -37764,169 +40402,6 @@ public object FfiConverterTypeChangedObject: FfiConverterRustBuffer, - /** - * Extra data only present in the final checkpoint of an epoch. - */ - var `endOfEpochData`: EndOfEpochData?, - /** - * CheckpointSummary is not an evolvable structure - it must be readable by - * any version of the code. Therefore, in order to allow extensions to - * be added to CheckpointSummary, we allow opaque data to be added to - * checkpoints which can be deserialized based on the current - * protocol version. - */ - var `versionSpecificData`: kotlin.ByteArray -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`epoch`, - this.`sequenceNumber`, - this.`networkTotalTransactions`, - this.`contentDigest`, - this.`previousDigest`, - this.`epochRollingGasCostSummary`, - this.`timestampMs`, - this.`checkpointCommitments`, - this.`endOfEpochData`, - this.`versionSpecificData` - ) - } - - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeCheckpointSummary: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CheckpointSummary { - return CheckpointSummary( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterTypeDigest.read(buf), - FfiConverterOptionalTypeDigest.read(buf), - FfiConverterTypeGasCostSummary.read(buf), - FfiConverterULong.read(buf), - FfiConverterSequenceTypeCheckpointCommitment.read(buf), - FfiConverterOptionalTypeEndOfEpochData.read(buf), - FfiConverterByteArray.read(buf), - ) - } - - override fun allocationSize(value: CheckpointSummary) = ( - FfiConverterULong.allocationSize(value.`epoch`) + - FfiConverterULong.allocationSize(value.`sequenceNumber`) + - FfiConverterULong.allocationSize(value.`networkTotalTransactions`) + - FfiConverterTypeDigest.allocationSize(value.`contentDigest`) + - FfiConverterOptionalTypeDigest.allocationSize(value.`previousDigest`) + - FfiConverterTypeGasCostSummary.allocationSize(value.`epochRollingGasCostSummary`) + - FfiConverterULong.allocationSize(value.`timestampMs`) + - FfiConverterSequenceTypeCheckpointCommitment.allocationSize(value.`checkpointCommitments`) + - FfiConverterOptionalTypeEndOfEpochData.allocationSize(value.`endOfEpochData`) + - FfiConverterByteArray.allocationSize(value.`versionSpecificData`) - ) - - override fun write(value: CheckpointSummary, buf: ByteBuffer) { - FfiConverterULong.write(value.`epoch`, buf) - FfiConverterULong.write(value.`sequenceNumber`, buf) - FfiConverterULong.write(value.`networkTotalTransactions`, buf) - FfiConverterTypeDigest.write(value.`contentDigest`, buf) - FfiConverterOptionalTypeDigest.write(value.`previousDigest`, buf) - FfiConverterTypeGasCostSummary.write(value.`epochRollingGasCostSummary`, buf) - FfiConverterULong.write(value.`timestampMs`, buf) - FfiConverterSequenceTypeCheckpointCommitment.write(value.`checkpointCommitments`, buf) - FfiConverterOptionalTypeEndOfEpochData.write(value.`endOfEpochData`, buf) - FfiConverterByteArray.write(value.`versionSpecificData`, buf) - } -} - - - /** * A page of items returned by the GraphQL server. */ @@ -44643,6 +47118,38 @@ public object FfiConverterOptionalTypeBatchSendStatus: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CheckpointSummary? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeCheckpointSummary.read(buf) + } + + override fun allocationSize(value: CheckpointSummary?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeCheckpointSummary.allocationSize(value) + } + } + + override fun write(value: CheckpointSummary?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeCheckpointSummary.write(value, buf) + } + } +} + + + + /** * @suppress */ @@ -45315,38 +47822,6 @@ public object FfiConverterOptionalTypeZkloginVerifier: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CheckpointSummary? { - if (buf.get().toInt() == 0) { - return null - } - return FfiConverterTypeCheckpointSummary.read(buf) - } - - override fun allocationSize(value: CheckpointSummary?): ULong { - if (value == null) { - return 1UL - } else { - return 1UL + FfiConverterTypeCheckpointSummary.allocationSize(value) - } - } - - override fun write(value: CheckpointSummary?, buf: ByteBuffer) { - if (value == null) { - buf.put(0) - } else { - buf.put(1) - FfiConverterTypeCheckpointSummary.write(value, buf) - } - } -} - - - - /** * @suppress */ @@ -46459,6 +48934,34 @@ public object FfiConverterSequenceByteArray: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List
{ + val len = buf.getInt() + return List
(len) { + FfiConverterTypeAddress.read(buf) + } + } + + override fun allocationSize(value: List
): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeAddress.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List
, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeAddress.write(it, buf) + } + } +} + + + + /** * @suppress */ @@ -46543,6 +49046,62 @@ public object FfiConverterSequenceTypeCheckpointCommitment: FfiConverterRustBuff +/** + * @suppress + */ +public object FfiConverterSequenceTypeCheckpointSummary: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeCheckpointSummary.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeCheckpointSummary.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeCheckpointSummary.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeCheckpointTransactionInfo: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeCheckpointTransactionInfo.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeCheckpointTransactionInfo.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeCheckpointTransactionInfo.write(it, buf) + } + } +} + + + + /** * @suppress */ @@ -47159,34 +49718,6 @@ public object FfiConverterSequenceTypeChangedObject: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { - val len = buf.getInt() - return List(len) { - FfiConverterTypeCheckpointSummary.read(buf) - } - } - - override fun allocationSize(value: List): ULong { - val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeCheckpointSummary.allocationSize(it) }.sum() - return sizeForLength + sizeForItems - } - - override fun write(value: List, buf: ByteBuffer) { - buf.putInt(value.size) - value.iterator().forEach { - FfiConverterTypeCheckpointSummary.write(it, buf) - } - } -} - - - - /** * @suppress */ diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 6d8c2642f..928d40c8a 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -517,6 +517,40 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set() != 22589: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest() != 22345: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info() != 56465: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments() != 61600: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest() != 31627: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest() != 14291: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data() != 49930: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch() != 35840: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary() != 10205: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions() != 50558: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest() != 933: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number() != 33896: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message() != 59962: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms() != 62474: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data() != 43828: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects() != 54822: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures() != 36925: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction() != 58570: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_coin_balance() != 29928: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_coin_coin_type() != 18211: @@ -605,7 +639,7 @@ 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_graphqlclient_chain_id() != 45619: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 13597: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 11584: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 8422: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -721,6 +755,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_multisigaggregator_with_verifier() != 10820: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() != 12725: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid() != 45468: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_members() != 62870: @@ -791,6 +827,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_object_data() != 4330: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_object_digest() != 48655: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_object_object_id() != 6575: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_object_object_type() != 1843: @@ -811,6 +849,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_objectdata_is_struct() != 58579: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id() != 47819: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_address() != 21880: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes() != 38367: @@ -843,10 +883,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_method_passkeyauthenticator_client_data_json() != 20272: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key() != 18555: + 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_passkeypublickey_derive_address() != 61803: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner() != 65008: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyverifier_verify() != 19101: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes() != 347: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest() != 39344: + 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: @@ -1001,6 +1051,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_systempackage_version() != 39738: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_digest() != 52429: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() != 47752: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment() != 5316: @@ -1009,6 +1061,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_transaction_sender() != 38190: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest() != 36608: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_add_gas_objects() != 33983: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_finish() != 1260: @@ -1043,8 +1097,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_transactioneffects_as_v1() != 48710: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest() != 46963: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1() != 39808: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest() != 55750: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_events() != 36651: + 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: @@ -1173,6 +1233,12 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed() != 3936: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address() != 14353: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded() != 45141: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded() != 51424: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss() != 58864: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_zkloginverifier_jwks() != 62366: @@ -1219,6 +1285,12 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new() != 52433: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new() != 27130: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new() != 16062: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new() != 65327: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new() != 39786: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new() != 50489: @@ -1359,6 +1431,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_objectdata_new_move_struct() != 1861: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id() != 16970: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes() != 41789: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex() != 30954: @@ -1375,8 +1449,12 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_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_passkeypublickey_new() != 30856: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_passkeyverifier_new() != 23457: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new() != 3617: + 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: @@ -1471,6 +1549,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_transactioneffects_new_v1() != 63561: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new() != 1310: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_authenticator_state_update_v1() != 29264: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_consensus_commit_prologue_v1() != 27756: @@ -2008,6 +2088,147 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointcontents.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointcontents.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_checkpointcontents.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_checkpointcontents.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontents_new.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontents_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_digest.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_transaction_info.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_transaction_info.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointsummary.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointsummary.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_checkpointsummary.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_checkpointsummary.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointsummary_new.argtypes = ( + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_uint64, + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointsummary_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_checkpoint_commitments.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_checkpoint_commitments.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_content_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_content_digest.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_digest.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_end_of_epoch_data.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_end_of_epoch_data.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch_rolling_gas_cost_summary.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch_rolling_gas_cost_summary.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_network_total_transactions.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_network_total_transactions.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_previous_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_previous_digest.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_sequence_number.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_sequence_number.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_signing_message.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_signing_message.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_timestamp_ms.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_timestamp_ms.restype = ctypes.c_uint64 +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_version_specific_data.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_version_specific_data.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointtransactioninfo.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointtransactioninfo.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_checkpointtransactioninfo.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_checkpointtransactioninfo.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointtransactioninfo_new.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointtransactioninfo_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_effects.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_effects.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_signatures.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_signatures.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_transaction.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_circomg1.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3218,6 +3439,11 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_multisigcommittee_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_derive_address.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_derive_address.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_is_valid.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3464,6 +3690,11 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_object_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_object_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_object_digest.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_object_object_id.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3544,6 +3775,12 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_objectid.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_objectid_derive_id.argtypes = ( + ctypes.c_void_p, + ctypes.c_uint64, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_objectid_derive_id.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes.argtypes = ( _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), @@ -3554,6 +3791,13 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_objectid_derive_dynamic_child_id.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_objectid_derive_dynamic_child_id.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_objectid_to_address.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3697,11 +3941,41 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_public_key.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_public_key.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_passkeypublickey.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_passkeypublickey.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_passkeypublickey.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_passkeypublickey.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_passkeypublickey_new.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_passkeypublickey_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_derive_address.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_derive_address.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_inner.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_inner.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_passkeyverifier.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -3723,6 +3997,31 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeyverifier_verify.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_personalmessage.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_personalmessage.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_personalmessage.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_personalmessage.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_personalmessage_new.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_personalmessage_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_personalmessage_message_bytes.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_personalmessage_message_bytes.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_personalmessage_signing_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_personalmessage_signing_digest.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -4567,6 +4866,11 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transaction_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_digest.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_expiration.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -4587,6 +4891,11 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_sender.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_signing_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_signing_digest.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactionbuilder.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -4724,11 +5033,41 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_digest.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1.restype = ctypes.c_int8 +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactionevents.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactionevents.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transactionevents.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_free_transactionevents.restype = None +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactionevents_new.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactionevents_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionevents_digest.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionevents_digest.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionevents_events.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionevents_events.restype = _UniffiRustBuffer _UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactionkind.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -5392,6 +5731,21 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_address_seed.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address.restype = _UniffiRustBuffer +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_padded.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_padded.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_unpadded.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_unpadded.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_iss.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -5785,6 +6139,57 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_digest.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontents_transaction_info.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_checkpoint_commitments.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_content_digest.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_digest.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_end_of_epoch_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_epoch_rolling_gas_cost_summary.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_network_total_transactions.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_previous_digest.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_sequence_number.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_signing_message.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_timestamp_ms.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointsummary_version_specific_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_effects.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_signatures.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_checkpointtransactioninfo_transaction.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_coin_balance.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_coin_balance.restype = ctypes.c_uint16 @@ -6091,6 +6496,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_verifier.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_verifier.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid.restype = ctypes.c_uint16 @@ -6196,6 +6604,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_data.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_digest.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_object_id.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_object_object_id.restype = ctypes.c_uint16 @@ -6226,6 +6637,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_objectdata_is_struct.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_objectdata_is_struct.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_objectid_derive_dynamic_child_id.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_address.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_address.restype = ctypes.c_uint16 @@ -6274,12 +6688,27 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key.restype = ctypes.c_uint16 _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_passkeypublickey_derive_address.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_derive_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeypublickey_inner.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyverifier_verify.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_passkeyverifier_verify.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_message_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_personalmessage_signing_digest.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 @@ -6511,6 +6940,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_version.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_systempackage_version.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_digest.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration.restype = ctypes.c_uint16 @@ -6523,6 +6955,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_sender.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_sender.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transaction_signing_digest.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_add_gas_objects.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_add_gas_objects.restype = ctypes.c_uint16 @@ -6574,9 +7009,18 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_digest.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_digest.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_events.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionevents_events.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 @@ -6769,6 +7213,15 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_padded.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_derive_address_unpadded.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss.restype = ctypes.c_uint16 @@ -6838,6 +7291,15 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_changeepochv2_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontents_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointsummary_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointtransactioninfo_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new.restype = ctypes.c_uint16 @@ -7048,6 +7510,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_struct.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_objectdata_new_move_struct.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes.restype = ctypes.c_uint16 @@ -7072,9 +7537,15 @@ 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_passkeypublickey_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_passkeypublickey_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_passkeyverifier_new.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_passkeyverifier_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_personalmessage_new.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 @@ -7216,6 +7687,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new.argtypes = ( +) +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionevents_new.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_authenticator_state_update_v1.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_new_authenticator_state_update_v1.restype = ctypes.c_uint16 @@ -7690,6 +8164,18 @@ def write(value, buf): + + + + + + + + + + + + @@ -7983,191 +8469,6 @@ def write(value, buf): _UniffiConverterTypeIdOperation.write(value.id_operation, buf) -class CheckpointSummary: - """ - A header for a Checkpoint on the IOTA blockchain. - - On the IOTA network, checkpoints define the history of the blockchain. They - are quite similar to the concept of blocks used by other blockchains like - Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after - transaction execution has already happened to provide a certified history of - the chain, instead of being formed before execution. - - Checkpoints commit to a variety of state including but not limited to: - - The hash of the previous checkpoint. - - The set of transaction digests, their corresponding effects digests, as - well as the set of user signatures which authorized its execution. - - The object's produced by a transaction. - - The set of live objects that make up the current state of the chain. - - On epoch transitions, the next validator committee. - - `CheckpointSummary`s themselves don't directly include all of the above - information but they are the top-level type by which all the above are - committed to transitively via cryptographic hashes included in the summary. - `CheckpointSummary`s are signed and certified by a quorum of the validator - committee in a given epoch in order to allow verification of the chain's - state. - - # BCS - - The BCS serialized form for this type is defined by the following ABNF: - - ```text - checkpoint-summary = u64 ; epoch - u64 ; sequence_number - u64 ; network_total_transactions - digest ; content_digest - (option digest) ; previous_digest - gas-cost-summary ; epoch_rolling_gas_cost_summary - u64 ; timestamp_ms - (vector checkpoint-commitment) ; checkpoint_commitments - (option end-of-epoch-data) ; end_of_epoch_data - bytes ; version_specific_data - ``` - """ - - epoch: "int" - """ - Epoch that this checkpoint belongs to. - """ - - sequence_number: "int" - """ - The height of this checkpoint. - """ - - network_total_transactions: "int" - """ - Total number of transactions committed since genesis, including those in - this checkpoint. - """ - - content_digest: "Digest" - """ - The hash of the `CheckpointContents` for this checkpoint. - """ - - previous_digest: "typing.Optional[Digest]" - """ - The hash of the previous `CheckpointSummary`. - - This will be only be `None` for the first, or genesis checkpoint. - """ - - epoch_rolling_gas_cost_summary: "GasCostSummary" - """ - The running total gas costs of all transactions included in the current - epoch so far until this checkpoint. - """ - - timestamp_ms: "int" - """ - Timestamp of the checkpoint - number of milliseconds from the Unix epoch - Checkpoint timestamps are monotonic, but not strongly monotonic - - subsequent checkpoints can have same timestamp if they originate - from the same underlining consensus commit - """ - - checkpoint_commitments: "typing.List[CheckpointCommitment]" - """ - Commitments to checkpoint-specific state. - """ - - end_of_epoch_data: "typing.Optional[EndOfEpochData]" - """ - Extra data only present in the final checkpoint of an epoch. - """ - - version_specific_data: "bytes" - """ - CheckpointSummary is not an evolvable structure - it must be readable by - any version of the code. Therefore, in order to allow extensions to - be added to CheckpointSummary, we allow opaque data to be added to - checkpoints which can be deserialized based on the current - protocol version. - """ - - def __init__(self, *, epoch: "int", sequence_number: "int", network_total_transactions: "int", content_digest: "Digest", previous_digest: "typing.Optional[Digest]", epoch_rolling_gas_cost_summary: "GasCostSummary", timestamp_ms: "int", checkpoint_commitments: "typing.List[CheckpointCommitment]", end_of_epoch_data: "typing.Optional[EndOfEpochData]", version_specific_data: "bytes"): - self.epoch = epoch - self.sequence_number = sequence_number - self.network_total_transactions = network_total_transactions - self.content_digest = content_digest - self.previous_digest = previous_digest - self.epoch_rolling_gas_cost_summary = epoch_rolling_gas_cost_summary - self.timestamp_ms = timestamp_ms - self.checkpoint_commitments = checkpoint_commitments - self.end_of_epoch_data = end_of_epoch_data - self.version_specific_data = version_specific_data - - def __str__(self): - return "CheckpointSummary(epoch={}, sequence_number={}, network_total_transactions={}, content_digest={}, previous_digest={}, epoch_rolling_gas_cost_summary={}, timestamp_ms={}, checkpoint_commitments={}, end_of_epoch_data={}, version_specific_data={})".format(self.epoch, self.sequence_number, self.network_total_transactions, self.content_digest, self.previous_digest, self.epoch_rolling_gas_cost_summary, self.timestamp_ms, self.checkpoint_commitments, self.end_of_epoch_data, self.version_specific_data) - - def __eq__(self, other): - if self.epoch != other.epoch: - return False - if self.sequence_number != other.sequence_number: - return False - if self.network_total_transactions != other.network_total_transactions: - return False - if self.content_digest != other.content_digest: - return False - if self.previous_digest != other.previous_digest: - return False - if self.epoch_rolling_gas_cost_summary != other.epoch_rolling_gas_cost_summary: - return False - if self.timestamp_ms != other.timestamp_ms: - return False - if self.checkpoint_commitments != other.checkpoint_commitments: - return False - if self.end_of_epoch_data != other.end_of_epoch_data: - return False - if self.version_specific_data != other.version_specific_data: - return False - return True - -class _UniffiConverterTypeCheckpointSummary(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return CheckpointSummary( - epoch=_UniffiConverterUInt64.read(buf), - sequence_number=_UniffiConverterUInt64.read(buf), - network_total_transactions=_UniffiConverterUInt64.read(buf), - content_digest=_UniffiConverterTypeDigest.read(buf), - previous_digest=_UniffiConverterOptionalTypeDigest.read(buf), - epoch_rolling_gas_cost_summary=_UniffiConverterTypeGasCostSummary.read(buf), - timestamp_ms=_UniffiConverterUInt64.read(buf), - checkpoint_commitments=_UniffiConverterSequenceTypeCheckpointCommitment.read(buf), - end_of_epoch_data=_UniffiConverterOptionalTypeEndOfEpochData.read(buf), - version_specific_data=_UniffiConverterBytes.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterUInt64.check_lower(value.epoch) - _UniffiConverterUInt64.check_lower(value.sequence_number) - _UniffiConverterUInt64.check_lower(value.network_total_transactions) - _UniffiConverterTypeDigest.check_lower(value.content_digest) - _UniffiConverterOptionalTypeDigest.check_lower(value.previous_digest) - _UniffiConverterTypeGasCostSummary.check_lower(value.epoch_rolling_gas_cost_summary) - _UniffiConverterUInt64.check_lower(value.timestamp_ms) - _UniffiConverterSequenceTypeCheckpointCommitment.check_lower(value.checkpoint_commitments) - _UniffiConverterOptionalTypeEndOfEpochData.check_lower(value.end_of_epoch_data) - _UniffiConverterBytes.check_lower(value.version_specific_data) - - @staticmethod - def write(value, buf): - _UniffiConverterUInt64.write(value.epoch, buf) - _UniffiConverterUInt64.write(value.sequence_number, buf) - _UniffiConverterUInt64.write(value.network_total_transactions, buf) - _UniffiConverterTypeDigest.write(value.content_digest, buf) - _UniffiConverterOptionalTypeDigest.write(value.previous_digest, buf) - _UniffiConverterTypeGasCostSummary.write(value.epoch_rolling_gas_cost_summary, buf) - _UniffiConverterUInt64.write(value.timestamp_ms, buf) - _UniffiConverterSequenceTypeCheckpointCommitment.write(value.checkpoint_commitments, buf) - _UniffiConverterOptionalTypeEndOfEpochData.write(value.end_of_epoch_data, buf) - _UniffiConverterBytes.write(value.version_specific_data, buf) - - class CheckpointSummaryPage: """ A page of items returned by the GraphQL server. @@ -16104,6 +16405,33 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeCheckpointSummary(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeCheckpointSummary.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeCheckpointSummary.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeCheckpointSummary.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeDigest(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -16671,33 +16999,6 @@ def read(cls, buf): -class _UniffiConverterOptionalTypeCheckpointSummary(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - if value is not None: - _UniffiConverterTypeCheckpointSummary.check_lower(value) - - @classmethod - def write(cls, value, buf): - if value is None: - buf.write_u8(0) - return - - buf.write_u8(1) - _UniffiConverterTypeCheckpointSummary.write(value, buf) - - @classmethod - def read(cls, buf): - flag = buf.read_u8() - if flag == 0: - return None - elif flag == 1: - return _UniffiConverterTypeCheckpointSummary.read(buf) - else: - raise InternalError("Unexpected flag byte for optional type") - - - class _UniffiConverterOptionalTypeCoinMetadata(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -17639,6 +17940,31 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeAddress(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeAddress.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeAddress.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeAddress.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeArgument(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -17714,6 +18040,56 @@ def read(cls, buf): +class _UniffiConverterSequenceTypeCheckpointSummary(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeCheckpointSummary.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeCheckpointSummary.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeCheckpointSummary.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeCheckpointTransactionInfo(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeCheckpointTransactionInfo.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeCheckpointTransactionInfo.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeCheckpointTransactionInfo.read(buf) for i in range(count) + ] + + + class _UniffiConverterSequenceTypeCoin(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -18264,31 +18640,6 @@ def read(cls, buf): -class _UniffiConverterSequenceTypeCheckpointSummary(_UniffiConverterRustBuffer): - @classmethod - def check_lower(cls, value): - for item in value: - _UniffiConverterTypeCheckpointSummary.check_lower(item) - - @classmethod - def write(cls, value, buf): - items = len(value) - buf.write_i32(items) - for item in value: - _UniffiConverterTypeCheckpointSummary.write(item, buf) - - @classmethod - def read(cls, buf): - count = buf.read_i32() - if count < 0: - raise InternalError("Unexpected negative sequence length") - - return [ - _UniffiConverterTypeCheckpointSummary.read(buf) for i in range(count) - ] - - - class _UniffiConverterSequenceTypeDynamicFieldOutput(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -20631,6 +20982,633 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: CheckpointCommitmentProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class CheckpointContentsProtocol(typing.Protocol): + """ + The committed to contents of a checkpoint. + + `CheckpointContents` contains a list of digests of Transactions, their + effects, and the user signatures that authorized their execution included in + a checkpoint. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + checkpoint-contents = %x00 checkpoint-contents-v1 ; variant 0 + + checkpoint-contents-v1 = (vector (digest digest)) ; vector of transaction and effect digests + (vector (vector bcs-user-signature)) ; set of user signatures for each + ; transaction. MUST be the same + ; length as the vector of digests + ``` + """ + + def digest(self, ): + raise NotImplementedError + def transaction_info(self, ): + raise NotImplementedError +# CheckpointContents is a Rust-only trait - it's a wrapper around a Rust implementation. +class CheckpointContents(): + """ + The committed to contents of a checkpoint. + + `CheckpointContents` contains a list of digests of Transactions, their + effects, and the user signatures that authorized their execution included in + a checkpoint. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + checkpoint-contents = %x00 checkpoint-contents-v1 ; variant 0 + + checkpoint-contents-v1 = (vector (digest digest)) ; vector of transaction and effect digests + (vector (vector bcs-user-signature)) ; set of user signatures for each + ; transaction. MUST be the same + ; length as the vector of digests + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, transaction_info: "typing.List[CheckpointTransactionInfo]"): + _UniffiConverterSequenceTypeCheckpointTransactionInfo.check_lower(transaction_info) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontents_new, + _UniffiConverterSequenceTypeCheckpointTransactionInfo.lower(transaction_info)) + + 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_checkpointcontents, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointcontents, 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 digest(self, ) -> "Digest": + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_digest,self._uniffi_clone_pointer(),) + ) + + + + + + def transaction_info(self, ) -> "typing.List[CheckpointTransactionInfo]": + return _UniffiConverterSequenceTypeCheckpointTransactionInfo.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointcontents_transaction_info,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeCheckpointContents: + + @staticmethod + def lift(value: int): + return CheckpointContents._make_instance_(value) + + @staticmethod + def check_lower(value: CheckpointContents): + if not isinstance(value, CheckpointContents): + raise TypeError("Expected CheckpointContents instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: CheckpointContentsProtocol): + if not isinstance(value, CheckpointContents): + raise TypeError("Expected CheckpointContents 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: CheckpointContentsProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class CheckpointSummaryProtocol(typing.Protocol): + """ + A header for a Checkpoint on the IOTA blockchain. + + On the IOTA network, checkpoints define the history of the blockchain. They + are quite similar to the concept of blocks used by other blockchains like + Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after + transaction execution has already happened to provide a certified history of + the chain, instead of being formed before execution. + + Checkpoints commit to a variety of state including but not limited to: + - The hash of the previous checkpoint. + - The set of transaction digests, their corresponding effects digests, as + well as the set of user signatures which authorized its execution. + - The object's produced by a transaction. + - The set of live objects that make up the current state of the chain. + - On epoch transitions, the next validator committee. + + `CheckpointSummary`s themselves don't directly include all of the above + information but they are the top-level type by which all the above are + committed to transitively via cryptographic hashes included in the summary. + `CheckpointSummary`s are signed and certified by a quorum of the validator + committee in a given epoch in order to allow verification of the chain's + state. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + checkpoint-summary = u64 ; epoch + u64 ; sequence_number + u64 ; network_total_transactions + digest ; content_digest + (option digest) ; previous_digest + gas-cost-summary ; epoch_rolling_gas_cost_summary + u64 ; timestamp_ms + (vector checkpoint-commitment) ; checkpoint_commitments + (option end-of-epoch-data) ; end_of_epoch_data + bytes ; version_specific_data + ``` + """ + + def checkpoint_commitments(self, ): + """ + Commitments to checkpoint-specific state. + """ + + raise NotImplementedError + def content_digest(self, ): + """ + The hash of the `CheckpointContents` for this checkpoint. + """ + + raise NotImplementedError + def digest(self, ): + raise NotImplementedError + def end_of_epoch_data(self, ): + """ + Extra data only present in the final checkpoint of an epoch. + """ + + raise NotImplementedError + def epoch(self, ): + """ + Epoch that this checkpoint belongs to. + """ + + raise NotImplementedError + def epoch_rolling_gas_cost_summary(self, ): + """ + The running total gas costs of all transactions included in the current + epoch so far until this checkpoint. + """ + + raise NotImplementedError + def network_total_transactions(self, ): + """ + Total number of transactions committed since genesis, including those in + this checkpoint. + """ + + raise NotImplementedError + def previous_digest(self, ): + """ + The hash of the previous `CheckpointSummary`. + + This will be only be `None` for the first, or genesis checkpoint. + """ + + raise NotImplementedError + def sequence_number(self, ): + """ + The height of this checkpoint. + """ + + raise NotImplementedError + def signing_message(self, ): + raise NotImplementedError + def timestamp_ms(self, ): + """ + Timestamp of the checkpoint - number of milliseconds from the Unix epoch + Checkpoint timestamps are monotonic, but not strongly monotonic - + subsequent checkpoints can have same timestamp if they originate + from the same underlining consensus commit + """ + + raise NotImplementedError + def version_specific_data(self, ): + """ + CheckpointSummary is not an evolvable structure - it must be readable by + any version of the code. Therefore, in order to allow extensions to + be added to CheckpointSummary, we allow opaque data to be added to + checkpoints which can be deserialized based on the current + protocol version. + """ + + raise NotImplementedError +# CheckpointSummary is a Rust-only trait - it's a wrapper around a Rust implementation. +class CheckpointSummary(): + """ + A header for a Checkpoint on the IOTA blockchain. + + On the IOTA network, checkpoints define the history of the blockchain. They + are quite similar to the concept of blocks used by other blockchains like + Bitcoin or Ethereum. The IOTA blockchain, however, forms checkpoints after + transaction execution has already happened to provide a certified history of + the chain, instead of being formed before execution. + + Checkpoints commit to a variety of state including but not limited to: + - The hash of the previous checkpoint. + - The set of transaction digests, their corresponding effects digests, as + well as the set of user signatures which authorized its execution. + - The object's produced by a transaction. + - The set of live objects that make up the current state of the chain. + - On epoch transitions, the next validator committee. + + `CheckpointSummary`s themselves don't directly include all of the above + information but they are the top-level type by which all the above are + committed to transitively via cryptographic hashes included in the summary. + `CheckpointSummary`s are signed and certified by a quorum of the validator + committee in a given epoch in order to allow verification of the chain's + state. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + checkpoint-summary = u64 ; epoch + u64 ; sequence_number + u64 ; network_total_transactions + digest ; content_digest + (option digest) ; previous_digest + gas-cost-summary ; epoch_rolling_gas_cost_summary + u64 ; timestamp_ms + (vector checkpoint-commitment) ; checkpoint_commitments + (option end-of-epoch-data) ; end_of_epoch_data + bytes ; version_specific_data + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, epoch: "int",sequence_number: "int",network_total_transactions: "int",content_digest: "Digest",previous_digest: "typing.Optional[Digest]",epoch_rolling_gas_cost_summary: "GasCostSummary",timestamp_ms: "int",checkpoint_commitments: "typing.List[CheckpointCommitment]",end_of_epoch_data: "typing.Optional[EndOfEpochData]",version_specific_data: "bytes"): + _UniffiConverterUInt64.check_lower(epoch) + + _UniffiConverterUInt64.check_lower(sequence_number) + + _UniffiConverterUInt64.check_lower(network_total_transactions) + + _UniffiConverterTypeDigest.check_lower(content_digest) + + _UniffiConverterOptionalTypeDigest.check_lower(previous_digest) + + _UniffiConverterTypeGasCostSummary.check_lower(epoch_rolling_gas_cost_summary) + + _UniffiConverterUInt64.check_lower(timestamp_ms) + + _UniffiConverterSequenceTypeCheckpointCommitment.check_lower(checkpoint_commitments) + + _UniffiConverterOptionalTypeEndOfEpochData.check_lower(end_of_epoch_data) + + _UniffiConverterBytes.check_lower(version_specific_data) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointsummary_new, + _UniffiConverterUInt64.lower(epoch), + _UniffiConverterUInt64.lower(sequence_number), + _UniffiConverterUInt64.lower(network_total_transactions), + _UniffiConverterTypeDigest.lower(content_digest), + _UniffiConverterOptionalTypeDigest.lower(previous_digest), + _UniffiConverterTypeGasCostSummary.lower(epoch_rolling_gas_cost_summary), + _UniffiConverterUInt64.lower(timestamp_ms), + _UniffiConverterSequenceTypeCheckpointCommitment.lower(checkpoint_commitments), + _UniffiConverterOptionalTypeEndOfEpochData.lower(end_of_epoch_data), + _UniffiConverterBytes.lower(version_specific_data)) + + 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_checkpointsummary, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointsummary, 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 checkpoint_commitments(self, ) -> "typing.List[CheckpointCommitment]": + """ + Commitments to checkpoint-specific state. + """ + + return _UniffiConverterSequenceTypeCheckpointCommitment.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_checkpoint_commitments,self._uniffi_clone_pointer(),) + ) + + + + + + def content_digest(self, ) -> "Digest": + """ + The hash of the `CheckpointContents` for this checkpoint. + """ + + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_content_digest,self._uniffi_clone_pointer(),) + ) + + + + + + def digest(self, ) -> "Digest": + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_digest,self._uniffi_clone_pointer(),) + ) + + + + + + def end_of_epoch_data(self, ) -> "typing.Optional[EndOfEpochData]": + """ + Extra data only present in the final checkpoint of an epoch. + """ + + return _UniffiConverterOptionalTypeEndOfEpochData.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_end_of_epoch_data,self._uniffi_clone_pointer(),) + ) + + + + + + def epoch(self, ) -> "int": + """ + Epoch that this checkpoint belongs to. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch,self._uniffi_clone_pointer(),) + ) + + + + + + def epoch_rolling_gas_cost_summary(self, ) -> "GasCostSummary": + """ + The running total gas costs of all transactions included in the current + epoch so far until this checkpoint. + """ + + return _UniffiConverterTypeGasCostSummary.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_epoch_rolling_gas_cost_summary,self._uniffi_clone_pointer(),) + ) + + + + + + def network_total_transactions(self, ) -> "int": + """ + Total number of transactions committed since genesis, including those in + this checkpoint. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_network_total_transactions,self._uniffi_clone_pointer(),) + ) + + + + + + def previous_digest(self, ) -> "typing.Optional[Digest]": + """ + The hash of the previous `CheckpointSummary`. + + This will be only be `None` for the first, or genesis checkpoint. + """ + + return _UniffiConverterOptionalTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_previous_digest,self._uniffi_clone_pointer(),) + ) + + + + + + def sequence_number(self, ) -> "int": + """ + The height of this checkpoint. + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_sequence_number,self._uniffi_clone_pointer(),) + ) + + + + + + def signing_message(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_signing_message,self._uniffi_clone_pointer(),) + ) + + + + + + def timestamp_ms(self, ) -> "int": + """ + Timestamp of the checkpoint - number of milliseconds from the Unix epoch + Checkpoint timestamps are monotonic, but not strongly monotonic - + subsequent checkpoints can have same timestamp if they originate + from the same underlining consensus commit + """ + + return _UniffiConverterUInt64.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_timestamp_ms,self._uniffi_clone_pointer(),) + ) + + + + + + def version_specific_data(self, ) -> "bytes": + """ + CheckpointSummary is not an evolvable structure - it must be readable by + any version of the code. Therefore, in order to allow extensions to + be added to CheckpointSummary, we allow opaque data to be added to + checkpoints which can be deserialized based on the current + protocol version. + """ + + return _UniffiConverterBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointsummary_version_specific_data,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeCheckpointSummary: + + @staticmethod + def lift(value: int): + return CheckpointSummary._make_instance_(value) + + @staticmethod + def check_lower(value: CheckpointSummary): + if not isinstance(value, CheckpointSummary): + raise TypeError("Expected CheckpointSummary instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: CheckpointSummaryProtocol): + if not isinstance(value, CheckpointSummary): + raise TypeError("Expected CheckpointSummary 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: CheckpointSummaryProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) +class CheckpointTransactionInfoProtocol(typing.Protocol): + """ + Transaction information committed to in a checkpoint + """ + + def effects(self, ): + raise NotImplementedError + def signatures(self, ): + raise NotImplementedError + def transaction(self, ): + raise NotImplementedError +# CheckpointTransactionInfo is a Rust-only trait - it's a wrapper around a Rust implementation. +class CheckpointTransactionInfo(): + """ + Transaction information committed to in a checkpoint + """ + + _pointer: ctypes.c_void_p + def __init__(self, transaction: "Digest",effects: "Digest",signatures: "typing.List[UserSignature]"): + _UniffiConverterTypeDigest.check_lower(transaction) + + _UniffiConverterTypeDigest.check_lower(effects) + + _UniffiConverterSequenceTypeUserSignature.check_lower(signatures) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_checkpointtransactioninfo_new, + _UniffiConverterTypeDigest.lower(transaction), + _UniffiConverterTypeDigest.lower(effects), + _UniffiConverterSequenceTypeUserSignature.lower(signatures)) + + 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_checkpointtransactioninfo, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_checkpointtransactioninfo, 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 effects(self, ) -> "Digest": + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_effects,self._uniffi_clone_pointer(),) + ) + + + + + + def signatures(self, ) -> "typing.List[UserSignature]": + return _UniffiConverterSequenceTypeUserSignature.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_signatures,self._uniffi_clone_pointer(),) + ) + + + + + + def transaction(self, ) -> "Digest": + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_checkpointtransactioninfo_transaction,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeCheckpointTransactionInfo: + + @staticmethod + def lift(value: int): + return CheckpointTransactionInfo._make_instance_(value) + + @staticmethod + def check_lower(value: CheckpointTransactionInfo): + if not isinstance(value, CheckpointTransactionInfo): + raise TypeError("Expected CheckpointTransactionInfo instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: CheckpointTransactionInfoProtocol): + if not isinstance(value, CheckpointTransactionInfo): + raise TypeError("Expected CheckpointTransactionInfo 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: CheckpointTransactionInfoProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class CircomG1Protocol(typing.Protocol): """ A G1 point @@ -26302,6 +27280,28 @@ class MultisigCommitteeProtocol(typing.Protocol): ``` """ + def derive_address(self, ): + """ + Derive an `Address` from this MultisigCommittee. + + A MultiSig address + is defined as the 32-byte Blake2b hash of serializing the + `SignatureScheme` flag (0x03), the threshold (in little endian), and + the concatenation of all n flag, public keys and its weight. + + `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 + || ... || flag_n || pk_n || weight_n)`. + + When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + refers to the same input used when deriving the address using the + [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + full 32-byte `address_seed` value). + + [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier + [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded + """ + + raise NotImplementedError def is_valid(self, ): """ Checks if the Committee is valid. @@ -26400,6 +27400,35 @@ def _make_instance_(cls, pointer): return inst + def derive_address(self, ) -> "Address": + """ + Derive an `Address` from this MultisigCommittee. + + A MultiSig address + is defined as the 32-byte Blake2b hash of serializing the + `SignatureScheme` flag (0x03), the threshold (in little endian), and + the concatenation of all n flag, public keys and its weight. + + `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 + || ... || flag_n || pk_n || weight_n)`. + + When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + refers to the same input used when deriving the address using the + [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + full 32-byte `address_seed` value). + + [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier + [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded + """ + + return _UniffiConverterTypeAddress.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_derive_address,self._uniffi_clone_pointer(),) + ) + + + + + def is_valid(self, ) -> "bool": """ Checks if the Committee is valid. @@ -27227,6 +28256,14 @@ def data(self, ): Return this object's data """ + raise NotImplementedError + def digest(self, ): + """ + Calculate the digest of this `Object` + + This is done by hashing the BCS bytes of this `Object` prefixed + """ + raise NotImplementedError def object_id(self, ): """ @@ -27342,6 +28379,21 @@ def data(self, ) -> "ObjectData": + def digest(self, ) -> "Digest": + """ + Calculate the digest of this `Object` + + This is done by hashing the BCS bytes of this `Object` prefixed + """ + + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_object_digest,self._uniffi_clone_pointer(),) + ) + + + + + def object_id(self, ) -> "ObjectId": """ Return this object's id @@ -27660,6 +28712,14 @@ class ObjectIdProtocol(typing.Protocol): ``` """ + def derive_dynamic_child_id(self, key_type_tag: "TypeTag",key_bytes: "bytes"): + """ + Derive an ObjectId for a Dynamic Child Object. + + hash(parent || len(key) || key || key_type_tag) + """ + + raise NotImplementedError def to_address(self, ): raise NotImplementedError def to_bytes(self, ): @@ -27712,6 +28772,23 @@ def _make_instance_(cls, pointer): inst._pointer = pointer return inst @classmethod + def derive_id(cls, digest: "Digest",count: "int"): + """ + Create an ObjectId from a transaction digest and the number of objects + that have been created during a transactions. + """ + + _UniffiConverterTypeDigest.check_lower(digest) + + _UniffiConverterUInt64.check_lower(count) + + # Call the (fallible) function before creating any half-baked object instances. + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_objectid_derive_id, + _UniffiConverterTypeDigest.lower(digest), + _UniffiConverterUInt64.lower(count)) + return cls._make_instance_(pointer) + + @classmethod def from_bytes(cls, bytes: "bytes"): _UniffiConverterBytes.check_lower(bytes) @@ -27731,6 +28808,27 @@ def from_hex(cls, hex: "str"): + def derive_dynamic_child_id(self, key_type_tag: "TypeTag",key_bytes: "bytes") -> "ObjectId": + """ + Derive an ObjectId for a Dynamic Child Object. + + hash(parent || len(key) || key || key_type_tag) + """ + + _UniffiConverterTypeTypeTag.check_lower(key_type_tag) + + _UniffiConverterBytes.check_lower(key_bytes) + + return _UniffiConverterTypeObjectId.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_objectid_derive_dynamic_child_id,self._uniffi_clone_pointer(), + _UniffiConverterTypeTypeTag.lower(key_type_tag), + _UniffiConverterBytes.lower(key_bytes)) + ) + + + + + def to_address(self, ) -> "Address": return _UniffiConverterTypeAddress.lift( _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_objectid_to_address,self._uniffi_clone_pointer(),) @@ -28162,6 +29260,12 @@ def client_data_json(self, ): for more information on this field. """ + raise NotImplementedError + def public_key(self, ): + """ + The passkey public key + """ + raise NotImplementedError def signature(self, ): """ @@ -28273,6 +29377,19 @@ def client_data_json(self, ) -> "str": + def public_key(self, ) -> "PasskeyPublicKey": + """ + The passkey public key + """ + + return _UniffiConverterTypePasskeyPublicKey.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_public_key,self._uniffi_clone_pointer(),) + ) + + + + + def signature(self, ) -> "SimpleSignature": """ The passkey signature. @@ -28314,6 +29431,133 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: PasskeyAuthenticatorProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class PasskeyPublicKeyProtocol(typing.Protocol): + """ + Public key of a `PasskeyAuthenticator`. + + This is used to derive the onchain `Address` for a `PasskeyAuthenticator`. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + passkey-public-key = passkey-flag secp256r1-public-key + ``` + """ + + def derive_address(self, ): + """ + Derive an `Address` from this Passkey Public Key + + An `Address` can be derived from a `PasskeyPublicKey` by hashing the + bytes of the `Secp256r1PublicKey` that corresponds to this passkey + prefixed with the Passkey `SignatureScheme` flag (`0x06`). + + `hash( 0x06 || 33-byte secp256r1 public key)` + """ + + raise NotImplementedError + def inner(self, ): + raise NotImplementedError +# PasskeyPublicKey is a Rust-only trait - it's a wrapper around a Rust implementation. +class PasskeyPublicKey(): + """ + Public key of a `PasskeyAuthenticator`. + + This is used to derive the onchain `Address` for a `PasskeyAuthenticator`. + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + passkey-public-key = passkey-flag secp256r1-public-key + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, public_key: "Secp256r1PublicKey"): + _UniffiConverterTypeSecp256r1PublicKey.check_lower(public_key) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_passkeypublickey_new, + _UniffiConverterTypeSecp256r1PublicKey.lower(public_key)) + + 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_passkeypublickey, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_passkeypublickey, 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 derive_address(self, ) -> "Address": + """ + Derive an `Address` from this Passkey Public Key + + An `Address` can be derived from a `PasskeyPublicKey` by hashing the + bytes of the `Secp256r1PublicKey` that corresponds to this passkey + prefixed with the Passkey `SignatureScheme` flag (`0x06`). + + `hash( 0x06 || 33-byte secp256r1 public key)` + """ + + return _UniffiConverterTypeAddress.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_derive_address,self._uniffi_clone_pointer(),) + ) + + + + + + def inner(self, ) -> "Secp256r1PublicKey": + return _UniffiConverterTypeSecp256r1PublicKey.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_passkeypublickey_inner,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypePasskeyPublicKey: + + @staticmethod + def lift(value: int): + return PasskeyPublicKey._make_instance_(value) + + @staticmethod + def check_lower(value: PasskeyPublicKey): + if not isinstance(value, PasskeyPublicKey): + raise TypeError("Expected PasskeyPublicKey instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: PasskeyPublicKeyProtocol): + if not isinstance(value, PasskeyPublicKey): + raise TypeError("Expected PasskeyPublicKey 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: PasskeyPublicKeyProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class PasskeyVerifierProtocol(typing.Protocol): def verify(self, message: "bytes",authenticator: "PasskeyAuthenticator"): raise NotImplementedError @@ -28384,6 +29628,85 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: PasskeyVerifierProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class PersonalMessageProtocol(typing.Protocol): + def message_bytes(self, ): + raise NotImplementedError + def signing_digest(self, ): + raise NotImplementedError +# PersonalMessage is a Rust-only trait - it's a wrapper around a Rust implementation. +class PersonalMessage(): + _pointer: ctypes.c_void_p + def __init__(self, message_bytes: "bytes"): + _UniffiConverterBytes.check_lower(message_bytes) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_personalmessage_new, + _UniffiConverterBytes.lower(message_bytes)) + + 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_personalmessage, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_personalmessage, 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 message_bytes(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_personalmessage_message_bytes,self._uniffi_clone_pointer(),) + ) + + + + + + def signing_digest(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_personalmessage_signing_digest,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypePersonalMessage: + + @staticmethod + def lift(value: int): + return PersonalMessage._make_instance_(value) + + @staticmethod + def check_lower(value: PersonalMessage): + if not isinstance(value, PersonalMessage): + raise TypeError("Expected PersonalMessage instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: PersonalMessageProtocol): + if not isinstance(value, PersonalMessage): + raise TypeError("Expected PersonalMessage 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: PersonalMessageProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class ProgrammableTransactionProtocol(typing.Protocol): """ A user transaction @@ -31218,6 +32541,8 @@ class TransactionProtocol(typing.Protocol): ``` """ + def digest(self, ): + raise NotImplementedError def expiration(self, ): raise NotImplementedError def gas_payment(self, ): @@ -31226,6 +32551,8 @@ def kind(self, ): raise NotImplementedError def sender(self, ): raise NotImplementedError + def signing_digest(self, ): + raise NotImplementedError # Transaction is a Rust-only trait - it's a wrapper around a Rust implementation. class Transaction(): """ @@ -31277,6 +32604,15 @@ def _make_instance_(cls, pointer): return inst + def digest(self, ) -> "Digest": + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_digest,self._uniffi_clone_pointer(),) + ) + + + + + def expiration(self, ) -> "TransactionExpiration": return _UniffiConverterTypeTransactionExpiration.lift( _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_expiration,self._uniffi_clone_pointer(),) @@ -31313,6 +32649,15 @@ def sender(self, ) -> "Address": + def signing_digest(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transaction_signing_digest,self._uniffi_clone_pointer(),) + ) + + + + + class _UniffiConverterTypeTransaction: @@ -31982,6 +33327,8 @@ class TransactionEffectsProtocol(typing.Protocol): def as_v1(self, ): raise NotImplementedError + def digest(self, ): + raise NotImplementedError def is_v1(self, ): raise NotImplementedError # TransactionEffects is a Rust-only trait - it's a wrapper around a Rust implementation. @@ -32041,6 +33388,15 @@ def as_v1(self, ) -> "TransactionEffectsV1": + def digest(self, ) -> "Digest": + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_digest,self._uniffi_clone_pointer(),) + ) + + + + + def is_v1(self, ) -> "bool": return _UniffiConverterBool.lift( _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1,self._uniffi_clone_pointer(),) @@ -32078,6 +33434,109 @@ def read(cls, buf: _UniffiRustBuffer): @classmethod def write(cls, value: TransactionEffectsProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) +class TransactionEventsProtocol(typing.Protocol): + """ + Events emitted during the successful execution of a transaction + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + transaction-events = vector event + ``` + """ + + def digest(self, ): + raise NotImplementedError + def events(self, ): + raise NotImplementedError +# TransactionEvents is a Rust-only trait - it's a wrapper around a Rust implementation. +class TransactionEvents(): + """ + Events emitted during the successful execution of a transaction + + # BCS + + The BCS serialized form for this type is defined by the following ABNF: + + ```text + transaction-events = vector event + ``` + """ + + _pointer: ctypes.c_void_p + def __init__(self, events: "typing.List[Event]"): + _UniffiConverterSequenceTypeEvent.check_lower(events) + + self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactionevents_new, + _UniffiConverterSequenceTypeEvent.lower(events)) + + 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_transactionevents, pointer) + + def _uniffi_clone_pointer(self): + return _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_clone_transactionevents, 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 digest(self, ) -> "Digest": + return _UniffiConverterTypeDigest.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionevents_digest,self._uniffi_clone_pointer(),) + ) + + + + + + def events(self, ) -> "typing.List[Event]": + return _UniffiConverterSequenceTypeEvent.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionevents_events,self._uniffi_clone_pointer(),) + ) + + + + + + +class _UniffiConverterTypeTransactionEvents: + + @staticmethod + def lift(value: int): + return TransactionEvents._make_instance_(value) + + @staticmethod + def check_lower(value: TransactionEvents): + if not isinstance(value, TransactionEvents): + raise TypeError("Expected TransactionEvents instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransactionEventsProtocol): + if not isinstance(value, TransactionEvents): + raise TypeError("Expected TransactionEvents 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: TransactionEventsProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) class TransactionKindProtocol(typing.Protocol): """ Transaction type @@ -34377,6 +35836,41 @@ class ZkLoginPublicIdentifierProtocol(typing.Protocol): """ def address_seed(self, ): + raise NotImplementedError + def derive_address(self, ): + """ + Provides an iterator over the addresses that correspond to this zklogin + authenticator. + + In the majority of instances this will only yield a single address, + except for the instances where the `address_seed` value has a + leading zero-byte, in such cases the returned iterator will yield + two addresses. + """ + + raise NotImplementedError + def derive_address_padded(self, ): + """ + Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + byte length of the `iss` followed by the `iss` bytes themselves and + the full 32 byte `address_seed` value, all prefixed with the zklogin + `SignatureScheme` flag (`0x05`). + + `hash( 0x05 || iss_bytes_len || iss_bytes || 32_byte_address_seed )` + """ + + raise NotImplementedError + def derive_address_unpadded(self, ): + """ + Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + byte length of the `iss` followed by the `iss` bytes themselves and + the `address_seed` bytes with any leading zero-bytes stripped, all + prefixed with the zklogin `SignatureScheme` flag (`0x05`). + + `hash( 0x05 || iss_bytes_len || iss_bytes || + unpadded_32_byte_address_seed )` + """ + raise NotImplementedError def iss(self, ): raise NotImplementedError @@ -34475,6 +35969,62 @@ def address_seed(self, ) -> "Bn254FieldElement": + def derive_address(self, ) -> "typing.List[Address]": + """ + Provides an iterator over the addresses that correspond to this zklogin + authenticator. + + In the majority of instances this will only yield a single address, + except for the instances where the `address_seed` value has a + leading zero-byte, in such cases the returned iterator will yield + two addresses. + """ + + return _UniffiConverterSequenceTypeAddress.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address,self._uniffi_clone_pointer(),) + ) + + + + + + def derive_address_padded(self, ) -> "Address": + """ + Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + byte length of the `iss` followed by the `iss` bytes themselves and + the full 32 byte `address_seed` value, all prefixed with the zklogin + `SignatureScheme` flag (`0x05`). + + `hash( 0x05 || iss_bytes_len || iss_bytes || 32_byte_address_seed )` + """ + + return _UniffiConverterTypeAddress.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_padded,self._uniffi_clone_pointer(),) + ) + + + + + + def derive_address_unpadded(self, ) -> "Address": + """ + Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + byte length of the `iss` followed by the `iss` bytes themselves and + the `address_seed` bytes with any leading zero-bytes stripped, all + prefixed with the zklogin `SignatureScheme` flag (`0x05`). + + `hash( 0x05 || iss_bytes_len || iss_bytes || + unpadded_32_byte_address_seed )` + """ + + return _UniffiConverterTypeAddress.lift( + _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_derive_address_unpadded,self._uniffi_clone_pointer(),) + ) + + + + + def iss(self, ) -> "str": return _UniffiConverterString.lift( _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_iss,self._uniffi_clone_pointer(),) @@ -34716,7 +36266,6 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "AuthenticatorStateExpire", "AuthenticatorStateUpdateV1", "ChangedObject", - "CheckpointSummary", "CheckpointSummaryPage", "CoinMetadata", "CoinPage", @@ -34794,6 +36343,9 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "ChangeEpoch", "ChangeEpochV2", "CheckpointCommitment", + "CheckpointContents", + "CheckpointSummary", + "CheckpointTransactionInfo", "CircomG1", "CircomG2", "Coin", @@ -34835,7 +36387,9 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "ObjectType", "Owner", "PasskeyAuthenticator", + "PasskeyPublicKey", "PasskeyVerifier", + "PersonalMessage", "ProgrammableTransaction", "Publish", "Secp256k1PrivateKey", @@ -34858,6 +36412,7 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "Transaction", "TransactionBuilder", "TransactionEffects", + "TransactionEvents", "TransactionKind", "TransferObjects", "TypeTag", diff --git a/crates/iota-sdk-ffi/src/graphql.rs b/crates/iota-sdk-ffi/src/graphql.rs index 3d083e260..d3d7e9649 100644 --- a/crates/iota-sdk-ffi/src/graphql.rs +++ b/crates/iota-sdk-ffi/src/graphql.rs @@ -209,14 +209,15 @@ impl GraphQLClient { &self, digest: Option>, seq_num: Option, - ) -> Result> { + ) -> Result>> { Ok(self .0 .read() .await .checkpoint(digest.map(|d| **d), seq_num) .await? - .map(Into::into)) + .map(Into::into) + .map(Arc::new)) } /// Get a page of [`CheckpointSummary`] for the provided parameters. diff --git a/crates/iota-sdk-ffi/src/types/checkpoint.rs b/crates/iota-sdk-ffi/src/types/checkpoint.rs index c1bb675c9..d9764fdaa 100644 --- a/crates/iota-sdk-ffi/src/types/checkpoint.rs +++ b/crates/iota-sdk-ffi/src/types/checkpoint.rs @@ -5,7 +5,9 @@ use std::sync::Arc; use iota_types::GasCostSummary; -use crate::types::{crypto::validator::ValidatorCommitteeMember, digest::Digest}; +use crate::types::{ + crypto::validator::ValidatorCommitteeMember, digest::Digest, signature::UserSignature, +}; pub type CheckpointSequenceNumber = u64; pub type CheckpointTimestamp = u64; @@ -52,81 +54,198 @@ pub type ProtocolVersion = u64; /// (option end-of-epoch-data) ; end_of_epoch_data /// bytes ; version_specific_data /// ``` -#[derive(uniffi::Record)] -pub struct CheckpointSummary { +#[derive(derive_more::From, uniffi::Object)] +pub struct CheckpointSummary(pub iota_types::CheckpointSummary); + +#[uniffi::export] +impl CheckpointSummary { + #[uniffi::constructor] + #[allow(clippy::too_many_arguments)] + pub fn new( + epoch: EpochId, + sequence_number: CheckpointSequenceNumber, + network_total_transactions: u64, + content_digest: &Digest, + previous_digest: Option>, + epoch_rolling_gas_cost_summary: GasCostSummary, + timestamp_ms: CheckpointTimestamp, + checkpoint_commitments: Vec>, + end_of_epoch_data: Option, + version_specific_data: Vec, + ) -> Self { + Self(iota_types::CheckpointSummary { + epoch, + sequence_number, + network_total_transactions, + content_digest: **content_digest, + previous_digest: previous_digest.map(|v| **v), + epoch_rolling_gas_cost_summary, + timestamp_ms, + checkpoint_commitments: checkpoint_commitments + .into_iter() + .map(|v| v.0.clone()) + .collect(), + end_of_epoch_data: end_of_epoch_data.map(Into::into), + version_specific_data, + }) + } + /// Epoch that this checkpoint belongs to. - pub epoch: u64, + pub fn epoch(&self) -> u64 { + self.0.epoch + } + /// The height of this checkpoint. - pub sequence_number: u64, + pub fn sequence_number(&self) -> u64 { + self.0.sequence_number + } + /// Total number of transactions committed since genesis, including those in /// this checkpoint. - pub network_total_transactions: u64, + pub fn network_total_transactions(&self) -> u64 { + self.0.network_total_transactions + } + /// The hash of the `CheckpointContents` for this checkpoint. - pub content_digest: Arc, + pub fn content_digest(&self) -> Digest { + self.0.content_digest.into() + } + /// The hash of the previous `CheckpointSummary`. /// /// This will be only be `None` for the first, or genesis checkpoint. - pub previous_digest: Option>, + pub fn previous_digest(&self) -> Option> { + self.0.previous_digest.map(Into::into).map(Arc::new) + } + /// The running total gas costs of all transactions included in the current /// epoch so far until this checkpoint. - pub epoch_rolling_gas_cost_summary: GasCostSummary, + pub fn epoch_rolling_gas_cost_summary(&self) -> GasCostSummary { + self.0.epoch_rolling_gas_cost_summary.clone() + } + /// Timestamp of the checkpoint - number of milliseconds from the Unix epoch /// Checkpoint timestamps are monotonic, but not strongly monotonic - /// subsequent checkpoints can have same timestamp if they originate /// from the same underlining consensus commit - pub timestamp_ms: u64, + pub fn timestamp_ms(&self) -> u64 { + self.0.timestamp_ms + } + /// Commitments to checkpoint-specific state. - pub checkpoint_commitments: Vec>, + pub fn checkpoint_commitments(&self) -> Vec> { + self.0 + .checkpoint_commitments + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } + /// Extra data only present in the final checkpoint of an epoch. - pub end_of_epoch_data: Option, + pub fn end_of_epoch_data(&self) -> Option { + self.0.end_of_epoch_data.clone().map(Into::into) + } + /// CheckpointSummary is not an evolvable structure - it must be readable by /// any version of the code. Therefore, in order to allow extensions to /// be added to CheckpointSummary, we allow opaque data to be added to /// checkpoints which can be deserialized based on the current /// protocol version. - pub version_specific_data: Vec, + pub fn version_specific_data(&self) -> Vec { + self.0.version_specific_data.clone() + } + + pub fn digest(&self) -> Digest { + self.0.digest().into() + } + + pub fn signing_message(&self) -> Vec { + self.0.signing_message() + } } -impl From for CheckpointSummary { - fn from(value: iota_types::CheckpointSummary) -> Self { - Self { - epoch: value.epoch, - sequence_number: value.sequence_number, - network_total_transactions: value.network_total_transactions, - content_digest: Arc::new(value.content_digest.into()), - previous_digest: value.previous_digest.map(Into::into).map(Arc::new), - epoch_rolling_gas_cost_summary: value.epoch_rolling_gas_cost_summary, - timestamp_ms: value.timestamp_ms, - checkpoint_commitments: value - .checkpoint_commitments - .into_iter() - .map(Into::into) - .map(Arc::new) - .collect(), - end_of_epoch_data: value.end_of_epoch_data.map(Into::into), - version_specific_data: value.version_specific_data, - } +/// The committed to contents of a checkpoint. +/// +/// `CheckpointContents` contains a list of digests of Transactions, their +/// effects, and the user signatures that authorized their execution included in +/// a checkpoint. +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// checkpoint-contents = %x00 checkpoint-contents-v1 ; variant 0 +/// +/// checkpoint-contents-v1 = (vector (digest digest)) ; vector of transaction and effect digests +/// (vector (vector bcs-user-signature)) ; set of user signatures for each +/// ; transaction. MUST be the same +/// ; length as the vector of digests +/// ``` +#[derive(derive_more::From, uniffi::Object)] +pub struct CheckpointContents(pub iota_types::CheckpointContents); + +#[uniffi::export] +impl CheckpointContents { + #[uniffi::constructor] + pub fn new(transaction_info: Vec>) -> Self { + Self(iota_types::CheckpointContents::new( + transaction_info.into_iter().map(|v| v.0.clone()).collect(), + )) + } + + pub fn transaction_info(&self) -> Vec> { + self.0 + .0 + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() + } + + pub fn digest(&self) -> Digest { + self.0.digest().into() } } -impl From for iota_types::CheckpointSummary { - fn from(value: CheckpointSummary) -> Self { - Self { - epoch: value.epoch, - sequence_number: value.sequence_number, - network_total_transactions: value.network_total_transactions, - content_digest: **value.content_digest, - previous_digest: value.previous_digest.map(|v| **v), - epoch_rolling_gas_cost_summary: value.epoch_rolling_gas_cost_summary, - timestamp_ms: value.timestamp_ms, - checkpoint_commitments: value - .checkpoint_commitments - .into_iter() - .map(|v| v.0.clone()) - .collect(), - end_of_epoch_data: value.end_of_epoch_data.map(Into::into), - version_specific_data: value.version_specific_data, - } +/// Transaction information committed to in a checkpoint +#[derive(derive_more::From, uniffi::Object)] +pub struct CheckpointTransactionInfo(pub iota_types::CheckpointTransactionInfo); + +#[uniffi::export] +impl CheckpointTransactionInfo { + #[uniffi::constructor] + pub fn new( + transaction: &Digest, + effects: &Digest, + signatures: Vec>, + ) -> Self { + Self(iota_types::CheckpointTransactionInfo { + transaction: **transaction, + effects: **effects, + signatures: signatures.into_iter().map(|v| v.0.clone()).collect(), + }) + } + + pub fn transaction(&self) -> Digest { + self.0.transaction.into() + } + + pub fn effects(&self) -> Digest { + self.0.effects.into() + } + + pub fn signatures(&self) -> Vec> { + self.0 + .signatures + .iter() + .cloned() + .map(Into::into) + .map(Arc::new) + .collect() } } diff --git a/crates/iota-sdk-ffi/src/types/crypto/mod.rs b/crates/iota-sdk-ffi/src/types/crypto/mod.rs index 9d0b631e0..a8a80fed2 100644 --- a/crates/iota-sdk-ffi/src/types/crypto/mod.rs +++ b/crates/iota-sdk-ffi/src/types/crypto/mod.rs @@ -8,7 +8,10 @@ pub mod zklogin; use std::sync::Arc; -use crate::{error::Result, types::signature::SimpleSignature}; +use crate::{ + error::Result, + types::{address::Address, signature::SimpleSignature}, +}; macro_rules! impl_crypto_object { ($(#[$meta:meta])* $t:ident) => { @@ -70,6 +73,19 @@ impl_crypto_object!( /// ``` Ed25519PublicKey ); + +impl Ed25519PublicKey { + /// Derive an `Address` from this Public Key + /// + /// An `Address` can be derived from an `Ed25519PublicKey` by hashing the + /// bytes of the public key with no prefix flag. + /// + /// `hash(32-byte ed25519 public key)` + pub fn derive_address(&self) -> Address { + self.0.derive_address().into() + } +} + impl_crypto_object!( /// A secp256k1 signature. /// @@ -82,6 +98,20 @@ impl_crypto_object!( /// ``` Secp256k1PublicKey ); + +impl Secp256k1PublicKey { + /// Derive an `Address` from this Public Key + /// + /// An `Address` can be derived from a `Secp256r1PublicKey` by hashing the + /// bytes of the public key prefixed with the Secp256r1 + /// `SignatureScheme` flag (`0x02`). + /// + /// `hash( 0x02 || 33-byte secp256r1 public key)` + pub fn derive_address(&self) -> Address { + self.0.derive_address().into() + } +} + impl_crypto_object!( /// A secp256r1 signature. /// @@ -94,6 +124,20 @@ impl_crypto_object!( /// ``` Secp256r1PublicKey ); + +impl Secp256r1PublicKey { + /// Derive an `Address` from this Public Key + /// + /// An `Address` can be derived from a `Secp256r1PublicKey` by hashing the + /// bytes of the public key prefixed with the Secp256r1 + /// `SignatureScheme` flag (`0x02`). + /// + /// `hash( 0x02 || 33-byte secp256r1 public key)` + pub fn derive_address(&self) -> Address { + self.0.derive_address().into() + } +} + impl_crypto_object!( /// An ed25519 signature. /// diff --git a/crates/iota-sdk-ffi/src/types/crypto/multisig.rs b/crates/iota-sdk-ffi/src/types/crypto/multisig.rs index ec158160a..98d42e159 100644 --- a/crates/iota-sdk-ffi/src/types/crypto/multisig.rs +++ b/crates/iota-sdk-ffi/src/types/crypto/multisig.rs @@ -5,10 +5,13 @@ use std::sync::Arc; use iota_types::SignatureScheme; -use crate::types::crypto::{ - Ed25519PublicKey, Ed25519Signature, Secp256k1PublicKey, Secp256k1Signature, Secp256r1PublicKey, - Secp256r1Signature, - zklogin::{ZkLoginAuthenticator, ZkLoginPublicIdentifier}, +use crate::types::{ + address::Address, + crypto::{ + Ed25519PublicKey, Ed25519Signature, Secp256k1PublicKey, Secp256k1Signature, + Secp256r1PublicKey, Secp256r1Signature, + zklogin::{ZkLoginAuthenticator, ZkLoginPublicIdentifier}, + }, }; /// A signature from a member of a multisig committee. @@ -45,8 +48,8 @@ impl MultisigMemberSignature { .map(Arc::new) } - pub fn as_ed25519(&self) -> Arc { - Arc::new((*self.0.as_ed25519()).into()) + pub fn as_ed25519(&self) -> Ed25519Signature { + (*self.0.as_ed25519()).into() } pub fn is_secp256k1(&self) -> bool { @@ -61,8 +64,8 @@ impl MultisigMemberSignature { .map(Arc::new) } - pub fn as_secp256k1(&self) -> Arc { - Arc::new((*self.0.as_secp256k1()).into()) + pub fn as_secp256k1(&self) -> Secp256k1Signature { + (*self.0.as_secp256k1()).into() } pub fn is_secp256r1(&self) -> bool { @@ -77,8 +80,8 @@ impl MultisigMemberSignature { .map(Arc::new) } - pub fn as_secp256r1(&self) -> Arc { - Arc::new((*self.0.as_secp256r1()).into()) + pub fn as_secp256r1(&self) -> Secp256r1Signature { + (*self.0.as_secp256r1()).into() } pub fn is_zklogin(&self) -> bool { @@ -93,8 +96,8 @@ impl MultisigMemberSignature { .map(Arc::new) } - pub fn as_zklogin(&self) -> Arc { - Arc::new(self.0.as_zklogin().clone().into()) + pub fn as_zklogin(&self) -> ZkLoginAuthenticator { + self.0.as_zklogin().clone().into() } } @@ -143,8 +146,8 @@ impl MultisigMemberPublicKey { .map(Arc::new) } - pub fn as_ed25519(&self) -> Arc { - Arc::new((*self.0.as_ed25519()).into()) + pub fn as_ed25519(&self) -> Ed25519PublicKey { + (*self.0.as_ed25519()).into() } pub fn is_secp256k1(&self) -> bool { @@ -159,8 +162,8 @@ impl MultisigMemberPublicKey { .map(Arc::new) } - pub fn as_secp256k1(&self) -> Arc { - Arc::new((*self.0.as_secp256k1()).into()) + pub fn as_secp256k1(&self) -> Secp256k1PublicKey { + (*self.0.as_secp256k1()).into() } pub fn is_secp256r1(&self) -> bool { @@ -175,8 +178,8 @@ impl MultisigMemberPublicKey { .map(Arc::new) } - pub fn as_secp256r1(&self) -> Arc { - Arc::new((*self.0.as_secp256r1()).into()) + pub fn as_secp256r1(&self) -> Secp256r1PublicKey { + (*self.0.as_secp256r1()).into() } pub fn is_zklogin(&self) -> bool { @@ -191,8 +194,8 @@ impl MultisigMemberPublicKey { .map(Arc::new) } - pub fn as_zklogin(&self) -> Arc { - Arc::new(self.0.as_zklogin().clone().into()) + pub fn as_zklogin(&self) -> ZkLoginPublicIdentifier { + self.0.as_zklogin().clone().into() } } @@ -343,6 +346,27 @@ impl MultisigCommittee { pub fn is_valid(&self) -> bool { self.0.is_valid() } + + /// Derive an `Address` from this MultisigCommittee. + /// + /// A MultiSig address + /// is defined as the 32-byte Blake2b hash of serializing the + /// `SignatureScheme` flag (0x03), the threshold (in little endian), and + /// the concatenation of all n flag, public keys and its weight. + /// + /// `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 + /// || ... || flag_n || pk_n || weight_n)`. + /// + /// When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + /// refers to the same input used when deriving the address using the + /// [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + /// full 32-byte `address_seed` value). + /// + /// [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier + /// [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded + pub fn derive_address(&self) -> Address { + self.0.derive_address().into() + } } /// A member in a multisig committee diff --git a/crates/iota-sdk-ffi/src/types/crypto/passkey.rs b/crates/iota-sdk-ffi/src/types/crypto/passkey.rs index 44df4be5b..fa4935796 100644 --- a/crates/iota-sdk-ffi/src/types/crypto/passkey.rs +++ b/crates/iota-sdk-ffi/src/types/crypto/passkey.rs @@ -1,9 +1,14 @@ // Copyright (c) 2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use std::sync::Arc; + use iota_crypto::Verifier; -use crate::{error::Result, types::signature::SimpleSignature}; +use crate::{ + error::Result, + types::{address::Address, crypto::Secp256r1PublicKey, signature::SimpleSignature}, +}; /// A passkey authenticator. /// @@ -65,4 +70,46 @@ impl PasskeyAuthenticator { pub fn signature(&self) -> SimpleSignature { self.0.signature().into() } + + /// The passkey public key + pub fn public_key(&self) -> PasskeyPublicKey { + self.0.public_key().into() + } +} + +/// Public key of a `PasskeyAuthenticator`. +/// +/// This is used to derive the onchain `Address` for a `PasskeyAuthenticator`. +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// passkey-public-key = passkey-flag secp256r1-public-key +/// ``` +#[derive(derive_more::From, uniffi::Object)] +pub struct PasskeyPublicKey(iota_types::PasskeyPublicKey); + +#[uniffi::export] +impl PasskeyPublicKey { + #[uniffi::constructor] + pub fn new(public_key: &Secp256r1PublicKey) -> Self { + Self(iota_types::PasskeyPublicKey::new(**public_key)) + } + + pub fn inner(&self) -> Secp256r1PublicKey { + (*self.0.inner()).into() + } + + /// Derive an `Address` from this Passkey Public Key + /// + /// An `Address` can be derived from a `PasskeyPublicKey` by hashing the + /// bytes of the `Secp256r1PublicKey` that corresponds to this passkey + /// prefixed with the Passkey `SignatureScheme` flag (`0x06`). + /// + /// `hash( 0x06 || 33-byte secp256r1 public key)` + pub fn derive_address(&self) -> Address { + self.0.derive_address().into() + } } diff --git a/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs b/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs index 88a1e8a17..c65ff029d 100644 --- a/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs +++ b/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs @@ -7,7 +7,7 @@ use iota_types::{Jwk, JwkId, ZkLoginClaim}; use crate::{ error::{Result, SdkFfiError}, - types::signature::SimpleSignature, + types::{address::Address, signature::SimpleSignature}, }; /// A zklogin authenticator @@ -127,6 +127,42 @@ impl ZkLoginPublicIdentifier { pub fn address_seed(&self) -> Bn254FieldElement { self.0.address_seed().clone().into() } + + /// Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + /// byte length of the `iss` followed by the `iss` bytes themselves and + /// the full 32 byte `address_seed` value, all prefixed with the zklogin + /// `SignatureScheme` flag (`0x05`). + /// + /// `hash( 0x05 || iss_bytes_len || iss_bytes || 32_byte_address_seed )` + pub fn derive_address_padded(&self) -> Address { + self.0.derive_address_padded().into() + } + + /// Derive an `Address` from this `ZkLoginPublicIdentifier` by hashing the + /// byte length of the `iss` followed by the `iss` bytes themselves and + /// the `address_seed` bytes with any leading zero-bytes stripped, all + /// prefixed with the zklogin `SignatureScheme` flag (`0x05`). + /// + /// `hash( 0x05 || iss_bytes_len || iss_bytes || + /// unpadded_32_byte_address_seed )` + pub fn derive_address_unpadded(&self) -> Address { + self.0.derive_address_unpadded().into() + } + + /// Provides an iterator over the addresses that correspond to this zklogin + /// authenticator. + /// + /// In the majority of instances this will only yield a single address, + /// except for the instances where the `address_seed` value has a + /// leading zero-byte, in such cases the returned iterator will yield + /// two addresses. + pub fn derive_address(&self) -> Vec> { + self.0 + .derive_address() + .map(Into::into) + .map(Arc::new) + .collect() + } } /// A zklogin groth16 proof and the required inputs to perform proof diff --git a/crates/iota-sdk-ffi/src/types/events.rs b/crates/iota-sdk-ffi/src/types/events.rs index eba4c937c..69d0f2b68 100644 --- a/crates/iota-sdk-ffi/src/types/events.rs +++ b/crates/iota-sdk-ffi/src/types/events.rs @@ -5,7 +5,7 @@ use std::{str::FromStr, sync::Arc}; use iota_types::{Identifier, StructTag}; -use crate::types::{address::Address, object::ObjectId}; +use crate::types::{address::Address, digest::Digest, object::ObjectId}; /// An event /// @@ -56,3 +56,33 @@ impl From for iota_types::Event { } } } + +/// Events emitted during the successful execution of a transaction +/// +/// # BCS +/// +/// The BCS serialized form for this type is defined by the following ABNF: +/// +/// ```text +/// transaction-events = vector event +/// ``` +#[derive(derive_more::From, uniffi::Object)] +pub struct TransactionEvents(pub iota_types::TransactionEvents); + +#[uniffi::export] +impl TransactionEvents { + #[uniffi::constructor] + pub fn new(events: Vec) -> Self { + Self(iota_types::TransactionEvents( + events.into_iter().map(Into::into).collect(), + )) + } + + pub fn events(&self) -> Vec { + self.0.0.iter().cloned().map(Into::into).collect() + } + + pub fn digest(&self) -> Digest { + self.0.digest().into() + } +} diff --git a/crates/iota-sdk-ffi/src/types/mod.rs b/crates/iota-sdk-ffi/src/types/mod.rs index 78fbe3657..74f037fc4 100644 --- a/crates/iota-sdk-ffi/src/types/mod.rs +++ b/crates/iota-sdk-ffi/src/types/mod.rs @@ -1,6 +1,8 @@ // Copyright (c) 2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use std::borrow::Cow; + pub mod address; pub mod checkpoint; pub mod coin; @@ -15,3 +17,24 @@ pub mod signature; pub mod struct_tag; pub mod transaction; pub mod type_tag; + +#[derive(derive_more::From, uniffi::Object)] +pub struct PersonalMessage(iota_types::PersonalMessage<'static>); + +#[uniffi::export] +impl PersonalMessage { + #[uniffi::constructor] + pub fn new(message_bytes: &[u8]) -> Self { + Self(iota_types::PersonalMessage(Cow::Owned( + message_bytes.to_vec(), + ))) + } + + pub fn message_bytes(&self) -> Vec { + self.0.0.clone().into_owned() + } + + pub fn signing_digest(&self) -> Vec { + self.0.signing_digest().to_vec() + } +} diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index aeacf4f87..7b4ec696b 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -15,6 +15,7 @@ use crate::{ address::Address, digest::Digest, struct_tag::{Identifier, StructTag}, + type_tag::TypeTag, }, }; @@ -65,6 +66,22 @@ impl ObjectId { pub fn to_hex(&self) -> String { self.0.as_address().to_hex() } + + /// Create an ObjectId from a transaction digest and the number of objects + /// that have been created during a transactions. + #[uniffi::constructor] + pub fn derive_id(digest: &Digest, count: u64) -> Self { + Self(iota_types::ObjectId::derive_id(**digest, count)) + } + + /// Derive an ObjectId for a Dynamic Child Object. + /// + /// hash(parent || len(key) || key || key_type_tag) + pub fn derive_dynamic_child_id(&self, key_type_tag: &TypeTag, key_bytes: &[u8]) -> Self { + self.0 + .derive_dynamic_child_id(&key_type_tag.0, key_bytes) + .into() + } } /// Reference to an object @@ -172,6 +189,13 @@ impl Object { pub fn storage_rebate(&self) -> u64 { self.0.storage_rebate } + + /// Calculate the digest of this `Object` + /// + /// This is done by hashing the BCS bytes of this `Object` prefixed + pub fn digest(&self) -> Digest { + self.0.digest().into() + } } /// Object data, either a package or struct diff --git a/crates/iota-sdk-ffi/src/types/signature.rs b/crates/iota-sdk-ffi/src/types/signature.rs index 1258754d5..0ede670f5 100644 --- a/crates/iota-sdk-ffi/src/types/signature.rs +++ b/crates/iota-sdk-ffi/src/types/signature.rs @@ -123,8 +123,8 @@ impl UserSignature { .map(Arc::new) } - pub fn as_simple(&self) -> Arc { - Arc::new(self.0.as_simple().clone().into()) + pub fn as_simple(&self) -> SimpleSignature { + self.0.as_simple().clone().into() } pub fn is_multisig(&self) -> bool { @@ -139,8 +139,8 @@ impl UserSignature { .map(Arc::new) } - pub fn as_multisig(&self) -> Arc { - Arc::new(self.0.as_multisig().clone().into()) + pub fn as_multisig(&self) -> MultisigAggregatedSignature { + self.0.as_multisig().clone().into() } pub fn is_zklogin(&self) -> bool { @@ -155,8 +155,8 @@ impl UserSignature { .map(Arc::new) } - pub fn as_zklogin(&self) -> Arc { - Arc::new(self.0.as_zklogin().clone().into()) + pub fn as_zklogin(&self) -> ZkLoginAuthenticator { + self.0.as_zklogin().clone().into() } pub fn is_passkey(&self) -> bool { @@ -171,8 +171,8 @@ impl UserSignature { .map(Arc::new) } - pub fn as_passkey(&self) -> Arc { - Arc::new(self.0.as_passkey().clone().into()) + pub fn as_passkey(&self) -> PasskeyAuthenticator { + self.0.as_passkey().clone().into() } } @@ -247,8 +247,8 @@ impl SimpleSignature { .map(Arc::new) } - pub fn ed25519_sig(&self) -> Arc { - Arc::new((*self.0.as_ed25519_sig()).into()) + pub fn ed25519_sig(&self) -> Ed25519Signature { + (*self.0.as_ed25519_sig()).into() } pub fn ed25519_pub_key_opt(&self) -> Option> { @@ -259,8 +259,8 @@ impl SimpleSignature { .map(Arc::new) } - pub fn ed25519_pub_key(&self) -> Arc { - Arc::new((*self.0.as_ed25519_pub_key()).into()) + pub fn ed25519_pub_key(&self) -> Ed25519PublicKey { + (*self.0.as_ed25519_pub_key()).into() } pub fn is_secp256k1(&self) -> bool { @@ -275,8 +275,8 @@ impl SimpleSignature { .map(Arc::new) } - pub fn secp256k1_sig(&self) -> Arc { - Arc::new((*self.0.as_secp256k1_sig()).into()) + pub fn secp256k1_sig(&self) -> Secp256k1Signature { + (*self.0.as_secp256k1_sig()).into() } pub fn secp256k1_pub_key_opt(&self) -> Option> { @@ -287,8 +287,8 @@ impl SimpleSignature { .map(Arc::new) } - pub fn secp256k1_pub_key(&self) -> Arc { - Arc::new((*self.0.as_secp256k1_pub_key()).into()) + pub fn secp256k1_pub_key(&self) -> Secp256k1PublicKey { + (*self.0.as_secp256k1_pub_key()).into() } pub fn is_secp256r1(&self) -> bool { @@ -303,8 +303,8 @@ impl SimpleSignature { .map(Arc::new) } - pub fn secp256r1_sig(&self) -> Arc { - Arc::new((*self.0.as_secp256r1_sig()).into()) + pub fn secp256r1_sig(&self) -> Secp256r1Signature { + (*self.0.as_secp256r1_sig()).into() } pub fn secp256r1_pub_key_opt(&self) -> Option> { @@ -315,7 +315,7 @@ impl SimpleSignature { .map(Arc::new) } - pub fn secp256r1_pub_key(&self) -> Arc { - Arc::new((*self.0.as_secp256r1_pub_key()).into()) + pub fn secp256r1_pub_key(&self) -> Secp256r1PublicKey { + (*self.0.as_secp256r1_pub_key()).into() } } diff --git a/crates/iota-sdk-ffi/src/types/transaction/mod.rs b/crates/iota-sdk-ffi/src/types/transaction/mod.rs index 3492d640b..8c3ace074 100644 --- a/crates/iota-sdk-ffi/src/types/transaction/mod.rs +++ b/crates/iota-sdk-ffi/src/types/transaction/mod.rs @@ -70,6 +70,14 @@ impl Transaction { pub fn expiration(&self) -> TransactionExpiration { self.0.expiration } + + pub fn digest(&self) -> Digest { + self.0.digest().into() + } + + pub fn signing_digest(&self) -> Vec { + self.0.signing_digest().to_vec() + } } #[derive(uniffi::Record)] @@ -1451,6 +1459,10 @@ impl TransactionEffects { pub fn as_v1(&self) -> TransactionEffectsV1 { self.0.as_v1().clone().into() } + + pub fn digest(&self) -> Digest { + self.0.digest().into() + } } /// A TTL for a transaction diff --git a/crates/iota-sdk-ffi/src/uniffi_helpers.rs b/crates/iota-sdk-ffi/src/uniffi_helpers.rs index 27c3d659c..b26bebc2a 100644 --- a/crates/iota-sdk-ffi/src/uniffi_helpers.rs +++ b/crates/iota-sdk-ffi/src/uniffi_helpers.rs @@ -36,7 +36,6 @@ macro_rules! define_paged_record { }; } -define_paged_record!(CheckpointSummaryPage, CheckpointSummary); define_paged_record!(SignedTransactionPage, SignedTransaction); define_paged_record!(TransactionDataEffectsPage, TransactionDataEffects); define_paged_record!(DynamicFieldOutputPage, DynamicFieldOutput); @@ -76,6 +75,7 @@ define_paged_object!(ObjectPage, Object); define_paged_object!(TransactionEffectsPage, TransactionEffects); define_paged_object!(MovePackagePage, MovePackage); define_paged_object!(EpochPage, Epoch); +define_paged_object!(CheckpointSummaryPage, CheckpointSummary); uniffi::custom_type!(Value, String, { remote,