diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml new file mode 100644 index 000000000..1111fb34f --- /dev/null +++ b/.github/workflows/bindings.yml @@ -0,0 +1,70 @@ +name: Bindings + +on: + push: + branches: [develop, sdk-bindings] + paths: + - ".github/workflow/bindings.yml" + - "bindings/**" + - "crates/iota-sdk-ffi/**" + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +concurrency: + group: sdk-bindings-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} + +jobs: + kotlin: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build the dynamic library + run: cargo build -p iota-sdk-ffi --lib --release + - name: Generate the bindings + run: cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi.so" --language kotlin --out-dir bindings/kotlin/lib --no-format -c bindings/kotlin/uniffi.toml + - name: Copy the dynamic library to the bindings directory + run: cp target/release/libiota_sdk_ffi.so bindings/kotlin/lib/ + - name: Checks for uncommitted changes + run: git diff --exit-code + - name: Install Gradle + run: | + curl -s "https://get.sdkman.io" | bash + source "$HOME/.sdkman/bin/sdkman-init.sh" + sdk install gradle + - name: Run the example + run: | + cd bindings/kotlin + ./gradlew build clean + LD_LIBRARY_PATH=./lib ./gradlew run -q + go: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install uniffi-bindgen-go + run: cargo install uniffi-bindgen-go --git https://github.com/filament-dm/uniffi-bindgen-go --rev ab7315502bd6b979207fdae854e87d531ee8764d + - name: Build the dynamic library + run: cargo build -p iota-sdk-ffi --lib --release + - name: Generate the bindings + run: uniffi-bindgen-go --library target/release/libiota_sdk_ffi.so --out-dir ./bindings/go --no-format + - name: Checks for uncommitted changes + run: git diff --exit-code + - name: Run the example + run: cd bindings/go && LD_LIBRARY_PATH="../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../target/release" go run test.go + python: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build the dynamic library + run: cargo build -p iota-sdk-ffi --lib --release + - name: Generate the bindings + run: cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi.so" --language python --out-dir bindings/python/lib --no-format + - name: Copy the dynamic library to the bindings directory + run: cp target/release/libiota_sdk_ffi.so bindings/python/lib/ + - name: Checks for uncommitted changes + run: git diff --exit-code + - name: Run the example + run: cd bindings/python && python3 test.py diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index 7b5352054..9f8546d4b 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -385,6 +385,33 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_bls12381signature_to_bytes() + }) + if checksum != 56969 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_bls12381signature_to_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_padded() + }) + if checksum != 44301 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_padded: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_unpadded() + }) + if checksum != 33350 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_unpadded: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest() }) @@ -403,6 +430,42 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_base58() + }) + if checksum != 60951 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_bytes() + }) + if checksum != 51343 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_base58() + }) + if checksum != 40700 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_bytes() + }) + if checksum != 48082 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_bytes: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_coin_balance() }) @@ -430,6 +493,42 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_base58() + }) + if checksum != 7053 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_bytes() + }) + if checksum != 5048 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_digest_to_base58() + }) + if checksum != 54638 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_digest_to_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_digest_to_bytes() + }) + if checksum != 14244 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_digest_to_bytes: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_ed25519publickey_to_bytes() }) @@ -439,6 +538,33 @@ func uniffiCheckChecksums() { } } { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_ed25519signature_to_bytes() + }) + if checksum != 31911 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_ed25519signature_to_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_base58() + }) + if checksum != 56652 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_bytes() + }) + if checksum != 12259 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_bytes: UniFFI API checksum mismatch") + } + } + { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request() }) @@ -863,7443 +989,12228 @@ func uniffiCheckChecksums() { } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_as_struct() + return C.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str() }) - if checksum != 2473 { + if checksum != 63815 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_as_struct: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_identifier_as_str: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_data() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap() }) - if checksum != 4330 { + if checksum != 41489 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_data: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_object_id() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_committee() }) - if checksum != 6575 { + if checksum != 17432 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_object_id: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_committee: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_object_type() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_signatures() }) - if checksum != 1843 { + if checksum != 5488 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_object_type: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_signatures: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_owner() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid() }) - if checksum != 3724 { + if checksum != 45468 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_owner: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_members() }) - if checksum != 455 { + if checksum != 62870 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_members: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_scheme() }) - if checksum != 24969 { + if checksum != 15458 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_scheme: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_object_version() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_threshold() }) - if checksum != 18433 { + if checksum != 21653 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_version: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_threshold: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_objectid_to_address() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmember_public_key() }) - if checksum != 21880 { + if checksum != 7804 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectid_to_address: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmember_public_key: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmember_weight() }) - if checksum != 38367 { + if checksum != 57194 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmember_weight: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519() }) - if checksum != 4418 { + if checksum != 8241 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519_opt() }) - if checksum != 49170 { + if checksum != 28021 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1() }) - if checksum != 21066 { + if checksum != 52073 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_structtag_address() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1_opt() }) - if checksum != 18393 { + if checksum != 40194 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_structtag_address: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1() }) - if checksum != 37745 { + if checksum != 38170 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1_opt() }) - if checksum != 65306 { + if checksum != 28963 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin() }) - if checksum != 47752 { + if checksum != 17714 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_expiration: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin_opt() }) - if checksum != 5316 { + if checksum != 23106 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_transaction_kind() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_ed25519() }) - if checksum != 49492 { + if checksum != 1939 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_kind: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_ed25519: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_transaction_sender() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256k1() }) - if checksum != 38190 { + if checksum != 49521 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_sender: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256k1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256r1() }) - if checksum != 48710 { + if checksum != 16265 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256r1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_zklogin() }) - if checksum != 39808 { + if checksum != 37193 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_zklogin: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519() }) - if checksum != 1715 { + if checksum != 22855 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519_opt() }) - if checksum != 15734 { + if checksum != 56690 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1() }) - if checksum != 20180 { + if checksum != 49085 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1_opt() }) - if checksum != 55130 { + if checksum != 26984 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_address() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1() }) - if checksum != 38219 { + if checksum != 57510 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_address: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1_opt() }) - if checksum != 30264 { + if checksum != 12419 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin() }) - if checksum != 57678 { + if checksum != 39624 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin_opt() }) - if checksum != 39029 { + if checksum != 34526 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_ed25519() }) - if checksum != 65460 { + if checksum != 18913 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_ed25519: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256k1() }) - if checksum != 34540 { + if checksum != 16841 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256k1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256r1() }) - if checksum != 65130 { + if checksum != 51171 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256r1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32() + return C.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_zklogin() }) - if checksum != 40795 { + if checksum != 65193 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_zklogin: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64() + return C.uniffi_iota_sdk_ffi_checksum_method_object_as_struct() }) - if checksum != 28705 { + if checksum != 37303 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_as_struct: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8() + return C.uniffi_iota_sdk_ffi_checksum_method_object_data() }) - if checksum != 18761 { + if checksum != 4330 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_data: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector() + return C.uniffi_iota_sdk_ffi_checksum_method_object_object_id() }) - if checksum != 49992 { + if checksum != 6575 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_object_id: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_object_object_type() }) - if checksum != 58901 { + if checksum != 1843 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_object_type: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex() + return C.uniffi_iota_sdk_ffi_checksum_method_object_owner() }) - if checksum != 63442 { + if checksum != 3724 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_owner: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_address_generate() + return C.uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction() }) - if checksum != 48865 { + if checksum != 455 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_generate: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate() }) - if checksum != 6069 { + if checksum != 24969 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str() + return C.uniffi_iota_sdk_ffi_checksum_method_object_version() }) - if checksum != 26128 { + if checksum != 18433 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_object_version: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate() + return C.uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_base58() }) - if checksum != 30791 { + if checksum != 2414 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_base58: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object() + return C.uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_bytes() }) - if checksum != 35349 { + if checksum != 31732 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_objectid_to_address() }) - if checksum != 60403 { + if checksum != 21880 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectid_to_address: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str() + return C.uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes() }) - if checksum != 38751 { + if checksum != 38367 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate() + return C.uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex() }) - if checksum != 46412 { + if checksum != 4418 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create() + return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data() }) - if checksum != 18946 { + if checksum != 55474 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire() + return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge() }) - if checksum != 49861 { + if checksum != 28147 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch() + return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json() }) - if checksum != 16640 { + if checksum != 20272 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2() + return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature() }) - if checksum != 17262 { + if checksum != 5489 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_signature: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet() + return C.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes() }) - if checksum != 37366 { + if checksum != 49170 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local() + return C.uniffi_iota_sdk_ffi_checksum_method_secp256k1signature_to_bytes() }) - if checksum != 55393 { + if checksum != 49705 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_secp256k1signature_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() + return C.uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes() }) - if checksum != 13557 { + if checksum != 21066 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet() + return C.uniffi_iota_sdk_ffi_checksum_method_secp256r1signature_to_bytes() }) - if checksum != 16109 { + if checksum != 64948 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_secp256r1signature_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key() }) - if checksum != 32097 { + if checksum != 36693 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key_opt() }) - if checksum != 6494 { + if checksum != 11858 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig() }) - if checksum != 5570 { + if checksum != 56126 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig_opt() }) - if checksum != 3613 { + if checksum != 33862 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_ed25519() }) - if checksum != 48529 { + if checksum != 64494 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_ed25519: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_object_new() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256k1() }) - if checksum != 56232 { + if checksum != 39262 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_object_new: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256k1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256r1() }) - if checksum != 41789 { + if checksum != 49536 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256r1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_scheme() }) - if checksum != 30954 { + if checksum != 30423 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_scheme: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key() }) - if checksum != 20339 { + if checksum != 51778 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key_opt() }) - if checksum != 24158 { + if checksum != 20475 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig() }) - if checksum != 36411 { + if checksum != 36141 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig_opt() }) - if checksum != 60002 { + if checksum != 16111 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key() }) - if checksum != 27991 { + if checksum != 25197 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key_opt() }) - if checksum != 49992 { + if checksum != 22487 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig() }) - if checksum != 13756 { + if checksum != 30390 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig_opt() }) - if checksum != 37848 { + if checksum != 51961 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_new() + return C.uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes() }) - if checksum != 20682 { + if checksum != 28081 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_new: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota() + return C.uniffi_iota_sdk_ffi_checksum_method_structtag_address() }) - if checksum != 30839 { + if checksum != 18393 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_structtag_address: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() + return C.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type() }) - if checksum != 4081 { + if checksum != 37745 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transaction_new: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1() + return C.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt() }) - if checksum != 63561 { + if checksum != 65306 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1() + return C.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() }) - if checksum != 37860 { + if checksum != 47752 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_expiration: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1() + return C.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment() }) - if checksum != 50635 { + if checksum != 5316 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch() + return C.uniffi_iota_sdk_ffi_checksum_method_transaction_kind() }) - if checksum != 65525 { + if checksum != 49492 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_kind: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis() + return C.uniffi_iota_sdk_ffi_checksum_method_transaction_sender() }) - if checksum != 65272 { + if checksum != 38190 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transaction_sender: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction() + return C.uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_base58() }) - if checksum != 51205 { + if checksum != 22119 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_base58: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update() + return C.uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_bytes() }) - if checksum != 45772 { + if checksum != 3253 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address() + return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1() }) - if checksum != 44901 { + if checksum != 48710 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_address: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool() + return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1() }) - if checksum != 19366 { + if checksum != 39808 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer() + return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_base58() }) - if checksum != 12676 { + if checksum != 38601 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_base58: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag() + return C.uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_bytes() }) - if checksum != 53303 { + if checksum != 43744 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128() + return C.uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_base58() }) - if checksum != 41280 { + if checksum != 54162 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_base58: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16() + return C.uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes() }) - if checksum != 13801 { + if checksum != 6773 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256() + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag() }) - if checksum != 13310 { + if checksum != 1715 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32() + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt() }) - if checksum != 9870 { + if checksum != 15734 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64() + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag() }) - if checksum != 59470 { + if checksum != 20180 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8() + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt() }) - if checksum != 9403 { + if checksum != 55130 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt: UniFFI API checksum mismatch") } } { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { - return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector() + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_address() }) - if checksum != 46548 { + if checksum != 38219 { // If this happens try cleaning and rebuilding your project - panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector: UniFFI API checksum mismatch") + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_address: UniFFI API checksum mismatch") } } -} - - - -type FfiConverterUint8 struct{} - -var FfiConverterUint8INSTANCE = FfiConverterUint8{} - -func (FfiConverterUint8) Lower(value uint8) C.uint8_t { - return C.uint8_t(value) -} - -func (FfiConverterUint8) Write(writer io.Writer, value uint8) { - writeUint8(writer, value) -} - -func (FfiConverterUint8) Lift(value C.uint8_t) uint8 { - return uint8(value) -} - -func (FfiConverterUint8) Read(reader io.Reader) uint8 { - return readUint8(reader) -} - -type FfiDestroyerUint8 struct {} - -func (FfiDestroyerUint8) Destroy(_ uint8) {} - -type FfiConverterUint16 struct{} - -var FfiConverterUint16INSTANCE = FfiConverterUint16{} - -func (FfiConverterUint16) Lower(value uint16) C.uint16_t { - return C.uint16_t(value) -} - -func (FfiConverterUint16) Write(writer io.Writer, value uint16) { - writeUint16(writer, value) -} - -func (FfiConverterUint16) Lift(value C.uint16_t) uint16 { - return uint16(value) -} - -func (FfiConverterUint16) Read(reader io.Reader) uint16 { - return readUint16(reader) -} - -type FfiDestroyerUint16 struct {} - -func (FfiDestroyerUint16) Destroy(_ uint16) {} - -type FfiConverterUint32 struct{} - -var FfiConverterUint32INSTANCE = FfiConverterUint32{} - -func (FfiConverterUint32) Lower(value uint32) C.uint32_t { - return C.uint32_t(value) -} - -func (FfiConverterUint32) Write(writer io.Writer, value uint32) { - writeUint32(writer, value) -} - -func (FfiConverterUint32) Lift(value C.uint32_t) uint32 { - return uint32(value) -} - -func (FfiConverterUint32) Read(reader io.Reader) uint32 { - return readUint32(reader) -} - -type FfiDestroyerUint32 struct {} + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool() + }) + if checksum != 30264 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer() + }) + if checksum != 57678 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct() + }) + if checksum != 39029 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128() + }) + if checksum != 65460 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16() + }) + if checksum != 34540 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256() + }) + if checksum != 65130 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32() + }) + if checksum != 40795 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64() + }) + if checksum != 28705 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8() + }) + if checksum != 18761 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector() + }) + if checksum != 49992 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig() + }) + if checksum != 36332 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig_opt() + }) + if checksum != 21895 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig_opt: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey() + }) + if checksum != 17710 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey_opt() + }) + if checksum != 53755 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey_opt: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple() + }) + if checksum != 57455 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple_opt() + }) + if checksum != 47248 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple_opt: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin() + }) + if checksum != 53484 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin_opt() + }) + if checksum != 43934 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin_opt: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_multisig() + }) + if checksum != 61839 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_is_multisig: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_passkey() + }) + if checksum != 35671 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_is_passkey: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_simple() + }) + if checksum != 58211 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_is_simple: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_zklogin() + }) + if checksum != 38693 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_is_zklogin: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_scheme() + }) + if checksum != 25381 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_scheme: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_to_base64() + }) + if checksum != 33757 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_to_base64: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_usersignature_to_bytes() + }) + if checksum != 58893 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_usersignature_to_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_inputs() + }) + if checksum != 1512 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_inputs: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_max_epoch() + }) + if checksum != 9769 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_max_epoch: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_signature() + }) + if checksum != 18838 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_signature: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_address_seed() + }) + if checksum != 4892 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zklogininputs_address_seed: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_header_base64() + }) + if checksum != 32056 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zklogininputs_header_base64: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_iss_base64_details() + }) + if checksum != 20914 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zklogininputs_iss_base64_details: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_proof_points() + }) + if checksum != 28172 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zklogininputs_proof_points: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginproof_a() + }) + if checksum != 6891 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginproof_a: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginproof_b() + }) + if checksum != 36477 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginproof_b: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginproof_c() + }) + if checksum != 10897 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginproof_c: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed() + }) + if checksum != 3936 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_address_seed: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss() + }) + if checksum != 58864 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes() + }) + if checksum != 58901 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex() + }) + if checksum != 63442 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_address_generate() + }) + if checksum != 48865 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes() + }) + if checksum != 6069 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str() + }) + if checksum != 26128 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate() + }) + if checksum != 30791 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_bytes() + }) + if checksum != 42745 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_str() + }) + if checksum != 5412 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_generate() + }) + if checksum != 58435 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_bytes() + }) + if checksum != 3672 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str() + }) + if checksum != 21214 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str_radix_10() + }) + if checksum != 17556 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str_radix_10: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58() + }) + if checksum != 33027 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_bytes() + }) + if checksum != 37261 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_generate() + }) + if checksum != 79 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_base58() + }) + if checksum != 65453 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_bytes() + }) + if checksum != 24226 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_generate() + }) + if checksum != 13389 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new() + }) + if checksum != 39786 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new() + }) + if checksum != 50489 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object() + }) + if checksum != 35349 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58() + }) + if checksum != 17742 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_bytes() + }) + if checksum != 58221 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_generate() + }) + if checksum != 49846 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_digest_from_base58() + }) + if checksum != 41234 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_digest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_digest_from_bytes() + }) + if checksum != 65530 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_digest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_digest_generate() + }) + if checksum != 8094 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_digest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes() + }) + if checksum != 60403 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str() + }) + if checksum != 38751 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate() + }) + if checksum != 46412 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_bytes() + }) + if checksum != 61841 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_str() + }) + if checksum != 39607 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_generate() + }) + if checksum != 41607 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_base58() + }) + if checksum != 31144 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_bytes() + }) + if checksum != 36699 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_generate() + }) + if checksum != 28926 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create() + }) + if checksum != 18946 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire() + }) + if checksum != 49861 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch() + }) + if checksum != 16640 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2() + }) + if checksum != 17262 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet() + }) + if checksum != 37366 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local() + }) + if checksum != 55393 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() + }) + if checksum != 13557 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet() + }) + if checksum != 16109 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new() + }) + if checksum != 32097 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet() + }) + if checksum != 6494 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost() + }) + if checksum != 5570 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet() + }) + if checksum != 3613 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet() + }) + if checksum != 48529 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new() + }) + if checksum != 9398 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_identifier_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() + }) + if checksum != 17506 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new() + }) + if checksum != 3396 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_multisigcommittee_new() + }) + if checksum != 40069 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_multisigcommittee_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_multisigmember_new() + }) + if checksum != 63622 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_multisigmember_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_object_new() + }) + if checksum != 56232 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_object_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_base58() + }) + if checksum != 57967 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_bytes() + }) + if checksum != 62288 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_generate() + }) + if checksum != 61181 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes() + }) + if checksum != 41789 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex() + }) + if checksum != 30954 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes() + }) + if checksum != 20339 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str() + }) + if checksum != 24158 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate() + }) + if checksum != 36411 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_bytes() + }) + if checksum != 36237 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_str() + }) + if checksum != 16397 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_generate() + }) + if checksum != 63087 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes() + }) + if checksum != 60002 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str() + }) + if checksum != 27991 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate() + }) + if checksum != 49992 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_bytes() + }) + if checksum != 8469 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_str() + }) + if checksum != 15312 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_str: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate() + }) + if checksum != 40260 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() + }) + if checksum != 13756 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin() + }) + if checksum != 37848 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_new() + }) + if checksum != 20682 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota() + }) + if checksum != 30839 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() + }) + if checksum != 4081 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transaction_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_base58() + }) + if checksum != 15069 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_bytes() + }) + if checksum != 43656 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_generate() + }) + if checksum != 14578 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1() + }) + if checksum != 63561 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_base58() + }) + if checksum != 63406 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_bytes() + }) + if checksum != 51937 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_generate() + }) + if checksum != 11715 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_base58() + }) + if checksum != 56954 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_base58: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_bytes() + }) + if checksum != 4647 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_generate() + }) + if checksum != 18224 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_generate: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1() + }) + if checksum != 37860 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1() + }) + if checksum != 50635 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch() + }) + if checksum != 65525 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis() + }) + if checksum != 65272 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction() + }) + if checksum != 51205 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update() + }) + if checksum != 45772 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address() + }) + if checksum != 44901 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_address: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool() + }) + if checksum != 19366 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer() + }) + if checksum != 12676 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag() + }) + if checksum != 53303 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128() + }) + if checksum != 41280 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16() + }) + if checksum != 13801 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256() + }) + if checksum != 13310 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32() + }) + if checksum != 9870 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64() + }) + if checksum != 59470 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8() + }) + if checksum != 9403 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector() + }) + if checksum != 46548 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64() + }) + if checksum != 8029 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_bytes() + }) + if checksum != 37499 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_bytes: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_zkloginauthenticator_new() + }) + if checksum != 32812 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_zkloginauthenticator_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_zklogininputs_new() + }) + if checksum != 54245 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_zklogininputs_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_zkloginproof_new() + }) + if checksum != 19950 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_zkloginproof_new: UniFFI API checksum mismatch") + } + } + { + checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_checksum_constructor_zkloginpublicidentifier_new() + }) + if checksum != 53294 { + // If this happens try cleaning and rebuilding your project + panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_zkloginpublicidentifier_new: UniFFI API checksum mismatch") + } + } +} + + + +type FfiConverterUint8 struct{} + +var FfiConverterUint8INSTANCE = FfiConverterUint8{} + +func (FfiConverterUint8) Lower(value uint8) C.uint8_t { + return C.uint8_t(value) +} + +func (FfiConverterUint8) Write(writer io.Writer, value uint8) { + writeUint8(writer, value) +} + +func (FfiConverterUint8) Lift(value C.uint8_t) uint8 { + return uint8(value) +} + +func (FfiConverterUint8) Read(reader io.Reader) uint8 { + return readUint8(reader) +} + +type FfiDestroyerUint8 struct {} + +func (FfiDestroyerUint8) Destroy(_ uint8) {} + +type FfiConverterUint16 struct{} + +var FfiConverterUint16INSTANCE = FfiConverterUint16{} + +func (FfiConverterUint16) Lower(value uint16) C.uint16_t { + return C.uint16_t(value) +} + +func (FfiConverterUint16) Write(writer io.Writer, value uint16) { + writeUint16(writer, value) +} + +func (FfiConverterUint16) Lift(value C.uint16_t) uint16 { + return uint16(value) +} + +func (FfiConverterUint16) Read(reader io.Reader) uint16 { + return readUint16(reader) +} + +type FfiDestroyerUint16 struct {} + +func (FfiDestroyerUint16) Destroy(_ uint16) {} + +type FfiConverterUint32 struct{} + +var FfiConverterUint32INSTANCE = FfiConverterUint32{} + +func (FfiConverterUint32) Lower(value uint32) C.uint32_t { + return C.uint32_t(value) +} + +func (FfiConverterUint32) Write(writer io.Writer, value uint32) { + writeUint32(writer, value) +} + +func (FfiConverterUint32) Lift(value C.uint32_t) uint32 { + return uint32(value) +} + +func (FfiConverterUint32) Read(reader io.Reader) uint32 { + return readUint32(reader) +} + +type FfiDestroyerUint32 struct {} + +func (FfiDestroyerUint32) Destroy(_ uint32) {} + +type FfiConverterInt32 struct{} + +var FfiConverterInt32INSTANCE = FfiConverterInt32{} + +func (FfiConverterInt32) Lower(value int32) C.int32_t { + return C.int32_t(value) +} + +func (FfiConverterInt32) Write(writer io.Writer, value int32) { + writeInt32(writer, value) +} + +func (FfiConverterInt32) Lift(value C.int32_t) int32 { + return int32(value) +} + +func (FfiConverterInt32) Read(reader io.Reader) int32 { + return readInt32(reader) +} + +type FfiDestroyerInt32 struct {} + +func (FfiDestroyerInt32) Destroy(_ int32) {} + +type FfiConverterUint64 struct{} + +var FfiConverterUint64INSTANCE = FfiConverterUint64{} + +func (FfiConverterUint64) Lower(value uint64) C.uint64_t { + return C.uint64_t(value) +} + +func (FfiConverterUint64) Write(writer io.Writer, value uint64) { + writeUint64(writer, value) +} + +func (FfiConverterUint64) Lift(value C.uint64_t) uint64 { + return uint64(value) +} + +func (FfiConverterUint64) Read(reader io.Reader) uint64 { + return readUint64(reader) +} + +type FfiDestroyerUint64 struct {} + +func (FfiDestroyerUint64) Destroy(_ uint64) {} + +type FfiConverterInt64 struct{} + +var FfiConverterInt64INSTANCE = FfiConverterInt64{} + +func (FfiConverterInt64) Lower(value int64) C.int64_t { + return C.int64_t(value) +} + +func (FfiConverterInt64) Write(writer io.Writer, value int64) { + writeInt64(writer, value) +} + +func (FfiConverterInt64) Lift(value C.int64_t) int64 { + return int64(value) +} + +func (FfiConverterInt64) Read(reader io.Reader) int64 { + return readInt64(reader) +} + +type FfiDestroyerInt64 struct {} + +func (FfiDestroyerInt64) Destroy(_ int64) {} + +type FfiConverterBool struct{} + +var FfiConverterBoolINSTANCE = FfiConverterBool{} + +func (FfiConverterBool) Lower(value bool) C.int8_t { + if value { + return C.int8_t(1) + } + return C.int8_t(0) +} + +func (FfiConverterBool) Write(writer io.Writer, value bool) { + if value { + writeInt8(writer, 1) + } else { + writeInt8(writer, 0) + } +} + +func (FfiConverterBool) Lift(value C.int8_t) bool { + return value != 0 +} + +func (FfiConverterBool) Read(reader io.Reader) bool { + return readInt8(reader) != 0 +} + +type FfiDestroyerBool struct {} + +func (FfiDestroyerBool) Destroy(_ bool) {} + +type FfiConverterString struct{} + +var FfiConverterStringINSTANCE = FfiConverterString{} + +func (FfiConverterString) Lift(rb RustBufferI) string { + defer rb.Free() + reader := rb.AsReader() + b, err := io.ReadAll(reader) + if err != nil { + panic(fmt.Errorf("reading reader: %w", err)) + } + return string(b) +} + +func (FfiConverterString) Read(reader io.Reader) string { + length := readInt32(reader) + buffer := make([]byte, length) + read_length, err := reader.Read(buffer) + if err != nil && err != io.EOF { + panic(err) + } + if read_length != int(length) { + panic(fmt.Errorf("bad read length when reading string, expected %d, read %d", length, read_length)) + } + return string(buffer) +} + +func (FfiConverterString) Lower(value string) C.RustBuffer { + return stringToRustBuffer(value) +} + +func (FfiConverterString) Write(writer io.Writer, value string) { + if len(value) > math.MaxInt32 { + panic("String is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + write_length, err := io.WriteString(writer, value) + if err != nil { + panic(err) + } + if write_length != len(value) { + panic(fmt.Errorf("bad write length when writing string, expected %d, written %d", len(value), write_length)) + } +} + +type FfiDestroyerString struct {} + +func (FfiDestroyerString) Destroy(_ string) {} + +type FfiConverterBytes struct{} + +var FfiConverterBytesINSTANCE = FfiConverterBytes{} + +func (c FfiConverterBytes) Lower(value []byte) C.RustBuffer { + return LowerIntoRustBuffer[[]byte](c, value) +} + +func (c FfiConverterBytes) Write(writer io.Writer, value []byte) { + if len(value) > math.MaxInt32 { + panic("[]byte is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + write_length, err := writer.Write(value) + if err != nil { + panic(err) + } + if write_length != len(value) { + panic(fmt.Errorf("bad write length when writing []byte, expected %d, written %d", len(value), write_length)) + } +} + +func (c FfiConverterBytes) Lift(rb RustBufferI) []byte { + return LiftFromRustBuffer[[]byte](c, rb) +} + +func (c FfiConverterBytes) Read(reader io.Reader) []byte { + length := readInt32(reader) + buffer := make([]byte, length) + read_length, err := reader.Read(buffer) + if err != nil && err != io.EOF { + panic(err) + } + if read_length != int(length) { + panic(fmt.Errorf("bad read length when reading []byte, expected %d, read %d", length, read_length)) + } + return buffer +} + +type FfiDestroyerBytes struct {} + +func (FfiDestroyerBytes) Destroy(_ []byte) {} + + +// Below is an implementation of synchronization requirements outlined in the link. +// https://github.com/mozilla/uniffi-rs/blob/0dc031132d9493ca812c3af6e7dd60ad2ea95bf0/uniffi_bindgen/src/bindings/kotlin/templates/ObjectRuntime.kt#L31 + +type FfiObject struct { + pointer unsafe.Pointer + callCounter atomic.Int64 + cloneFunction func(unsafe.Pointer, *C.RustCallStatus) unsafe.Pointer + freeFunction func(unsafe.Pointer, *C.RustCallStatus) + destroyed atomic.Bool +} + +func newFfiObject( + pointer unsafe.Pointer, + cloneFunction func(unsafe.Pointer, *C.RustCallStatus) unsafe.Pointer, + freeFunction func(unsafe.Pointer, *C.RustCallStatus), +) FfiObject { + return FfiObject { + pointer: pointer, + cloneFunction: cloneFunction, + freeFunction: freeFunction, + } +} + +func (ffiObject *FfiObject)incrementPointer(debugName string) unsafe.Pointer { + for { + counter := ffiObject.callCounter.Load() + if counter <= -1 { + panic(fmt.Errorf("%v object has already been destroyed", debugName)) + } + if counter == math.MaxInt64 { + panic(fmt.Errorf("%v object call counter would overflow", debugName)) + } + if ffiObject.callCounter.CompareAndSwap(counter, counter + 1) { + break + } + } + + return rustCall(func(status *C.RustCallStatus) unsafe.Pointer { + return ffiObject.cloneFunction(ffiObject.pointer, status) + }) +} + +func (ffiObject *FfiObject)decrementPointer() { + if ffiObject.callCounter.Add(-1) == -1 { + ffiObject.freeRustArcPtr() + } +} + +func (ffiObject *FfiObject)destroy() { + if ffiObject.destroyed.CompareAndSwap(false, true) { + if ffiObject.callCounter.Add(-1) == -1 { + ffiObject.freeRustArcPtr() + } + } +} + +func (ffiObject *FfiObject)freeRustArcPtr() { + rustCall(func(status *C.RustCallStatus) int32 { + ffiObject.freeFunction(ffiObject.pointer, status) + return 0 + }) +} +// Unique identifier for an Account on the IOTA blockchain. +// +// An `Address` is a 32-byte pseudonymous identifier used to uniquely identify +// an account and asset-ownership on the IOTA blockchain. Often, human-readable +// addresses are encoded in hexadecimal with a `0x` prefix. For example, this +// is a valid IOTA address: +// `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. +// +// ``` +// use iota_types::Address; +// +// let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; +// let address = Address::from_hex(hex).unwrap(); +// println!("Address: {}", address); +// assert_eq!(hex, address.to_string()); +// ``` +// +// # Deriving an Address +// +// Addresses are cryptographically derived from a number of user account +// authenticators, the simplest of which is an +// [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). +// +// Deriving an address consists of the Blake2b256 hash of the sequence of bytes +// of its corresponding authenticator, prefixed with a domain-separator (except +// ed25519, for compatability reasons). For each other authenticator, this +// domain-separator is the single byte-value of its +// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature +// schema flag || authenticator bytes)`. +// +// Each authenticator has a method for deriving its `Address` as well as +// documentation for the specifics of how the derivation is done. See +// [`Ed25519PublicKey::derive_address`] for an example. +// +// [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address +// +// ## Relationship to ObjectIds +// +// [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but +// are derived leveraging different domain-separator values to ensure that, +// cryptographically, there won't be any overlap, e.g. there can't be a +// valid `Object` who's `ObjectId` is equal to that of the `Address` of a user +// account. +// +// [`ObjectId`]: iota_types::ObjectId +// +// # BCS +// +// An `Address`'s BCS serialized form is defined by the following: +// +// ```text +// address = 32OCTET +// ``` +type AddressInterface interface { + ToBytes() []byte + ToHex() string +} +// Unique identifier for an Account on the IOTA blockchain. +// +// An `Address` is a 32-byte pseudonymous identifier used to uniquely identify +// an account and asset-ownership on the IOTA blockchain. Often, human-readable +// addresses are encoded in hexadecimal with a `0x` prefix. For example, this +// is a valid IOTA address: +// `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. +// +// ``` +// use iota_types::Address; +// +// let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; +// let address = Address::from_hex(hex).unwrap(); +// println!("Address: {}", address); +// assert_eq!(hex, address.to_string()); +// ``` +// +// # Deriving an Address +// +// Addresses are cryptographically derived from a number of user account +// authenticators, the simplest of which is an +// [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). +// +// Deriving an address consists of the Blake2b256 hash of the sequence of bytes +// of its corresponding authenticator, prefixed with a domain-separator (except +// ed25519, for compatability reasons). For each other authenticator, this +// domain-separator is the single byte-value of its +// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature +// schema flag || authenticator bytes)`. +// +// Each authenticator has a method for deriving its `Address` as well as +// documentation for the specifics of how the derivation is done. See +// [`Ed25519PublicKey::derive_address`] for an example. +// +// [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address +// +// ## Relationship to ObjectIds +// +// [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but +// are derived leveraging different domain-separator values to ensure that, +// cryptographically, there won't be any overlap, e.g. there can't be a +// valid `Object` who's `ObjectId` is equal to that of the `Address` of a user +// account. +// +// [`ObjectId`]: iota_types::ObjectId +// +// # BCS +// +// An `Address`'s BCS serialized form is defined by the following: +// +// ```text +// address = 32OCTET +// ``` +type Address struct { + ffiObject FfiObject +} + + +func AddressFromBytes(bytes []byte) (*Address, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Address + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterAddressINSTANCE.Lift(_uniffiRV), nil + } +} + +func AddressFromHex(hex string) (*Address, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_address_from_hex(FfiConverterStringINSTANCE.Lower(hex),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Address + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterAddressINSTANCE.Lift(_uniffiRV), nil + } +} + +func AddressGenerate() *Address { + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_address_generate(_uniffiStatus) + })) +} + + + +func (_self *Address) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Address") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_address_to_bytes( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *Address) ToHex() string { + _pointer := _self.ffiObject.incrementPointer("*Address") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_address_to_hex( + _pointer,_uniffiStatus), + } + })) +} +func (object *Address) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterAddress struct {} + +var FfiConverterAddressINSTANCE = FfiConverterAddress{} + + +func (c FfiConverterAddress) Lift(pointer unsafe.Pointer) *Address { + result := &Address { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_address(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_address(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Address).Destroy) + return result +} + +func (c FfiConverterAddress) Read(reader io.Reader) *Address { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterAddress) Lower(value *Address) 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("*Address") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterAddress) Write(writer io.Writer, value *Address) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerAddress struct {} + +func (_ FfiDestroyerAddress) Destroy(value *Address) { + value.Destroy() +} + + + +type AuthenticatorStateExpireInterface interface { +} +type AuthenticatorStateExpire struct { + ffiObject FfiObject +} + + + +func (object *AuthenticatorStateExpire) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterAuthenticatorStateExpire struct {} + +var FfiConverterAuthenticatorStateExpireINSTANCE = FfiConverterAuthenticatorStateExpire{} + + +func (c FfiConverterAuthenticatorStateExpire) Lift(pointer unsafe.Pointer) *AuthenticatorStateExpire { + result := &AuthenticatorStateExpire { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*AuthenticatorStateExpire).Destroy) + return result +} + +func (c FfiConverterAuthenticatorStateExpire) Read(reader io.Reader) *AuthenticatorStateExpire { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterAuthenticatorStateExpire) Lower(value *AuthenticatorStateExpire) 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("*AuthenticatorStateExpire") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterAuthenticatorStateExpire) Write(writer io.Writer, value *AuthenticatorStateExpire) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerAuthenticatorStateExpire struct {} + +func (_ FfiDestroyerAuthenticatorStateExpire) Destroy(value *AuthenticatorStateExpire) { + value.Destroy() +} + + + +type AuthenticatorStateUpdateV1Interface interface { +} +type AuthenticatorStateUpdateV1 struct { + ffiObject FfiObject +} + + + +func (object *AuthenticatorStateUpdateV1) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterAuthenticatorStateUpdateV1 struct {} + +var FfiConverterAuthenticatorStateUpdateV1INSTANCE = FfiConverterAuthenticatorStateUpdateV1{} + + +func (c FfiConverterAuthenticatorStateUpdateV1) Lift(pointer unsafe.Pointer) *AuthenticatorStateUpdateV1 { + result := &AuthenticatorStateUpdateV1 { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*AuthenticatorStateUpdateV1).Destroy) + return result +} + +func (c FfiConverterAuthenticatorStateUpdateV1) Read(reader io.Reader) *AuthenticatorStateUpdateV1 { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterAuthenticatorStateUpdateV1) Lower(value *AuthenticatorStateUpdateV1) 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("*AuthenticatorStateUpdateV1") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterAuthenticatorStateUpdateV1) Write(writer io.Writer, value *AuthenticatorStateUpdateV1) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerAuthenticatorStateUpdateV1 struct {} + +func (_ FfiDestroyerAuthenticatorStateUpdateV1) Destroy(value *AuthenticatorStateUpdateV1) { + value.Destroy() +} + + + +type BatchSendStatusInterface interface { +} +type BatchSendStatus struct { + ffiObject FfiObject +} + + + +func (object *BatchSendStatus) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterBatchSendStatus struct {} + +var FfiConverterBatchSendStatusINSTANCE = FfiConverterBatchSendStatus{} + + +func (c FfiConverterBatchSendStatus) Lift(pointer unsafe.Pointer) *BatchSendStatus { + result := &BatchSendStatus { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_batchsendstatus(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*BatchSendStatus).Destroy) + return result +} + +func (c FfiConverterBatchSendStatus) Read(reader io.Reader) *BatchSendStatus { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterBatchSendStatus) Lower(value *BatchSendStatus) 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("*BatchSendStatus") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterBatchSendStatus) Write(writer io.Writer, value *BatchSendStatus) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerBatchSendStatus struct {} + +func (_ FfiDestroyerBatchSendStatus) Destroy(value *BatchSendStatus) { + value.Destroy() +} + + + +// A bls12381 min-sig public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// bls-public-key = %x60 96OCTECT +// ``` +// +// Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a +// fixed-length of 96, IOTA's binary representation of a min-sig +// `Bls12381PublicKey` is prefixed with its length meaning its serialized +// binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. +type Bls12381PublicKeyInterface interface { + ToBytes() []byte +} +// A bls12381 min-sig public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// bls-public-key = %x60 96OCTECT +// ``` +// +// Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a +// fixed-length of 96, IOTA's binary representation of a min-sig +// `Bls12381PublicKey` is prefixed with its length meaning its serialized +// binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. +type Bls12381PublicKey struct { + ffiObject FfiObject +} + + +func Bls12381PublicKeyFromBytes(bytes []byte) (*Bls12381PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Bls12381PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBls12381PublicKeyINSTANCE.Lift(_uniffiRV), nil + } +} + +func Bls12381PublicKeyFromStr(s string) (*Bls12381PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Bls12381PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBls12381PublicKeyINSTANCE.Lift(_uniffiRV), nil + } +} + +func Bls12381PublicKeyGenerate() *Bls12381PublicKey { + return FfiConverterBls12381PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate(_uniffiStatus) + })) +} + + + +func (_self *Bls12381PublicKey) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Bls12381PublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Bls12381PublicKey) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterBls12381PublicKey struct {} + +var FfiConverterBls12381PublicKeyINSTANCE = FfiConverterBls12381PublicKey{} + + +func (c FfiConverterBls12381PublicKey) Lift(pointer unsafe.Pointer) *Bls12381PublicKey { + result := &Bls12381PublicKey { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_bls12381publickey(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Bls12381PublicKey).Destroy) + return result +} + +func (c FfiConverterBls12381PublicKey) Read(reader io.Reader) *Bls12381PublicKey { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterBls12381PublicKey) Lower(value *Bls12381PublicKey) 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("*Bls12381PublicKey") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterBls12381PublicKey) Write(writer io.Writer, value *Bls12381PublicKey) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerBls12381PublicKey struct {} + +func (_ FfiDestroyerBls12381PublicKey) Destroy(value *Bls12381PublicKey) { + value.Destroy() +} + + + +// A bls12381 min-sig public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// bls-public-key = %x60 96OCTECT +// ``` +// +// Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a +// fixed-length of 96, IOTA's binary representation of a min-sig +// `Bls12381PublicKey` is prefixed with its length meaning its serialized +// binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. +type Bls12381SignatureInterface interface { + ToBytes() []byte +} +// A bls12381 min-sig public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// bls-public-key = %x60 96OCTECT +// ``` +// +// Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a +// fixed-length of 96, IOTA's binary representation of a min-sig +// `Bls12381PublicKey` is prefixed with its length meaning its serialized +// binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. +type Bls12381Signature struct { + ffiObject FfiObject +} + + +func Bls12381SignatureFromBytes(bytes []byte) (*Bls12381Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Bls12381Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBls12381SignatureINSTANCE.Lift(_uniffiRV), nil + } +} + +func Bls12381SignatureFromStr(s string) (*Bls12381Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Bls12381Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBls12381SignatureINSTANCE.Lift(_uniffiRV), nil + } +} + +func Bls12381SignatureGenerate() *Bls12381Signature { + return FfiConverterBls12381SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_generate(_uniffiStatus) + })) +} + + + +func (_self *Bls12381Signature) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Bls12381Signature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_bls12381signature_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Bls12381Signature) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterBls12381Signature struct {} + +var FfiConverterBls12381SignatureINSTANCE = FfiConverterBls12381Signature{} + + +func (c FfiConverterBls12381Signature) Lift(pointer unsafe.Pointer) *Bls12381Signature { + result := &Bls12381Signature { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_bls12381signature(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_bls12381signature(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Bls12381Signature).Destroy) + return result +} + +func (c FfiConverterBls12381Signature) Read(reader io.Reader) *Bls12381Signature { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterBls12381Signature) Lower(value *Bls12381Signature) 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("*Bls12381Signature") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterBls12381Signature) Write(writer io.Writer, value *Bls12381Signature) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerBls12381Signature struct {} + +func (_ FfiDestroyerBls12381Signature) Destroy(value *Bls12381Signature) { + value.Destroy() +} + + + +// A point on the BN254 elliptic curve. +// +// This is a 32-byte, or 256-bit, value that is generally represented as +// radix10 when a human-readable display format is needed, and is represented +// as a 32-byte big-endian value while in memory. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// bn254-field-element = *DIGIT ; which is then interpreted as a radix10 encoded 32-byte value +// ``` +type Bn254FieldElementInterface interface { + Padded() []byte + Unpadded() []byte +} +// A point on the BN254 elliptic curve. +// +// This is a 32-byte, or 256-bit, value that is generally represented as +// radix10 when a human-readable display format is needed, and is represented +// as a 32-byte big-endian value while in memory. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// bn254-field-element = *DIGIT ; which is then interpreted as a radix10 encoded 32-byte value +// ``` +type Bn254FieldElement struct { + ffiObject FfiObject +} + + +func Bn254FieldElementFromBytes(bytes []byte) (*Bn254FieldElement, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Bn254FieldElement + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBn254FieldElementINSTANCE.Lift(_uniffiRV), nil + } +} + +func Bn254FieldElementFromStr(s string) (*Bn254FieldElement, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Bn254FieldElement + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBn254FieldElementINSTANCE.Lift(_uniffiRV), nil + } +} + +func Bn254FieldElementFromStrRadix10(s string) (*Bn254FieldElement, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str_radix_10(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Bn254FieldElement + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterBn254FieldElementINSTANCE.Lift(_uniffiRV), nil + } +} + + + +func (_self *Bn254FieldElement) Padded() []byte { + _pointer := _self.ffiObject.incrementPointer("*Bn254FieldElement") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_padded( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *Bn254FieldElement) Unpadded() []byte { + _pointer := _self.ffiObject.incrementPointer("*Bn254FieldElement") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_unpadded( + _pointer,_uniffiStatus), + } + })) +} +func (object *Bn254FieldElement) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterBn254FieldElement struct {} + +var FfiConverterBn254FieldElementINSTANCE = FfiConverterBn254FieldElement{} + + +func (c FfiConverterBn254FieldElement) Lift(pointer unsafe.Pointer) *Bn254FieldElement { + result := &Bn254FieldElement { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_bn254fieldelement(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_bn254fieldelement(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Bn254FieldElement).Destroy) + return result +} + +func (c FfiConverterBn254FieldElement) Read(reader io.Reader) *Bn254FieldElement { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterBn254FieldElement) Lower(value *Bn254FieldElement) 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("*Bn254FieldElement") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterBn254FieldElement) Write(writer io.Writer, value *Bn254FieldElement) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerBn254FieldElement struct {} + +func (_ FfiDestroyerBn254FieldElement) Destroy(value *Bn254FieldElement) { + value.Destroy() +} + + + +type ChangeEpochInterface interface { +} +type ChangeEpoch struct { + ffiObject FfiObject +} + + + +func (object *ChangeEpoch) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterChangeEpoch struct {} + +var FfiConverterChangeEpochINSTANCE = FfiConverterChangeEpoch{} + + +func (c FfiConverterChangeEpoch) Lift(pointer unsafe.Pointer) *ChangeEpoch { + result := &ChangeEpoch { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_changeepoch(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_changeepoch(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*ChangeEpoch).Destroy) + return result +} + +func (c FfiConverterChangeEpoch) Read(reader io.Reader) *ChangeEpoch { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterChangeEpoch) Lower(value *ChangeEpoch) 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("*ChangeEpoch") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterChangeEpoch) Write(writer io.Writer, value *ChangeEpoch) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerChangeEpoch struct {} + +func (_ FfiDestroyerChangeEpoch) Destroy(value *ChangeEpoch) { + value.Destroy() +} + + + +type ChangeEpochV2Interface interface { +} +type ChangeEpochV2 struct { + ffiObject FfiObject +} + + + +func (object *ChangeEpochV2) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterChangeEpochV2 struct {} + +var FfiConverterChangeEpochV2INSTANCE = FfiConverterChangeEpochV2{} + + +func (c FfiConverterChangeEpochV2) Lift(pointer unsafe.Pointer) *ChangeEpochV2 { + result := &ChangeEpochV2 { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_changeepochv2(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_changeepochv2(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*ChangeEpochV2).Destroy) + return result +} + +func (c FfiConverterChangeEpochV2) Read(reader io.Reader) *ChangeEpochV2 { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterChangeEpochV2) Lower(value *ChangeEpochV2) 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("*ChangeEpochV2") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterChangeEpochV2) Write(writer io.Writer, value *ChangeEpochV2) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerChangeEpochV2 struct {} + +func (_ FfiDestroyerChangeEpochV2) Destroy(value *ChangeEpochV2) { + value.Destroy() +} + + + +type CheckpointCommitmentInterface interface { + AsEcmhLiveObjectSetDigest() *Digest + IsEcmhLiveObjectSet() bool +} +type CheckpointCommitment struct { + ffiObject FfiObject +} + + + + +func (_self *CheckpointCommitment) AsEcmhLiveObjectSetDigest() *Digest { + _pointer := _self.ffiObject.incrementPointer("*CheckpointCommitment") + defer _self.ffiObject.decrementPointer() + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest( + _pointer,_uniffiStatus) + })) +} + +func (_self *CheckpointCommitment) IsEcmhLiveObjectSet() bool { + _pointer := _self.ffiObject.incrementPointer("*CheckpointCommitment") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set( + _pointer,_uniffiStatus) + })) +} +func (object *CheckpointCommitment) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCheckpointCommitment struct {} + +var FfiConverterCheckpointCommitmentINSTANCE = FfiConverterCheckpointCommitment{} + + +func (c FfiConverterCheckpointCommitment) Lift(pointer unsafe.Pointer) *CheckpointCommitment { + result := &CheckpointCommitment { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CheckpointCommitment).Destroy) + return result +} + +func (c FfiConverterCheckpointCommitment) Read(reader io.Reader) *CheckpointCommitment { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCheckpointCommitment) Lower(value *CheckpointCommitment) 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("*CheckpointCommitment") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCheckpointCommitment) Write(writer io.Writer, value *CheckpointCommitment) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCheckpointCommitment struct {} + +func (_ FfiDestroyerCheckpointCommitment) Destroy(value *CheckpointCommitment) { + value.Destroy() +} + + + +type CheckpointContentsDigestInterface interface { + ToBase58() string + ToBytes() []byte +} +type CheckpointContentsDigest struct { + ffiObject FfiObject +} + + +func CheckpointContentsDigestFromBase58(base58 string) (*CheckpointContentsDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *CheckpointContentsDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterCheckpointContentsDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func CheckpointContentsDigestFromBytes(bytes []byte) (*CheckpointContentsDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *CheckpointContentsDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterCheckpointContentsDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func CheckpointContentsDigestGenerate() *CheckpointContentsDigest { + return FfiConverterCheckpointContentsDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_generate(_uniffiStatus) + })) +} + + + +func (_self *CheckpointContentsDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*CheckpointContentsDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_base58( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *CheckpointContentsDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*CheckpointContentsDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *CheckpointContentsDigest) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCheckpointContentsDigest struct {} + +var FfiConverterCheckpointContentsDigestINSTANCE = FfiConverterCheckpointContentsDigest{} + + +func (c FfiConverterCheckpointContentsDigest) Lift(pointer unsafe.Pointer) *CheckpointContentsDigest { + result := &CheckpointContentsDigest { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_checkpointcontentsdigest(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CheckpointContentsDigest).Destroy) + return result +} + +func (c FfiConverterCheckpointContentsDigest) Read(reader io.Reader) *CheckpointContentsDigest { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCheckpointContentsDigest) Lower(value *CheckpointContentsDigest) 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("*CheckpointContentsDigest") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCheckpointContentsDigest) Write(writer io.Writer, value *CheckpointContentsDigest) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCheckpointContentsDigest struct {} + +func (_ FfiDestroyerCheckpointContentsDigest) Destroy(value *CheckpointContentsDigest) { + value.Destroy() +} + + + +type CheckpointDigestInterface interface { + ToBase58() string + ToBytes() []byte +} +type CheckpointDigest struct { + ffiObject FfiObject +} + + +func CheckpointDigestFromBase58(base58 string) (*CheckpointDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *CheckpointDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterCheckpointDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func CheckpointDigestFromBytes(bytes []byte) (*CheckpointDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *CheckpointDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterCheckpointDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func CheckpointDigestGenerate() *CheckpointDigest { + return FfiConverterCheckpointDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_generate(_uniffiStatus) + })) +} + + + +func (_self *CheckpointDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*CheckpointDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_base58( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *CheckpointDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*CheckpointDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *CheckpointDigest) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCheckpointDigest struct {} + +var FfiConverterCheckpointDigestINSTANCE = FfiConverterCheckpointDigest{} + + +func (c FfiConverterCheckpointDigest) Lift(pointer unsafe.Pointer) *CheckpointDigest { + result := &CheckpointDigest { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_checkpointdigest(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CheckpointDigest).Destroy) + return result +} + +func (c FfiConverterCheckpointDigest) Read(reader io.Reader) *CheckpointDigest { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCheckpointDigest) Lower(value *CheckpointDigest) 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("*CheckpointDigest") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCheckpointDigest) Write(writer io.Writer, value *CheckpointDigest) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCheckpointDigest struct {} + +func (_ FfiDestroyerCheckpointDigest) Destroy(value *CheckpointDigest) { + 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) + })) +} + + + +func (object *CircomG1) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCircomG1 struct {} + +var FfiConverterCircomG1INSTANCE = FfiConverterCircomG1{} + + +func (c FfiConverterCircomG1) Lift(pointer unsafe.Pointer) *CircomG1 { + result := &CircomG1 { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_circomg1(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_circomg1(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CircomG1).Destroy) + return result +} + +func (c FfiConverterCircomG1) Read(reader io.Reader) *CircomG1 { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCircomG1) Lower(value *CircomG1) 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("*CircomG1") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCircomG1) Write(writer io.Writer, value *CircomG1) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCircomG1 struct {} + +func (_ FfiDestroyerCircomG1) Destroy(value *CircomG1) { + value.Destroy() +} + + + +// 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)) +// ``` +type CircomG2Interface interface { +} +// 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)) +// ``` +type CircomG2 struct { + ffiObject FfiObject +} +func NewCircomG2(el00 *Bn254FieldElement, el01 *Bn254FieldElement, el10 *Bn254FieldElement, el11 *Bn254FieldElement, el20 *Bn254FieldElement, el21 *Bn254FieldElement) *CircomG2 { + return FfiConverterCircomG2INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_circomg2_new(FfiConverterBn254FieldElementINSTANCE.Lower(el00), FfiConverterBn254FieldElementINSTANCE.Lower(el01), FfiConverterBn254FieldElementINSTANCE.Lower(el10), FfiConverterBn254FieldElementINSTANCE.Lower(el11), FfiConverterBn254FieldElementINSTANCE.Lower(el20), FfiConverterBn254FieldElementINSTANCE.Lower(el21),_uniffiStatus) + })) +} + + + +func (object *CircomG2) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCircomG2 struct {} + +var FfiConverterCircomG2INSTANCE = FfiConverterCircomG2{} + + +func (c FfiConverterCircomG2) Lift(pointer unsafe.Pointer) *CircomG2 { + result := &CircomG2 { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_circomg2(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_circomg2(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CircomG2).Destroy) + return result +} + +func (c FfiConverterCircomG2) Read(reader io.Reader) *CircomG2 { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCircomG2) Lower(value *CircomG2) 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("*CircomG2") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCircomG2) Write(writer io.Writer, value *CircomG2) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCircomG2 struct {} + +func (_ FfiDestroyerCircomG2) Destroy(value *CircomG2) { + value.Destroy() +} + + + +type CoinInterface interface { + Balance() uint64 + CoinType() *TypeTag + Id() *ObjectId +} +type Coin struct { + ffiObject FfiObject +} + + +func CoinTryFromObject(object *Object) (*Coin, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_coin_try_from_object(FfiConverterObjectINSTANCE.Lower(object),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Coin + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterCoinINSTANCE.Lift(_uniffiRV), nil + } +} + + + +func (_self *Coin) Balance() uint64 { + _pointer := _self.ffiObject.incrementPointer("*Coin") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_coin_balance( + _pointer,_uniffiStatus) + })) +} + +func (_self *Coin) CoinType() *TypeTag { + _pointer := _self.ffiObject.incrementPointer("*Coin") + defer _self.ffiObject.decrementPointer() + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_coin_coin_type( + _pointer,_uniffiStatus) + })) +} + +func (_self *Coin) Id() *ObjectId { + _pointer := _self.ffiObject.incrementPointer("*Coin") + defer _self.ffiObject.decrementPointer() + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_coin_id( + _pointer,_uniffiStatus) + })) +} +func (object *Coin) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCoin struct {} + +var FfiConverterCoinINSTANCE = FfiConverterCoin{} + + +func (c FfiConverterCoin) Lift(pointer unsafe.Pointer) *Coin { + result := &Coin { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_coin(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_coin(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Coin).Destroy) + return result +} + +func (c FfiConverterCoin) Read(reader io.Reader) *Coin { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCoin) Lower(value *Coin) 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("*Coin") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCoin) Write(writer io.Writer, value *Coin) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCoin struct {} + +func (_ FfiDestroyerCoin) Destroy(value *Coin) { + value.Destroy() +} + + + +type CoinMetadataInterface interface { +} +type CoinMetadata struct { + ffiObject FfiObject +} + + + +func (object *CoinMetadata) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterCoinMetadata struct {} + +var FfiConverterCoinMetadataINSTANCE = FfiConverterCoinMetadata{} + + +func (c FfiConverterCoinMetadata) Lift(pointer unsafe.Pointer) *CoinMetadata { + result := &CoinMetadata { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_coinmetadata(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_coinmetadata(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*CoinMetadata).Destroy) + return result +} + +func (c FfiConverterCoinMetadata) Read(reader io.Reader) *CoinMetadata { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterCoinMetadata) Lower(value *CoinMetadata) 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("*CoinMetadata") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterCoinMetadata) Write(writer io.Writer, value *CoinMetadata) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerCoinMetadata struct {} + +func (_ FfiDestroyerCoinMetadata) Destroy(value *CoinMetadata) { + value.Destroy() +} + + + +type ConsensusCommitDigestInterface interface { + ToBase58() string + ToBytes() []byte +} +type ConsensusCommitDigest struct { + ffiObject FfiObject +} + + +func ConsensusCommitDigestFromBase58(base58 string) (*ConsensusCommitDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *ConsensusCommitDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterConsensusCommitDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func ConsensusCommitDigestFromBytes(bytes []byte) (*ConsensusCommitDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *ConsensusCommitDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterConsensusCommitDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func ConsensusCommitDigestGenerate() *ConsensusCommitDigest { + return FfiConverterConsensusCommitDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_generate(_uniffiStatus) + })) +} + + + +func (_self *ConsensusCommitDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*ConsensusCommitDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_base58( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *ConsensusCommitDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*ConsensusCommitDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *ConsensusCommitDigest) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterConsensusCommitDigest struct {} + +var FfiConverterConsensusCommitDigestINSTANCE = FfiConverterConsensusCommitDigest{} + + +func (c FfiConverterConsensusCommitDigest) Lift(pointer unsafe.Pointer) *ConsensusCommitDigest { + result := &ConsensusCommitDigest { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*ConsensusCommitDigest).Destroy) + return result +} + +func (c FfiConverterConsensusCommitDigest) Read(reader io.Reader) *ConsensusCommitDigest { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterConsensusCommitDigest) Lower(value *ConsensusCommitDigest) 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("*ConsensusCommitDigest") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterConsensusCommitDigest) Write(writer io.Writer, value *ConsensusCommitDigest) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerConsensusCommitDigest struct {} + +func (_ FfiDestroyerConsensusCommitDigest) Destroy(value *ConsensusCommitDigest) { + value.Destroy() +} + + + +type ConsensusCommitPrologueV1Interface interface { +} +type ConsensusCommitPrologueV1 struct { + ffiObject FfiObject +} + + + +func (object *ConsensusCommitPrologueV1) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterConsensusCommitPrologueV1 struct {} + +var FfiConverterConsensusCommitPrologueV1INSTANCE = FfiConverterConsensusCommitPrologueV1{} + + +func (c FfiConverterConsensusCommitPrologueV1) Lift(pointer unsafe.Pointer) *ConsensusCommitPrologueV1 { + result := &ConsensusCommitPrologueV1 { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_consensuscommitprologuev1(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*ConsensusCommitPrologueV1).Destroy) + return result +} + +func (c FfiConverterConsensusCommitPrologueV1) Read(reader io.Reader) *ConsensusCommitPrologueV1 { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterConsensusCommitPrologueV1) Lower(value *ConsensusCommitPrologueV1) 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("*ConsensusCommitPrologueV1") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterConsensusCommitPrologueV1) Write(writer io.Writer, value *ConsensusCommitPrologueV1) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerConsensusCommitPrologueV1 struct {} + +func (_ FfiDestroyerConsensusCommitPrologueV1) Destroy(value *ConsensusCommitPrologueV1) { + value.Destroy() +} + + + +// A 32-byte Blake2b256 hash output. +// +// # BCS +// +// A `Digest`'s BCS serialized form is defined by the following: +// +// ```text +// digest = %x20 32OCTET +// ``` +// +// Due to historical reasons, even though a `Digest` has a fixed-length of 32, +// IOTA's binary representation of a `Digest` is prefixed with its length +// meaning its serialized binary form (in bcs) is 33 bytes long vs a more +// compact 32 bytes. +type DigestInterface interface { + ToBase58() string + ToBytes() []byte +} +// A 32-byte Blake2b256 hash output. +// +// # BCS +// +// A `Digest`'s BCS serialized form is defined by the following: +// +// ```text +// digest = %x20 32OCTET +// ``` +// +// Due to historical reasons, even though a `Digest` has a fixed-length of 32, +// IOTA's binary representation of a `Digest` is prefixed with its length +// meaning its serialized binary form (in bcs) is 33 bytes long vs a more +// compact 32 bytes. +type Digest struct { + ffiObject FfiObject +} + + +func DigestFromBase58(base58 string) (*Digest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_digest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Digest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func DigestFromBytes(bytes []byte) (*Digest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_digest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Digest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func DigestGenerate() *Digest { + return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_digest_generate(_uniffiStatus) + })) +} + + + +func (_self *Digest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*Digest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_digest_to_base58( + _pointer,_uniffiStatus), + } + })) +} -func (FfiDestroyerUint32) Destroy(_ uint32) {} +func (_self *Digest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Digest") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_digest_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Digest) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} -type FfiConverterInt32 struct{} +type FfiConverterDigest struct {} -var FfiConverterInt32INSTANCE = FfiConverterInt32{} +var FfiConverterDigestINSTANCE = FfiConverterDigest{} -func (FfiConverterInt32) Lower(value int32) C.int32_t { - return C.int32_t(value) + +func (c FfiConverterDigest) Lift(pointer unsafe.Pointer) *Digest { + result := &Digest { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_digest(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_digest(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Digest).Destroy) + return result +} + +func (c FfiConverterDigest) Read(reader io.Reader) *Digest { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterDigest) Lower(value *Digest) 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("*Digest") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterDigest) Write(writer io.Writer, value *Digest) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerDigest struct {} + +func (_ FfiDestroyerDigest) Destroy(value *Digest) { + value.Destroy() +} + + + +// An ed25519 public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// ed25519-public-key = 32OCTECT +// ``` +type Ed25519PublicKeyInterface interface { + ToBytes() []byte +} +// An ed25519 public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// ed25519-public-key = 32OCTECT +// ``` +type Ed25519PublicKey struct { + ffiObject FfiObject +} + + +func Ed25519PublicKeyFromBytes(bytes []byte) (*Ed25519PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Ed25519PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterEd25519PublicKeyINSTANCE.Lift(_uniffiRV), nil + } +} + +func Ed25519PublicKeyFromStr(s string) (*Ed25519PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Ed25519PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterEd25519PublicKeyINSTANCE.Lift(_uniffiRV), nil + } +} + +func Ed25519PublicKeyGenerate() *Ed25519PublicKey { + return FfiConverterEd25519PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_generate(_uniffiStatus) + })) +} + + + +func (_self *Ed25519PublicKey) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Ed25519PublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_ed25519publickey_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Ed25519PublicKey) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterEd25519PublicKey struct {} + +var FfiConverterEd25519PublicKeyINSTANCE = FfiConverterEd25519PublicKey{} + + +func (c FfiConverterEd25519PublicKey) Lift(pointer unsafe.Pointer) *Ed25519PublicKey { + result := &Ed25519PublicKey { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_ed25519publickey(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_ed25519publickey(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Ed25519PublicKey).Destroy) + return result +} + +func (c FfiConverterEd25519PublicKey) Read(reader io.Reader) *Ed25519PublicKey { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterEd25519PublicKey) Lower(value *Ed25519PublicKey) 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("*Ed25519PublicKey") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterEd25519PublicKey) Write(writer io.Writer, value *Ed25519PublicKey) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerEd25519PublicKey struct {} + +func (_ FfiDestroyerEd25519PublicKey) Destroy(value *Ed25519PublicKey) { + value.Destroy() +} + + + +// An ed25519 signature. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// ed25519-signature = 64OCTECT +// ``` +type Ed25519SignatureInterface interface { + ToBytes() []byte } +// An ed25519 signature. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// ed25519-signature = 64OCTECT +// ``` +type Ed25519Signature struct { + ffiObject FfiObject +} + + +func Ed25519SignatureFromBytes(bytes []byte) (*Ed25519Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Ed25519Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterEd25519SignatureINSTANCE.Lift(_uniffiRV), nil + } +} + +func Ed25519SignatureFromStr(s string) (*Ed25519Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Ed25519Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterEd25519SignatureINSTANCE.Lift(_uniffiRV), nil + } +} + +func Ed25519SignatureGenerate() *Ed25519Signature { + return FfiConverterEd25519SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_generate(_uniffiStatus) + })) +} + + + +func (_self *Ed25519Signature) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Ed25519Signature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_ed25519signature_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Ed25519Signature) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterEd25519Signature struct {} + +var FfiConverterEd25519SignatureINSTANCE = FfiConverterEd25519Signature{} + + +func (c FfiConverterEd25519Signature) Lift(pointer unsafe.Pointer) *Ed25519Signature { + result := &Ed25519Signature { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_ed25519signature(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_ed25519signature(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*Ed25519Signature).Destroy) + return result +} + +func (c FfiConverterEd25519Signature) Read(reader io.Reader) *Ed25519Signature { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +} + +func (c FfiConverterEd25519Signature) Lower(value *Ed25519Signature) 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("*Ed25519Signature") + defer value.ffiObject.decrementPointer() + return pointer -func (FfiConverterInt32) Write(writer io.Writer, value int32) { - writeInt32(writer, value) } -func (FfiConverterInt32) Lift(value C.int32_t) int32 { - return int32(value) +func (c FfiConverterEd25519Signature) Write(writer io.Writer, value *Ed25519Signature) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -func (FfiConverterInt32) Read(reader io.Reader) int32 { - return readInt32(reader) +type FfiDestroyerEd25519Signature struct {} + +func (_ FfiDestroyerEd25519Signature) Destroy(value *Ed25519Signature) { + value.Destroy() } -type FfiDestroyerInt32 struct {} -func (FfiDestroyerInt32) Destroy(_ int32) {} -type FfiConverterUint64 struct{} +type EffectsAuxiliaryDataDigestInterface interface { + ToBase58() string + ToBytes() []byte +} +type EffectsAuxiliaryDataDigest struct { + ffiObject FfiObject +} -var FfiConverterUint64INSTANCE = FfiConverterUint64{} -func (FfiConverterUint64) Lower(value uint64) C.uint64_t { - return C.uint64_t(value) +func EffectsAuxiliaryDataDigestFromBase58(base58 string) (*EffectsAuxiliaryDataDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *EffectsAuxiliaryDataDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterEffectsAuxiliaryDataDigestINSTANCE.Lift(_uniffiRV), nil + } } -func (FfiConverterUint64) Write(writer io.Writer, value uint64) { - writeUint64(writer, value) +func EffectsAuxiliaryDataDigestFromBytes(bytes []byte) (*EffectsAuxiliaryDataDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *EffectsAuxiliaryDataDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterEffectsAuxiliaryDataDigestINSTANCE.Lift(_uniffiRV), nil + } } -func (FfiConverterUint64) Lift(value C.uint64_t) uint64 { - return uint64(value) +func EffectsAuxiliaryDataDigestGenerate() *EffectsAuxiliaryDataDigest { + return FfiConverterEffectsAuxiliaryDataDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_generate(_uniffiStatus) + })) } -func (FfiConverterUint64) Read(reader io.Reader) uint64 { - return readUint64(reader) + + +func (_self *EffectsAuxiliaryDataDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*EffectsAuxiliaryDataDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_base58( + _pointer,_uniffiStatus), + } + })) } -type FfiDestroyerUint64 struct {} +func (_self *EffectsAuxiliaryDataDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*EffectsAuxiliaryDataDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *EffectsAuxiliaryDataDigest) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} -func (FfiDestroyerUint64) Destroy(_ uint64) {} +type FfiConverterEffectsAuxiliaryDataDigest struct {} -type FfiConverterInt64 struct{} +var FfiConverterEffectsAuxiliaryDataDigestINSTANCE = FfiConverterEffectsAuxiliaryDataDigest{} -var FfiConverterInt64INSTANCE = FfiConverterInt64{} -func (FfiConverterInt64) Lower(value int64) C.int64_t { - return C.int64_t(value) +func (c FfiConverterEffectsAuxiliaryDataDigest) Lift(pointer unsafe.Pointer) *EffectsAuxiliaryDataDigest { + result := &EffectsAuxiliaryDataDigest { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_effectsauxiliarydatadigest(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*EffectsAuxiliaryDataDigest).Destroy) + return result } -func (FfiConverterInt64) Write(writer io.Writer, value int64) { - writeInt64(writer, value) +func (c FfiConverterEffectsAuxiliaryDataDigest) Read(reader io.Reader) *EffectsAuxiliaryDataDigest { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (FfiConverterInt64) Lift(value C.int64_t) int64 { - return int64(value) +func (c FfiConverterEffectsAuxiliaryDataDigest) Lower(value *EffectsAuxiliaryDataDigest) 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("*EffectsAuxiliaryDataDigest") + defer value.ffiObject.decrementPointer() + return pointer + } -func (FfiConverterInt64) Read(reader io.Reader) int64 { - return readInt64(reader) +func (c FfiConverterEffectsAuxiliaryDataDigest) Write(writer io.Writer, value *EffectsAuxiliaryDataDigest) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerInt64 struct {} +type FfiDestroyerEffectsAuxiliaryDataDigest struct {} -func (FfiDestroyerInt64) Destroy(_ int64) {} +func (_ FfiDestroyerEffectsAuxiliaryDataDigest) Destroy(value *EffectsAuxiliaryDataDigest) { + value.Destroy() +} -type FfiConverterBool struct{} -var FfiConverterBoolINSTANCE = FfiConverterBool{} -func (FfiConverterBool) Lower(value bool) C.int8_t { - if value { - return C.int8_t(1) - } - return C.int8_t(0) +// Operation run at the end of an epoch +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// end-of-epoch-transaction-kind = eoe-change-epoch +// =/ eoe-authenticator-state-create +// =/ eoe-authenticator-state-expire +// =/ eoe-randomness-state-create +// =/ eoe-deny-list-state-create +// =/ eoe-bridge-state-create +// =/ eoe-bridge-committee-init +// =/ eoe-store-execution-time-observations +// +// eoe-change-epoch = %x00 change-epoch +// eoe-authenticator-state-create = %x01 +// eoe-authenticator-state-expire = %x02 authenticator-state-expire +// eoe-randomness-state-create = %x03 +// eoe-deny-list-state-create = %x04 +// eoe-bridge-state-create = %x05 digest +// eoe-bridge-committee-init = %x06 u64 +// eoe-store-execution-time-observations = %x07 stored-execution-time-observations +// ``` +type EndOfEpochTransactionKindInterface interface { } - -func (FfiConverterBool) Write(writer io.Writer, value bool) { - if value { - writeInt8(writer, 1) - } else { - writeInt8(writer, 0) - } +// Operation run at the end of an epoch +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// end-of-epoch-transaction-kind = eoe-change-epoch +// =/ eoe-authenticator-state-create +// =/ eoe-authenticator-state-expire +// =/ eoe-randomness-state-create +// =/ eoe-deny-list-state-create +// =/ eoe-bridge-state-create +// =/ eoe-bridge-committee-init +// =/ eoe-store-execution-time-observations +// +// eoe-change-epoch = %x00 change-epoch +// eoe-authenticator-state-create = %x01 +// eoe-authenticator-state-expire = %x02 authenticator-state-expire +// eoe-randomness-state-create = %x03 +// eoe-deny-list-state-create = %x04 +// eoe-bridge-state-create = %x05 digest +// eoe-bridge-committee-init = %x06 u64 +// eoe-store-execution-time-observations = %x07 stored-execution-time-observations +// ``` +type EndOfEpochTransactionKind struct { + ffiObject FfiObject } -func (FfiConverterBool) Lift(value C.int8_t) bool { - return value != 0 -} -func (FfiConverterBool) Read(reader io.Reader) bool { - return readInt8(reader) != 0 +func EndOfEpochTransactionKindAuthenticatorStateCreate() *EndOfEpochTransactionKind { + return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_create(_uniffiStatus) + })) } -type FfiDestroyerBool struct {} - -func (FfiDestroyerBool) Destroy(_ bool) {} - -type FfiConverterString struct{} - -var FfiConverterStringINSTANCE = FfiConverterString{} - -func (FfiConverterString) Lift(rb RustBufferI) string { - defer rb.Free() - reader := rb.AsReader() - b, err := io.ReadAll(reader) - if err != nil { - panic(fmt.Errorf("reading reader: %w", err)) - } - return string(b) +func EndOfEpochTransactionKindAuthenticatorStateExpire(tx *AuthenticatorStateExpire) *EndOfEpochTransactionKind { + return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_expire(FfiConverterAuthenticatorStateExpireINSTANCE.Lower(tx),_uniffiStatus) + })) } -func (FfiConverterString) Read(reader io.Reader) string { - length := readInt32(reader) - buffer := make([]byte, length) - read_length, err := reader.Read(buffer) - if err != nil && err != io.EOF { - panic(err) - } - if read_length != int(length) { - panic(fmt.Errorf("bad read length when reading string, expected %d, read %d", length, read_length)) - } - return string(buffer) +func EndOfEpochTransactionKindChangeEpoch(tx *ChangeEpoch) *EndOfEpochTransactionKind { + return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch(FfiConverterChangeEpochINSTANCE.Lower(tx),_uniffiStatus) + })) } -func (FfiConverterString) Lower(value string) C.RustBuffer { - return stringToRustBuffer(value) +func EndOfEpochTransactionKindChangeEpochV2(tx *ChangeEpochV2) *EndOfEpochTransactionKind { + return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch_v2(FfiConverterChangeEpochV2INSTANCE.Lower(tx),_uniffiStatus) + })) } -func (FfiConverterString) Write(writer io.Writer, value string) { - if len(value) > math.MaxInt32 { - panic("String is too large to fit into Int32") - } - writeInt32(writer, int32(len(value))) - write_length, err := io.WriteString(writer, value) - if err != nil { - panic(err) - } - if write_length != len(value) { - panic(fmt.Errorf("bad write length when writing string, expected %d, written %d", len(value), write_length)) - } +func (object *EndOfEpochTransactionKind) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() } -type FfiDestroyerString struct {} +type FfiConverterEndOfEpochTransactionKind struct {} -func (FfiDestroyerString) Destroy(_ string) {} +var FfiConverterEndOfEpochTransactionKindINSTANCE = FfiConverterEndOfEpochTransactionKind{} -type FfiConverterBytes struct{} -var FfiConverterBytesINSTANCE = FfiConverterBytes{} +func (c FfiConverterEndOfEpochTransactionKind) Lift(pointer unsafe.Pointer) *EndOfEpochTransactionKind { + result := &EndOfEpochTransactionKind { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_endofepochtransactionkind(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_endofepochtransactionkind(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*EndOfEpochTransactionKind).Destroy) + return result +} -func (c FfiConverterBytes) Lower(value []byte) C.RustBuffer { - return LowerIntoRustBuffer[[]byte](c, value) +func (c FfiConverterEndOfEpochTransactionKind) Read(reader io.Reader) *EndOfEpochTransactionKind { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterBytes) Write(writer io.Writer, value []byte) { - if len(value) > math.MaxInt32 { - panic("[]byte is too large to fit into Int32") - } +func (c FfiConverterEndOfEpochTransactionKind) Lower(value *EndOfEpochTransactionKind) 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("*EndOfEpochTransactionKind") + defer value.ffiObject.decrementPointer() + return pointer - writeInt32(writer, int32(len(value))) - write_length, err := writer.Write(value) - if err != nil { - panic(err) - } - if write_length != len(value) { - panic(fmt.Errorf("bad write length when writing []byte, expected %d, written %d", len(value), write_length)) - } } -func (c FfiConverterBytes) Lift(rb RustBufferI) []byte { - return LiftFromRustBuffer[[]byte](c, rb) +func (c FfiConverterEndOfEpochTransactionKind) Write(writer io.Writer, value *EndOfEpochTransactionKind) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -func (c FfiConverterBytes) Read(reader io.Reader) []byte { - length := readInt32(reader) - buffer := make([]byte, length) - read_length, err := reader.Read(buffer) - if err != nil && err != io.EOF { - panic(err) - } - if read_length != int(length) { - panic(fmt.Errorf("bad read length when reading []byte, expected %d, read %d", length, read_length)) - } - return buffer +type FfiDestroyerEndOfEpochTransactionKind struct {} + +func (_ FfiDestroyerEndOfEpochTransactionKind) Destroy(value *EndOfEpochTransactionKind) { + value.Destroy() } -type FfiDestroyerBytes struct {} -func (FfiDestroyerBytes) Destroy(_ []byte) {} +type EpochInterface interface { +} +type Epoch struct { + ffiObject FfiObject +} -// Below is an implementation of synchronization requirements outlined in the link. -// https://github.com/mozilla/uniffi-rs/blob/0dc031132d9493ca812c3af6e7dd60ad2ea95bf0/uniffi_bindgen/src/bindings/kotlin/templates/ObjectRuntime.kt#L31 -type FfiObject struct { - pointer unsafe.Pointer - callCounter atomic.Int64 - cloneFunction func(unsafe.Pointer, *C.RustCallStatus) unsafe.Pointer - freeFunction func(unsafe.Pointer, *C.RustCallStatus) - destroyed atomic.Bool -} -func newFfiObject( - pointer unsafe.Pointer, - cloneFunction func(unsafe.Pointer, *C.RustCallStatus) unsafe.Pointer, - freeFunction func(unsafe.Pointer, *C.RustCallStatus), -) FfiObject { - return FfiObject { - pointer: pointer, - cloneFunction: cloneFunction, - freeFunction: freeFunction, - } +func (object *Epoch) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() } -func (ffiObject *FfiObject)incrementPointer(debugName string) unsafe.Pointer { - for { - counter := ffiObject.callCounter.Load() - if counter <= -1 { - panic(fmt.Errorf("%v object has already been destroyed", debugName)) - } - if counter == math.MaxInt64 { - panic(fmt.Errorf("%v object call counter would overflow", debugName)) - } - if ffiObject.callCounter.CompareAndSwap(counter, counter + 1) { - break - } - } +type FfiConverterEpoch struct {} - return rustCall(func(status *C.RustCallStatus) unsafe.Pointer { - return ffiObject.cloneFunction(ffiObject.pointer, status) - }) -} +var FfiConverterEpochINSTANCE = FfiConverterEpoch{} -func (ffiObject *FfiObject)decrementPointer() { - if ffiObject.callCounter.Add(-1) == -1 { - ffiObject.freeRustArcPtr() - } -} -func (ffiObject *FfiObject)destroy() { - if ffiObject.destroyed.CompareAndSwap(false, true) { - if ffiObject.callCounter.Add(-1) == -1 { - ffiObject.freeRustArcPtr() - } +func (c FfiConverterEpoch) Lift(pointer unsafe.Pointer) *Epoch { + result := &Epoch { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_epoch(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_epoch(pointer, status) + }, + ), } + runtime.SetFinalizer(result, (*Epoch).Destroy) + return result } -func (ffiObject *FfiObject)freeRustArcPtr() { - rustCall(func(status *C.RustCallStatus) int32 { - ffiObject.freeFunction(ffiObject.pointer, status) - return 0 - }) -} -// Unique identifier for an Account on the IOTA blockchain. -// -// An `Address` is a 32-byte pseudonymous identifier used to uniquely identify -// an account and asset-ownership on the IOTA blockchain. Often, human-readable -// addresses are encoded in hexadecimal with a `0x` prefix. For example, this -// is a valid IOTA address: -// `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. -// -// ``` -// use iota_types::Address; -// -// let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; -// let address = Address::from_hex(hex).unwrap(); -// println!("Address: {}", address); -// assert_eq!(hex, address.to_string()); -// ``` -// -// # Deriving an Address -// -// Addresses are cryptographically derived from a number of user account -// authenticators, the simplest of which is an -// [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). -// -// Deriving an address consists of the Blake2b256 hash of the sequence of bytes -// of its corresponding authenticator, prefixed with a domain-separator (except -// ed25519, for compatability reasons). For each other authenticator, this -// domain-separator is the single byte-value of its -// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature -// schema flag || authenticator bytes)`. -// -// Each authenticator has a method for deriving its `Address` as well as -// documentation for the specifics of how the derivation is done. See -// [`Ed25519PublicKey::derive_address`] for an example. -// -// [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address -// -// ## Relationship to ObjectIds -// -// [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but -// are derived leveraging different domain-separator values to ensure that, -// cryptographically, there won't be any overlap, e.g. there can't be a -// valid `Object` who's `ObjectId` is equal to that of the `Address` of a user -// account. -// -// [`ObjectId`]: iota_types::ObjectId -// -// # BCS -// -// An `Address`'s BCS serialized form is defined by the following: -// -// ```text -// address = 32OCTET -// ``` -type AddressInterface interface { - ToBytes() []byte - ToHex() string -} -// Unique identifier for an Account on the IOTA blockchain. -// -// An `Address` is a 32-byte pseudonymous identifier used to uniquely identify -// an account and asset-ownership on the IOTA blockchain. Often, human-readable -// addresses are encoded in hexadecimal with a `0x` prefix. For example, this -// is a valid IOTA address: -// `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. -// -// ``` -// use iota_types::Address; -// -// let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; -// let address = Address::from_hex(hex).unwrap(); -// println!("Address: {}", address); -// assert_eq!(hex, address.to_string()); -// ``` -// -// # Deriving an Address -// -// Addresses are cryptographically derived from a number of user account -// authenticators, the simplest of which is an -// [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). -// -// Deriving an address consists of the Blake2b256 hash of the sequence of bytes -// of its corresponding authenticator, prefixed with a domain-separator (except -// ed25519, for compatability reasons). For each other authenticator, this -// domain-separator is the single byte-value of its -// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature -// schema flag || authenticator bytes)`. -// -// Each authenticator has a method for deriving its `Address` as well as -// documentation for the specifics of how the derivation is done. See -// [`Ed25519PublicKey::derive_address`] for an example. -// -// [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address -// -// ## Relationship to ObjectIds -// -// [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but -// are derived leveraging different domain-separator values to ensure that, -// cryptographically, there won't be any overlap, e.g. there can't be a -// valid `Object` who's `ObjectId` is equal to that of the `Address` of a user -// account. -// -// [`ObjectId`]: iota_types::ObjectId -// -// # BCS -// -// An `Address`'s BCS serialized form is defined by the following: -// -// ```text -// address = 32OCTET -// ``` -type Address struct { - ffiObject FfiObject +func (c FfiConverterEpoch) Read(reader io.Reader) *Epoch { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } +func (c FfiConverterEpoch) Lower(value *Epoch) 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("*Epoch") + defer value.ffiObject.decrementPointer() + return pointer + +} -func AddressFromBytes(bytes []byte) (*Address, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *Address - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterAddressINSTANCE.Lift(_uniffiRV), nil - } +func (c FfiConverterEpoch) Write(writer io.Writer, value *Epoch) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -func AddressFromHex(hex string) (*Address, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_address_from_hex(FfiConverterStringINSTANCE.Lower(hex),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *Address - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterAddressINSTANCE.Lift(_uniffiRV), nil - } -} +type FfiDestroyerEpoch struct {} -func AddressGenerate() *Address { - return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_address_generate(_uniffiStatus) - })) +func (_ FfiDestroyerEpoch) Destroy(value *Epoch) { + value.Destroy() } -func (_self *Address) ToBytes() []byte { - _pointer := _self.ffiObject.incrementPointer("*Address") - defer _self.ffiObject.decrementPointer() - return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_address_to_bytes( - _pointer,_uniffiStatus), - } - })) +type ExecutionTimeObservationsInterface interface { } - -func (_self *Address) ToHex() string { - _pointer := _self.ffiObject.incrementPointer("*Address") - defer _self.ffiObject.decrementPointer() - return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_address_to_hex( - _pointer,_uniffiStatus), - } - })) +type ExecutionTimeObservations struct { + ffiObject FfiObject } -func (object *Address) Destroy() { + + + +func (object *ExecutionTimeObservations) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterAddress struct {} +type FfiConverterExecutionTimeObservations struct {} -var FfiConverterAddressINSTANCE = FfiConverterAddress{} +var FfiConverterExecutionTimeObservationsINSTANCE = FfiConverterExecutionTimeObservations{} -func (c FfiConverterAddress) Lift(pointer unsafe.Pointer) *Address { - result := &Address { +func (c FfiConverterExecutionTimeObservations) Lift(pointer unsafe.Pointer) *ExecutionTimeObservations { + result := &ExecutionTimeObservations { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_address(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_executiontimeobservations(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_address(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_executiontimeobservations(pointer, status) }, ), } - runtime.SetFinalizer(result, (*Address).Destroy) + runtime.SetFinalizer(result, (*ExecutionTimeObservations).Destroy) return result } -func (c FfiConverterAddress) Read(reader io.Reader) *Address { +func (c FfiConverterExecutionTimeObservations) Read(reader io.Reader) *ExecutionTimeObservations { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterAddress) Lower(value *Address) unsafe.Pointer { +func (c FfiConverterExecutionTimeObservations) Lower(value *ExecutionTimeObservations) 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("*Address") + pointer := value.ffiObject.incrementPointer("*ExecutionTimeObservations") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterAddress) Write(writer io.Writer, value *Address) { +func (c FfiConverterExecutionTimeObservations) Write(writer io.Writer, value *ExecutionTimeObservations) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerAddress struct {} +type FfiDestroyerExecutionTimeObservations struct {} -func (_ FfiDestroyerAddress) Destroy(value *Address) { +func (_ FfiDestroyerExecutionTimeObservations) Destroy(value *ExecutionTimeObservations) { value.Destroy() } -type AuthenticatorStateExpireInterface interface { +type FaucetClientInterface interface { + // Request gas from the faucet. Note that this will return the UUID of the + // request and not wait until the token is received. Use + // `request_and_wait` to wait for the token. + Request(address *Address) (*string, error) + // Request gas from the faucet and wait until the request is completed and + // token is transferred. Returns `FaucetReceipt` if the request is + // successful, which contains the list of tokens transferred, and the + // transaction digest. + // + // Note that the faucet is heavily rate-limited, so calling repeatedly the + // faucet would likely result in a 429 code or 502 code. + RequestAndWait(address *Address) (**FaucetReceipt, error) + // Check the faucet request status. + // + // Possible statuses are defined in: [`BatchSendStatusType`] + RequestStatus(id string) (**BatchSendStatus, error) } -type AuthenticatorStateExpire struct { +type FaucetClient struct { ffiObject FfiObject } +// Construct a new `FaucetClient` with the given faucet service URL. This +// [`FaucetClient`] expects that the service provides two endpoints: +// /v1/gas and /v1/status. As such, do not provide the request +// endpoint, just the top level service endpoint. +// +// - /v1/gas is used to request gas +// - /v1/status/taks-uuid is used to check the status of the request +func NewFaucetClient(faucetUrl string) *FaucetClient { + return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_new(FfiConverterStringINSTANCE.Lower(faucetUrl),_uniffiStatus) + })) +} +// Set to devnet faucet. +func FaucetClientDevnet() *FaucetClient { + return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_devnet(_uniffiStatus) + })) +} -func (object *AuthenticatorStateExpire) Destroy() { +// Set to local faucet. +func FaucetClientLocal() *FaucetClient { + return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_local(_uniffiStatus) + })) +} + +// Set to testnet faucet. +func FaucetClientTestnet() *FaucetClient { + return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_testnet(_uniffiStatus) + })) +} + + + +// Request gas from the faucet. Note that this will return the UUID of the +// request and not wait until the token is received. Use +// `request_and_wait` to wait for the token. +func (_self *FaucetClient) Request(address *Address) (*string, error) { + _pointer := _self.ffiObject.incrementPointer("*FaucetClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *string { + return FfiConverterOptionalStringINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_faucetclient_request( + _pointer,FfiConverterAddressINSTANCE.Lower(address)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + + return res, err +} + +// Request gas from the faucet and wait until the request is completed and +// token is transferred. Returns `FaucetReceipt` if the request is +// successful, which contains the list of tokens transferred, and the +// transaction digest. +// +// Note that the faucet is heavily rate-limited, so calling repeatedly the +// faucet would likely result in a 429 code or 502 code. +func (_self *FaucetClient) RequestAndWait(address *Address) (**FaucetReceipt, error) { + _pointer := _self.ffiObject.incrementPointer("*FaucetClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **FaucetReceipt { + return FfiConverterOptionalFaucetReceiptINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_and_wait( + _pointer,FfiConverterAddressINSTANCE.Lower(address)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + + return res, err +} + +// Check the faucet request status. +// +// Possible statuses are defined in: [`BatchSendStatusType`] +func (_self *FaucetClient) RequestStatus(id string) (**BatchSendStatus, error) { + _pointer := _self.ffiObject.incrementPointer("*FaucetClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **BatchSendStatus { + return FfiConverterOptionalBatchSendStatusINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_status( + _pointer,FfiConverterStringINSTANCE.Lower(id)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + + return res, err +} +func (object *FaucetClient) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterAuthenticatorStateExpire struct {} +type FfiConverterFaucetClient struct {} -var FfiConverterAuthenticatorStateExpireINSTANCE = FfiConverterAuthenticatorStateExpire{} +var FfiConverterFaucetClientINSTANCE = FfiConverterFaucetClient{} -func (c FfiConverterAuthenticatorStateExpire) Lift(pointer unsafe.Pointer) *AuthenticatorStateExpire { - result := &AuthenticatorStateExpire { +func (c FfiConverterFaucetClient) Lift(pointer unsafe.Pointer) *FaucetClient { + result := &FaucetClient { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_faucetclient(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_faucetclient(pointer, status) }, ), } - runtime.SetFinalizer(result, (*AuthenticatorStateExpire).Destroy) + runtime.SetFinalizer(result, (*FaucetClient).Destroy) return result } -func (c FfiConverterAuthenticatorStateExpire) Read(reader io.Reader) *AuthenticatorStateExpire { +func (c FfiConverterFaucetClient) Read(reader io.Reader) *FaucetClient { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterAuthenticatorStateExpire) Lower(value *AuthenticatorStateExpire) unsafe.Pointer { +func (c FfiConverterFaucetClient) Lower(value *FaucetClient) 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("*AuthenticatorStateExpire") + pointer := value.ffiObject.incrementPointer("*FaucetClient") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterAuthenticatorStateExpire) Write(writer io.Writer, value *AuthenticatorStateExpire) { +func (c FfiConverterFaucetClient) Write(writer io.Writer, value *FaucetClient) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerAuthenticatorStateExpire struct {} +type FfiDestroyerFaucetClient struct {} -func (_ FfiDestroyerAuthenticatorStateExpire) Destroy(value *AuthenticatorStateExpire) { +func (_ FfiDestroyerFaucetClient) Destroy(value *FaucetClient) { value.Destroy() } -type AuthenticatorStateUpdateV1Interface interface { +type FaucetReceiptInterface interface { } -type AuthenticatorStateUpdateV1 struct { +type FaucetReceipt struct { ffiObject FfiObject } -func (object *AuthenticatorStateUpdateV1) Destroy() { +func (object *FaucetReceipt) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterAuthenticatorStateUpdateV1 struct {} +type FfiConverterFaucetReceipt struct {} -var FfiConverterAuthenticatorStateUpdateV1INSTANCE = FfiConverterAuthenticatorStateUpdateV1{} +var FfiConverterFaucetReceiptINSTANCE = FfiConverterFaucetReceipt{} -func (c FfiConverterAuthenticatorStateUpdateV1) Lift(pointer unsafe.Pointer) *AuthenticatorStateUpdateV1 { - result := &AuthenticatorStateUpdateV1 { +func (c FfiConverterFaucetReceipt) Lift(pointer unsafe.Pointer) *FaucetReceipt { + result := &FaucetReceipt { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_faucetreceipt(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_faucetreceipt(pointer, status) }, ), } - runtime.SetFinalizer(result, (*AuthenticatorStateUpdateV1).Destroy) + runtime.SetFinalizer(result, (*FaucetReceipt).Destroy) return result } -func (c FfiConverterAuthenticatorStateUpdateV1) Read(reader io.Reader) *AuthenticatorStateUpdateV1 { +func (c FfiConverterFaucetReceipt) Read(reader io.Reader) *FaucetReceipt { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterAuthenticatorStateUpdateV1) Lower(value *AuthenticatorStateUpdateV1) unsafe.Pointer { +func (c FfiConverterFaucetReceipt) Lower(value *FaucetReceipt) 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("*AuthenticatorStateUpdateV1") + pointer := value.ffiObject.incrementPointer("*FaucetReceipt") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterAuthenticatorStateUpdateV1) Write(writer io.Writer, value *AuthenticatorStateUpdateV1) { +func (c FfiConverterFaucetReceipt) Write(writer io.Writer, value *FaucetReceipt) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerAuthenticatorStateUpdateV1 struct {} +type FfiDestroyerFaucetReceipt struct {} -func (_ FfiDestroyerAuthenticatorStateUpdateV1) Destroy(value *AuthenticatorStateUpdateV1) { +func (_ FfiDestroyerFaucetReceipt) Destroy(value *FaucetReceipt) { value.Destroy() } -type BatchSendStatusInterface interface { +type GenesisTransactionInterface interface { } -type BatchSendStatus struct { +type GenesisTransaction struct { ffiObject FfiObject } -func (object *BatchSendStatus) Destroy() { +func (object *GenesisTransaction) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterBatchSendStatus struct {} +type FfiConverterGenesisTransaction struct {} -var FfiConverterBatchSendStatusINSTANCE = FfiConverterBatchSendStatus{} +var FfiConverterGenesisTransactionINSTANCE = FfiConverterGenesisTransaction{} -func (c FfiConverterBatchSendStatus) Lift(pointer unsafe.Pointer) *BatchSendStatus { - result := &BatchSendStatus { +func (c FfiConverterGenesisTransaction) Lift(pointer unsafe.Pointer) *GenesisTransaction { + result := &GenesisTransaction { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_genesistransaction(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_batchsendstatus(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_genesistransaction(pointer, status) }, ), } - runtime.SetFinalizer(result, (*BatchSendStatus).Destroy) + runtime.SetFinalizer(result, (*GenesisTransaction).Destroy) return result } -func (c FfiConverterBatchSendStatus) Read(reader io.Reader) *BatchSendStatus { +func (c FfiConverterGenesisTransaction) Read(reader io.Reader) *GenesisTransaction { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterBatchSendStatus) Lower(value *BatchSendStatus) unsafe.Pointer { +func (c FfiConverterGenesisTransaction) Lower(value *GenesisTransaction) 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("*BatchSendStatus") + pointer := value.ffiObject.incrementPointer("*GenesisTransaction") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterBatchSendStatus) Write(writer io.Writer, value *BatchSendStatus) { +func (c FfiConverterGenesisTransaction) Write(writer io.Writer, value *GenesisTransaction) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerBatchSendStatus struct {} +type FfiDestroyerGenesisTransaction struct {} -func (_ FfiDestroyerBatchSendStatus) Destroy(value *BatchSendStatus) { +func (_ FfiDestroyerGenesisTransaction) Destroy(value *GenesisTransaction) { value.Destroy() } -// A bls12381 min-sig public key. -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// bls-public-key = %x60 96OCTECT -// ``` -// -// Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a -// fixed-length of 96, IOTA's binary representation of a min-sig -// `Bls12381PublicKey` is prefixed with its length meaning its serialized -// binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. -type Bls12381PublicKeyInterface interface { - ToBytes() []byte +type GraphQlClientInterface interface { + // Get the list of active validators for the provided epoch, including + // related metadata. If no epoch is provided, it will return the active + // validators for the current epoch. + ActiveValidators(paginationFilter PaginationFilter, epoch *uint64) (ValidatorPage, error) + // Get the balance of all the coins owned by address for the provided coin + // type. Coin type will default to `0x2::coin::Coin<0x2::iota::IOTA>` + // if not provided. + Balance(address *Address, coinType *string) (*uint64, error) + // Get the chain identifier. + 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. + Checkpoint(digest **CheckpointContentsDigest, 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. + CoinMetadata(coinType string) (**CoinMetadata, error) + // Get the list of coins for the specified address. + // + // If `coin_type` is not provided, it will default to `0x2::coin::Coin`, + // which will return all coins. For IOTA coin, pass in the coin type: + // `0x2::coin::Coin<0x2::iota::IOTA>`. + Coins(owner *Address, paginationFilter PaginationFilter, coinType *string) (CoinPage, error) + // Dry run a [`Transaction`] and return the transaction effects and dry run + // error (if any). + // + // `skipChecks` optional flag disables the usual verification checks that + // prevent access to objects that are owned by addresses other than the + // sender, and calling non-public, non-entry functions, and some other + // checks. Defaults to false. + DryRunTx(tx *Transaction, skipChecks *bool) (DryRunResult, error) + // Dry run a [`TransactionKind`] and return the transaction effects and dry + // run error (if any). + // + // `skipChecks` optional flag disables the usual verification checks that + // prevent access to objects that are owned by addresses other than the + // sender, and calling non-public, non-entry functions, and some other + // checks. Defaults to false. + // + // `tx_meta` is the transaction metadata. + DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks *bool) (DryRunResult, error) + // Access a dynamic field on an object using its name. Names are arbitrary + // Move values whose type have copy, drop, and store, and are specified + // using their type, and their BCS contents, Base64 encoded. + // + // The `name` argument is a json serialized type. + // + // This returns [`DynamicFieldOutput`] which contains the name, the value + // as json, and object. + // + // # Example + // ```rust,ignore + // + // let client = iota_graphql_client::Client::new_devnet(); + // let address = Address::from_str("0x5").unwrap(); + // let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); + // + // # alternatively, pass in the bcs bytes + // let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); + // let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); + // ``` + DynamicField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) + // Get a page of dynamic fields for the provided address. Note that this + // will also fetch dynamic fields on wrapped objects. + // + // This returns [`Page`] of [`DynamicFieldOutput`]s. + DynamicFields(address *Address, paginationFilter PaginationFilter) (DynamicFieldOutputPage, error) + // Access a dynamic object field on an object using its name. Names are + // arbitrary Move values whose type have copy, drop, and store, and are + // specified using their type, and their BCS contents, Base64 encoded. + // + // The `name` argument is a json serialized type. + // + // This returns [`DynamicFieldOutput`] which contains the name, the value + // as json, and object. + DynamicObjectField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) + // Return the epoch information for the provided epoch. If no epoch is + // provided, it will return the last known epoch. + Epoch(epoch *uint64) (**Epoch, error) + // Return the number of checkpoints in this epoch. This will return + // `Ok(None)` if the epoch requested is not available in the GraphQL + // service (e.g., due to pruning). + EpochTotalCheckpoints(epoch *uint64) (*uint64, error) + // Return the number of transaction blocks in this epoch. This will return + // `Ok(None)` if the epoch requested is not available in the GraphQL + // service (e.g., due to pruning). + EpochTotalTransactionBlocks(epoch *uint64) (*uint64, error) + // Return a page of tuple (event, transaction digest) based on the + // (optional) event filter. + Events(paginationFilter PaginationFilter, filter *EventFilter) (EventPage, error) + // Execute a transaction. + ExecuteTx(signatures []*UserSignature, tx *Transaction) (**TransactionEffects, error) + // Return the sequence number of the latest checkpoint that has been + // executed. + LatestCheckpointSequenceNumber() (*uint64, error) + // Lazily fetch the max page size + MaxPageSize() (int32, error) + // Return the contents' JSON of an object that is a Move object. + // + // If the object does not exist (e.g., due to pruning), this will return + // `Ok(None)`. Similarly, if this is not an object but an address, it + // will return `Ok(None)`. + MoveObjectContents(objectId *ObjectId, version *uint64) (*Value, error) + // Return the BCS of an object that is a Move object. + // + // If the object does not exist (e.g., due to pruning), this will return + // `Ok(None)`. Similarly, if this is not an object but an address, it + // will return `Ok(None)`. + MoveObjectContentsBcs(objectId *ObjectId, version *uint64) (*[]byte, error) + // Return the normalized Move function data for the provided package, + // module, and function. + NormalizedMoveFunction(varPackage string, module string, function string, version *uint64) (**MoveFunction, error) + // Return the normalized Move module data for the provided module. + NormalizedMoveModule(varPackage string, module string, paginationFilterEnums PaginationFilter, paginationFilterFriends PaginationFilter, paginationFilterFunctions PaginationFilter, paginationFilterStructs PaginationFilter, version *uint64) (**MoveModule, error) + // Return an object based on the provided [`Address`]. + // + // If the object does not exist (e.g., due to pruning), this will return + // `Ok(None)`. Similarly, if this is not an object but an address, it + // will return `Ok(None)`. + Object(objectId *ObjectId, version *uint64) (**Object, error) + // Return the object's bcs content [`Vec`] based on the provided + // [`Address`]. + ObjectBcs(objectId *ObjectId) (*[]byte, error) + // Return a page of objects based on the provided parameters. + // + // Use this function together with the [`ObjectFilter::owner`] to get the + // objects owned by an address. + // + // # Example + // + // ```rust,ignore + // let filter = ObjectFilter { + // type_tag: None, + // owner: Some(Address::from_str("test").unwrap().into()), + // object_ids: None, + // }; + // + // let owned_objects = client.objects(None, None, Some(filter), None, None).await; + // ``` + Objects(paginationFilter PaginationFilter, filter *ObjectFilter) (ObjectPage, error) + // The package corresponding to the given address (at the optionally given + // version). When no version is given, the package is loaded directly + // from the address given. Otherwise, the address is translated before + // loading to point to the package whose original ID matches + // the package at address, but whose version is version. For non-system + // packages, this might result in a different address than address + // because different versions of a package, introduced by upgrades, + // exist at distinct addresses. + // + // Note that this interpretation of version is different from a historical + // object read (the interpretation of version for the object query). + Package(address *Address, version *uint64) (**MovePackage, error) + // Fetch the latest version of the package at address. + // This corresponds to the package with the highest version that shares its + // original ID with the package at address. + PackageLatest(address *Address) (**MovePackage, error) + // Fetch all versions of package at address (packages that share this + // package's original ID), optionally bounding the versions exclusively + // from below with afterVersion, or from above with beforeVersion. + PackageVersions(address *Address, paginationFilter PaginationFilter, afterVersion *uint64, beforeVersion *uint64) (MovePackagePage, error) + // The Move packages that exist in the network, optionally filtered to be + // strictly before beforeCheckpoint and/or strictly after + // afterCheckpoint. + // + // This query returns all versions of a given user package that appear + // between the specified checkpoints, but only records the latest + // versions of system packages. + Packages(paginationFilter PaginationFilter, afterCheckpoint *uint64, beforeCheckpoint *uint64) (MovePackagePage, error) + // Get the protocol configuration. + ProtocolConfig(version *uint64) (**ProtocolConfigs, error) + // Get the reference gas price for the provided epoch or the last known one + // if no epoch is provided. + // + // This will return `Ok(None)` if the epoch requested is not available in + // the GraphQL service (e.g., due to pruning). + ReferenceGasPrice(epoch *uint64) (*uint64, error) + // Get the GraphQL service configuration, including complexity limits, read + // and mutation limits, supported versions, and others. + ServiceConfig() (*ServiceConfig, error) + // Set the server address for the GraphQL GraphQL client. It should be a + // valid URL with a host and optionally a port number. + SetRpcServer(server string) error + // Get total supply for the coin type. + TotalSupply(coinType string) (*uint64, error) + // The total number of transaction blocks in the network by the end of the + // last known checkpoint. + TotalTransactionBlocks() (*uint64, error) + // The total number of transaction blocks in the network by the end of the + // provided checkpoint digest. + TotalTransactionBlocksByDigest(digest *CheckpointContentsDigest) (*uint64, error) + // The total number of transaction blocks in the network by the end of the + // provided checkpoint sequence number. + TotalTransactionBlocksBySeqNum(seqNum uint64) (*uint64, error) + // Get a transaction by its digest. + Transaction(digest *TransactionDigest) (*SignedTransaction, error) + // Get a transaction's data and effects by its digest. + TransactionDataEffects(digest *TransactionDigest) (*TransactionDataEffects, error) + // Get a transaction's effects by its digest. + TransactionEffects(digest *TransactionDigest) (**TransactionEffects, error) + // Get a page of transactions based on the provided filters. + Transactions(paginationFilter PaginationFilter, filter *TransactionsFilter) (SignedTransactionPage, error) + // Get a page of transactions' data and effects based on the provided + // filters. + TransactionsDataEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionDataEffectsPage, error) + // Get a page of transactions' effects based on the provided filters. + TransactionsEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionEffectsPage, error) } -// A bls12381 min-sig public key. -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// bls-public-key = %x60 96OCTECT -// ``` -// -// Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a -// fixed-length of 96, IOTA's binary representation of a min-sig -// `Bls12381PublicKey` is prefixed with its length meaning its serialized -// binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. -type Bls12381PublicKey struct { +type GraphQlClient struct { ffiObject FfiObject } - - -func Bls12381PublicKeyFromBytes(bytes []byte) (*Bls12381PublicKey, error) { +// Create a new GraphQL client with the provided server address. +func NewGraphQlClient(server string) (*GraphQlClient, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new(FfiConverterStringINSTANCE.Lower(server),_uniffiStatus) }) if _uniffiErr != nil { - var _uniffiDefaultValue *Bls12381PublicKey + var _uniffiDefaultValue *GraphQlClient return _uniffiDefaultValue, _uniffiErr } else { - return FfiConverterBls12381PublicKeyINSTANCE.Lift(_uniffiRV), nil + return FfiConverterGraphQlClientINSTANCE.Lift(_uniffiRV), nil } } -func Bls12381PublicKeyFromStr(s string) (*Bls12381PublicKey, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *Bls12381PublicKey - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterBls12381PublicKeyINSTANCE.Lift(_uniffiRV), nil - } -} -func Bls12381PublicKeyGenerate() *Bls12381PublicKey { - return FfiConverterBls12381PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate(_uniffiStatus) +// Create a new GraphQL client connected to the `devnet` GraphQL server: +// {DEVNET_HOST}. +func GraphQlClientNewDevnet() *GraphQlClient { + return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_devnet(_uniffiStatus) })) } - - -func (_self *Bls12381PublicKey) ToBytes() []byte { - _pointer := _self.ffiObject.incrementPointer("*Bls12381PublicKey") - defer _self.ffiObject.decrementPointer() - return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes( - _pointer,_uniffiStatus), - } +// Create a new GraphQL client connected to the `localhost` GraphQL server: +// {DEFAULT_LOCAL_HOST}. +func GraphQlClientNewLocalhost() *GraphQlClient { + return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_localhost(_uniffiStatus) })) } -func (object *Bls12381PublicKey) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterBls12381PublicKey struct {} - -var FfiConverterBls12381PublicKeyINSTANCE = FfiConverterBls12381PublicKey{} - - -func (c FfiConverterBls12381PublicKey) Lift(pointer unsafe.Pointer) *Bls12381PublicKey { - result := &Bls12381PublicKey { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_bls12381publickey(pointer, status) - }, - ), - } - runtime.SetFinalizer(result, (*Bls12381PublicKey).Destroy) - return result -} - -func (c FfiConverterBls12381PublicKey) Read(reader io.Reader) *Bls12381PublicKey { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterBls12381PublicKey) Lower(value *Bls12381PublicKey) 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("*Bls12381PublicKey") - defer value.ffiObject.decrementPointer() - return pointer - -} - -func (c FfiConverterBls12381PublicKey) Write(writer io.Writer, value *Bls12381PublicKey) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) -} - -type FfiDestroyerBls12381PublicKey struct {} - -func (_ FfiDestroyerBls12381PublicKey) Destroy(value *Bls12381PublicKey) { - value.Destroy() -} - - -type ChangeEpochInterface interface { -} -type ChangeEpoch struct { - ffiObject FfiObject +// Create a new GraphQL client connected to the `mainnet` GraphQL server: +// {MAINNET_HOST}. +func GraphQlClientNewMainnet() *GraphQlClient { + return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_mainnet(_uniffiStatus) + })) } - - -func (object *ChangeEpoch) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() +// Create a new GraphQL client connected to the `testnet` GraphQL server: +// {TESTNET_HOST}. +func GraphQlClientNewTestnet() *GraphQlClient { + return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_testnet(_uniffiStatus) + })) } -type FfiConverterChangeEpoch struct {} - -var FfiConverterChangeEpochINSTANCE = FfiConverterChangeEpoch{} -func (c FfiConverterChangeEpoch) Lift(pointer unsafe.Pointer) *ChangeEpoch { - result := &ChangeEpoch { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_changeepoch(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_changeepoch(pointer, status) - }, - ), +// Get the list of active validators for the provided epoch, including +// related metadata. If no epoch is provided, it will return the active +// validators for the current epoch. +func (_self *GraphQlClient) ActiveValidators(paginationFilter PaginationFilter, epoch *uint64) (ValidatorPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*ChangeEpoch).Destroy) - return result -} - -func (c FfiConverterChangeEpoch) Read(reader io.Reader) *ChangeEpoch { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterChangeEpoch) Lower(value *ChangeEpoch) 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("*ChangeEpoch") - defer value.ffiObject.decrementPointer() - return pointer - -} - -func (c FfiConverterChangeEpoch) Write(writer io.Writer, value *ChangeEpoch) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) -} - -type FfiDestroyerChangeEpoch struct {} - -func (_ FfiDestroyerChangeEpoch) Destroy(value *ChangeEpoch) { - value.Destroy() -} - - - -type ChangeEpochV2Interface interface { -} -type ChangeEpochV2 struct { - ffiObject FfiObject -} - - - -func (object *ChangeEpochV2) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterChangeEpochV2 struct {} - -var FfiConverterChangeEpochV2INSTANCE = FfiConverterChangeEpochV2{} + }, + // liftFn + func(ffi RustBufferI) ValidatorPage { + return FfiConverterValidatorPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_active_validators( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalUint64INSTANCE.Lower(epoch)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + return res, err +} -func (c FfiConverterChangeEpochV2) Lift(pointer unsafe.Pointer) *ChangeEpochV2 { - result := &ChangeEpochV2 { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_changeepochv2(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_changeepochv2(pointer, status) - }, - ), +// Get the balance of all the coins owned by address for the provided coin +// type. Coin type will default to `0x2::coin::Coin<0x2::iota::IOTA>` +// if not provided. +func (_self *GraphQlClient) Balance(address *Address, coinType *string) (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*ChangeEpochV2).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_balance( + _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterOptionalStringINSTANCE.Lower(coinType)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterChangeEpochV2) Read(reader io.Reader) *ChangeEpochV2 { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterChangeEpochV2) Lower(value *ChangeEpochV2) 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("*ChangeEpochV2") - defer value.ffiObject.decrementPointer() - return pointer - -} +// Get the chain identifier. +func (_self *GraphQlClient) ChainId() (string, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) string { + return FfiConverterStringINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_chain_id( + _pointer,), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterChangeEpochV2) Write(writer io.Writer, value *ChangeEpochV2) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) + return res, err } -type FfiDestroyerChangeEpochV2 struct {} +// 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 **CheckpointContentsDigest, seqNum *uint64) (*CheckpointSummary, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *CheckpointSummary { + return FfiConverterOptionalCheckpointSummaryINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoint( + _pointer,FfiConverterOptionalCheckpointContentsDigestINSTANCE.Lower(digest), FfiConverterOptionalUint64INSTANCE.Lower(seqNum)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_ FfiDestroyerChangeEpochV2) Destroy(value *ChangeEpochV2) { - value.Destroy() + return res, err } +// Get a page of [`CheckpointSummary`] for the provided parameters. +func (_self *GraphQlClient) Checkpoints(paginationFilter PaginationFilter) (CheckpointSummaryPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) CheckpointSummaryPage { + return FfiConverterCheckpointSummaryPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoints( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -type CheckpointCommitmentInterface interface { - AsEcmhLiveObjectSetDigest() *Digest - IsEcmhLiveObjectSet() bool -} -type CheckpointCommitment struct { - ffiObject FfiObject + return res, err } - - - -func (_self *CheckpointCommitment) AsEcmhLiveObjectSetDigest() *Digest { - _pointer := _self.ffiObject.incrementPointer("*CheckpointCommitment") +// Get the coin metadata for the coin type. +func (_self *GraphQlClient) CoinMetadata(coinType string) (**CoinMetadata, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() - return FfiConverterDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest( - _pointer,_uniffiStatus) - })) -} + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **CoinMetadata { + return FfiConverterOptionalCoinMetadataINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata( + _pointer,FfiConverterStringINSTANCE.Lower(coinType)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_self *CheckpointCommitment) IsEcmhLiveObjectSet() bool { - _pointer := _self.ffiObject.incrementPointer("*CheckpointCommitment") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set( - _pointer,_uniffiStatus) - })) -} -func (object *CheckpointCommitment) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() + return res, err } -type FfiConverterCheckpointCommitment struct {} - -var FfiConverterCheckpointCommitmentINSTANCE = FfiConverterCheckpointCommitment{} - - -func (c FfiConverterCheckpointCommitment) Lift(pointer unsafe.Pointer) *CheckpointCommitment { - result := &CheckpointCommitment { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(pointer, status) - }, - ), +// Get the list of coins for the specified address. +// +// If `coin_type` is not provided, it will default to `0x2::coin::Coin`, +// which will return all coins. For IOTA coin, pass in the coin type: +// `0x2::coin::Coin<0x2::iota::IOTA>`. +func (_self *GraphQlClient) Coins(owner *Address, paginationFilter PaginationFilter, coinType *string) (CoinPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*CheckpointCommitment).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) CoinPage { + return FfiConverterCoinPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins( + _pointer,FfiConverterAddressINSTANCE.Lower(owner), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalStringINSTANCE.Lower(coinType)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCheckpointCommitment) Read(reader io.Reader) *CheckpointCommitment { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterCheckpointCommitment) Lower(value *CheckpointCommitment) 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("*CheckpointCommitment") - defer value.ffiObject.decrementPointer() - return pointer - -} +// Dry run a [`Transaction`] and return the transaction effects and dry run +// error (if any). +// +// `skipChecks` optional flag disables the usual verification checks that +// prevent access to objects that are owned by addresses other than the +// sender, and calling non-public, non-entry functions, and some other +// checks. Defaults to false. +func (_self *GraphQlClient) DryRunTx(tx *Transaction, skipChecks *bool) (DryRunResult, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) DryRunResult { + return FfiConverterDryRunResultINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx( + _pointer,FfiConverterTransactionINSTANCE.Lower(tx), FfiConverterOptionalBoolINSTANCE.Lower(skipChecks)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCheckpointCommitment) Write(writer io.Writer, value *CheckpointCommitment) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) + return res, err } -type FfiDestroyerCheckpointCommitment struct {} +// Dry run a [`TransactionKind`] and return the transaction effects and dry +// run error (if any). +// +// `skipChecks` optional flag disables the usual verification checks that +// prevent access to objects that are owned by addresses other than the +// sender, and calling non-public, non-entry functions, and some other +// checks. Defaults to false. +// +// `tx_meta` is the transaction metadata. +func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks *bool) (DryRunResult, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) DryRunResult { + return FfiConverterDryRunResultINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind( + _pointer,FfiConverterTransactionKindINSTANCE.Lower(txKind), FfiConverterTransactionMetadataINSTANCE.Lower(txMeta), FfiConverterOptionalBoolINSTANCE.Lower(skipChecks)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_ FfiDestroyerCheckpointCommitment) Destroy(value *CheckpointCommitment) { - value.Destroy() + return res, err } +// Access a dynamic field on an object using its name. Names are arbitrary +// Move values whose type have copy, drop, and store, and are specified +// using their type, and their BCS contents, Base64 encoded. +// +// The `name` argument is a json serialized type. +// +// This returns [`DynamicFieldOutput`] which contains the name, the value +// as json, and object. +// +// # Example +// ```rust,ignore +// +// let client = iota_graphql_client::Client::new_devnet(); +// let address = Address::from_str("0x5").unwrap(); +// let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); +// +// # alternatively, pass in the bcs bytes +// let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); +// let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); +// ``` +func (_self *GraphQlClient) DynamicField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *DynamicFieldOutput { + return FfiConverterOptionalDynamicFieldOutputINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field( + _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterTypeTagINSTANCE.Lower(typeTag), FfiConverterTypeValueINSTANCE.Lower(name)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -type CheckpointContentsDigestInterface interface { -} -type CheckpointContentsDigest struct { - ffiObject FfiObject + return res, err } +// Get a page of dynamic fields for the provided address. Note that this +// will also fetch dynamic fields on wrapped objects. +// +// This returns [`Page`] of [`DynamicFieldOutput`]s. +func (_self *GraphQlClient) DynamicFields(address *Address, paginationFilter PaginationFilter) (DynamicFieldOutputPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) DynamicFieldOutputPage { + return FfiConverterDynamicFieldOutputPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_fields( + _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -func (object *CheckpointContentsDigest) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() + return res, err } -type FfiConverterCheckpointContentsDigest struct {} - -var FfiConverterCheckpointContentsDigestINSTANCE = FfiConverterCheckpointContentsDigest{} +// Access a dynamic object field on an object using its name. Names are +// arbitrary Move values whose type have copy, drop, and store, and are +// specified using their type, and their BCS contents, Base64 encoded. +// +// The `name` argument is a json serialized type. +// +// This returns [`DynamicFieldOutput`] which contains the name, the value +// as json, and object. +func (_self *GraphQlClient) DynamicObjectField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *DynamicFieldOutput { + return FfiConverterOptionalDynamicFieldOutputINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_object_field( + _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterTypeTagINSTANCE.Lower(typeTag), FfiConverterTypeValueINSTANCE.Lower(name)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + return res, err +} -func (c FfiConverterCheckpointContentsDigest) Lift(pointer unsafe.Pointer) *CheckpointContentsDigest { - result := &CheckpointContentsDigest { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_checkpointcontentsdigest(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(pointer, status) - }, - ), +// Return the epoch information for the provided epoch. If no epoch is +// provided, it will return the last known epoch. +func (_self *GraphQlClient) Epoch(epoch *uint64) (**Epoch, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*CheckpointContentsDigest).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) **Epoch { + return FfiConverterOptionalEpochINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch( + _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCheckpointContentsDigest) Read(reader io.Reader) *CheckpointContentsDigest { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterCheckpointContentsDigest) Lower(value *CheckpointContentsDigest) 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("*CheckpointContentsDigest") - defer value.ffiObject.decrementPointer() - return pointer +// Return the number of checkpoints in this epoch. This will return +// `Ok(None)` if the epoch requested is not available in the GraphQL +// service (e.g., due to pruning). +func (_self *GraphQlClient) EpochTotalCheckpoints(epoch *uint64) (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_checkpoints( + _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + return res, err } -func (c FfiConverterCheckpointContentsDigest) Write(writer io.Writer, value *CheckpointContentsDigest) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +// Return the number of transaction blocks in this epoch. This will return +// `Ok(None)` if the epoch requested is not available in the GraphQL +// service (e.g., due to pruning). +func (_self *GraphQlClient) EpochTotalTransactionBlocks(epoch *uint64) (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_transaction_blocks( + _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) + + return res, err } -type FfiDestroyerCheckpointContentsDigest struct {} +// Return a page of tuple (event, transaction digest) based on the +// (optional) event filter. +func (_self *GraphQlClient) Events(paginationFilter PaginationFilter, filter *EventFilter) (EventPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) EventPage { + return FfiConverterEventPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_events( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalEventFilterINSTANCE.Lower(filter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_ FfiDestroyerCheckpointContentsDigest) Destroy(value *CheckpointContentsDigest) { - value.Destroy() + return res, err } +// Execute a transaction. +func (_self *GraphQlClient) ExecuteTx(signatures []*UserSignature, tx *Transaction) (**TransactionEffects, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **TransactionEffects { + return FfiConverterOptionalTransactionEffectsINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx( + _pointer,FfiConverterSequenceUserSignatureINSTANCE.Lower(signatures), FfiConverterTransactionINSTANCE.Lower(tx)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -type CheckpointDigestInterface interface { -} -type CheckpointDigest struct { - ffiObject FfiObject + return res, err } +// Return the sequence number of the latest checkpoint that has been +// executed. +func (_self *GraphQlClient) LatestCheckpointSequenceNumber() (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_latest_checkpoint_sequence_number( + _pointer,), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -func (object *CheckpointDigest) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() + return res, err } -type FfiConverterCheckpointDigest struct {} - -var FfiConverterCheckpointDigestINSTANCE = FfiConverterCheckpointDigest{} +// Lazily fetch the max page size +func (_self *GraphQlClient) MaxPageSize() (int32, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) C.int32_t { + res := C.ffi_iota_sdk_ffi_rust_future_complete_i32(handle, status) + return res + }, + // liftFn + func(ffi C.int32_t) int32 { + return FfiConverterInt32INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_max_page_size( + _pointer,), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_i32(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_i32(handle) + }, + ) + return res, err +} -func (c FfiConverterCheckpointDigest) Lift(pointer unsafe.Pointer) *CheckpointDigest { - result := &CheckpointDigest { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_checkpointdigest(pointer, status) - }, - ), +// Return the contents' JSON of an object that is a Move object. +// +// If the object does not exist (e.g., due to pruning), this will return +// `Ok(None)`. Similarly, if this is not an object but an address, it +// will return `Ok(None)`. +func (_self *GraphQlClient) MoveObjectContents(objectId *ObjectId, version *uint64) (*Value, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*CheckpointDigest).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) *Value { + return FfiConverterOptionalTypeValueINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents( + _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId), FfiConverterOptionalUint64INSTANCE.Lower(version)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCheckpointDigest) Read(reader io.Reader) *CheckpointDigest { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterCheckpointDigest) Lower(value *CheckpointDigest) 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("*CheckpointDigest") - defer value.ffiObject.decrementPointer() - return pointer - -} +// Return the BCS of an object that is a Move object. +// +// If the object does not exist (e.g., due to pruning), this will return +// `Ok(None)`. Similarly, if this is not an object but an address, it +// will return `Ok(None)`. +func (_self *GraphQlClient) MoveObjectContentsBcs(objectId *ObjectId, version *uint64) (*[]byte, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *[]byte { + return FfiConverterOptionalBytesINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents_bcs( + _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId), FfiConverterOptionalUint64INSTANCE.Lower(version)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCheckpointDigest) Write(writer io.Writer, value *CheckpointDigest) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) + return res, err } -type FfiDestroyerCheckpointDigest struct {} +// Return the normalized Move function data for the provided package, +// module, and function. +func (_self *GraphQlClient) NormalizedMoveFunction(varPackage string, module string, function string, version *uint64) (**MoveFunction, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **MoveFunction { + return FfiConverterOptionalMoveFunctionINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_function( + _pointer,FfiConverterStringINSTANCE.Lower(varPackage), FfiConverterStringINSTANCE.Lower(module), FfiConverterStringINSTANCE.Lower(function), FfiConverterOptionalUint64INSTANCE.Lower(version)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_ FfiDestroyerCheckpointDigest) Destroy(value *CheckpointDigest) { - value.Destroy() + return res, err } +// Return the normalized Move module data for the provided module. +func (_self *GraphQlClient) NormalizedMoveModule(varPackage string, module string, paginationFilterEnums PaginationFilter, paginationFilterFriends PaginationFilter, paginationFilterFunctions PaginationFilter, paginationFilterStructs PaginationFilter, version *uint64) (**MoveModule, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **MoveModule { + return FfiConverterOptionalMoveModuleINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_module( + _pointer,FfiConverterStringINSTANCE.Lower(varPackage), FfiConverterStringINSTANCE.Lower(module), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterEnums), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterFriends), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterFunctions), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterStructs), FfiConverterOptionalUint64INSTANCE.Lower(version)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -type CoinInterface interface { - Balance() uint64 - CoinType() *TypeTag - Id() *ObjectId -} -type Coin struct { - ffiObject FfiObject + return res, err } +// Return an object based on the provided [`Address`]. +// +// If the object does not exist (e.g., due to pruning), this will return +// `Ok(None)`. Similarly, if this is not an object but an address, it +// will return `Ok(None)`. +func (_self *GraphQlClient) Object(objectId *ObjectId, version *uint64) (**Object, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **Object { + return FfiConverterOptionalObjectINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object( + _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId), FfiConverterOptionalUint64INSTANCE.Lower(version)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func CoinTryFromObject(object *Object) (*Coin, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_coin_try_from_object(FfiConverterObjectINSTANCE.Lower(object),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *Coin - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterCoinINSTANCE.Lift(_uniffiRV), nil - } + return res, err } - - -func (_self *Coin) Balance() uint64 { - _pointer := _self.ffiObject.incrementPointer("*Coin") +// Return the object's bcs content [`Vec`] based on the provided +// [`Address`]. +func (_self *GraphQlClient) ObjectBcs(objectId *ObjectId) (*[]byte, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() - return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { - return C.uniffi_iota_sdk_ffi_fn_method_coin_balance( - _pointer,_uniffiStatus) - })) -} + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *[]byte { + return FfiConverterOptionalBytesINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object_bcs( + _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_self *Coin) CoinType() *TypeTag { - _pointer := _self.ffiObject.incrementPointer("*Coin") - defer _self.ffiObject.decrementPointer() - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_coin_coin_type( - _pointer,_uniffiStatus) - })) + return res, err } -func (_self *Coin) Id() *ObjectId { - _pointer := _self.ffiObject.incrementPointer("*Coin") +// Return a page of objects based on the provided parameters. +// +// Use this function together with the [`ObjectFilter::owner`] to get the +// objects owned by an address. +// +// # Example +// +// ```rust,ignore +// let filter = ObjectFilter { +// type_tag: None, +// owner: Some(Address::from_str("test").unwrap().into()), +// object_ids: None, +// }; +// +// let owned_objects = client.objects(None, None, Some(filter), None, None).await; +// ``` +func (_self *GraphQlClient) Objects(paginationFilter PaginationFilter, filter *ObjectFilter) (ObjectPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() - return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_coin_id( - _pointer,_uniffiStatus) - })) -} -func (object *Coin) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterCoin struct {} - -var FfiConverterCoinINSTANCE = FfiConverterCoin{} - - -func (c FfiConverterCoin) Lift(pointer unsafe.Pointer) *Coin { - result := &Coin { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_coin(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_coin(pointer, status) - }, - ), + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*Coin).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) ObjectPage { + return FfiConverterObjectPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalObjectFilterINSTANCE.Lower(filter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCoin) Read(reader io.Reader) *Coin { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterCoin) Lower(value *Coin) 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("*Coin") - defer value.ffiObject.decrementPointer() - return pointer - -} +// The package corresponding to the given address (at the optionally given +// version). When no version is given, the package is loaded directly +// from the address given. Otherwise, the address is translated before +// loading to point to the package whose original ID matches +// the package at address, but whose version is version. For non-system +// packages, this might result in a different address than address +// because different versions of a package, introduced by upgrades, +// exist at distinct addresses. +// +// Note that this interpretation of version is different from a historical +// object read (the interpretation of version for the object query). +func (_self *GraphQlClient) Package(address *Address, version *uint64) (**MovePackage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **MovePackage { + return FfiConverterOptionalMovePackageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package( + _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterOptionalUint64INSTANCE.Lower(version)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCoin) Write(writer io.Writer, value *Coin) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) + return res, err } -type FfiDestroyerCoin struct {} +// Fetch the latest version of the package at address. +// This corresponds to the package with the highest version that shares its +// original ID with the package at address. +func (_self *GraphQlClient) PackageLatest(address *Address) (**MovePackage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) **MovePackage { + return FfiConverterOptionalMovePackageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_latest( + _pointer,FfiConverterAddressINSTANCE.Lower(address)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_ FfiDestroyerCoin) Destroy(value *Coin) { - value.Destroy() + return res, err } +// Fetch all versions of package at address (packages that share this +// package's original ID), optionally bounding the versions exclusively +// from below with afterVersion, or from above with beforeVersion. +func (_self *GraphQlClient) PackageVersions(address *Address, paginationFilter PaginationFilter, afterVersion *uint64, beforeVersion *uint64) (MovePackagePage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) MovePackagePage { + return FfiConverterMovePackagePageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_versions( + _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalUint64INSTANCE.Lower(afterVersion), FfiConverterOptionalUint64INSTANCE.Lower(beforeVersion)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -type CoinMetadataInterface interface { -} -type CoinMetadata struct { - ffiObject FfiObject + return res, err } +// The Move packages that exist in the network, optionally filtered to be +// strictly before beforeCheckpoint and/or strictly after +// afterCheckpoint. +// +// This query returns all versions of a given user package that appear +// between the specified checkpoints, but only records the latest +// versions of system packages. +func (_self *GraphQlClient) Packages(paginationFilter PaginationFilter, afterCheckpoint *uint64, beforeCheckpoint *uint64) (MovePackagePage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) MovePackagePage { + return FfiConverterMovePackagePageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_packages( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalUint64INSTANCE.Lower(afterCheckpoint), FfiConverterOptionalUint64INSTANCE.Lower(beforeCheckpoint)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -func (object *CoinMetadata) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() + return res, err } -type FfiConverterCoinMetadata struct {} - -var FfiConverterCoinMetadataINSTANCE = FfiConverterCoinMetadata{} - - -func (c FfiConverterCoinMetadata) Lift(pointer unsafe.Pointer) *CoinMetadata { - result := &CoinMetadata { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_coinmetadata(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_coinmetadata(pointer, status) - }, - ), +// Get the protocol configuration. +func (_self *GraphQlClient) ProtocolConfig(version *uint64) (**ProtocolConfigs, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*CoinMetadata).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) **ProtocolConfigs { + return FfiConverterOptionalProtocolConfigsINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_protocol_config( + _pointer,FfiConverterOptionalUint64INSTANCE.Lower(version)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCoinMetadata) Read(reader io.Reader) *CoinMetadata { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterCoinMetadata) Lower(value *CoinMetadata) 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("*CoinMetadata") - defer value.ffiObject.decrementPointer() - return pointer - -} +// Get the reference gas price for the provided epoch or the last known one +// if no epoch is provided. +// +// This will return `Ok(None)` if the epoch requested is not available in +// the GraphQL service (e.g., due to pruning). +func (_self *GraphQlClient) ReferenceGasPrice(epoch *uint64) (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_reference_gas_price( + _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterCoinMetadata) Write(writer io.Writer, value *CoinMetadata) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) + return res, err } -type FfiDestroyerCoinMetadata struct {} +// Get the GraphQL service configuration, including complexity limits, read +// and mutation limits, supported versions, and others. +func (_self *GraphQlClient) ServiceConfig() (*ServiceConfig, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer { + res := C.ffi_iota_sdk_ffi_rust_future_complete_pointer(handle, status) + return res + }, + // liftFn + func(ffi unsafe.Pointer) *ServiceConfig { + return FfiConverterServiceConfigINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_service_config( + _pointer,), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_pointer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_pointer(handle) + }, + ) -func (_ FfiDestroyerCoinMetadata) Destroy(value *CoinMetadata) { - value.Destroy() + return res, err } +// Set the server address for the GraphQL GraphQL client. It should be a +// valid URL with a host and optionally a port number. +func (_self *GraphQlClient) SetRpcServer(server string) error { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + _, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) struct{} { + C.ffi_iota_sdk_ffi_rust_future_complete_void(handle, status) + return struct{}{} + }, + // liftFn + func(_ struct{}) struct{} { return struct{}{} }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_set_rpc_server( + _pointer,FfiConverterStringINSTANCE.Lower(server)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_void(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_void(handle) + }, + ) - -type ConsensusCommitDigestInterface interface { -} -type ConsensusCommitDigest struct { - ffiObject FfiObject + return err } +// Get total supply for the coin type. +func (_self *GraphQlClient) TotalSupply(coinType string) (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_supply( + _pointer,FfiConverterStringINSTANCE.Lower(coinType)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -func (object *ConsensusCommitDigest) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() + return res, err } -type FfiConverterConsensusCommitDigest struct {} - -var FfiConverterConsensusCommitDigestINSTANCE = FfiConverterConsensusCommitDigest{} - - -func (c FfiConverterConsensusCommitDigest) Lift(pointer unsafe.Pointer) *ConsensusCommitDigest { - result := &ConsensusCommitDigest { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest(pointer, status) - }, - ), +// The total number of transaction blocks in the network by the end of the +// last known checkpoint. +func (_self *GraphQlClient) TotalTransactionBlocks() (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*ConsensusCommitDigest).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks( + _pointer,), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterConsensusCommitDigest) Read(reader io.Reader) *ConsensusCommitDigest { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterConsensusCommitDigest) Lower(value *ConsensusCommitDigest) 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("*ConsensusCommitDigest") - defer value.ffiObject.decrementPointer() - return pointer - -} +// The total number of transaction blocks in the network by the end of the +// provided checkpoint digest. +func (_self *GraphQlClient) TotalTransactionBlocksByDigest(digest *CheckpointContentsDigest) (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_digest( + _pointer,FfiConverterCheckpointContentsDigestINSTANCE.Lower(digest)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterConsensusCommitDigest) Write(writer io.Writer, value *ConsensusCommitDigest) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) + return res, err } -type FfiDestroyerConsensusCommitDigest struct {} +// The total number of transaction blocks in the network by the end of the +// provided checkpoint sequence number. +func (_self *GraphQlClient) TotalTransactionBlocksBySeqNum(seqNum uint64) (*uint64, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *uint64 { + return FfiConverterOptionalUint64INSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_seq_num( + _pointer,FfiConverterUint64INSTANCE.Lower(seqNum)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_ FfiDestroyerConsensusCommitDigest) Destroy(value *ConsensusCommitDigest) { - value.Destroy() + return res, err } +// Get a transaction by its digest. +func (_self *GraphQlClient) Transaction(digest *TransactionDigest) (*SignedTransaction, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *SignedTransaction { + return FfiConverterOptionalSignedTransactionINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction( + _pointer,FfiConverterTransactionDigestINSTANCE.Lower(digest)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -type ConsensusCommitPrologueV1Interface interface { -} -type ConsensusCommitPrologueV1 struct { - ffiObject FfiObject + return res, err } +// Get a transaction's data and effects by its digest. +func (_self *GraphQlClient) TransactionDataEffects(digest *TransactionDigest) (*TransactionDataEffects, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) *TransactionDataEffects { + return FfiConverterOptionalTransactionDataEffectsINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_data_effects( + _pointer,FfiConverterTransactionDigestINSTANCE.Lower(digest)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -func (object *ConsensusCommitPrologueV1) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() + return res, err } -type FfiConverterConsensusCommitPrologueV1 struct {} - -var FfiConverterConsensusCommitPrologueV1INSTANCE = FfiConverterConsensusCommitPrologueV1{} - - -func (c FfiConverterConsensusCommitPrologueV1) Lift(pointer unsafe.Pointer) *ConsensusCommitPrologueV1 { - result := &ConsensusCommitPrologueV1 { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_consensuscommitprologuev1(pointer, status) - }, - ), +// Get a transaction's effects by its digest. +func (_self *GraphQlClient) TransactionEffects(digest *TransactionDigest) (**TransactionEffects, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, } - runtime.SetFinalizer(result, (*ConsensusCommitPrologueV1).Destroy) - return result -} + }, + // liftFn + func(ffi RustBufferI) **TransactionEffects { + return FfiConverterOptionalTransactionEffectsINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_effects( + _pointer,FfiConverterTransactionDigestINSTANCE.Lower(digest)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterConsensusCommitPrologueV1) Read(reader io.Reader) *ConsensusCommitPrologueV1 { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) + return res, err } -func (c FfiConverterConsensusCommitPrologueV1) Lower(value *ConsensusCommitPrologueV1) 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("*ConsensusCommitPrologueV1") - defer value.ffiObject.decrementPointer() - return pointer - -} +// Get a page of transactions based on the provided filters. +func (_self *GraphQlClient) Transactions(paginationFilter PaginationFilter, filter *TransactionsFilter) (SignedTransactionPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) SignedTransactionPage { + return FfiConverterSignedTransactionPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalTransactionsFilterINSTANCE.Lower(filter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (c FfiConverterConsensusCommitPrologueV1) Write(writer io.Writer, value *ConsensusCommitPrologueV1) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) + return res, err } -type FfiDestroyerConsensusCommitPrologueV1 struct {} +// Get a page of transactions' data and effects based on the provided +// filters. +func (_self *GraphQlClient) TransactionsDataEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionDataEffectsPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) TransactionDataEffectsPage { + return FfiConverterTransactionDataEffectsPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_data_effects( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalTransactionsFilterINSTANCE.Lower(filter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) -func (_ FfiDestroyerConsensusCommitPrologueV1) Destroy(value *ConsensusCommitPrologueV1) { - value.Destroy() + return res, err } +// Get a page of transactions' effects based on the provided filters. +func (_self *GraphQlClient) TransactionsEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionEffectsPage, error) { + _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + defer _self.ffiObject.decrementPointer() + res, err :=uniffiRustCallAsync[SdkFfiError]( + FfiConverterSdkFfiErrorINSTANCE, + // completeFn + func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { + res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) + return GoRustBuffer { + inner: res, + } + }, + // liftFn + func(ffi RustBufferI) TransactionEffectsPage { + return FfiConverterTransactionEffectsPageINSTANCE.Lift(ffi) + }, + C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects( + _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalTransactionsFilterINSTANCE.Lower(filter)), + // pollFn + func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) + }, + // freeFn + func (handle C.uint64_t) { + C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) + }, + ) - -// A 32-byte Blake2b256 hash output. -// -// # BCS -// -// A `Digest`'s BCS serialized form is defined by the following: -// -// ```text -// digest = %x20 32OCTET -// ``` -// -// Due to historical reasons, even though a `Digest` has a fixed-length of 32, -// IOTA's binary representation of a `Digest` is prefixed with its length -// meaning its serialized binary form (in bcs) is 33 bytes long vs a more -// compact 32 bytes. -type DigestInterface interface { -} -// A 32-byte Blake2b256 hash output. -// -// # BCS -// -// A `Digest`'s BCS serialized form is defined by the following: -// -// ```text -// digest = %x20 32OCTET -// ``` -// -// Due to historical reasons, even though a `Digest` has a fixed-length of 32, -// IOTA's binary representation of a `Digest` is prefixed with its length -// meaning its serialized binary form (in bcs) is 33 bytes long vs a more -// compact 32 bytes. -type Digest struct { - ffiObject FfiObject + return res, err } - - - -func (object *Digest) Destroy() { +func (object *GraphQlClient) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterDigest struct {} +type FfiConverterGraphQlClient struct {} -var FfiConverterDigestINSTANCE = FfiConverterDigest{} +var FfiConverterGraphQlClientINSTANCE = FfiConverterGraphQlClient{} -func (c FfiConverterDigest) Lift(pointer unsafe.Pointer) *Digest { - result := &Digest { +func (c FfiConverterGraphQlClient) Lift(pointer unsafe.Pointer) *GraphQlClient { + result := &GraphQlClient { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_digest(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_graphqlclient(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_digest(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_graphqlclient(pointer, status) }, ), } - runtime.SetFinalizer(result, (*Digest).Destroy) + runtime.SetFinalizer(result, (*GraphQlClient).Destroy) return result } -func (c FfiConverterDigest) Read(reader io.Reader) *Digest { +func (c FfiConverterGraphQlClient) Read(reader io.Reader) *GraphQlClient { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterDigest) Lower(value *Digest) unsafe.Pointer { +func (c FfiConverterGraphQlClient) Lower(value *GraphQlClient) 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("*Digest") + pointer := value.ffiObject.incrementPointer("*GraphQlClient") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterDigest) Write(writer io.Writer, value *Digest) { +func (c FfiConverterGraphQlClient) Write(writer io.Writer, value *GraphQlClient) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerDigest struct {} +type FfiDestroyerGraphQlClient struct {} -func (_ FfiDestroyerDigest) Destroy(value *Digest) { +func (_ FfiDestroyerGraphQlClient) Destroy(value *GraphQlClient) { value.Destroy() } -// An ed25519 public key. +// A move identifier // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// ed25519-public-key = 32OCTECT +// identifier = %x01-80 ; length of the identifier +// (ALPHA *127(ALPHA / DIGIT / UNDERSCORE)) / +// (UNDERSCORE 1*127(ALPHA / DIGIT / UNDERSCORE)) +// +// UNDERSCORE = %x95 // ``` -type Ed25519PublicKeyInterface interface { - ToBytes() []byte +type IdentifierInterface interface { + AsStr() string } -// An ed25519 public key. +// A move identifier // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// ed25519-public-key = 32OCTECT +// identifier = %x01-80 ; length of the identifier +// (ALPHA *127(ALPHA / DIGIT / UNDERSCORE)) / +// (UNDERSCORE 1*127(ALPHA / DIGIT / UNDERSCORE)) +// +// UNDERSCORE = %x95 // ``` -type Ed25519PublicKey struct { +type Identifier struct { ffiObject FfiObject } - - -func Ed25519PublicKeyFromBytes(bytes []byte) (*Ed25519PublicKey, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *Ed25519PublicKey - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterEd25519PublicKeyINSTANCE.Lift(_uniffiRV), nil - } -} - -func Ed25519PublicKeyFromStr(s string) (*Ed25519PublicKey, error) { +func NewIdentifier(identifier string) (*Identifier, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + return C.uniffi_iota_sdk_ffi_fn_constructor_identifier_new(FfiConverterStringINSTANCE.Lower(identifier),_uniffiStatus) }) if _uniffiErr != nil { - var _uniffiDefaultValue *Ed25519PublicKey + var _uniffiDefaultValue *Identifier return _uniffiDefaultValue, _uniffiErr } else { - return FfiConverterEd25519PublicKeyINSTANCE.Lift(_uniffiRV), nil + return FfiConverterIdentifierINSTANCE.Lift(_uniffiRV), nil } } -func Ed25519PublicKeyGenerate() *Ed25519PublicKey { - return FfiConverterEd25519PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_generate(_uniffiStatus) - })) -} -func (_self *Ed25519PublicKey) ToBytes() []byte { - _pointer := _self.ffiObject.incrementPointer("*Ed25519PublicKey") +func (_self *Identifier) AsStr() string { + _pointer := _self.ffiObject.incrementPointer("*Identifier") defer _self.ffiObject.decrementPointer() - return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_ed25519publickey_to_bytes( + inner: C.uniffi_iota_sdk_ffi_fn_method_identifier_as_str( _pointer,_uniffiStatus), } })) } -func (object *Ed25519PublicKey) Destroy() { +func (object *Identifier) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterEd25519PublicKey struct {} +type FfiConverterIdentifier struct {} -var FfiConverterEd25519PublicKeyINSTANCE = FfiConverterEd25519PublicKey{} +var FfiConverterIdentifierINSTANCE = FfiConverterIdentifier{} -func (c FfiConverterEd25519PublicKey) Lift(pointer unsafe.Pointer) *Ed25519PublicKey { - result := &Ed25519PublicKey { +func (c FfiConverterIdentifier) Lift(pointer unsafe.Pointer) *Identifier { + result := &Identifier { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_ed25519publickey(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_identifier(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_ed25519publickey(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_identifier(pointer, status) }, ), } - runtime.SetFinalizer(result, (*Ed25519PublicKey).Destroy) + runtime.SetFinalizer(result, (*Identifier).Destroy) return result } -func (c FfiConverterEd25519PublicKey) Read(reader io.Reader) *Ed25519PublicKey { +func (c FfiConverterIdentifier) Read(reader io.Reader) *Identifier { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterEd25519PublicKey) Lower(value *Ed25519PublicKey) unsafe.Pointer { +func (c FfiConverterIdentifier) Lower(value *Identifier) 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("*Ed25519PublicKey") + pointer := value.ffiObject.incrementPointer("*Identifier") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterEd25519PublicKey) Write(writer io.Writer, value *Ed25519PublicKey) { +func (c FfiConverterIdentifier) Write(writer io.Writer, value *Identifier) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerEd25519PublicKey struct {} +type FfiDestroyerIdentifier struct {} -func (_ FfiDestroyerEd25519PublicKey) Destroy(value *Ed25519PublicKey) { +func (_ FfiDestroyerIdentifier) Destroy(value *Identifier) { value.Destroy() } -type EffectsAuxiliaryDataDigestInterface interface { +type MoveFunctionInterface interface { } -type EffectsAuxiliaryDataDigest struct { +type MoveFunction struct { ffiObject FfiObject } -func (object *EffectsAuxiliaryDataDigest) Destroy() { +func (object *MoveFunction) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterEffectsAuxiliaryDataDigest struct {} +type FfiConverterMoveFunction struct {} -var FfiConverterEffectsAuxiliaryDataDigestINSTANCE = FfiConverterEffectsAuxiliaryDataDigest{} +var FfiConverterMoveFunctionINSTANCE = FfiConverterMoveFunction{} -func (c FfiConverterEffectsAuxiliaryDataDigest) Lift(pointer unsafe.Pointer) *EffectsAuxiliaryDataDigest { - result := &EffectsAuxiliaryDataDigest { +func (c FfiConverterMoveFunction) Lift(pointer unsafe.Pointer) *MoveFunction { + result := &MoveFunction { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_movefunction(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_effectsauxiliarydatadigest(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_movefunction(pointer, status) }, ), } - runtime.SetFinalizer(result, (*EffectsAuxiliaryDataDigest).Destroy) + runtime.SetFinalizer(result, (*MoveFunction).Destroy) return result } -func (c FfiConverterEffectsAuxiliaryDataDigest) Read(reader io.Reader) *EffectsAuxiliaryDataDigest { +func (c FfiConverterMoveFunction) Read(reader io.Reader) *MoveFunction { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterEffectsAuxiliaryDataDigest) Lower(value *EffectsAuxiliaryDataDigest) unsafe.Pointer { +func (c FfiConverterMoveFunction) Lower(value *MoveFunction) 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("*EffectsAuxiliaryDataDigest") + pointer := value.ffiObject.incrementPointer("*MoveFunction") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterEffectsAuxiliaryDataDigest) Write(writer io.Writer, value *EffectsAuxiliaryDataDigest) { +func (c FfiConverterMoveFunction) Write(writer io.Writer, value *MoveFunction) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerEffectsAuxiliaryDataDigest struct {} +type FfiDestroyerMoveFunction struct {} -func (_ FfiDestroyerEffectsAuxiliaryDataDigest) Destroy(value *EffectsAuxiliaryDataDigest) { +func (_ FfiDestroyerMoveFunction) Destroy(value *MoveFunction) { value.Destroy() } -// Operation run at the end of an epoch -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// end-of-epoch-transaction-kind = eoe-change-epoch -// =/ eoe-authenticator-state-create -// =/ eoe-authenticator-state-expire -// =/ eoe-randomness-state-create -// =/ eoe-deny-list-state-create -// =/ eoe-bridge-state-create -// =/ eoe-bridge-committee-init -// =/ eoe-store-execution-time-observations -// -// eoe-change-epoch = %x00 change-epoch -// eoe-authenticator-state-create = %x01 -// eoe-authenticator-state-expire = %x02 authenticator-state-expire -// eoe-randomness-state-create = %x03 -// eoe-deny-list-state-create = %x04 -// eoe-bridge-state-create = %x05 digest -// eoe-bridge-committee-init = %x06 u64 -// eoe-store-execution-time-observations = %x07 stored-execution-time-observations -// ``` -type EndOfEpochTransactionKindInterface interface { +type MoveModuleInterface interface { } -// Operation run at the end of an epoch -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// end-of-epoch-transaction-kind = eoe-change-epoch -// =/ eoe-authenticator-state-create -// =/ eoe-authenticator-state-expire -// =/ eoe-randomness-state-create -// =/ eoe-deny-list-state-create -// =/ eoe-bridge-state-create -// =/ eoe-bridge-committee-init -// =/ eoe-store-execution-time-observations -// -// eoe-change-epoch = %x00 change-epoch -// eoe-authenticator-state-create = %x01 -// eoe-authenticator-state-expire = %x02 authenticator-state-expire -// eoe-randomness-state-create = %x03 -// eoe-deny-list-state-create = %x04 -// eoe-bridge-state-create = %x05 digest -// eoe-bridge-committee-init = %x06 u64 -// eoe-store-execution-time-observations = %x07 stored-execution-time-observations -// ``` -type EndOfEpochTransactionKind struct { +type MoveModule struct { ffiObject FfiObject } -func EndOfEpochTransactionKindAuthenticatorStateCreate() *EndOfEpochTransactionKind { - return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_create(_uniffiStatus) - })) -} - -func EndOfEpochTransactionKindAuthenticatorStateExpire(tx *AuthenticatorStateExpire) *EndOfEpochTransactionKind { - return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_expire(FfiConverterAuthenticatorStateExpireINSTANCE.Lower(tx),_uniffiStatus) - })) -} - -func EndOfEpochTransactionKindChangeEpoch(tx *ChangeEpoch) *EndOfEpochTransactionKind { - return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch(FfiConverterChangeEpochINSTANCE.Lower(tx),_uniffiStatus) - })) -} - -func EndOfEpochTransactionKindChangeEpochV2(tx *ChangeEpochV2) *EndOfEpochTransactionKind { - return FfiConverterEndOfEpochTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch_v2(FfiConverterChangeEpochV2INSTANCE.Lower(tx),_uniffiStatus) - })) -} - -func (object *EndOfEpochTransactionKind) Destroy() { +func (object *MoveModule) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterEndOfEpochTransactionKind struct {} +type FfiConverterMoveModule struct {} -var FfiConverterEndOfEpochTransactionKindINSTANCE = FfiConverterEndOfEpochTransactionKind{} +var FfiConverterMoveModuleINSTANCE = FfiConverterMoveModule{} -func (c FfiConverterEndOfEpochTransactionKind) Lift(pointer unsafe.Pointer) *EndOfEpochTransactionKind { - result := &EndOfEpochTransactionKind { +func (c FfiConverterMoveModule) Lift(pointer unsafe.Pointer) *MoveModule { + result := &MoveModule { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_endofepochtransactionkind(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_movemodule(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_endofepochtransactionkind(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_movemodule(pointer, status) }, ), } - runtime.SetFinalizer(result, (*EndOfEpochTransactionKind).Destroy) + runtime.SetFinalizer(result, (*MoveModule).Destroy) return result } -func (c FfiConverterEndOfEpochTransactionKind) Read(reader io.Reader) *EndOfEpochTransactionKind { +func (c FfiConverterMoveModule) Read(reader io.Reader) *MoveModule { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterEndOfEpochTransactionKind) Lower(value *EndOfEpochTransactionKind) unsafe.Pointer { +func (c FfiConverterMoveModule) Lower(value *MoveModule) 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("*EndOfEpochTransactionKind") + pointer := value.ffiObject.incrementPointer("*MoveModule") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterEndOfEpochTransactionKind) Write(writer io.Writer, value *EndOfEpochTransactionKind) { +func (c FfiConverterMoveModule) Write(writer io.Writer, value *MoveModule) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerEndOfEpochTransactionKind struct {} +type FfiDestroyerMoveModule struct {} -func (_ FfiDestroyerEndOfEpochTransactionKind) Destroy(value *EndOfEpochTransactionKind) { +func (_ FfiDestroyerMoveModule) Destroy(value *MoveModule) { value.Destroy() } -type EpochInterface interface { +// A move package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// object-move-package = object-id u64 move-modules type-origin-table linkage-table +// +// move-modules = map (identifier bytes) +// type-origin-table = vector type-origin +// linkage-table = map (object-id upgrade-info) +// ``` +type MovePackageInterface interface { } -type Epoch struct { +// A move package +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// object-move-package = object-id u64 move-modules type-origin-table linkage-table +// +// move-modules = map (identifier bytes) +// type-origin-table = vector type-origin +// linkage-table = map (object-id upgrade-info) +// ``` +type MovePackage struct { ffiObject FfiObject } +func NewMovePackage(id *ObjectId, version uint64, modules map[*Identifier][]byte, typeOriginTable []TypeOrigin, linkageTable map[*ObjectId]UpgradeInfo) (*MovePackage, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new(FfiConverterObjectIdINSTANCE.Lower(id), FfiConverterUint64INSTANCE.Lower(version), FfiConverterMapIdentifierBytesINSTANCE.Lower(modules), FfiConverterSequenceTypeOriginINSTANCE.Lower(typeOriginTable), FfiConverterMapObjectIdUpgradeInfoINSTANCE.Lower(linkageTable),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *MovePackage + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterMovePackageINSTANCE.Lift(_uniffiRV), nil + } +} -func (object *Epoch) Destroy() { +func (object *MovePackage) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterEpoch struct {} +type FfiConverterMovePackage struct {} -var FfiConverterEpochINSTANCE = FfiConverterEpoch{} +var FfiConverterMovePackageINSTANCE = FfiConverterMovePackage{} -func (c FfiConverterEpoch) Lift(pointer unsafe.Pointer) *Epoch { - result := &Epoch { +func (c FfiConverterMovePackage) Lift(pointer unsafe.Pointer) *MovePackage { + result := &MovePackage { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_epoch(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_epoch(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_movepackage(pointer, status) }, ), } - runtime.SetFinalizer(result, (*Epoch).Destroy) + runtime.SetFinalizer(result, (*MovePackage).Destroy) return result } -func (c FfiConverterEpoch) Read(reader io.Reader) *Epoch { +func (c FfiConverterMovePackage) Read(reader io.Reader) *MovePackage { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterEpoch) Lower(value *Epoch) unsafe.Pointer { +func (c FfiConverterMovePackage) Lower(value *MovePackage) unsafe.Pointer { // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, // because the pointer will be decremented immediately after this function returns, // and someone will be left holding onto a non-locked pointer. - pointer := value.ffiObject.incrementPointer("*Epoch") + pointer := value.ffiObject.incrementPointer("*MovePackage") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterEpoch) Write(writer io.Writer, value *Epoch) { +func (c FfiConverterMovePackage) Write(writer io.Writer, value *MovePackage) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerEpoch struct {} +type FfiDestroyerMovePackage struct {} -func (_ FfiDestroyerEpoch) Destroy(value *Epoch) { +func (_ FfiDestroyerMovePackage) Destroy(value *MovePackage) { value.Destroy() } -type ExecutionTimeObservationsInterface interface { -} -type ExecutionTimeObservations struct { +// Aggregated signature from members of a multisig committee. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-aggregated-signature = (vector multisig-member-signature) +// u16 ; bitmap +// multisig-committee +// ``` +// +// There is also a legacy encoding for this type defined as: +// +// ```text +// legacy-multisig-aggregated-signature = (vector multisig-member-signature) +// roaring-bitmap ; bitmap +// legacy-multisig-committee +// roaring-bitmap = bytes ; where the contents of the bytes are valid +// ; according to the serialized spec for +// ; roaring bitmaps +// ``` +// +// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +// serialized format of RoaringBitmaps. +type MultisigAggregatedSignatureInterface interface { + // The bitmap that indicates which committee members provided their + // signature. + Bitmap() uint16 + Committee() *MultisigCommittee + // The list of signatures from committee members + Signatures() []*MultisigMemberSignature +} +// Aggregated signature from members of a multisig committee. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-aggregated-signature = (vector multisig-member-signature) +// u16 ; bitmap +// multisig-committee +// ``` +// +// There is also a legacy encoding for this type defined as: +// +// ```text +// legacy-multisig-aggregated-signature = (vector multisig-member-signature) +// roaring-bitmap ; bitmap +// legacy-multisig-committee +// roaring-bitmap = bytes ; where the contents of the bytes are valid +// ; according to the serialized spec for +// ; roaring bitmaps +// ``` +// +// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +// serialized format of RoaringBitmaps. +type MultisigAggregatedSignature struct { ffiObject FfiObject } +// Construct a new aggregated multisig signature. +// +// Since the list of signatures doesn't contain sufficient information to +// identify which committee member provided the signature, it is up to +// the caller to ensure that the provided signature list is in the same +// order as it's corresponding member in the provided committee +// and that it's position in the provided bitmap is set. +func NewMultisigAggregatedSignature(committee *MultisigCommittee, signatures []*MultisigMemberSignature, bitmap uint16) *MultisigAggregatedSignature { + return FfiConverterMultisigAggregatedSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_multisigaggregatedsignature_new(FfiConverterMultisigCommitteeINSTANCE.Lower(committee), FfiConverterSequenceMultisigMemberSignatureINSTANCE.Lower(signatures), FfiConverterUint16INSTANCE.Lower(bitmap),_uniffiStatus) + })) +} -func (object *ExecutionTimeObservations) Destroy() { + +// The bitmap that indicates which committee members provided their +// signature. +func (_self *MultisigAggregatedSignature) Bitmap() uint16 { + _pointer := _self.ffiObject.incrementPointer("*MultisigAggregatedSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint16INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_bitmap( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigAggregatedSignature) Committee() *MultisigCommittee { + _pointer := _self.ffiObject.incrementPointer("*MultisigAggregatedSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterMultisigCommitteeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_committee( + _pointer,_uniffiStatus) + })) +} + +// The list of signatures from committee members +func (_self *MultisigAggregatedSignature) Signatures() []*MultisigMemberSignature { + _pointer := _self.ffiObject.incrementPointer("*MultisigAggregatedSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceMultisigMemberSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_signatures( + _pointer,_uniffiStatus), + } + })) +} +func (object *MultisigAggregatedSignature) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterExecutionTimeObservations struct {} +type FfiConverterMultisigAggregatedSignature struct {} -var FfiConverterExecutionTimeObservationsINSTANCE = FfiConverterExecutionTimeObservations{} +var FfiConverterMultisigAggregatedSignatureINSTANCE = FfiConverterMultisigAggregatedSignature{} -func (c FfiConverterExecutionTimeObservations) Lift(pointer unsafe.Pointer) *ExecutionTimeObservations { - result := &ExecutionTimeObservations { +func (c FfiConverterMultisigAggregatedSignature) Lift(pointer unsafe.Pointer) *MultisigAggregatedSignature { + result := &MultisigAggregatedSignature { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_executiontimeobservations(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_multisigaggregatedsignature(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_executiontimeobservations(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_multisigaggregatedsignature(pointer, status) }, ), } - runtime.SetFinalizer(result, (*ExecutionTimeObservations).Destroy) + runtime.SetFinalizer(result, (*MultisigAggregatedSignature).Destroy) return result } -func (c FfiConverterExecutionTimeObservations) Read(reader io.Reader) *ExecutionTimeObservations { +func (c FfiConverterMultisigAggregatedSignature) Read(reader io.Reader) *MultisigAggregatedSignature { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterExecutionTimeObservations) Lower(value *ExecutionTimeObservations) unsafe.Pointer { +func (c FfiConverterMultisigAggregatedSignature) Lower(value *MultisigAggregatedSignature) 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("*ExecutionTimeObservations") + pointer := value.ffiObject.incrementPointer("*MultisigAggregatedSignature") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterExecutionTimeObservations) Write(writer io.Writer, value *ExecutionTimeObservations) { +func (c FfiConverterMultisigAggregatedSignature) Write(writer io.Writer, value *MultisigAggregatedSignature) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerExecutionTimeObservations struct {} +type FfiDestroyerMultisigAggregatedSignature struct {} -func (_ FfiDestroyerExecutionTimeObservations) Destroy(value *ExecutionTimeObservations) { +func (_ FfiDestroyerMultisigAggregatedSignature) Destroy(value *MultisigAggregatedSignature) { value.Destroy() } -type FaucetClientInterface interface { - // Request gas from the faucet. Note that this will return the UUID of the - // request and not wait until the token is received. Use - // `request_and_wait` to wait for the token. - Request(address *Address) (*string, error) - // Request gas from the faucet and wait until the request is completed and - // token is transferred. Returns `FaucetReceipt` if the request is - // successful, which contains the list of tokens transferred, and the - // transaction digest. - // - // Note that the faucet is heavily rate-limited, so calling repeatedly the - // faucet would likely result in a 429 code or 502 code. - RequestAndWait(address *Address) (**FaucetReceipt, error) - // Check the faucet request status. +// A multisig committee +// +// A `MultisigCommittee` is a set of members who collectively control a single +// `Address` on the IOTA blockchain. The number of required signautres to +// authorize the execution of a transaction is determined by +// `(signature_0_weight + signature_1_weight ..) >= threshold`. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-committee = (vector multisig-member) +// u16 ; threshold +// ``` +// +// There is also a legacy encoding for this type defined as: +// +// ```text +// legacy-multisig-committee = (vector legacy-multisig-member) +// u16 ; threshold +// ``` +type MultisigCommitteeInterface interface { + // Checks if the Committee is valid. // - // Possible statuses are defined in: [`BatchSendStatusType`] - RequestStatus(id string) (**BatchSendStatus, error) -} -type FaucetClient struct { + // A valid committee is one that: + // - Has a nonzero threshold + // - Has at least one member + // - Has at most ten members + // - No member has weight 0 + // - the sum of the weights of all members must be larger than the + // threshold + // - contains no duplicate members + IsValid() bool + // The members of the committee + Members() []*MultisigMember + // Return the flag for this signature scheme + Scheme() SignatureScheme + // The total signature weight required to authorize a transaction for the + // address corresponding to this `MultisigCommittee`. + Threshold() uint16 +} +// A multisig committee +// +// A `MultisigCommittee` is a set of members who collectively control a single +// `Address` on the IOTA blockchain. The number of required signautres to +// authorize the execution of a transaction is determined by +// `(signature_0_weight + signature_1_weight ..) >= threshold`. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-committee = (vector multisig-member) +// u16 ; threshold +// ``` +// +// There is also a legacy encoding for this type defined as: +// +// ```text +// legacy-multisig-committee = (vector legacy-multisig-member) +// u16 ; threshold +// ``` +type MultisigCommittee struct { ffiObject FfiObject } -// Construct a new `FaucetClient` with the given faucet service URL. This -// [`FaucetClient`] expects that the service provides two endpoints: -// /v1/gas and /v1/status. As such, do not provide the request -// endpoint, just the top level service endpoint. +// Construct a new committee from a list of `MultisigMember`s and a +// `threshold`. // -// - /v1/gas is used to request gas -// - /v1/status/taks-uuid is used to check the status of the request -func NewFaucetClient(faucetUrl string) *FaucetClient { - return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_new(FfiConverterStringINSTANCE.Lower(faucetUrl),_uniffiStatus) +// Note that the order of the members is significant towards deriving the +// `Address` governed by this committee. +func NewMultisigCommittee(members []*MultisigMember, threshold uint16) *MultisigCommittee { + return FfiConverterMultisigCommitteeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_multisigcommittee_new(FfiConverterSequenceMultisigMemberINSTANCE.Lower(members), FfiConverterUint16INSTANCE.Lower(threshold),_uniffiStatus) })) } -// Set to devnet faucet. -func FaucetClientDevnet() *FaucetClient { - return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_devnet(_uniffiStatus) + + +// Checks if the Committee is valid. +// +// A valid committee is one that: +// - Has a nonzero threshold +// - Has at least one member +// - Has at most ten members +// - No member has weight 0 +// - the sum of the weights of all members must be larger than the +// threshold +// - contains no duplicate members +func (_self *MultisigCommittee) IsValid() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigCommittee") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_is_valid( + _pointer,_uniffiStatus) })) } -// Set to local faucet. -func FaucetClientLocal() *FaucetClient { - return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_local(_uniffiStatus) +// The members of the committee +func (_self *MultisigCommittee) Members() []*MultisigMember { + _pointer := _self.ffiObject.incrementPointer("*MultisigCommittee") + defer _self.ffiObject.decrementPointer() + return FfiConverterSequenceMultisigMemberINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_members( + _pointer,_uniffiStatus), + } })) } -// Set to testnet faucet. -func FaucetClientTestnet() *FaucetClient { - return FfiConverterFaucetClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_testnet(_uniffiStatus) +// Return the flag for this signature scheme +func (_self *MultisigCommittee) Scheme() SignatureScheme { + _pointer := _self.ffiObject.incrementPointer("*MultisigCommittee") + defer _self.ffiObject.decrementPointer() + return FfiConverterSignatureSchemeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_scheme( + _pointer,_uniffiStatus), + } })) } +// The total signature weight required to authorize a transaction for the +// address corresponding to this `MultisigCommittee`. +func (_self *MultisigCommittee) Threshold() uint16 { + _pointer := _self.ffiObject.incrementPointer("*MultisigCommittee") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint16INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_threshold( + _pointer,_uniffiStatus) + })) +} +func (object *MultisigCommittee) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} +type FfiConverterMultisigCommittee struct {} -// Request gas from the faucet. Note that this will return the UUID of the -// request and not wait until the token is received. Use -// `request_and_wait` to wait for the token. -func (_self *FaucetClient) Request(address *Address) (*string, error) { - _pointer := _self.ffiObject.incrementPointer("*FaucetClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, +var FfiConverterMultisigCommitteeINSTANCE = FfiConverterMultisigCommittee{} + + +func (c FfiConverterMultisigCommittee) Lift(pointer unsafe.Pointer) *MultisigCommittee { + result := &MultisigCommittee { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_multisigcommittee(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_multisigcommittee(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) *string { - return FfiConverterOptionalStringINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_faucetclient_request( - _pointer,FfiConverterAddressINSTANCE.Lower(address)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*MultisigCommittee).Destroy) + return result +} - return res, err +func (c FfiConverterMultisigCommittee) Read(reader io.Reader) *MultisigCommittee { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Request gas from the faucet and wait until the request is completed and -// token is transferred. Returns `FaucetReceipt` if the request is -// successful, which contains the list of tokens transferred, and the -// transaction digest. -// -// Note that the faucet is heavily rate-limited, so calling repeatedly the -// faucet would likely result in a 429 code or 502 code. -func (_self *FaucetClient) RequestAndWait(address *Address) (**FaucetReceipt, error) { - _pointer := _self.ffiObject.incrementPointer("*FaucetClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **FaucetReceipt { - return FfiConverterOptionalFaucetReceiptINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_and_wait( - _pointer,FfiConverterAddressINSTANCE.Lower(address)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterMultisigCommittee) Lower(value *MultisigCommittee) 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("*MultisigCommittee") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterMultisigCommittee) Write(writer io.Writer, value *MultisigCommittee) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} - return res, err +type FfiDestroyerMultisigCommittee struct {} + +func (_ FfiDestroyerMultisigCommittee) Destroy(value *MultisigCommittee) { + value.Destroy() } -// Check the faucet request status. + + +// A member in a multisig committee // -// Possible statuses are defined in: [`BatchSendStatusType`] -func (_self *FaucetClient) RequestStatus(id string) (**BatchSendStatus, error) { - _pointer := _self.ffiObject.incrementPointer("*FaucetClient") +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-member = multisig-member-public-key +// u8 ; weight +// ``` +// +// There is also a legacy encoding for this type defined as: +// +// ```text +// legacy-multisig-member = legacy-multisig-member-public-key +// u8 ; weight +// ``` +type MultisigMemberInterface interface { + // This member's public key. + PublicKey() *MultisigMemberPublicKey + // Weight of this member's signature. + Weight() uint8 +} +// A member in a multisig committee +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-member = multisig-member-public-key +// u8 ; weight +// ``` +// +// There is also a legacy encoding for this type defined as: +// +// ```text +// legacy-multisig-member = legacy-multisig-member-public-key +// u8 ; weight +// ``` +type MultisigMember struct { + ffiObject FfiObject +} +// Construct a new member from a `MultisigMemberPublicKey` and a `weight`. +func NewMultisigMember(publicKey *MultisigMemberPublicKey, weight uint8) *MultisigMember { + return FfiConverterMultisigMemberINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_multisigmember_new(FfiConverterMultisigMemberPublicKeyINSTANCE.Lower(publicKey), FfiConverterUint8INSTANCE.Lower(weight),_uniffiStatus) + })) +} + + + + +// This member's public key. +func (_self *MultisigMember) PublicKey() *MultisigMemberPublicKey { + _pointer := _self.ffiObject.incrementPointer("*MultisigMember") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **BatchSendStatus { - return FfiConverterOptionalBatchSendStatusINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_status( - _pointer,FfiConverterStringINSTANCE.Lower(id)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + return FfiConverterMultisigMemberPublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmember_public_key( + _pointer,_uniffiStatus) + })) +} - return res, err +// Weight of this member's signature. +func (_self *MultisigMember) Weight() uint8 { + _pointer := _self.ffiObject.incrementPointer("*MultisigMember") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint8INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmember_weight( + _pointer,_uniffiStatus) + })) } -func (object *FaucetClient) Destroy() { +func (object *MultisigMember) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterFaucetClient struct {} +type FfiConverterMultisigMember struct {} -var FfiConverterFaucetClientINSTANCE = FfiConverterFaucetClient{} +var FfiConverterMultisigMemberINSTANCE = FfiConverterMultisigMember{} -func (c FfiConverterFaucetClient) Lift(pointer unsafe.Pointer) *FaucetClient { - result := &FaucetClient { +func (c FfiConverterMultisigMember) Lift(pointer unsafe.Pointer) *MultisigMember { + result := &MultisigMember { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_faucetclient(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_multisigmember(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_faucetclient(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_multisigmember(pointer, status) }, ), } - runtime.SetFinalizer(result, (*FaucetClient).Destroy) + runtime.SetFinalizer(result, (*MultisigMember).Destroy) return result } -func (c FfiConverterFaucetClient) Read(reader io.Reader) *FaucetClient { +func (c FfiConverterMultisigMember) Read(reader io.Reader) *MultisigMember { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterFaucetClient) Lower(value *FaucetClient) unsafe.Pointer { +func (c FfiConverterMultisigMember) Lower(value *MultisigMember) 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("*FaucetClient") + pointer := value.ffiObject.incrementPointer("*MultisigMember") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterFaucetClient) Write(writer io.Writer, value *FaucetClient) { +func (c FfiConverterMultisigMember) Write(writer io.Writer, value *MultisigMember) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerFaucetClient struct {} +type FfiDestroyerMultisigMember struct {} -func (_ FfiDestroyerFaucetClient) Destroy(value *FaucetClient) { +func (_ FfiDestroyerMultisigMember) Destroy(value *MultisigMember) { value.Destroy() } -type FaucetReceiptInterface interface { +type MultisigMemberPublicKeyInterface interface { + AsEd25519() *Ed25519PublicKey + AsEd25519Opt() **Ed25519PublicKey + AsSecp256k1() *Secp256k1PublicKey + AsSecp256k1Opt() **Secp256k1PublicKey + AsSecp256r1() *Secp256r1PublicKey + AsSecp256r1Opt() **Secp256r1PublicKey + AsZklogin() *ZkLoginPublicIdentifier + AsZkloginOpt() **ZkLoginPublicIdentifier + IsEd25519() bool + IsSecp256k1() bool + IsSecp256r1() bool + IsZklogin() bool } -type FaucetReceipt struct { +type MultisigMemberPublicKey struct { ffiObject FfiObject } -func (object *FaucetReceipt) Destroy() { + +func (_self *MultisigMemberPublicKey) AsEd25519() *Ed25519PublicKey { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterEd25519PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberPublicKey) AsEd25519Opt() **Ed25519PublicKey { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalEd25519PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberPublicKey) AsSecp256k1() *Secp256k1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberPublicKey) AsSecp256k1Opt() **Secp256k1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256k1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberPublicKey) AsSecp256r1() *Secp256r1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberPublicKey) AsSecp256r1Opt() **Secp256r1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256r1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberPublicKey) AsZklogin() *ZkLoginPublicIdentifier { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterZkLoginPublicIdentifierINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberPublicKey) AsZkloginOpt() **ZkLoginPublicIdentifier { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalZkLoginPublicIdentifierINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberPublicKey) IsEd25519() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_ed25519( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberPublicKey) IsSecp256k1() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256k1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberPublicKey) IsSecp256r1() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256r1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberPublicKey) IsZklogin() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberPublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_zklogin( + _pointer,_uniffiStatus) + })) +} +func (object *MultisigMemberPublicKey) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterFaucetReceipt struct {} +type FfiConverterMultisigMemberPublicKey struct {} -var FfiConverterFaucetReceiptINSTANCE = FfiConverterFaucetReceipt{} +var FfiConverterMultisigMemberPublicKeyINSTANCE = FfiConverterMultisigMemberPublicKey{} -func (c FfiConverterFaucetReceipt) Lift(pointer unsafe.Pointer) *FaucetReceipt { - result := &FaucetReceipt { +func (c FfiConverterMultisigMemberPublicKey) Lift(pointer unsafe.Pointer) *MultisigMemberPublicKey { + result := &MultisigMemberPublicKey { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_faucetreceipt(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_multisigmemberpublickey(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_faucetreceipt(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_multisigmemberpublickey(pointer, status) }, ), } - runtime.SetFinalizer(result, (*FaucetReceipt).Destroy) + runtime.SetFinalizer(result, (*MultisigMemberPublicKey).Destroy) return result } -func (c FfiConverterFaucetReceipt) Read(reader io.Reader) *FaucetReceipt { +func (c FfiConverterMultisigMemberPublicKey) Read(reader io.Reader) *MultisigMemberPublicKey { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterFaucetReceipt) Lower(value *FaucetReceipt) unsafe.Pointer { +func (c FfiConverterMultisigMemberPublicKey) Lower(value *MultisigMemberPublicKey) 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("*FaucetReceipt") + pointer := value.ffiObject.incrementPointer("*MultisigMemberPublicKey") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterFaucetReceipt) Write(writer io.Writer, value *FaucetReceipt) { +func (c FfiConverterMultisigMemberPublicKey) Write(writer io.Writer, value *MultisigMemberPublicKey) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerFaucetReceipt struct {} +type FfiDestroyerMultisigMemberPublicKey struct {} -func (_ FfiDestroyerFaucetReceipt) Destroy(value *FaucetReceipt) { +func (_ FfiDestroyerMultisigMemberPublicKey) Destroy(value *MultisigMemberPublicKey) { value.Destroy() } -type GenesisTransactionInterface interface { -} -type GenesisTransaction struct { +// A signature from a member of a multisig committee. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-member-signature = ed25519-multisig-member-signature / +// secp256k1-multisig-member-signature / +// secp256r1-multisig-member-signature / +// zklogin-multisig-member-signature +// +// ed25519-multisig-member-signature = %x00 ed25519-signature +// secp256k1-multisig-member-signature = %x01 secp256k1-signature +// secp256r1-multisig-member-signature = %x02 secp256r1-signature +// zklogin-multisig-member-signature = %x03 zklogin-authenticator +// ``` +type MultisigMemberSignatureInterface interface { + AsEd25519() *Ed25519Signature + AsEd25519Opt() **Ed25519Signature + AsSecp256k1() *Secp256k1Signature + AsSecp256k1Opt() **Secp256k1Signature + AsSecp256r1() *Secp256r1Signature + AsSecp256r1Opt() **Secp256r1Signature + AsZklogin() *ZkLoginAuthenticator + AsZkloginOpt() **ZkLoginAuthenticator + IsEd25519() bool + IsSecp256k1() bool + IsSecp256r1() bool + IsZklogin() bool +} +// A signature from a member of a multisig committee. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// multisig-member-signature = ed25519-multisig-member-signature / +// secp256k1-multisig-member-signature / +// secp256r1-multisig-member-signature / +// zklogin-multisig-member-signature +// +// ed25519-multisig-member-signature = %x00 ed25519-signature +// secp256k1-multisig-member-signature = %x01 secp256k1-signature +// secp256r1-multisig-member-signature = %x02 secp256r1-signature +// zklogin-multisig-member-signature = %x03 zklogin-authenticator +// ``` +type MultisigMemberSignature struct { ffiObject FfiObject } -func (object *GenesisTransaction) Destroy() { + +func (_self *MultisigMemberSignature) AsEd25519() *Ed25519Signature { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterEd25519SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberSignature) AsEd25519Opt() **Ed25519Signature { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalEd25519SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberSignature) AsSecp256k1() *Secp256k1Signature { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256k1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberSignature) AsSecp256k1Opt() **Secp256k1Signature { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256k1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberSignature) AsSecp256r1() *Secp256r1Signature { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256r1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberSignature) AsSecp256r1Opt() **Secp256r1Signature { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256r1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberSignature) AsZklogin() *ZkLoginAuthenticator { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterZkLoginAuthenticatorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberSignature) AsZkloginOpt() **ZkLoginAuthenticator { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalZkLoginAuthenticatorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin_opt( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *MultisigMemberSignature) IsEd25519() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_ed25519( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberSignature) IsSecp256k1() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256k1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberSignature) IsSecp256r1() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256r1( + _pointer,_uniffiStatus) + })) +} + +func (_self *MultisigMemberSignature) IsZklogin() bool { + _pointer := _self.ffiObject.incrementPointer("*MultisigMemberSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_zklogin( + _pointer,_uniffiStatus) + })) +} +func (object *MultisigMemberSignature) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterGenesisTransaction struct {} +type FfiConverterMultisigMemberSignature struct {} -var FfiConverterGenesisTransactionINSTANCE = FfiConverterGenesisTransaction{} +var FfiConverterMultisigMemberSignatureINSTANCE = FfiConverterMultisigMemberSignature{} -func (c FfiConverterGenesisTransaction) Lift(pointer unsafe.Pointer) *GenesisTransaction { - result := &GenesisTransaction { +func (c FfiConverterMultisigMemberSignature) Lift(pointer unsafe.Pointer) *MultisigMemberSignature { + result := &MultisigMemberSignature { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_genesistransaction(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_multisigmembersignature(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_genesistransaction(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_multisigmembersignature(pointer, status) }, ), } - runtime.SetFinalizer(result, (*GenesisTransaction).Destroy) + runtime.SetFinalizer(result, (*MultisigMemberSignature).Destroy) return result } -func (c FfiConverterGenesisTransaction) Read(reader io.Reader) *GenesisTransaction { +func (c FfiConverterMultisigMemberSignature) Read(reader io.Reader) *MultisigMemberSignature { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterGenesisTransaction) Lower(value *GenesisTransaction) unsafe.Pointer { +func (c FfiConverterMultisigMemberSignature) Lower(value *MultisigMemberSignature) 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("*GenesisTransaction") + pointer := value.ffiObject.incrementPointer("*MultisigMemberSignature") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterGenesisTransaction) Write(writer io.Writer, value *GenesisTransaction) { +func (c FfiConverterMultisigMemberSignature) Write(writer io.Writer, value *MultisigMemberSignature) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerGenesisTransaction struct {} +type FfiDestroyerMultisigMemberSignature struct {} -func (_ FfiDestroyerGenesisTransaction) Destroy(value *GenesisTransaction) { +func (_ FfiDestroyerMultisigMemberSignature) Destroy(value *MultisigMemberSignature) { value.Destroy() } -type GraphQlClientInterface interface { - // Get the list of active validators for the provided epoch, including - // related metadata. If no epoch is provided, it will return the active - // validators for the current epoch. - ActiveValidators(paginationFilter PaginationFilter, epoch *uint64) (ValidatorPage, error) - // Get the balance of all the coins owned by address for the provided coin - // type. Coin type will default to `0x2::coin::Coin<0x2::iota::IOTA>` - // if not provided. - Balance(address *Address, coinType *string) (*uint64, error) - // Get the chain identifier. - 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. - Checkpoint(digest **CheckpointContentsDigest, 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. - CoinMetadata(coinType string) (**CoinMetadata, error) - // Get the list of coins for the specified address. - // - // If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - // which will return all coins. For IOTA coin, pass in the coin type: - // `0x2::coin::Coin<0x2::iota::IOTA>`. - Coins(owner *Address, paginationFilter PaginationFilter, coinType *string) (CoinPage, error) - // Dry run a [`Transaction`] and return the transaction effects and dry run - // error (if any). - // - // `skipChecks` optional flag disables the usual verification checks that - // prevent access to objects that are owned by addresses other than the - // sender, and calling non-public, non-entry functions, and some other - // checks. Defaults to false. - DryRunTx(tx *Transaction, skipChecks *bool) (DryRunResult, error) - // Dry run a [`TransactionKind`] and return the transaction effects and dry - // run error (if any). - // - // `skipChecks` optional flag disables the usual verification checks that - // prevent access to objects that are owned by addresses other than the - // sender, and calling non-public, non-entry functions, and some other - // checks. Defaults to false. - // - // `tx_meta` is the transaction metadata. - DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks *bool) (DryRunResult, error) - // Access a dynamic field on an object using its name. Names are arbitrary - // Move values whose type have copy, drop, and store, and are specified - // using their type, and their BCS contents, Base64 encoded. - // - // The `name` argument is a json serialized type. - // - // This returns [`DynamicFieldOutput`] which contains the name, the value - // as json, and object. - // - // # Example - // ```rust,ignore - // - // let client = iota_graphql_client::Client::new_devnet(); - // let address = Address::from_str("0x5").unwrap(); - // let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); - // - // # alternatively, pass in the bcs bytes - // let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); - // let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); - // ``` - DynamicField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) - // Get a page of dynamic fields for the provided address. Note that this - // will also fetch dynamic fields on wrapped objects. - // - // This returns [`Page`] of [`DynamicFieldOutput`]s. - DynamicFields(address *Address, paginationFilter PaginationFilter) (DynamicFieldOutputPage, error) - // Access a dynamic object field on an object using its name. Names are - // arbitrary Move values whose type have copy, drop, and store, and are - // specified using their type, and their BCS contents, Base64 encoded. - // - // The `name` argument is a json serialized type. - // - // This returns [`DynamicFieldOutput`] which contains the name, the value - // as json, and object. - DynamicObjectField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) - // Return the epoch information for the provided epoch. If no epoch is - // provided, it will return the last known epoch. - Epoch(epoch *uint64) (**Epoch, error) - // Return the number of checkpoints in this epoch. This will return - // `Ok(None)` if the epoch requested is not available in the GraphQL - // service (e.g., due to pruning). - EpochTotalCheckpoints(epoch *uint64) (*uint64, error) - // Return the number of transaction blocks in this epoch. This will return - // `Ok(None)` if the epoch requested is not available in the GraphQL - // service (e.g., due to pruning). - EpochTotalTransactionBlocks(epoch *uint64) (*uint64, error) - // Return a page of tuple (event, transaction digest) based on the - // (optional) event filter. - Events(paginationFilter PaginationFilter, filter *EventFilter) (EventPage, error) - // Execute a transaction. - ExecuteTx(signatures []*UserSignature, tx *Transaction) (**TransactionEffects, error) - // Return the sequence number of the latest checkpoint that has been - // executed. - LatestCheckpointSequenceNumber() (*uint64, error) - // Lazily fetch the max page size - MaxPageSize() (int32, error) - // Return the contents' JSON of an object that is a Move object. - // - // If the object does not exist (e.g., due to pruning), this will return - // `Ok(None)`. Similarly, if this is not an object but an address, it - // will return `Ok(None)`. - MoveObjectContents(objectId *ObjectId, version *uint64) (*Value, error) - // Return the BCS of an object that is a Move object. - // - // If the object does not exist (e.g., due to pruning), this will return - // `Ok(None)`. Similarly, if this is not an object but an address, it - // will return `Ok(None)`. - MoveObjectContentsBcs(objectId *ObjectId, version *uint64) (*[]byte, error) - // Return the normalized Move function data for the provided package, - // module, and function. - NormalizedMoveFunction(varPackage string, module string, function string, version *uint64) (**MoveFunction, error) - // Return the normalized Move module data for the provided module. - NormalizedMoveModule(varPackage string, module string, paginationFilterEnums PaginationFilter, paginationFilterFriends PaginationFilter, paginationFilterFunctions PaginationFilter, paginationFilterStructs PaginationFilter, version *uint64) (**MoveModule, error) - // Return an object based on the provided [`Address`]. - // - // If the object does not exist (e.g., due to pruning), this will return - // `Ok(None)`. Similarly, if this is not an object but an address, it - // will return `Ok(None)`. - Object(objectId *ObjectId, version *uint64) (**Object, error) - // Return the object's bcs content [`Vec`] based on the provided - // [`Address`]. - ObjectBcs(objectId *ObjectId) (*[]byte, error) - // Return a page of objects based on the provided parameters. - // - // Use this function together with the [`ObjectFilter::owner`] to get the - // objects owned by an address. - // - // # Example - // - // ```rust,ignore - // let filter = ObjectFilter { - // type_tag: None, - // owner: Some(Address::from_str("test").unwrap().into()), - // object_ids: None, - // }; - // - // let owned_objects = client.objects(None, None, Some(filter), None, None).await; - // ``` - Objects(paginationFilter PaginationFilter, filter *ObjectFilter) (ObjectPage, error) - // The package corresponding to the given address (at the optionally given - // version). When no version is given, the package is loaded directly - // from the address given. Otherwise, the address is translated before - // loading to point to the package whose original ID matches - // the package at address, but whose version is version. For non-system - // packages, this might result in a different address than address - // because different versions of a package, introduced by upgrades, - // exist at distinct addresses. - // - // Note that this interpretation of version is different from a historical - // object read (the interpretation of version for the object query). - Package(address *Address, version *uint64) (**MovePackage, error) - // Fetch the latest version of the package at address. - // This corresponds to the package with the highest version that shares its - // original ID with the package at address. - PackageLatest(address *Address) (**MovePackage, error) - // Fetch all versions of package at address (packages that share this - // package's original ID), optionally bounding the versions exclusively - // from below with afterVersion, or from above with beforeVersion. - PackageVersions(address *Address, paginationFilter PaginationFilter, afterVersion *uint64, beforeVersion *uint64) (MovePackagePage, error) - // The Move packages that exist in the network, optionally filtered to be - // strictly before beforeCheckpoint and/or strictly after - // afterCheckpoint. - // - // This query returns all versions of a given user package that appear - // between the specified checkpoints, but only records the latest - // versions of system packages. - Packages(paginationFilter PaginationFilter, afterCheckpoint *uint64, beforeCheckpoint *uint64) (MovePackagePage, error) - // Get the protocol configuration. - ProtocolConfig(version *uint64) (**ProtocolConfigs, error) - // Get the reference gas price for the provided epoch or the last known one - // if no epoch is provided. +// 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 +// ``` +type ObjectInterface interface { + // Try to interpret this object as a move struct + AsStruct() *MoveStruct + // Return this object's data + Data() *ObjectData + // Return this object's id + ObjectId() *ObjectId + // Return this object's type + ObjectType() *ObjectType + // Return this object's owner + Owner() *Owner + // Return the digest of the transaction that last modified this object + PreviousTransaction() *TransactionDigest + // Return the storage rebate locked in this object // - // This will return `Ok(None)` if the epoch requested is not available in - // the GraphQL service (e.g., due to pruning). - ReferenceGasPrice(epoch *uint64) (*uint64, error) - // Get the GraphQL service configuration, including complexity limits, read - // and mutation limits, supported versions, and others. - ServiceConfig() (*ServiceConfig, error) - // Set the server address for the GraphQL GraphQL client. It should be a - // valid URL with a host and optionally a port number. - SetRpcServer(server string) error - // Get total supply for the coin type. - TotalSupply(coinType string) (*uint64, error) - // The total number of transaction blocks in the network by the end of the - // last known checkpoint. - TotalTransactionBlocks() (*uint64, error) - // The total number of transaction blocks in the network by the end of the - // provided checkpoint digest. - TotalTransactionBlocksByDigest(digest *CheckpointContentsDigest) (*uint64, error) - // The total number of transaction blocks in the network by the end of the - // provided checkpoint sequence number. - TotalTransactionBlocksBySeqNum(seqNum uint64) (*uint64, error) - // Get a transaction by its digest. - Transaction(digest *TransactionDigest) (*SignedTransaction, error) - // Get a transaction's data and effects by its digest. - TransactionDataEffects(digest *TransactionDigest) (*TransactionDataEffects, error) - // Get a transaction's effects by its digest. - TransactionEffects(digest *TransactionDigest) (**TransactionEffects, error) - // Get a page of transactions based on the provided filters. - Transactions(paginationFilter PaginationFilter, filter *TransactionsFilter) (SignedTransactionPage, error) - // Get a page of transactions' data and effects based on the provided - // filters. - TransactionsDataEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionDataEffectsPage, error) - // Get a page of transactions' effects based on the provided filters. - TransactionsEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionEffectsPage, error) + // Storage rebates are credited to the gas coin used in a transaction that + // deletes this object. + StorageRebate() uint64 + // Return this object's version + Version() uint64 } -type GraphQlClient struct { +// 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 +// ``` +type Object struct { ffiObject FfiObject } -// Create a new GraphQL client with the provided server address. -func NewGraphQlClient(server string) (*GraphQlClient, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new(FfiConverterStringINSTANCE.Lower(server),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *GraphQlClient - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterGraphQlClientINSTANCE.Lift(_uniffiRV), nil - } +func NewObject(data *ObjectData, owner *Owner, previousTransaction *TransactionDigest, storageRebate uint64) *Object { + return FfiConverterObjectINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_object_new(FfiConverterObjectDataINSTANCE.Lower(data), FfiConverterOwnerINSTANCE.Lower(owner), FfiConverterTransactionDigestINSTANCE.Lower(previousTransaction), FfiConverterUint64INSTANCE.Lower(storageRebate),_uniffiStatus) + })) } -// Create a new GraphQL client connected to the `devnet` GraphQL server: -// {DEVNET_HOST}. -func GraphQlClientNewDevnet() *GraphQlClient { - return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_devnet(_uniffiStatus) + + +// Try to interpret this object as a move struct +func (_self *Object) AsStruct() *MoveStruct { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalMoveStructINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_object_as_struct( + _pointer,_uniffiStatus), + } })) } -// Create a new GraphQL client connected to the `localhost` GraphQL server: -// {DEFAULT_LOCAL_HOST}. -func GraphQlClientNewLocalhost() *GraphQlClient { - return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_localhost(_uniffiStatus) +// Return this object's data +func (_self *Object) Data() *ObjectData { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterObjectDataINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_object_data( + _pointer,_uniffiStatus) })) } -// Create a new GraphQL client connected to the `mainnet` GraphQL server: -// {MAINNET_HOST}. -func GraphQlClientNewMainnet() *GraphQlClient { - return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_mainnet(_uniffiStatus) +// Return this object's id +func (_self *Object) ObjectId() *ObjectId { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_object_object_id( + _pointer,_uniffiStatus) })) } -// Create a new GraphQL client connected to the `testnet` GraphQL server: -// {TESTNET_HOST}. -func GraphQlClientNewTestnet() *GraphQlClient { - return FfiConverterGraphQlClientINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_testnet(_uniffiStatus) +// Return this object's type +func (_self *Object) ObjectType() *ObjectType { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterObjectTypeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_object_object_type( + _pointer,_uniffiStatus) + })) +} + +// Return this object's owner +func (_self *Object) Owner() *Owner { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterOwnerINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_object_owner( + _pointer,_uniffiStatus) })) } +// Return the digest of the transaction that last modified this object +func (_self *Object) PreviousTransaction() *TransactionDigest { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterTransactionDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_object_previous_transaction( + _pointer,_uniffiStatus) + })) +} +// Return the storage rebate locked in this object +// +// Storage rebates are credited to the gas coin used in a transaction that +// deletes this object. +func (_self *Object) StorageRebate() uint64 { + _pointer := _self.ffiObject.incrementPointer("*Object") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_object_storage_rebate( + _pointer,_uniffiStatus) + })) +} -// Get the list of active validators for the provided epoch, including -// related metadata. If no epoch is provided, it will return the active -// validators for the current epoch. -func (_self *GraphQlClient) ActiveValidators(paginationFilter PaginationFilter, epoch *uint64) (ValidatorPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +// Return this object's version +func (_self *Object) Version() uint64 { + _pointer := _self.ffiObject.incrementPointer("*Object") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_object_version( + _pointer,_uniffiStatus) + })) +} +func (object *Object) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterObject struct {} + +var FfiConverterObjectINSTANCE = FfiConverterObject{} + + +func (c FfiConverterObject) Lift(pointer unsafe.Pointer) *Object { + result := &Object { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_object(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_object(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) ValidatorPage { - return FfiConverterValidatorPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_active_validators( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalUint64INSTANCE.Lower(epoch)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*Object).Destroy) + return result +} - return res, err +func (c FfiConverterObject) Read(reader io.Reader) *Object { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Get the balance of all the coins owned by address for the provided coin -// type. Coin type will default to `0x2::coin::Coin<0x2::iota::IOTA>` -// if not provided. -func (_self *GraphQlClient) Balance(address *Address, coinType *string) (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, +func (c FfiConverterObject) Lower(value *Object) 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("*Object") + defer value.ffiObject.decrementPointer() + return pointer + +} + +func (c FfiConverterObject) Write(writer io.Writer, value *Object) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerObject struct {} + +func (_ FfiDestroyerObject) Destroy(value *Object) { + value.Destroy() +} + + + +type ObjectDataInterface interface { +} +type ObjectData struct { + ffiObject FfiObject +} + + + +func (object *ObjectData) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterObjectData struct {} + +var FfiConverterObjectDataINSTANCE = FfiConverterObjectData{} + + +func (c FfiConverterObjectData) Lift(pointer unsafe.Pointer) *ObjectData { + result := &ObjectData { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_objectdata(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_objectdata(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_balance( - _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterOptionalStringINSTANCE.Lower(coinType)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*ObjectData).Destroy) + return result +} - return res, err +func (c FfiConverterObjectData) Read(reader io.Reader) *ObjectData { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Get the chain identifier. -func (_self *GraphQlClient) ChainId() (string, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) string { - return FfiConverterStringINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_chain_id( - _pointer,), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterObjectData) Lower(value *ObjectData) 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("*ObjectData") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// 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 **CheckpointContentsDigest, seqNum *uint64) (*CheckpointSummary, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *CheckpointSummary { - return FfiConverterOptionalCheckpointSummaryINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoint( - _pointer,FfiConverterOptionalCheckpointContentsDigestINSTANCE.Lower(digest), FfiConverterOptionalUint64INSTANCE.Lower(seqNum)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterObjectData) Write(writer io.Writer, value *ObjectData) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} - return res, err +type FfiDestroyerObjectData struct {} + +func (_ FfiDestroyerObjectData) Destroy(value *ObjectData) { + value.Destroy() } -// Get a page of [`CheckpointSummary`] for the provided parameters. -func (_self *GraphQlClient) Checkpoints(paginationFilter PaginationFilter) (CheckpointSummaryPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) CheckpointSummaryPage { - return FfiConverterCheckpointSummaryPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoints( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +type ObjectDigestInterface interface { + ToBase58() string + ToBytes() []byte +} +type ObjectDigest struct { + ffiObject FfiObject } -// Get the coin metadata for the coin type. -func (_self *GraphQlClient) CoinMetadata(coinType string) (**CoinMetadata, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **CoinMetadata { - return FfiConverterOptionalCoinMetadataINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata( - _pointer,FfiConverterStringINSTANCE.Lower(coinType)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err +func ObjectDigestFromBase58(base58 string) (*ObjectDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *ObjectDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterObjectDigestINSTANCE.Lift(_uniffiRV), nil + } } -// Get the list of coins for the specified address. -// -// If `coin_type` is not provided, it will default to `0x2::coin::Coin`, -// which will return all coins. For IOTA coin, pass in the coin type: -// `0x2::coin::Coin<0x2::iota::IOTA>`. -func (_self *GraphQlClient) Coins(owner *Address, paginationFilter PaginationFilter, coinType *string) (CoinPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +func ObjectDigestFromBytes(bytes []byte) (*ObjectDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *ObjectDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterObjectDigestINSTANCE.Lift(_uniffiRV), nil + } +} + +func ObjectDigestGenerate() *ObjectDigest { + return FfiConverterObjectDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_generate(_uniffiStatus) + })) +} + + + +func (_self *ObjectDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*ObjectDigest") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_base58( + _pointer,_uniffiStatus), } - }, - // liftFn - func(ffi RustBufferI) CoinPage { - return FfiConverterCoinPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins( - _pointer,FfiConverterAddressINSTANCE.Lower(owner), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalStringINSTANCE.Lower(coinType)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - - return res, err + })) } -// Dry run a [`Transaction`] and return the transaction effects and dry run -// error (if any). -// -// `skipChecks` optional flag disables the usual verification checks that -// prevent access to objects that are owned by addresses other than the -// sender, and calling non-public, non-entry functions, and some other -// checks. Defaults to false. -func (_self *GraphQlClient) DryRunTx(tx *Transaction, skipChecks *bool) (DryRunResult, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +func (_self *ObjectDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*ObjectDigest") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_bytes( + _pointer,_uniffiStatus), } - }, - // liftFn - func(ffi RustBufferI) DryRunResult { - return FfiConverterDryRunResultINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx( - _pointer,FfiConverterTransactionINSTANCE.Lower(tx), FfiConverterOptionalBoolINSTANCE.Lower(skipChecks)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + })) +} +func (object *ObjectDigest) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterObjectDigest struct {} + +var FfiConverterObjectDigestINSTANCE = FfiConverterObjectDigest{} + + +func (c FfiConverterObjectDigest) Lift(pointer unsafe.Pointer) *ObjectDigest { + result := &ObjectDigest { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_objectdigest(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_objectdigest(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*ObjectDigest).Destroy) + return result +} - return res, err +func (c FfiConverterObjectDigest) Read(reader io.Reader) *ObjectDigest { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Dry run a [`TransactionKind`] and return the transaction effects and dry -// run error (if any). -// -// `skipChecks` optional flag disables the usual verification checks that -// prevent access to objects that are owned by addresses other than the -// sender, and calling non-public, non-entry functions, and some other -// checks. Defaults to false. -// -// `tx_meta` is the transaction metadata. -func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta TransactionMetadata, skipChecks *bool) (DryRunResult, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) DryRunResult { - return FfiConverterDryRunResultINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind( - _pointer,FfiConverterTransactionKindINSTANCE.Lower(txKind), FfiConverterTransactionMetadataINSTANCE.Lower(txMeta), FfiConverterOptionalBoolINSTANCE.Lower(skipChecks)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterObjectDigest) Lower(value *ObjectDigest) 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("*ObjectDigest") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// Access a dynamic field on an object using its name. Names are arbitrary -// Move values whose type have copy, drop, and store, and are specified -// using their type, and their BCS contents, Base64 encoded. +func (c FfiConverterObjectDigest) Write(writer io.Writer, value *ObjectDigest) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerObjectDigest struct {} + +func (_ FfiDestroyerObjectDigest) Destroy(value *ObjectDigest) { + value.Destroy() +} + + + +// An `ObjectId` is a 32-byte identifier used to uniquely identify an object on +// the IOTA blockchain. // -// The `name` argument is a json serialized type. +// ## Relationship to Address // -// This returns [`DynamicFieldOutput`] which contains the name, the value -// as json, and object. +// [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but +// are derived leveraging different domain-separator values to ensure, +// cryptographically, that there won't be any overlap, e.g. there can't be a +// valid `Object` whose `ObjectId` is equal to that of the `Address` of a user +// account. // -// # Example -// ```rust,ignore +// # BCS // -// let client = iota_graphql_client::Client::new_devnet(); -// let address = Address::from_str("0x5").unwrap(); -// let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); +// An `ObjectId`'s BCS serialized form is defined by the following: // -// # alternatively, pass in the bcs bytes -// let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); -// let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); +// ```text +// object-id = 32*OCTET // ``` -func (_self *GraphQlClient) DynamicField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *DynamicFieldOutput { - return FfiConverterOptionalDynamicFieldOutputINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field( - _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterTypeTagINSTANCE.Lower(typeTag), FfiConverterTypeValueINSTANCE.Lower(name)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +type ObjectIdInterface interface { + ToAddress() *Address + ToBytes() []byte + ToHex() string +} +// An `ObjectId` is a 32-byte identifier used to uniquely identify an object on +// the IOTA blockchain. +// +// ## Relationship to Address +// +// [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but +// are derived leveraging different domain-separator values to ensure, +// cryptographically, that there won't be any overlap, e.g. there can't be a +// valid `Object` whose `ObjectId` is equal to that of the `Address` of a user +// account. +// +// # BCS +// +// An `ObjectId`'s BCS serialized form is defined by the following: +// +// ```text +// object-id = 32*OCTET +// ``` +type ObjectId struct { + ffiObject FfiObject +} - return res, err + +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) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *ObjectId + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterObjectIdINSTANCE.Lift(_uniffiRV), nil + } } -// Get a page of dynamic fields for the provided address. Note that this -// will also fetch dynamic fields on wrapped objects. -// -// This returns [`Page`] of [`DynamicFieldOutput`]s. -func (_self *GraphQlClient) DynamicFields(address *Address, paginationFilter PaginationFilter) (DynamicFieldOutputPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +func ObjectIdFromHex(hex string) (*ObjectId, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex(FfiConverterStringINSTANCE.Lower(hex),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *ObjectId + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterObjectIdINSTANCE.Lift(_uniffiRV), nil + } +} + + + +func (_self *ObjectId) ToAddress() *Address { + _pointer := _self.ffiObject.incrementPointer("*ObjectId") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) DynamicFieldOutputPage { - return FfiConverterDynamicFieldOutputPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_fields( - _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_objectid_to_address( + _pointer,_uniffiStatus) + })) +} - return res, err +func (_self *ObjectId) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*ObjectId") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes( + _pointer,_uniffiStatus), + } + })) } -// Access a dynamic object field on an object using its name. Names are -// arbitrary Move values whose type have copy, drop, and store, and are -// specified using their type, and their BCS contents, Base64 encoded. -// -// The `name` argument is a json serialized type. -// -// This returns [`DynamicFieldOutput`] which contains the name, the value -// as json, and object. -func (_self *GraphQlClient) DynamicObjectField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +func (_self *ObjectId) ToHex() string { + _pointer := _self.ffiObject.incrementPointer("*ObjectId") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_objectid_to_hex( + _pointer,_uniffiStatus), + } + })) +} +func (object *ObjectId) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterObjectId struct {} + +var FfiConverterObjectIdINSTANCE = FfiConverterObjectId{} + + +func (c FfiConverterObjectId) Lift(pointer unsafe.Pointer) *ObjectId { + result := &ObjectId { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_objectid(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_objectid(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) *DynamicFieldOutput { - return FfiConverterOptionalDynamicFieldOutputINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_object_field( - _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterTypeTagINSTANCE.Lower(typeTag), FfiConverterTypeValueINSTANCE.Lower(name)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*ObjectId).Destroy) + return result +} - return res, err +func (c FfiConverterObjectId) Read(reader io.Reader) *ObjectId { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Return the epoch information for the provided epoch. If no epoch is -// provided, it will return the last known epoch. -func (_self *GraphQlClient) Epoch(epoch *uint64) (**Epoch, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **Epoch { - return FfiConverterOptionalEpochINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch( - _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterObjectId) Lower(value *ObjectId) 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("*ObjectId") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// Return the number of checkpoints in this epoch. This will return -// `Ok(None)` if the epoch requested is not available in the GraphQL -// service (e.g., due to pruning). -func (_self *GraphQlClient) EpochTotalCheckpoints(epoch *uint64) (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_checkpoints( - _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterObjectId) Write(writer io.Writer, value *ObjectId) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} - return res, err +type FfiDestroyerObjectId struct {} + +func (_ FfiDestroyerObjectId) Destroy(value *ObjectId) { + value.Destroy() } -// Return the number of transaction blocks in this epoch. This will return -// `Ok(None)` if the epoch requested is not available in the GraphQL -// service (e.g., due to pruning). -func (_self *GraphQlClient) EpochTotalTransactionBlocks(epoch *uint64) (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_transaction_blocks( - _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +type ObjectTypeInterface interface { +} +type ObjectType struct { + ffiObject FfiObject } -// Return a page of tuple (event, transaction digest) based on the -// (optional) event filter. -func (_self *GraphQlClient) Events(paginationFilter PaginationFilter, filter *EventFilter) (EventPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) EventPage { - return FfiConverterEventPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_events( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalEventFilterINSTANCE.Lower(filter)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +func (object *ObjectType) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() } -// Execute a transaction. -func (_self *GraphQlClient) ExecuteTx(signatures []*UserSignature, tx *Transaction) (**TransactionEffects, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, +type FfiConverterObjectType struct {} + +var FfiConverterObjectTypeINSTANCE = FfiConverterObjectType{} + + +func (c FfiConverterObjectType) Lift(pointer unsafe.Pointer) *ObjectType { + result := &ObjectType { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_objecttype(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_objecttype(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) **TransactionEffects { - return FfiConverterOptionalTransactionEffectsINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx( - _pointer,FfiConverterSequenceUserSignatureINSTANCE.Lower(signatures), FfiConverterTransactionINSTANCE.Lower(tx)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*ObjectType).Destroy) + return result +} - return res, err +func (c FfiConverterObjectType) Read(reader io.Reader) *ObjectType { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Return the sequence number of the latest checkpoint that has been -// executed. -func (_self *GraphQlClient) LatestCheckpointSequenceNumber() (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_latest_checkpoint_sequence_number( - _pointer,), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterObjectType) Lower(value *ObjectType) 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("*ObjectType") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// Lazily fetch the max page size -func (_self *GraphQlClient) MaxPageSize() (int32, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) C.int32_t { - res := C.ffi_iota_sdk_ffi_rust_future_complete_i32(handle, status) - return res - }, - // liftFn - func(ffi C.int32_t) int32 { - return FfiConverterInt32INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_max_page_size( - _pointer,), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_i32(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_i32(handle) - }, - ) - - return res, err +func (c FfiConverterObjectType) Write(writer io.Writer, value *ObjectType) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -// Return the contents' JSON of an object that is a Move object. -// -// If the object does not exist (e.g., due to pruning), this will return -// `Ok(None)`. Similarly, if this is not an object but an address, it -// will return `Ok(None)`. -func (_self *GraphQlClient) MoveObjectContents(objectId *ObjectId, version *uint64) (*Value, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *Value { - return FfiConverterOptionalTypeValueINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents( - _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId), FfiConverterOptionalUint64INSTANCE.Lower(version)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +type FfiDestroyerObjectType struct {} - return res, err +func (_ FfiDestroyerObjectType) Destroy(value *ObjectType) { + value.Destroy() } -// Return the BCS of an object that is a Move object. -// -// If the object does not exist (e.g., due to pruning), this will return -// `Ok(None)`. Similarly, if this is not an object but an address, it -// will return `Ok(None)`. -func (_self *GraphQlClient) MoveObjectContentsBcs(objectId *ObjectId, version *uint64) (*[]byte, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *[]byte { - return FfiConverterOptionalBytesINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents_bcs( - _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId), FfiConverterOptionalUint64INSTANCE.Lower(version)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +type OwnerInterface interface { +} +type Owner struct { + ffiObject FfiObject } -// Return the normalized Move function data for the provided package, -// module, and function. -func (_self *GraphQlClient) NormalizedMoveFunction(varPackage string, module string, function string, version *uint64) (**MoveFunction, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **MoveFunction { - return FfiConverterOptionalMoveFunctionINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_function( - _pointer,FfiConverterStringINSTANCE.Lower(varPackage), FfiConverterStringINSTANCE.Lower(module), FfiConverterStringINSTANCE.Lower(function), FfiConverterOptionalUint64INSTANCE.Lower(version)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +func (object *Owner) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() } -// Return the normalized Move module data for the provided module. -func (_self *GraphQlClient) NormalizedMoveModule(varPackage string, module string, paginationFilterEnums PaginationFilter, paginationFilterFriends PaginationFilter, paginationFilterFunctions PaginationFilter, paginationFilterStructs PaginationFilter, version *uint64) (**MoveModule, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **MoveModule { - return FfiConverterOptionalMoveModuleINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_module( - _pointer,FfiConverterStringINSTANCE.Lower(varPackage), FfiConverterStringINSTANCE.Lower(module), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterEnums), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterFriends), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterFunctions), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilterStructs), FfiConverterOptionalUint64INSTANCE.Lower(version)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +type FfiConverterOwner struct {} - return res, err -} +var FfiConverterOwnerINSTANCE = FfiConverterOwner{} -// Return an object based on the provided [`Address`]. -// -// If the object does not exist (e.g., due to pruning), this will return -// `Ok(None)`. Similarly, if this is not an object but an address, it -// will return `Ok(None)`. -func (_self *GraphQlClient) Object(objectId *ObjectId, version *uint64) (**Object, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + +func (c FfiConverterOwner) Lift(pointer unsafe.Pointer) *Owner { + result := &Owner { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_owner(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_owner(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) **Object { - return FfiConverterOptionalObjectINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object( - _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId), FfiConverterOptionalUint64INSTANCE.Lower(version)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*Owner).Destroy) + return result +} - return res, err +func (c FfiConverterOwner) Read(reader io.Reader) *Owner { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Return the object's bcs content [`Vec`] based on the provided -// [`Address`]. -func (_self *GraphQlClient) ObjectBcs(objectId *ObjectId) (*[]byte, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *[]byte { - return FfiConverterOptionalBytesINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object_bcs( - _pointer,FfiConverterObjectIdINSTANCE.Lower(objectId)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterOwner) Lower(value *Owner) 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("*Owner") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// Return a page of objects based on the provided parameters. +func (c FfiConverterOwner) Write(writer io.Writer, value *Owner) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} + +type FfiDestroyerOwner struct {} + +func (_ FfiDestroyerOwner) Destroy(value *Owner) { + value.Destroy() +} + + + +// A passkey authenticator. // -// Use this function together with the [`ObjectFilter::owner`] to get the -// objects owned by an address. +// # BCS // -// # Example +// The BCS serialized form for this type is defined by the following ABNF: // -// ```rust,ignore -// let filter = ObjectFilter { -// type_tag: None, -// owner: Some(Address::from_str("test").unwrap().into()), -// object_ids: None, -// }; +// ```text +// passkey-bcs = bytes ; where the contents of the bytes are +// ; defined by +// passkey = passkey-flag +// bytes ; passkey authenticator data +// client-data-json ; valid json +// simple-signature ; required to be a secp256r1 signature // -// let owned_objects = client.objects(None, None, Some(filter), None, None).await; +// client-data-json = string ; valid json // ``` -func (_self *GraphQlClient) Objects(paginationFilter PaginationFilter, filter *ObjectFilter) (ObjectPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) ObjectPage { - return FfiConverterObjectPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalObjectFilterINSTANCE.Lower(filter)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - - return res, err +// +// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for +// the required json-schema for the `client-data-json` rule. In addition, IOTA +// currently requires that the `CollectedClientData.type` field is required to +// be `webauthn.get`. +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type PasskeyAuthenticatorInterface interface { + // Opaque authenticator data for this passkey signature. + // + // See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for + // more information on this field. + AuthenticatorData() []byte + // The parsed challenge message for this passkey signature. + // + // This is parsed by decoding the base64url data from the + // `client_data_json.challenge` field. + Challenge() []byte + // Structured, unparsed, JSON for this passkey signature. + // + // See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + // for more information on this field. + ClientDataJson() string + // The passkey signature. + Signature() *SimpleSignature } - -// The package corresponding to the given address (at the optionally given -// version). When no version is given, the package is loaded directly -// from the address given. Otherwise, the address is translated before -// loading to point to the package whose original ID matches -// the package at address, but whose version is version. For non-system -// packages, this might result in a different address than address -// because different versions of a package, introduced by upgrades, -// exist at distinct addresses. +// A passkey authenticator. // -// Note that this interpretation of version is different from a historical -// object read (the interpretation of version for the object query). -func (_self *GraphQlClient) Package(address *Address, version *uint64) (**MovePackage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **MovePackage { - return FfiConverterOptionalMovePackageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package( - _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterOptionalUint64INSTANCE.Lower(version)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - - return res, err +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// passkey-bcs = bytes ; where the contents of the bytes are +// ; defined by +// passkey = passkey-flag +// bytes ; passkey authenticator data +// client-data-json ; valid json +// simple-signature ; required to be a secp256r1 signature +// +// client-data-json = string ; valid json +// ``` +// +// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for +// the required json-schema for the `client-data-json` rule. In addition, IOTA +// currently requires that the `CollectedClientData.type` field is required to +// be `webauthn.get`. +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type PasskeyAuthenticator struct { + ffiObject FfiObject } -// Fetch the latest version of the package at address. -// This corresponds to the package with the highest version that shares its -// original ID with the package at address. -func (_self *GraphQlClient) PackageLatest(address *Address) (**MovePackage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") + + + +// Opaque authenticator data for this passkey signature. +// +// See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for +// more information on this field. +func (_self *PasskeyAuthenticator) AuthenticatorData() []byte { + _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_authenticator_data( + _pointer,_uniffiStatus), } - }, - // liftFn - func(ffi RustBufferI) **MovePackage { - return FfiConverterOptionalMovePackageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_latest( - _pointer,FfiConverterAddressINSTANCE.Lower(address)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - - return res, err + })) } -// Fetch all versions of package at address (packages that share this -// package's original ID), optionally bounding the versions exclusively -// from below with afterVersion, or from above with beforeVersion. -func (_self *GraphQlClient) PackageVersions(address *Address, paginationFilter PaginationFilter, afterVersion *uint64, beforeVersion *uint64) (MovePackagePage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +// The parsed challenge message for this passkey signature. +// +// This is parsed by decoding the base64url data from the +// `client_data_json.challenge` field. +func (_self *PasskeyAuthenticator) Challenge() []byte { + _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge( + _pointer,_uniffiStatus), } - }, - // liftFn - func(ffi RustBufferI) MovePackagePage { - return FfiConverterMovePackagePageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_versions( - _pointer,FfiConverterAddressINSTANCE.Lower(address), FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalUint64INSTANCE.Lower(afterVersion), FfiConverterOptionalUint64INSTANCE.Lower(beforeVersion)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - - return res, err + })) } -// The Move packages that exist in the network, optionally filtered to be -// strictly before beforeCheckpoint and/or strictly after -// afterCheckpoint. +// Structured, unparsed, JSON for this passkey signature. // -// This query returns all versions of a given user package that appear -// between the specified checkpoints, but only records the latest -// versions of system packages. -func (_self *GraphQlClient) Packages(paginationFilter PaginationFilter, afterCheckpoint *uint64, beforeCheckpoint *uint64) (MovePackagePage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) +// for more information on this field. +func (_self *PasskeyAuthenticator) ClientDataJson() string { + _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json( + _pointer,_uniffiStatus), } - }, - // liftFn - func(ffi RustBufferI) MovePackagePage { - return FfiConverterMovePackagePageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_packages( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalUint64INSTANCE.Lower(afterCheckpoint), FfiConverterOptionalUint64INSTANCE.Lower(beforeCheckpoint)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - - return res, err + })) } -// Get the protocol configuration. -func (_self *GraphQlClient) ProtocolConfig(version *uint64) (**ProtocolConfigs, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") +// The passkey signature. +func (_self *PasskeyAuthenticator) Signature() *SimpleSignature { + _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **ProtocolConfigs { - return FfiConverterOptionalProtocolConfigsINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_protocol_config( - _pointer,FfiConverterOptionalUint64INSTANCE.Lower(version)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + return FfiConverterSimpleSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature( + _pointer,_uniffiStatus) + })) +} +func (object *PasskeyAuthenticator) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() +} + +type FfiConverterPasskeyAuthenticator struct {} + +var FfiConverterPasskeyAuthenticatorINSTANCE = FfiConverterPasskeyAuthenticator{} - return res, err -} -// Get the reference gas price for the provided epoch or the last known one -// if no epoch is provided. -// -// This will return `Ok(None)` if the epoch requested is not available in -// the GraphQL service (e.g., due to pruning). -func (_self *GraphQlClient) ReferenceGasPrice(epoch *uint64) (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, +func (c FfiConverterPasskeyAuthenticator) Lift(pointer unsafe.Pointer) *PasskeyAuthenticator { + result := &PasskeyAuthenticator { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_reference_gas_price( - _pointer,FfiConverterOptionalUint64INSTANCE.Lower(epoch)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*PasskeyAuthenticator).Destroy) + return result +} - return res, err +func (c FfiConverterPasskeyAuthenticator) Read(reader io.Reader) *PasskeyAuthenticator { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Get the GraphQL service configuration, including complexity limits, read -// and mutation limits, supported versions, and others. -func (_self *GraphQlClient) ServiceConfig() (*ServiceConfig, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) unsafe.Pointer { - res := C.ffi_iota_sdk_ffi_rust_future_complete_pointer(handle, status) - return res - }, - // liftFn - func(ffi unsafe.Pointer) *ServiceConfig { - return FfiConverterServiceConfigINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_service_config( - _pointer,), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_pointer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_pointer(handle) - }, - ) +func (c FfiConverterPasskeyAuthenticator) Lower(value *PasskeyAuthenticator) unsafe.Pointer { + // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, + // because the pointer will be decremented immediately after this function returns, + // and someone will be left holding onto a non-locked pointer. + pointer := value.ffiObject.incrementPointer("*PasskeyAuthenticator") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// Set the server address for the GraphQL GraphQL client. It should be a -// valid URL with a host and optionally a port number. -func (_self *GraphQlClient) SetRpcServer(server string) error { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - _, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) struct{} { - C.ffi_iota_sdk_ffi_rust_future_complete_void(handle, status) - return struct{}{} - }, - // liftFn - func(_ struct{}) struct{} { return struct{}{} }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_set_rpc_server( - _pointer,FfiConverterStringINSTANCE.Lower(server)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_void(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_void(handle) - }, - ) +func (c FfiConverterPasskeyAuthenticator) Write(writer io.Writer, value *PasskeyAuthenticator) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} - return err +type FfiDestroyerPasskeyAuthenticator struct {} + +func (_ FfiDestroyerPasskeyAuthenticator) Destroy(value *PasskeyAuthenticator) { + value.Destroy() } -// Get total supply for the coin type. -func (_self *GraphQlClient) TotalSupply(coinType string) (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_supply( - _pointer,FfiConverterStringINSTANCE.Lower(coinType)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +type ProgrammableTransactionInterface interface { +} +type ProgrammableTransaction struct { + ffiObject FfiObject } -// The total number of transaction blocks in the network by the end of the -// last known checkpoint. -func (_self *GraphQlClient) TotalTransactionBlocks() (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks( - _pointer,), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +func (object *ProgrammableTransaction) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() } -// The total number of transaction blocks in the network by the end of the -// provided checkpoint digest. -func (_self *GraphQlClient) TotalTransactionBlocksByDigest(digest *CheckpointContentsDigest) (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, +type FfiConverterProgrammableTransaction struct {} + +var FfiConverterProgrammableTransactionINSTANCE = FfiConverterProgrammableTransaction{} + + +func (c FfiConverterProgrammableTransaction) Lift(pointer unsafe.Pointer) *ProgrammableTransaction { + result := &ProgrammableTransaction { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_programmabletransaction(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_digest( - _pointer,FfiConverterCheckpointContentsDigestINSTANCE.Lower(digest)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*ProgrammableTransaction).Destroy) + return result +} - return res, err +func (c FfiConverterProgrammableTransaction) Read(reader io.Reader) *ProgrammableTransaction { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// The total number of transaction blocks in the network by the end of the -// provided checkpoint sequence number. -func (_self *GraphQlClient) TotalTransactionBlocksBySeqNum(seqNum uint64) (*uint64, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *uint64 { - return FfiConverterOptionalUint64INSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_seq_num( - _pointer,FfiConverterUint64INSTANCE.Lower(seqNum)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterProgrammableTransaction) Lower(value *ProgrammableTransaction) unsafe.Pointer { + // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, + // because the pointer will be decremented immediately after this function returns, + // and someone will be left holding onto a non-locked pointer. + pointer := value.ffiObject.incrementPointer("*ProgrammableTransaction") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// Get a transaction by its digest. -func (_self *GraphQlClient) Transaction(digest *TransactionDigest) (*SignedTransaction, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *SignedTransaction { - return FfiConverterOptionalSignedTransactionINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction( - _pointer,FfiConverterTransactionDigestINSTANCE.Lower(digest)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterProgrammableTransaction) Write(writer io.Writer, value *ProgrammableTransaction) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} - return res, err +type FfiDestroyerProgrammableTransaction struct {} + +func (_ FfiDestroyerProgrammableTransaction) Destroy(value *ProgrammableTransaction) { + value.Destroy() } -// Get a transaction's data and effects by its digest. -func (_self *GraphQlClient) TransactionDataEffects(digest *TransactionDigest) (*TransactionDataEffects, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) *TransactionDataEffects { - return FfiConverterOptionalTransactionDataEffectsINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_data_effects( - _pointer,FfiConverterTransactionDigestINSTANCE.Lower(digest)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +type ProtocolConfigsInterface interface { +} +type ProtocolConfigs struct { + ffiObject FfiObject } -// Get a transaction's effects by its digest. -func (_self *GraphQlClient) TransactionEffects(digest *TransactionDigest) (**TransactionEffects, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) **TransactionEffects { - return FfiConverterOptionalTransactionEffectsINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_effects( - _pointer,FfiConverterTransactionDigestINSTANCE.Lower(digest)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) - return res, err + +func (object *ProtocolConfigs) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() } -// Get a page of transactions based on the provided filters. -func (_self *GraphQlClient) Transactions(paginationFilter PaginationFilter, filter *TransactionsFilter) (SignedTransactionPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, +type FfiConverterProtocolConfigs struct {} + +var FfiConverterProtocolConfigsINSTANCE = FfiConverterProtocolConfigs{} + + +func (c FfiConverterProtocolConfigs) Lift(pointer unsafe.Pointer) *ProtocolConfigs { + result := &ProtocolConfigs { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_protocolconfigs(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_protocolconfigs(pointer, status) + }, + ), } - }, - // liftFn - func(ffi RustBufferI) SignedTransactionPage { - return FfiConverterSignedTransactionPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalTransactionsFilterINSTANCE.Lower(filter)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) + runtime.SetFinalizer(result, (*ProtocolConfigs).Destroy) + return result +} - return res, err +func (c FfiConverterProtocolConfigs) Read(reader io.Reader) *ProtocolConfigs { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -// Get a page of transactions' data and effects based on the provided -// filters. -func (_self *GraphQlClient) TransactionsDataEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionDataEffectsPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) TransactionDataEffectsPage { - return FfiConverterTransactionDataEffectsPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_data_effects( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalTransactionsFilterINSTANCE.Lower(filter)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterProtocolConfigs) Lower(value *ProtocolConfigs) 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("*ProtocolConfigs") + defer value.ffiObject.decrementPointer() + return pointer - return res, err } -// Get a page of transactions' effects based on the provided filters. -func (_self *GraphQlClient) TransactionsEffects(paginationFilter PaginationFilter, filter *TransactionsFilter) (TransactionEffectsPage, error) { - _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") - defer _self.ffiObject.decrementPointer() - res, err :=uniffiRustCallAsync[SdkFfiError]( - FfiConverterSdkFfiErrorINSTANCE, - // completeFn - func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI { - res := C.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(handle, status) - return GoRustBuffer { - inner: res, - } - }, - // liftFn - func(ffi RustBufferI) TransactionEffectsPage { - return FfiConverterTransactionEffectsPageINSTANCE.Lift(ffi) - }, - C.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects( - _pointer,FfiConverterPaginationFilterINSTANCE.Lower(paginationFilter), FfiConverterOptionalTransactionsFilterINSTANCE.Lower(filter)), - // pollFn - func (handle C.uint64_t, continuation C.UniffiRustFutureContinuationCallback, data C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(handle, continuation, data) - }, - // freeFn - func (handle C.uint64_t) { - C.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(handle) - }, - ) +func (c FfiConverterProtocolConfigs) Write(writer io.Writer, value *ProtocolConfigs) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) +} - return res, err +type FfiDestroyerProtocolConfigs struct {} + +func (_ FfiDestroyerProtocolConfigs) Destroy(value *ProtocolConfigs) { + value.Destroy() } -func (object *GraphQlClient) Destroy() { + + + +type RandomnessStateUpdateInterface interface { +} +type RandomnessStateUpdate struct { + ffiObject FfiObject +} + + + +func (object *RandomnessStateUpdate) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterGraphQlClient struct {} +type FfiConverterRandomnessStateUpdate struct {} -var FfiConverterGraphQlClientINSTANCE = FfiConverterGraphQlClient{} +var FfiConverterRandomnessStateUpdateINSTANCE = FfiConverterRandomnessStateUpdate{} -func (c FfiConverterGraphQlClient) Lift(pointer unsafe.Pointer) *GraphQlClient { - result := &GraphQlClient { +func (c FfiConverterRandomnessStateUpdate) Lift(pointer unsafe.Pointer) *RandomnessStateUpdate { + result := &RandomnessStateUpdate { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_graphqlclient(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_graphqlclient(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_randomnessstateupdate(pointer, status) }, ), } - runtime.SetFinalizer(result, (*GraphQlClient).Destroy) + runtime.SetFinalizer(result, (*RandomnessStateUpdate).Destroy) return result } -func (c FfiConverterGraphQlClient) Read(reader io.Reader) *GraphQlClient { +func (c FfiConverterRandomnessStateUpdate) Read(reader io.Reader) *RandomnessStateUpdate { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterGraphQlClient) Lower(value *GraphQlClient) unsafe.Pointer { +func (c FfiConverterRandomnessStateUpdate) Lower(value *RandomnessStateUpdate) 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("*GraphQlClient") + pointer := value.ffiObject.incrementPointer("*RandomnessStateUpdate") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterGraphQlClient) Write(writer io.Writer, value *GraphQlClient) { +func (c FfiConverterRandomnessStateUpdate) Write(writer io.Writer, value *RandomnessStateUpdate) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerGraphQlClient struct {} +type FfiDestroyerRandomnessStateUpdate struct {} -func (_ FfiDestroyerGraphQlClient) Destroy(value *GraphQlClient) { +func (_ FfiDestroyerRandomnessStateUpdate) Destroy(value *RandomnessStateUpdate) { value.Destroy() } -// A move identifier +// A secp256k1 signature. // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// identifier = %x01-80 ; length of the identifier -// (ALPHA *127(ALPHA / DIGIT / UNDERSCORE)) / -// (UNDERSCORE 1*127(ALPHA / DIGIT / UNDERSCORE)) -// -// UNDERSCORE = %x95 +// secp256k1-signature = 64OCTECT // ``` -type IdentifierInterface interface { +type Secp256k1PublicKeyInterface interface { + ToBytes() []byte } -// A move identifier +// A secp256k1 signature. // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// identifier = %x01-80 ; length of the identifier -// (ALPHA *127(ALPHA / DIGIT / UNDERSCORE)) / -// (UNDERSCORE 1*127(ALPHA / DIGIT / UNDERSCORE)) -// -// UNDERSCORE = %x95 +// secp256k1-signature = 64OCTECT // ``` -type Identifier struct { +type Secp256k1PublicKey struct { ffiObject FfiObject } - -func (object *Identifier) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterIdentifier struct {} - -var FfiConverterIdentifierINSTANCE = FfiConverterIdentifier{} - - -func (c FfiConverterIdentifier) Lift(pointer unsafe.Pointer) *Identifier { - result := &Identifier { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_identifier(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_identifier(pointer, status) - }, - ), - } - runtime.SetFinalizer(result, (*Identifier).Destroy) - return result -} - -func (c FfiConverterIdentifier) Read(reader io.Reader) *Identifier { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterIdentifier) Lower(value *Identifier) 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("*Identifier") - defer value.ffiObject.decrementPointer() - return pointer - +func Secp256k1PublicKeyFromBytes(bytes []byte) (*Secp256k1PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256k1PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(_uniffiRV), nil + } } -func (c FfiConverterIdentifier) Write(writer io.Writer, value *Identifier) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +func Secp256k1PublicKeyFromStr(s string) (*Secp256k1PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256k1PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(_uniffiRV), nil + } } -type FfiDestroyerIdentifier struct {} - -func (_ FfiDestroyerIdentifier) Destroy(value *Identifier) { - value.Destroy() +func Secp256k1PublicKeyGenerate() *Secp256k1PublicKey { + return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate(_uniffiStatus) + })) } -type MoveFunctionInterface interface { -} -type MoveFunction struct { - ffiObject FfiObject +func (_self *Secp256k1PublicKey) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Secp256k1PublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes( + _pointer,_uniffiStatus), + } + })) } - - - -func (object *MoveFunction) Destroy() { +func (object *Secp256k1PublicKey) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterMoveFunction struct {} +type FfiConverterSecp256k1PublicKey struct {} -var FfiConverterMoveFunctionINSTANCE = FfiConverterMoveFunction{} +var FfiConverterSecp256k1PublicKeyINSTANCE = FfiConverterSecp256k1PublicKey{} -func (c FfiConverterMoveFunction) Lift(pointer unsafe.Pointer) *MoveFunction { - result := &MoveFunction { +func (c FfiConverterSecp256k1PublicKey) Lift(pointer unsafe.Pointer) *Secp256k1PublicKey { + result := &Secp256k1PublicKey { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_movefunction(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_secp256k1publickey(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_movefunction(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_secp256k1publickey(pointer, status) }, ), } - runtime.SetFinalizer(result, (*MoveFunction).Destroy) + runtime.SetFinalizer(result, (*Secp256k1PublicKey).Destroy) return result } -func (c FfiConverterMoveFunction) Read(reader io.Reader) *MoveFunction { +func (c FfiConverterSecp256k1PublicKey) Read(reader io.Reader) *Secp256k1PublicKey { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterMoveFunction) Lower(value *MoveFunction) unsafe.Pointer { +func (c FfiConverterSecp256k1PublicKey) Lower(value *Secp256k1PublicKey) 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("*MoveFunction") + pointer := value.ffiObject.incrementPointer("*Secp256k1PublicKey") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterMoveFunction) Write(writer io.Writer, value *MoveFunction) { +func (c FfiConverterSecp256k1PublicKey) Write(writer io.Writer, value *Secp256k1PublicKey) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerMoveFunction struct {} +type FfiDestroyerSecp256k1PublicKey struct {} -func (_ FfiDestroyerMoveFunction) Destroy(value *MoveFunction) { +func (_ FfiDestroyerSecp256k1PublicKey) Destroy(value *Secp256k1PublicKey) { value.Destroy() } -type MoveModuleInterface interface { +// A secp256k1 public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// secp256k1-public-key = 33OCTECT +// ``` +type Secp256k1SignatureInterface interface { + ToBytes() []byte } -type MoveModule struct { +// A secp256k1 public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// secp256k1-public-key = 33OCTECT +// ``` +type Secp256k1Signature struct { ffiObject FfiObject } +func Secp256k1SignatureFromBytes(bytes []byte) (*Secp256k1Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256k1Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256k1SignatureINSTANCE.Lift(_uniffiRV), nil + } +} -func (object *MoveModule) Destroy() { +func Secp256k1SignatureFromStr(s string) (*Secp256k1Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256k1Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256k1SignatureINSTANCE.Lift(_uniffiRV), nil + } +} + +func Secp256k1SignatureGenerate() *Secp256k1Signature { + return FfiConverterSecp256k1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_generate(_uniffiStatus) + })) +} + + + +func (_self *Secp256k1Signature) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Secp256k1Signature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_secp256k1signature_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Secp256k1Signature) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterMoveModule struct {} +type FfiConverterSecp256k1Signature struct {} -var FfiConverterMoveModuleINSTANCE = FfiConverterMoveModule{} +var FfiConverterSecp256k1SignatureINSTANCE = FfiConverterSecp256k1Signature{} -func (c FfiConverterMoveModule) Lift(pointer unsafe.Pointer) *MoveModule { - result := &MoveModule { +func (c FfiConverterSecp256k1Signature) Lift(pointer unsafe.Pointer) *Secp256k1Signature { + result := &Secp256k1Signature { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_movemodule(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_secp256k1signature(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_movemodule(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_secp256k1signature(pointer, status) }, ), } - runtime.SetFinalizer(result, (*MoveModule).Destroy) + runtime.SetFinalizer(result, (*Secp256k1Signature).Destroy) return result } -func (c FfiConverterMoveModule) Read(reader io.Reader) *MoveModule { +func (c FfiConverterSecp256k1Signature) Read(reader io.Reader) *Secp256k1Signature { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterMoveModule) Lower(value *MoveModule) unsafe.Pointer { +func (c FfiConverterSecp256k1Signature) Lower(value *Secp256k1Signature) 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("*MoveModule") + pointer := value.ffiObject.incrementPointer("*Secp256k1Signature") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterMoveModule) Write(writer io.Writer, value *MoveModule) { +func (c FfiConverterSecp256k1Signature) Write(writer io.Writer, value *Secp256k1Signature) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerMoveModule struct {} +type FfiDestroyerSecp256k1Signature struct {} -func (_ FfiDestroyerMoveModule) Destroy(value *MoveModule) { +func (_ FfiDestroyerSecp256k1Signature) Destroy(value *Secp256k1Signature) { value.Destroy() } -type MovePackageInterface interface { +// A secp256r1 signature. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// secp256r1-signature = 64OCTECT +// ``` +type Secp256r1PublicKeyInterface interface { + ToBytes() []byte } -type MovePackage struct { +// A secp256r1 signature. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// secp256r1-signature = 64OCTECT +// ``` +type Secp256r1PublicKey struct { ffiObject FfiObject } +func Secp256r1PublicKeyFromBytes(bytes []byte) (*Secp256r1PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256r1PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(_uniffiRV), nil + } +} + +func Secp256r1PublicKeyFromStr(s string) (*Secp256r1PublicKey, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256r1PublicKey + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(_uniffiRV), nil + } +} + +func Secp256r1PublicKeyGenerate() *Secp256r1PublicKey { + return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate(_uniffiStatus) + })) +} + + -func (object *MovePackage) Destroy() { +func (_self *Secp256r1PublicKey) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Secp256r1PublicKey") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Secp256r1PublicKey) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterMovePackage struct {} +type FfiConverterSecp256r1PublicKey struct {} -var FfiConverterMovePackageINSTANCE = FfiConverterMovePackage{} +var FfiConverterSecp256r1PublicKeyINSTANCE = FfiConverterSecp256r1PublicKey{} -func (c FfiConverterMovePackage) Lift(pointer unsafe.Pointer) *MovePackage { - result := &MovePackage { +func (c FfiConverterSecp256r1PublicKey) Lift(pointer unsafe.Pointer) *Secp256r1PublicKey { + result := &Secp256r1PublicKey { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_movepackage(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_secp256r1publickey(pointer, status) }, ), } - runtime.SetFinalizer(result, (*MovePackage).Destroy) + runtime.SetFinalizer(result, (*Secp256r1PublicKey).Destroy) return result } -func (c FfiConverterMovePackage) Read(reader io.Reader) *MovePackage { +func (c FfiConverterSecp256r1PublicKey) Read(reader io.Reader) *Secp256r1PublicKey { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterMovePackage) Lower(value *MovePackage) unsafe.Pointer { +func (c FfiConverterSecp256r1PublicKey) Lower(value *Secp256r1PublicKey) unsafe.Pointer { // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, // because the pointer will be decremented immediately after this function returns, // and someone will be left holding onto a non-locked pointer. - pointer := value.ffiObject.incrementPointer("*MovePackage") + pointer := value.ffiObject.incrementPointer("*Secp256r1PublicKey") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterMovePackage) Write(writer io.Writer, value *MovePackage) { +func (c FfiConverterSecp256r1PublicKey) Write(writer io.Writer, value *Secp256r1PublicKey) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerMovePackage struct {} +type FfiDestroyerSecp256r1PublicKey struct {} -func (_ FfiDestroyerMovePackage) Destroy(value *MovePackage) { +func (_ FfiDestroyerSecp256r1PublicKey) Destroy(value *Secp256r1PublicKey) { value.Destroy() } -type MoveStructInterface interface { +// A secp256r1 public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// secp256r1-public-key = 33OCTECT +// ``` +type Secp256r1SignatureInterface interface { + ToBytes() []byte } -type MoveStruct struct { +// A secp256r1 public key. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// secp256r1-public-key = 33OCTECT +// ``` +type Secp256r1Signature struct { ffiObject FfiObject } +func Secp256r1SignatureFromBytes(bytes []byte) (*Secp256r1Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256r1Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256r1SignatureINSTANCE.Lift(_uniffiRV), nil + } +} + +func Secp256r1SignatureFromStr(s string) (*Secp256r1Signature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *Secp256r1Signature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterSecp256r1SignatureINSTANCE.Lift(_uniffiRV), nil + } +} + +func Secp256r1SignatureGenerate() *Secp256r1Signature { + return FfiConverterSecp256r1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate(_uniffiStatus) + })) +} + + -func (object *MoveStruct) Destroy() { +func (_self *Secp256r1Signature) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*Secp256r1Signature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *Secp256r1Signature) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterMoveStruct struct {} +type FfiConverterSecp256r1Signature struct {} -var FfiConverterMoveStructINSTANCE = FfiConverterMoveStruct{} +var FfiConverterSecp256r1SignatureINSTANCE = FfiConverterSecp256r1Signature{} -func (c FfiConverterMoveStruct) Lift(pointer unsafe.Pointer) *MoveStruct { - result := &MoveStruct { +func (c FfiConverterSecp256r1Signature) Lift(pointer unsafe.Pointer) *Secp256r1Signature { + result := &Secp256r1Signature { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_movestruct(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_secp256r1signature(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_movestruct(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_secp256r1signature(pointer, status) }, ), } - runtime.SetFinalizer(result, (*MoveStruct).Destroy) + runtime.SetFinalizer(result, (*Secp256r1Signature).Destroy) return result } -func (c FfiConverterMoveStruct) Read(reader io.Reader) *MoveStruct { +func (c FfiConverterSecp256r1Signature) Read(reader io.Reader) *Secp256r1Signature { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterMoveStruct) Lower(value *MoveStruct) unsafe.Pointer { +func (c FfiConverterSecp256r1Signature) Lower(value *Secp256r1Signature) 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("*MoveStruct") + pointer := value.ffiObject.incrementPointer("*Secp256r1Signature") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterMoveStruct) Write(writer io.Writer, value *MoveStruct) { +func (c FfiConverterSecp256r1Signature) Write(writer io.Writer, value *Secp256r1Signature) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerMoveStruct struct {} +type FfiDestroyerSecp256r1Signature struct {} -func (_ FfiDestroyerMoveStruct) Destroy(value *MoveStruct) { +func (_ FfiDestroyerSecp256r1Signature) Destroy(value *Secp256r1Signature) { value.Destroy() } -// 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 -// ``` -type ObjectInterface interface { - // Try to interpret this object as a move struct - AsStruct() **MoveStruct - // Return this object's data - Data() *ObjectData - // Return this object's id - ObjectId() *ObjectId - // Return this object's type - ObjectType() *ObjectType - // Return this object's owner - Owner() *Owner - // Return the digest of the transaction that last modified this object - PreviousTransaction() *TransactionDigest - // Return the storage rebate locked in this object - // - // Storage rebates are credited to the gas coin used in a transaction that - // deletes this object. - StorageRebate() uint64 - // Return this object's version - Version() uint64 +type ServiceConfigInterface interface { } -// 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 -// ``` -type Object struct { +type ServiceConfig struct { ffiObject FfiObject } -func NewObject(data *ObjectData, owner *Owner, previousTransaction *TransactionDigest, storageRebate uint64) *Object { - return FfiConverterObjectINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_object_new(FfiConverterObjectDataINSTANCE.Lower(data), FfiConverterOwnerINSTANCE.Lower(owner), FfiConverterTransactionDigestINSTANCE.Lower(previousTransaction), FfiConverterUint64INSTANCE.Lower(storageRebate),_uniffiStatus) - })) -} - - - - -// Try to interpret this object as a move struct -func (_self *Object) AsStruct() **MoveStruct { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterOptionalMoveStructINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_object_as_struct( - _pointer,_uniffiStatus), - } - })) -} - -// Return this object's data -func (_self *Object) Data() *ObjectData { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterObjectDataINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_object_data( - _pointer,_uniffiStatus) - })) -} - -// Return this object's id -func (_self *Object) ObjectId() *ObjectId { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_object_object_id( - _pointer,_uniffiStatus) - })) -} - -// Return this object's type -func (_self *Object) ObjectType() *ObjectType { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterObjectTypeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_object_object_type( - _pointer,_uniffiStatus) - })) -} - -// Return this object's owner -func (_self *Object) Owner() *Owner { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterOwnerINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_object_owner( - _pointer,_uniffiStatus) - })) -} -// Return the digest of the transaction that last modified this object -func (_self *Object) PreviousTransaction() *TransactionDigest { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterTransactionDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_object_previous_transaction( - _pointer,_uniffiStatus) - })) -} -// Return the storage rebate locked in this object -// -// Storage rebates are credited to the gas coin used in a transaction that -// deletes this object. -func (_self *Object) StorageRebate() uint64 { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { - return C.uniffi_iota_sdk_ffi_fn_method_object_storage_rebate( - _pointer,_uniffiStatus) - })) -} -// Return this object's version -func (_self *Object) Version() uint64 { - _pointer := _self.ffiObject.incrementPointer("*Object") - defer _self.ffiObject.decrementPointer() - return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { - return C.uniffi_iota_sdk_ffi_fn_method_object_version( - _pointer,_uniffiStatus) - })) -} -func (object *Object) Destroy() { +func (object *ServiceConfig) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterObject struct {} +type FfiConverterServiceConfig struct {} -var FfiConverterObjectINSTANCE = FfiConverterObject{} +var FfiConverterServiceConfigINSTANCE = FfiConverterServiceConfig{} -func (c FfiConverterObject) Lift(pointer unsafe.Pointer) *Object { - result := &Object { +func (c FfiConverterServiceConfig) Lift(pointer unsafe.Pointer) *ServiceConfig { + result := &ServiceConfig { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_object(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_serviceconfig(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_object(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_serviceconfig(pointer, status) }, ), } - runtime.SetFinalizer(result, (*Object).Destroy) + runtime.SetFinalizer(result, (*ServiceConfig).Destroy) return result } -func (c FfiConverterObject) Read(reader io.Reader) *Object { +func (c FfiConverterServiceConfig) Read(reader io.Reader) *ServiceConfig { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterObject) Lower(value *Object) unsafe.Pointer { +func (c FfiConverterServiceConfig) Lower(value *ServiceConfig) 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("*Object") + pointer := value.ffiObject.incrementPointer("*ServiceConfig") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterObject) Write(writer io.Writer, value *Object) { +func (c FfiConverterServiceConfig) Write(writer io.Writer, value *ServiceConfig) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerObject struct {} +type FfiDestroyerServiceConfig struct {} -func (_ FfiDestroyerObject) Destroy(value *Object) { +func (_ FfiDestroyerServiceConfig) Destroy(value *ServiceConfig) { value.Destroy() } -type ObjectDataInterface interface { +// A basic signature +// +// This enumeration defines the set of simple or basic signature schemes +// supported by IOTA. Most signature schemes supported by IOTA end up +// comprising of a at least one simple signature scheme. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// simple-signature-bcs = bytes ; where the contents of the bytes are defined by +// simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / +// (secp256k1-flag secp256k1-signature secp256k1-public-key) / +// (secp256r1-flag secp256r1-signature secp256r1-public-key) +// ``` +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type SimpleSignatureInterface interface { + Ed25519PubKey() *Ed25519PublicKey + Ed25519PubKeyOpt() **Ed25519PublicKey + Ed25519Sig() *Ed25519Signature + Ed25519SigOpt() **Ed25519Signature + IsEd25519() bool + IsSecp256k1() bool + IsSecp256r1() bool + Scheme() SignatureScheme + Secp256k1PubKey() *Secp256k1PublicKey + Secp256k1PubKeyOpt() **Secp256k1PublicKey + Secp256k1Sig() *Secp256k1Signature + Secp256k1SigOpt() **Secp256k1Signature + Secp256r1PubKey() *Secp256r1PublicKey + Secp256r1PubKeyOpt() **Secp256r1PublicKey + Secp256r1Sig() *Secp256r1Signature + Secp256r1SigOpt() **Secp256r1Signature + ToBytes() []byte } -type ObjectData struct { +// A basic signature +// +// This enumeration defines the set of simple or basic signature schemes +// supported by IOTA. Most signature schemes supported by IOTA end up +// comprising of a at least one simple signature scheme. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// simple-signature-bcs = bytes ; where the contents of the bytes are defined by +// simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / +// (secp256k1-flag secp256k1-signature secp256k1-public-key) / +// (secp256r1-flag secp256r1-signature secp256r1-public-key) +// ``` +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type SimpleSignature struct { ffiObject FfiObject } -func (object *ObjectData) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} -type FfiConverterObjectData struct {} +func (_self *SimpleSignature) Ed25519PubKey() *Ed25519PublicKey { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterEd25519PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key( + _pointer,_uniffiStatus) + })) +} -var FfiConverterObjectDataINSTANCE = FfiConverterObjectData{} +func (_self *SimpleSignature) Ed25519PubKeyOpt() **Ed25519PublicKey { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalEd25519PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key_opt( + _pointer,_uniffiStatus), + } + })) +} +func (_self *SimpleSignature) Ed25519Sig() *Ed25519Signature { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterEd25519SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig( + _pointer,_uniffiStatus) + })) +} -func (c FfiConverterObjectData) Lift(pointer unsafe.Pointer) *ObjectData { - result := &ObjectData { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_objectdata(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_objectdata(pointer, status) - }, - ), +func (_self *SimpleSignature) Ed25519SigOpt() **Ed25519Signature { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalEd25519SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig_opt( + _pointer,_uniffiStatus), } - runtime.SetFinalizer(result, (*ObjectData).Destroy) - return result + })) } -func (c FfiConverterObjectData) Read(reader io.Reader) *ObjectData { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +func (_self *SimpleSignature) IsEd25519() bool { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_ed25519( + _pointer,_uniffiStatus) + })) } -func (c FfiConverterObjectData) Lower(value *ObjectData) 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("*ObjectData") - defer value.ffiObject.decrementPointer() - return pointer +func (_self *SimpleSignature) IsSecp256k1() bool { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256k1( + _pointer,_uniffiStatus) + })) +} +func (_self *SimpleSignature) IsSecp256r1() bool { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256r1( + _pointer,_uniffiStatus) + })) } -func (c FfiConverterObjectData) Write(writer io.Writer, value *ObjectData) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +func (_self *SimpleSignature) Scheme() SignatureScheme { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSignatureSchemeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_scheme( + _pointer,_uniffiStatus), + } + })) } -type FfiDestroyerObjectData struct {} +func (_self *SimpleSignature) Secp256k1PubKey() *Secp256k1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key( + _pointer,_uniffiStatus) + })) +} -func (_ FfiDestroyerObjectData) Destroy(value *ObjectData) { - value.Destroy() +func (_self *SimpleSignature) Secp256k1PubKeyOpt() **Secp256k1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256k1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key_opt( + _pointer,_uniffiStatus), + } + })) } +func (_self *SimpleSignature) Secp256k1Sig() *Secp256k1Signature { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256k1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig( + _pointer,_uniffiStatus) + })) +} +func (_self *SimpleSignature) Secp256k1SigOpt() **Secp256k1Signature { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256k1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig_opt( + _pointer,_uniffiStatus), + } + })) +} -type ObjectDigestInterface interface { +func (_self *SimpleSignature) Secp256r1PubKey() *Secp256r1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key( + _pointer,_uniffiStatus) + })) } -type ObjectDigest struct { - ffiObject FfiObject + +func (_self *SimpleSignature) Secp256r1PubKeyOpt() **Secp256r1PublicKey { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256r1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt( + _pointer,_uniffiStatus), + } + })) } +func (_self *SimpleSignature) Secp256r1Sig() *Secp256r1Signature { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSecp256r1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig( + _pointer,_uniffiStatus) + })) +} +func (_self *SimpleSignature) Secp256r1SigOpt() **Secp256r1Signature { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSecp256r1SignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt( + _pointer,_uniffiStatus), + } + })) +} -func (object *ObjectDigest) Destroy() { +func (_self *SimpleSignature) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*SimpleSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *SimpleSignature) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterObjectDigest struct {} +type FfiConverterSimpleSignature struct {} -var FfiConverterObjectDigestINSTANCE = FfiConverterObjectDigest{} +var FfiConverterSimpleSignatureINSTANCE = FfiConverterSimpleSignature{} -func (c FfiConverterObjectDigest) Lift(pointer unsafe.Pointer) *ObjectDigest { - result := &ObjectDigest { +func (c FfiConverterSimpleSignature) Lift(pointer unsafe.Pointer) *SimpleSignature { + result := &SimpleSignature { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_objectdigest(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_simplesignature(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_objectdigest(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_simplesignature(pointer, status) }, ), } - runtime.SetFinalizer(result, (*ObjectDigest).Destroy) + runtime.SetFinalizer(result, (*SimpleSignature).Destroy) return result } -func (c FfiConverterObjectDigest) Read(reader io.Reader) *ObjectDigest { +func (c FfiConverterSimpleSignature) Read(reader io.Reader) *SimpleSignature { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterObjectDigest) Lower(value *ObjectDigest) unsafe.Pointer { +func (c FfiConverterSimpleSignature) Lower(value *SimpleSignature) 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("*ObjectDigest") + pointer := value.ffiObject.incrementPointer("*SimpleSignature") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterObjectDigest) Write(writer io.Writer, value *ObjectDigest) { +func (c FfiConverterSimpleSignature) Write(writer io.Writer, value *SimpleSignature) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerObjectDigest struct {} +type FfiDestroyerSimpleSignature struct {} -func (_ FfiDestroyerObjectDigest) Destroy(value *ObjectDigest) { +func (_ FfiDestroyerSimpleSignature) Destroy(value *SimpleSignature) { value.Destroy() } -// An `ObjectId` is a 32-byte identifier used to uniquely identify an object on -// the IOTA blockchain. -// -// ## Relationship to Address -// -// [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but -// are derived leveraging different domain-separator values to ensure, -// cryptographically, that there won't be any overlap, e.g. there can't be a -// valid `Object` whose `ObjectId` is equal to that of the `Address` of a user -// account. +// Type information for a move struct // // # BCS // -// An `ObjectId`'s BCS serialized form is defined by the following: +// The BCS serialized form for this type is defined by the following ABNF: // // ```text -// object-id = 32*OCTET +// struct-tag = address ; address of the package +// identifier ; name of the module +// identifier ; name of the type +// (vector type-tag) ; type parameters // ``` -type ObjectIdInterface interface { - ToAddress() *Address - ToBytes() []byte - ToHex() string +type StructTagInterface interface { + Address() *Address + // Checks if this is a Coin type + CoinType() *TypeTag + // Checks if this is a Coin type + CoinTypeOpt() **TypeTag } -// An `ObjectId` is a 32-byte identifier used to uniquely identify an object on -// the IOTA blockchain. -// -// ## Relationship to Address -// -// [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but -// are derived leveraging different domain-separator values to ensure, -// cryptographically, that there won't be any overlap, e.g. there can't be a -// valid `Object` whose `ObjectId` is equal to that of the `Address` of a user -// account. +// Type information for a move struct // // # BCS // -// An `ObjectId`'s BCS serialized form is defined by the following: +// The BCS serialized form for this type is defined by the following ABNF: // // ```text -// object-id = 32*OCTET +// struct-tag = address ; address of the package +// identifier ; name of the module +// identifier ; name of the type +// (vector type-tag) ; type parameters // ``` -type ObjectId struct { +type StructTag struct { ffiObject FfiObject } +func NewStructTag(address *Address, module *Identifier, name *Identifier, typeParams []*TypeTag) *StructTag { + return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_new(FfiConverterAddressINSTANCE.Lower(address), FfiConverterIdentifierINSTANCE.Lower(module), FfiConverterIdentifierINSTANCE.Lower(name), FfiConverterSequenceTypeTagINSTANCE.Lower(typeParams),_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) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *ObjectId - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterObjectIdINSTANCE.Lift(_uniffiRV), nil - } +func StructTagCoin(typeTag *TypeTag) *StructTag { + return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin(FfiConverterTypeTagINSTANCE.Lower(typeTag),_uniffiStatus) + })) } -func ObjectIdFromHex(hex string) (*ObjectId, error) { - _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex(FfiConverterStringINSTANCE.Lower(hex),_uniffiStatus) - }) - if _uniffiErr != nil { - var _uniffiDefaultValue *ObjectId - return _uniffiDefaultValue, _uniffiErr - } else { - return FfiConverterObjectIdINSTANCE.Lift(_uniffiRV), nil - } +func StructTagGasCoin() *StructTag { + return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin(_uniffiStatus) + })) } +func StructTagStakedIota() *StructTag { + return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota(_uniffiStatus) + })) +} -func (_self *ObjectId) ToAddress() *Address { - _pointer := _self.ffiObject.incrementPointer("*ObjectId") + +func (_self *StructTag) Address() *Address { + _pointer := _self.ffiObject.incrementPointer("*StructTag") defer _self.ffiObject.decrementPointer() return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_objectid_to_address( + return C.uniffi_iota_sdk_ffi_fn_method_structtag_address( _pointer,_uniffiStatus) })) } -func (_self *ObjectId) ToBytes() []byte { - _pointer := _self.ffiObject.incrementPointer("*ObjectId") +// Checks if this is a Coin type +func (_self *StructTag) CoinType() *TypeTag { + _pointer := _self.ffiObject.incrementPointer("*StructTag") defer _self.ffiObject.decrementPointer() - return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes( - _pointer,_uniffiStatus), - } + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type( + _pointer,_uniffiStatus) })) } -func (_self *ObjectId) ToHex() string { - _pointer := _self.ffiObject.incrementPointer("*ObjectId") +// Checks if this is a Coin type +func (_self *StructTag) CoinTypeOpt() **TypeTag { + _pointer := _self.ffiObject.incrementPointer("*StructTag") defer _self.ffiObject.decrementPointer() - return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return FfiConverterOptionalTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_objectid_to_hex( + inner: C.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt( _pointer,_uniffiStatus), } })) } -func (object *ObjectId) Destroy() { +func (object *StructTag) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterObjectId struct {} +type FfiConverterStructTag struct {} -var FfiConverterObjectIdINSTANCE = FfiConverterObjectId{} +var FfiConverterStructTagINSTANCE = FfiConverterStructTag{} -func (c FfiConverterObjectId) Lift(pointer unsafe.Pointer) *ObjectId { - result := &ObjectId { +func (c FfiConverterStructTag) Lift(pointer unsafe.Pointer) *StructTag { + result := &StructTag { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_objectid(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_structtag(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_objectid(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_structtag(pointer, status) }, ), } - runtime.SetFinalizer(result, (*ObjectId).Destroy) + runtime.SetFinalizer(result, (*StructTag).Destroy) return result } -func (c FfiConverterObjectId) Read(reader io.Reader) *ObjectId { +func (c FfiConverterStructTag) Read(reader io.Reader) *StructTag { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterObjectId) Lower(value *ObjectId) unsafe.Pointer { +func (c FfiConverterStructTag) Lower(value *StructTag) 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("*ObjectId") + pointer := value.ffiObject.incrementPointer("*StructTag") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterObjectId) Write(writer io.Writer, value *ObjectId) { +func (c FfiConverterStructTag) Write(writer io.Writer, value *StructTag) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerObjectId struct {} +type FfiDestroyerStructTag struct {} -func (_ FfiDestroyerObjectId) Destroy(value *ObjectId) { +func (_ FfiDestroyerStructTag) Destroy(value *StructTag) { value.Destroy() } -type ObjectTypeInterface interface { +// A transaction +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// transaction = %x00 transaction-v1 +// +// transaction-v1 = transaction-kind address gas-payment transaction-expiration +// ``` +type TransactionInterface interface { + Expiration() TransactionExpiration + GasPayment() GasPayment + Kind() *TransactionKind + Sender() *Address } -type ObjectType struct { +// A transaction +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// transaction = %x00 transaction-v1 +// +// transaction-v1 = transaction-kind address gas-payment transaction-expiration +// ``` +type Transaction struct { ffiObject FfiObject } - - - -func (object *ObjectType) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() +func NewTransaction(kind *TransactionKind, sender *Address, gasPayment GasPayment, expiration TransactionExpiration) *Transaction { + return FfiConverterTransactionINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transaction_new(FfiConverterTransactionKindINSTANCE.Lower(kind), FfiConverterAddressINSTANCE.Lower(sender), FfiConverterGasPaymentINSTANCE.Lower(gasPayment), FfiConverterTransactionExpirationINSTANCE.Lower(expiration),_uniffiStatus) + })) } -type FfiConverterObjectType struct {} -var FfiConverterObjectTypeINSTANCE = FfiConverterObjectType{} -func (c FfiConverterObjectType) Lift(pointer unsafe.Pointer) *ObjectType { - result := &ObjectType { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_objecttype(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_objecttype(pointer, status) - }, - ), +func (_self *Transaction) Expiration() TransactionExpiration { + _pointer := _self.ffiObject.incrementPointer("*Transaction") + defer _self.ffiObject.decrementPointer() + return FfiConverterTransactionExpirationINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transaction_expiration( + _pointer,_uniffiStatus), } - runtime.SetFinalizer(result, (*ObjectType).Destroy) - return result -} - -func (c FfiConverterObjectType) Read(reader io.Reader) *ObjectType { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterObjectType) Lower(value *ObjectType) 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("*ObjectType") - defer value.ffiObject.decrementPointer() - return pointer - + })) } -func (c FfiConverterObjectType) Write(writer io.Writer, value *ObjectType) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +func (_self *Transaction) GasPayment() GasPayment { + _pointer := _self.ffiObject.incrementPointer("*Transaction") + defer _self.ffiObject.decrementPointer() + return FfiConverterGasPaymentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment( + _pointer,_uniffiStatus), + } + })) } -type FfiDestroyerObjectType struct {} - -func (_ FfiDestroyerObjectType) Destroy(value *ObjectType) { - value.Destroy() +func (_self *Transaction) Kind() *TransactionKind { + _pointer := _self.ffiObject.incrementPointer("*Transaction") + defer _self.ffiObject.decrementPointer() + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_transaction_kind( + _pointer,_uniffiStatus) + })) } - - -type OwnerInterface interface { -} -type Owner struct { - ffiObject FfiObject +func (_self *Transaction) Sender() *Address { + _pointer := _self.ffiObject.incrementPointer("*Transaction") + defer _self.ffiObject.decrementPointer() + return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_transaction_sender( + _pointer,_uniffiStatus) + })) } - - - -func (object *Owner) Destroy() { +func (object *Transaction) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterOwner struct {} +type FfiConverterTransaction struct {} -var FfiConverterOwnerINSTANCE = FfiConverterOwner{} +var FfiConverterTransactionINSTANCE = FfiConverterTransaction{} -func (c FfiConverterOwner) Lift(pointer unsafe.Pointer) *Owner { - result := &Owner { +func (c FfiConverterTransaction) Lift(pointer unsafe.Pointer) *Transaction { + result := &Transaction { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_owner(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_transaction(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_owner(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_transaction(pointer, status) }, ), } - runtime.SetFinalizer(result, (*Owner).Destroy) + runtime.SetFinalizer(result, (*Transaction).Destroy) return result } -func (c FfiConverterOwner) Read(reader io.Reader) *Owner { +func (c FfiConverterTransaction) Read(reader io.Reader) *Transaction { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterOwner) Lower(value *Owner) unsafe.Pointer { +func (c FfiConverterTransaction) Lower(value *Transaction) 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("*Owner") + pointer := value.ffiObject.incrementPointer("*Transaction") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterOwner) Write(writer io.Writer, value *Owner) { +func (c FfiConverterTransaction) Write(writer io.Writer, value *Transaction) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerOwner struct {} +type FfiDestroyerTransaction struct {} -func (_ FfiDestroyerOwner) Destroy(value *Owner) { +func (_ FfiDestroyerTransaction) Destroy(value *Transaction) { value.Destroy() } -type ProgrammableTransactionInterface interface { +type TransactionDigestInterface interface { + ToBase58() string + ToBytes() []byte } -type ProgrammableTransaction struct { +type TransactionDigest struct { ffiObject FfiObject } - -func (object *ProgrammableTransaction) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterProgrammableTransaction struct {} - -var FfiConverterProgrammableTransactionINSTANCE = FfiConverterProgrammableTransaction{} - - -func (c FfiConverterProgrammableTransaction) Lift(pointer unsafe.Pointer) *ProgrammableTransaction { - result := &ProgrammableTransaction { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_programmabletransaction(pointer, status) - }, - ), - } - runtime.SetFinalizer(result, (*ProgrammableTransaction).Destroy) - return result -} - -func (c FfiConverterProgrammableTransaction) Read(reader io.Reader) *ProgrammableTransaction { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterProgrammableTransaction) Lower(value *ProgrammableTransaction) unsafe.Pointer { - // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, - // because the pointer will be decremented immediately after this function returns, - // and someone will be left holding onto a non-locked pointer. - pointer := value.ffiObject.incrementPointer("*ProgrammableTransaction") - defer value.ffiObject.decrementPointer() - return pointer - +func TransactionDigestFromBase58(base58 string) (*TransactionDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *TransactionDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterTransactionDigestINSTANCE.Lift(_uniffiRV), nil + } } -func (c FfiConverterProgrammableTransaction) Write(writer io.Writer, value *ProgrammableTransaction) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +func TransactionDigestFromBytes(bytes []byte) (*TransactionDigest, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *TransactionDigest + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterTransactionDigestINSTANCE.Lift(_uniffiRV), nil + } } -type FfiDestroyerProgrammableTransaction struct {} - -func (_ FfiDestroyerProgrammableTransaction) Destroy(value *ProgrammableTransaction) { - value.Destroy() +func TransactionDigestGenerate() *TransactionDigest { + return FfiConverterTransactionDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_generate(_uniffiStatus) + })) } -type ProtocolConfigsInterface interface { -} -type ProtocolConfigs struct { - ffiObject FfiObject +func (_self *TransactionDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*TransactionDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_base58( + _pointer,_uniffiStatus), + } + })) } - - -func (object *ProtocolConfigs) Destroy() { +func (_self *TransactionDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*TransactionDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *TransactionDigest) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterProtocolConfigs struct {} +type FfiConverterTransactionDigest struct {} -var FfiConverterProtocolConfigsINSTANCE = FfiConverterProtocolConfigs{} +var FfiConverterTransactionDigestINSTANCE = FfiConverterTransactionDigest{} -func (c FfiConverterProtocolConfigs) Lift(pointer unsafe.Pointer) *ProtocolConfigs { - result := &ProtocolConfigs { +func (c FfiConverterTransactionDigest) Lift(pointer unsafe.Pointer) *TransactionDigest { + result := &TransactionDigest { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_protocolconfigs(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_transactiondigest(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_protocolconfigs(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_transactiondigest(pointer, status) }, ), } - runtime.SetFinalizer(result, (*ProtocolConfigs).Destroy) + runtime.SetFinalizer(result, (*TransactionDigest).Destroy) return result } -func (c FfiConverterProtocolConfigs) Read(reader io.Reader) *ProtocolConfigs { +func (c FfiConverterTransactionDigest) Read(reader io.Reader) *TransactionDigest { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterProtocolConfigs) Lower(value *ProtocolConfigs) unsafe.Pointer { +func (c FfiConverterTransactionDigest) Lower(value *TransactionDigest) 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("*ProtocolConfigs") + pointer := value.ffiObject.incrementPointer("*TransactionDigest") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterProtocolConfigs) Write(writer io.Writer, value *ProtocolConfigs) { +func (c FfiConverterTransactionDigest) Write(writer io.Writer, value *TransactionDigest) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerProtocolConfigs struct {} +type FfiDestroyerTransactionDigest struct {} -func (_ FfiDestroyerProtocolConfigs) Destroy(value *ProtocolConfigs) { +func (_ FfiDestroyerTransactionDigest) Destroy(value *TransactionDigest) { value.Destroy() } -type RandomnessStateUpdateInterface interface { +type TransactionEffectsInterface interface { + AsV1() TransactionEffectsV1 + IsV1() bool } -type RandomnessStateUpdate struct { +type TransactionEffects struct { ffiObject FfiObject } +func TransactionEffectsNewV1(effects TransactionEffectsV1) *TransactionEffects { + return FfiConverterTransactionEffectsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1(FfiConverterTransactionEffectsV1INSTANCE.Lower(effects),_uniffiStatus) + })) +} + + -func (object *RandomnessStateUpdate) Destroy() { +func (_self *TransactionEffects) AsV1() TransactionEffectsV1 { + _pointer := _self.ffiObject.incrementPointer("*TransactionEffects") + defer _self.ffiObject.decrementPointer() + return FfiConverterTransactionEffectsV1INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *TransactionEffects) IsV1() bool { + _pointer := _self.ffiObject.incrementPointer("*TransactionEffects") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1( + _pointer,_uniffiStatus) + })) +} +func (object *TransactionEffects) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterRandomnessStateUpdate struct {} +type FfiConverterTransactionEffects struct {} -var FfiConverterRandomnessStateUpdateINSTANCE = FfiConverterRandomnessStateUpdate{} +var FfiConverterTransactionEffectsINSTANCE = FfiConverterTransactionEffects{} -func (c FfiConverterRandomnessStateUpdate) Lift(pointer unsafe.Pointer) *RandomnessStateUpdate { - result := &RandomnessStateUpdate { +func (c FfiConverterTransactionEffects) Lift(pointer unsafe.Pointer) *TransactionEffects { + result := &TransactionEffects { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_transactioneffects(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_randomnessstateupdate(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_transactioneffects(pointer, status) }, ), } - runtime.SetFinalizer(result, (*RandomnessStateUpdate).Destroy) + runtime.SetFinalizer(result, (*TransactionEffects).Destroy) return result } -func (c FfiConverterRandomnessStateUpdate) Read(reader io.Reader) *RandomnessStateUpdate { +func (c FfiConverterTransactionEffects) Read(reader io.Reader) *TransactionEffects { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterRandomnessStateUpdate) Lower(value *RandomnessStateUpdate) unsafe.Pointer { +func (c FfiConverterTransactionEffects) Lower(value *TransactionEffects) 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("*RandomnessStateUpdate") + pointer := value.ffiObject.incrementPointer("*TransactionEffects") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterRandomnessStateUpdate) Write(writer io.Writer, value *RandomnessStateUpdate) { +func (c FfiConverterTransactionEffects) Write(writer io.Writer, value *TransactionEffects) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerRandomnessStateUpdate struct {} +type FfiDestroyerTransactionEffects struct {} -func (_ FfiDestroyerRandomnessStateUpdate) Destroy(value *RandomnessStateUpdate) { +func (_ FfiDestroyerTransactionEffects) Destroy(value *TransactionEffects) { value.Destroy() } -// A secp256k1 signature. -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// secp256k1-signature = 64OCTECT -// ``` -type Secp256k1PublicKeyInterface interface { +type TransactionEffectsDigestInterface interface { + ToBase58() string ToBytes() []byte } -// A secp256k1 signature. -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// secp256k1-signature = 64OCTECT -// ``` -type Secp256k1PublicKey struct { +type TransactionEffectsDigest struct { ffiObject FfiObject } -func Secp256k1PublicKeyFromBytes(bytes []byte) (*Secp256k1PublicKey, error) { +func TransactionEffectsDigestFromBase58(base58 string) (*TransactionEffectsDigest, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) }) if _uniffiErr != nil { - var _uniffiDefaultValue *Secp256k1PublicKey + var _uniffiDefaultValue *TransactionEffectsDigest return _uniffiDefaultValue, _uniffiErr } else { - return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(_uniffiRV), nil + return FfiConverterTransactionEffectsDigestINSTANCE.Lift(_uniffiRV), nil } } -func Secp256k1PublicKeyFromStr(s string) (*Secp256k1PublicKey, error) { +func TransactionEffectsDigestFromBytes(bytes []byte) (*TransactionEffectsDigest, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) }) if _uniffiErr != nil { - var _uniffiDefaultValue *Secp256k1PublicKey + var _uniffiDefaultValue *TransactionEffectsDigest return _uniffiDefaultValue, _uniffiErr } else { - return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(_uniffiRV), nil + return FfiConverterTransactionEffectsDigestINSTANCE.Lift(_uniffiRV), nil } } -func Secp256k1PublicKeyGenerate() *Secp256k1PublicKey { - return FfiConverterSecp256k1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate(_uniffiStatus) +func TransactionEffectsDigestGenerate() *TransactionEffectsDigest { + return FfiConverterTransactionEffectsDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_generate(_uniffiStatus) })) } -func (_self *Secp256k1PublicKey) ToBytes() []byte { - _pointer := _self.ffiObject.incrementPointer("*Secp256k1PublicKey") +func (_self *TransactionEffectsDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*TransactionEffectsDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_base58( + _pointer,_uniffiStatus), + } + })) +} + +func (_self *TransactionEffectsDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*TransactionEffectsDigest") defer _self.ffiObject.decrementPointer() return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes( + inner: C.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_bytes( _pointer,_uniffiStatus), } })) } -func (object *Secp256k1PublicKey) Destroy() { +func (object *TransactionEffectsDigest) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterSecp256k1PublicKey struct {} +type FfiConverterTransactionEffectsDigest struct {} -var FfiConverterSecp256k1PublicKeyINSTANCE = FfiConverterSecp256k1PublicKey{} +var FfiConverterTransactionEffectsDigestINSTANCE = FfiConverterTransactionEffectsDigest{} -func (c FfiConverterSecp256k1PublicKey) Lift(pointer unsafe.Pointer) *Secp256k1PublicKey { - result := &Secp256k1PublicKey { +func (c FfiConverterTransactionEffectsDigest) Lift(pointer unsafe.Pointer) *TransactionEffectsDigest { + result := &TransactionEffectsDigest { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_secp256k1publickey(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_secp256k1publickey(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_transactioneffectsdigest(pointer, status) }, ), } - runtime.SetFinalizer(result, (*Secp256k1PublicKey).Destroy) + runtime.SetFinalizer(result, (*TransactionEffectsDigest).Destroy) return result } -func (c FfiConverterSecp256k1PublicKey) Read(reader io.Reader) *Secp256k1PublicKey { +func (c FfiConverterTransactionEffectsDigest) Read(reader io.Reader) *TransactionEffectsDigest { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterSecp256k1PublicKey) Lower(value *Secp256k1PublicKey) unsafe.Pointer { +func (c FfiConverterTransactionEffectsDigest) Lower(value *TransactionEffectsDigest) 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("*Secp256k1PublicKey") + pointer := value.ffiObject.incrementPointer("*TransactionEffectsDigest") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterSecp256k1PublicKey) Write(writer io.Writer, value *Secp256k1PublicKey) { +func (c FfiConverterTransactionEffectsDigest) Write(writer io.Writer, value *TransactionEffectsDigest) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerSecp256k1PublicKey struct {} +type FfiDestroyerTransactionEffectsDigest struct {} -func (_ FfiDestroyerSecp256k1PublicKey) Destroy(value *Secp256k1PublicKey) { +func (_ FfiDestroyerTransactionEffectsDigest) Destroy(value *TransactionEffectsDigest) { value.Destroy() } -// A secp256r1 signature. -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// secp256r1-signature = 64OCTECT -// ``` -type Secp256r1PublicKeyInterface interface { +type TransactionEventsDigestInterface interface { + ToBase58() string ToBytes() []byte } -// A secp256r1 signature. -// -// # BCS -// -// The BCS serialized form for this type is defined by the following ABNF: -// -// ```text -// secp256r1-signature = 64OCTECT -// ``` -type Secp256r1PublicKey struct { +type TransactionEventsDigest struct { ffiObject FfiObject } -func Secp256r1PublicKeyFromBytes(bytes []byte) (*Secp256r1PublicKey, error) { +func TransactionEventsDigestFromBase58(base58 string) (*TransactionEventsDigest, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_base58(FfiConverterStringINSTANCE.Lower(base58),_uniffiStatus) }) if _uniffiErr != nil { - var _uniffiDefaultValue *Secp256r1PublicKey + var _uniffiDefaultValue *TransactionEventsDigest return _uniffiDefaultValue, _uniffiErr } else { - return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(_uniffiRV), nil + return FfiConverterTransactionEventsDigestINSTANCE.Lift(_uniffiRV), nil } } -func Secp256r1PublicKeyFromStr(s string) (*Secp256r1PublicKey, error) { +func TransactionEventsDigestFromBytes(bytes []byte) (*TransactionEventsDigest, error) { _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_str(FfiConverterStringINSTANCE.Lower(s),_uniffiStatus) + return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) }) if _uniffiErr != nil { - var _uniffiDefaultValue *Secp256r1PublicKey + var _uniffiDefaultValue *TransactionEventsDigest return _uniffiDefaultValue, _uniffiErr } else { - return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(_uniffiRV), nil + return FfiConverterTransactionEventsDigestINSTANCE.Lift(_uniffiRV), nil } -} - -func Secp256r1PublicKeyGenerate() *Secp256r1PublicKey { - return FfiConverterSecp256r1PublicKeyINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate(_uniffiStatus) - })) -} - - - -func (_self *Secp256r1PublicKey) ToBytes() []byte { - _pointer := _self.ffiObject.incrementPointer("*Secp256r1PublicKey") - defer _self.ffiObject.decrementPointer() - return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes( - _pointer,_uniffiStatus), - } - })) -} -func (object *Secp256r1PublicKey) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} - -type FfiConverterSecp256r1PublicKey struct {} - -var FfiConverterSecp256r1PublicKeyINSTANCE = FfiConverterSecp256r1PublicKey{} - - -func (c FfiConverterSecp256r1PublicKey) Lift(pointer unsafe.Pointer) *Secp256r1PublicKey { - result := &Secp256r1PublicKey { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_secp256r1publickey(pointer, status) - }, - ), - } - runtime.SetFinalizer(result, (*Secp256r1PublicKey).Destroy) - return result -} - -func (c FfiConverterSecp256r1PublicKey) Read(reader io.Reader) *Secp256r1PublicKey { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) -} - -func (c FfiConverterSecp256r1PublicKey) Lower(value *Secp256r1PublicKey) 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("*Secp256r1PublicKey") - defer value.ffiObject.decrementPointer() - return pointer - -} - -func (c FfiConverterSecp256r1PublicKey) Write(writer io.Writer, value *Secp256r1PublicKey) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) -} - -type FfiDestroyerSecp256r1PublicKey struct {} +} -func (_ FfiDestroyerSecp256r1PublicKey) Destroy(value *Secp256r1PublicKey) { - value.Destroy() +func TransactionEventsDigestGenerate() *TransactionEventsDigest { + return FfiConverterTransactionEventsDigestINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_generate(_uniffiStatus) + })) } -type ServiceConfigInterface interface { -} -type ServiceConfig struct { - ffiObject FfiObject +func (_self *TransactionEventsDigest) ToBase58() string { + _pointer := _self.ffiObject.incrementPointer("*TransactionEventsDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_base58( + _pointer,_uniffiStatus), + } + })) } - - -func (object *ServiceConfig) Destroy() { +func (_self *TransactionEventsDigest) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*TransactionEventsDigest") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *TransactionEventsDigest) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterServiceConfig struct {} +type FfiConverterTransactionEventsDigest struct {} -var FfiConverterServiceConfigINSTANCE = FfiConverterServiceConfig{} +var FfiConverterTransactionEventsDigestINSTANCE = FfiConverterTransactionEventsDigest{} -func (c FfiConverterServiceConfig) Lift(pointer unsafe.Pointer) *ServiceConfig { - result := &ServiceConfig { +func (c FfiConverterTransactionEventsDigest) Lift(pointer unsafe.Pointer) *TransactionEventsDigest { + result := &TransactionEventsDigest { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_serviceconfig(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_serviceconfig(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_transactioneventsdigest(pointer, status) }, ), } - runtime.SetFinalizer(result, (*ServiceConfig).Destroy) + runtime.SetFinalizer(result, (*TransactionEventsDigest).Destroy) return result } -func (c FfiConverterServiceConfig) Read(reader io.Reader) *ServiceConfig { +func (c FfiConverterTransactionEventsDigest) Read(reader io.Reader) *TransactionEventsDigest { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterServiceConfig) Lower(value *ServiceConfig) unsafe.Pointer { +func (c FfiConverterTransactionEventsDigest) Lower(value *TransactionEventsDigest) 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("*ServiceConfig") + pointer := value.ffiObject.incrementPointer("*TransactionEventsDigest") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterServiceConfig) Write(writer io.Writer, value *ServiceConfig) { +func (c FfiConverterTransactionEventsDigest) Write(writer io.Writer, value *TransactionEventsDigest) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerServiceConfig struct {} +type FfiDestroyerTransactionEventsDigest struct {} -func (_ FfiDestroyerServiceConfig) Destroy(value *ServiceConfig) { +func (_ FfiDestroyerTransactionEventsDigest) Destroy(value *TransactionEventsDigest) { value.Destroy() } -// Type information for a move struct +// Transaction type // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// struct-tag = address ; address of the package -// identifier ; name of the module -// identifier ; name of the type -// (vector type-tag) ; type parameters +// transaction-kind = %x00 ptb +// =/ %x01 change-epoch +// =/ %x02 genesis-transaction +// =/ %x03 consensus-commit-prologue +// =/ %x04 authenticator-state-update +// =/ %x05 (vector end-of-epoch-transaction-kind) +// =/ %x06 randomness-state-update +// =/ %x07 consensus-commit-prologue-v2 +// =/ %x08 consensus-commit-prologue-v3 // ``` -type StructTagInterface interface { - Address() *Address - // Checks if this is a Coin type - CoinType() *TypeTag - // Checks if this is a Coin type - CoinTypeOpt() **TypeTag +type TransactionKindInterface interface { } -// Type information for a move struct +// Transaction type // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// struct-tag = address ; address of the package -// identifier ; name of the module -// identifier ; name of the type -// (vector type-tag) ; type parameters +// transaction-kind = %x00 ptb +// =/ %x01 change-epoch +// =/ %x02 genesis-transaction +// =/ %x03 consensus-commit-prologue +// =/ %x04 authenticator-state-update +// =/ %x05 (vector end-of-epoch-transaction-kind) +// =/ %x06 randomness-state-update +// =/ %x07 consensus-commit-prologue-v2 +// =/ %x08 consensus-commit-prologue-v3 // ``` -type StructTag struct { +type TransactionKind struct { ffiObject FfiObject } -func NewStructTag(address *Address, module *Identifier, name *Identifier, typeParams []*TypeTag) *StructTag { - return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_new(FfiConverterAddressINSTANCE.Lower(address), FfiConverterIdentifierINSTANCE.Lower(module), FfiConverterIdentifierINSTANCE.Lower(name), FfiConverterSequenceTypeTagINSTANCE.Lower(typeParams),_uniffiStatus) - })) -} -func StructTagCoin(typeTag *TypeTag) *StructTag { - return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin(FfiConverterTypeTagINSTANCE.Lower(typeTag),_uniffiStatus) +func TransactionKindAuthenticatorStateUpdateV1(tx *AuthenticatorStateUpdateV1) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_authenticator_state_update_v1(FfiConverterAuthenticatorStateUpdateV1INSTANCE.Lower(tx),_uniffiStatus) })) } -func StructTagGasCoin() *StructTag { - return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin(_uniffiStatus) +func TransactionKindConsensusCommitPrologueV1(tx *ConsensusCommitPrologueV1) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_consensus_commit_prologue_v1(FfiConverterConsensusCommitPrologueV1INSTANCE.Lower(tx),_uniffiStatus) })) } -func StructTagStakedIota() *StructTag { - return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota(_uniffiStatus) +func TransactionKindEndOfEpoch(tx []*EndOfEpochTransactionKind) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch(FfiConverterSequenceEndOfEpochTransactionKindINSTANCE.Lower(tx),_uniffiStatus) })) } - - -func (_self *StructTag) Address() *Address { - _pointer := _self.ffiObject.incrementPointer("*StructTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_structtag_address( - _pointer,_uniffiStatus) +func TransactionKindGenesis(tx *GenesisTransaction) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis(FfiConverterGenesisTransactionINSTANCE.Lower(tx),_uniffiStatus) })) } -// Checks if this is a Coin type -func (_self *StructTag) CoinType() *TypeTag { - _pointer := _self.ffiObject.incrementPointer("*StructTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type( - _pointer,_uniffiStatus) +func TransactionKindProgrammableTransaction(tx *ProgrammableTransaction) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction(FfiConverterProgrammableTransactionINSTANCE.Lower(tx),_uniffiStatus) })) } -// Checks if this is a Coin type -func (_self *StructTag) CoinTypeOpt() **TypeTag { - _pointer := _self.ffiObject.incrementPointer("*StructTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterOptionalTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt( - _pointer,_uniffiStatus), - } +func TransactionKindRandomnessStateUpdate(tx *RandomnessStateUpdate) *TransactionKind { + return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(FfiConverterRandomnessStateUpdateINSTANCE.Lower(tx),_uniffiStatus) })) } -func (object *StructTag) Destroy() { + + +func (object *TransactionKind) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterStructTag struct {} +type FfiConverterTransactionKind struct {} -var FfiConverterStructTagINSTANCE = FfiConverterStructTag{} +var FfiConverterTransactionKindINSTANCE = FfiConverterTransactionKind{} -func (c FfiConverterStructTag) Lift(pointer unsafe.Pointer) *StructTag { - result := &StructTag { +func (c FfiConverterTransactionKind) Lift(pointer unsafe.Pointer) *TransactionKind { + result := &TransactionKind { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_structtag(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_structtag(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_transactionkind(pointer, status) }, ), } - runtime.SetFinalizer(result, (*StructTag).Destroy) + runtime.SetFinalizer(result, (*TransactionKind).Destroy) return result } -func (c FfiConverterStructTag) Read(reader io.Reader) *StructTag { +func (c FfiConverterTransactionKind) Read(reader io.Reader) *TransactionKind { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterStructTag) Lower(value *StructTag) unsafe.Pointer { +func (c FfiConverterTransactionKind) Lower(value *TransactionKind) unsafe.Pointer { // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, // because the pointer will be decremented immediately after this function returns, // and someone will be left holding onto a non-locked pointer. - pointer := value.ffiObject.incrementPointer("*StructTag") + pointer := value.ffiObject.incrementPointer("*TransactionKind") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterStructTag) Write(writer io.Writer, value *StructTag) { +func (c FfiConverterTransactionKind) Write(writer io.Writer, value *TransactionKind) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerStructTag struct {} +type FfiDestroyerTransactionKind struct {} -func (_ FfiDestroyerStructTag) Destroy(value *StructTag) { +func (_ FfiDestroyerTransactionKind) Destroy(value *TransactionKind) { value.Destroy() } -// A transaction +// Type of a move value // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// transaction = %x00 transaction-v1 +// type-tag = type-tag-u8 \ +// type-tag-u16 \ +// type-tag-u32 \ +// type-tag-u64 \ +// type-tag-u128 \ +// type-tag-u256 \ +// type-tag-bool \ +// type-tag-address \ +// type-tag-signer \ +// type-tag-vector \ +// type-tag-struct // -// transaction-v1 = transaction-kind address gas-payment transaction-expiration +// type-tag-u8 = %x01 +// type-tag-u16 = %x08 +// type-tag-u32 = %x09 +// type-tag-u64 = %x02 +// type-tag-u128 = %x03 +// type-tag-u256 = %x0a +// type-tag-bool = %x00 +// type-tag-address = %x04 +// type-tag-signer = %x05 +// type-tag-vector = %x06 type-tag +// type-tag-struct = %x07 struct-tag // ``` -type TransactionInterface interface { - Expiration() TransactionExpiration - GasPayment() GasPayment - Kind() *TransactionKind - Sender() *Address +type TypeTagInterface interface { + AsStructTag() *StructTag + AsStructTagOpt() **StructTag + AsVectorTypeTag() *TypeTag + AsVectorTypeTagOpt() **TypeTag + IsAddress() bool + IsBool() bool + IsSigner() bool + IsStruct() bool + IsU128() bool + IsU16() bool + IsU256() bool + IsU32() bool + IsU64() bool + IsU8() bool + IsVector() bool } -// A transaction +// Type of a move value // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// transaction = %x00 transaction-v1 +// type-tag = type-tag-u8 \ +// type-tag-u16 \ +// type-tag-u32 \ +// type-tag-u64 \ +// type-tag-u128 \ +// type-tag-u256 \ +// type-tag-bool \ +// type-tag-address \ +// type-tag-signer \ +// type-tag-vector \ +// type-tag-struct // -// transaction-v1 = transaction-kind address gas-payment transaction-expiration +// type-tag-u8 = %x01 +// type-tag-u16 = %x08 +// type-tag-u32 = %x09 +// type-tag-u64 = %x02 +// type-tag-u128 = %x03 +// type-tag-u256 = %x0a +// type-tag-bool = %x00 +// type-tag-address = %x04 +// type-tag-signer = %x05 +// type-tag-vector = %x06 type-tag +// type-tag-struct = %x07 struct-tag // ``` -type Transaction struct { - ffiObject FfiObject -} -func NewTransaction(kind *TransactionKind, sender *Address, gasPayment GasPayment, expiration TransactionExpiration) *Transaction { - return FfiConverterTransactionINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transaction_new(FfiConverterTransactionKindINSTANCE.Lower(kind), FfiConverterAddressINSTANCE.Lower(sender), FfiConverterGasPaymentINSTANCE.Lower(gasPayment), FfiConverterTransactionExpirationINSTANCE.Lower(expiration),_uniffiStatus) - })) +type TypeTag struct { + ffiObject FfiObject } - - -func (_self *Transaction) Expiration() TransactionExpiration { - _pointer := _self.ffiObject.incrementPointer("*Transaction") - defer _self.ffiObject.decrementPointer() - return FfiConverterTransactionExpirationINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_transaction_expiration( - _pointer,_uniffiStatus), - } +func TypeTagAddress() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_address(_uniffiStatus) })) } -func (_self *Transaction) GasPayment() GasPayment { - _pointer := _self.ffiObject.incrementPointer("*Transaction") - defer _self.ffiObject.decrementPointer() - return FfiConverterGasPaymentINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment( - _pointer,_uniffiStatus), - } +func TypeTagBool() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool(_uniffiStatus) })) } -func (_self *Transaction) Kind() *TransactionKind { - _pointer := _self.ffiObject.incrementPointer("*Transaction") - defer _self.ffiObject.decrementPointer() - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_transaction_kind( - _pointer,_uniffiStatus) +func TypeTagSigner() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer(_uniffiStatus) })) } -func (_self *Transaction) Sender() *Address { - _pointer := _self.ffiObject.incrementPointer("*Transaction") - defer _self.ffiObject.decrementPointer() - return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_transaction_sender( - _pointer,_uniffiStatus) +func TypeTagStructTag(structTag *StructTag) *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag(FfiConverterStructTagINSTANCE.Lower(structTag),_uniffiStatus) })) } -func (object *Transaction) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() -} -type FfiConverterTransaction struct {} - -var FfiConverterTransactionINSTANCE = FfiConverterTransaction{} - - -func (c FfiConverterTransaction) Lift(pointer unsafe.Pointer) *Transaction { - result := &Transaction { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_transaction(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_transaction(pointer, status) - }, - ), - } - runtime.SetFinalizer(result, (*Transaction).Destroy) - return result +func TypeTagU128() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128(_uniffiStatus) + })) } -func (c FfiConverterTransaction) Read(reader io.Reader) *Transaction { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +func TypeTagU16() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16(_uniffiStatus) + })) } -func (c FfiConverterTransaction) Lower(value *Transaction) 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("*Transaction") - defer value.ffiObject.decrementPointer() - return pointer - +func TypeTagU256() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256(_uniffiStatus) + })) } -func (c FfiConverterTransaction) Write(writer io.Writer, value *Transaction) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +func TypeTagU32() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32(_uniffiStatus) + })) } -type FfiDestroyerTransaction struct {} - -func (_ FfiDestroyerTransaction) Destroy(value *Transaction) { - value.Destroy() +func TypeTagU64() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64(_uniffiStatus) + })) } - - -type TransactionDigestInterface interface { -} -type TransactionDigest struct { - ffiObject FfiObject +func TypeTagU8() *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8(_uniffiStatus) + })) } - - -func (object *TransactionDigest) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() +func TypeTagVector(typeTag *TypeTag) *TypeTag { + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector(FfiConverterTypeTagINSTANCE.Lower(typeTag),_uniffiStatus) + })) } -type FfiConverterTransactionDigest struct {} -var FfiConverterTransactionDigestINSTANCE = FfiConverterTransactionDigest{} +func (_self *TypeTag) AsStructTag() *StructTag { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag( + _pointer,_uniffiStatus) + })) +} -func (c FfiConverterTransactionDigest) Lift(pointer unsafe.Pointer) *TransactionDigest { - result := &TransactionDigest { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_transactiondigest(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_transactiondigest(pointer, status) - }, - ), +func (_self *TypeTag) AsStructTagOpt() **StructTag { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt( + _pointer,_uniffiStatus), } - runtime.SetFinalizer(result, (*TransactionDigest).Destroy) - return result + })) } -func (c FfiConverterTransactionDigest) Read(reader io.Reader) *TransactionDigest { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +func (_self *TypeTag) AsVectorTypeTag() *TypeTag { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag( + _pointer,_uniffiStatus) + })) } -func (c FfiConverterTransactionDigest) Lower(value *TransactionDigest) 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("*TransactionDigest") - defer value.ffiObject.decrementPointer() - return pointer - +func (_self *TypeTag) AsVectorTypeTagOpt() **TypeTag { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt( + _pointer,_uniffiStatus), + } + })) } -func (c FfiConverterTransactionDigest) Write(writer io.Writer, value *TransactionDigest) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +func (_self *TypeTag) IsAddress() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_address( + _pointer,_uniffiStatus) + })) } -type FfiDestroyerTransactionDigest struct {} +func (_self *TypeTag) IsBool() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool( + _pointer,_uniffiStatus) + })) +} -func (_ FfiDestroyerTransactionDigest) Destroy(value *TransactionDigest) { - value.Destroy() +func (_self *TypeTag) IsSigner() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer( + _pointer,_uniffiStatus) + })) } +func (_self *TypeTag) IsStruct() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct( + _pointer,_uniffiStatus) + })) +} +func (_self *TypeTag) IsU128() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128( + _pointer,_uniffiStatus) + })) +} -type TransactionEffectsInterface interface { - AsV1() TransactionEffectsV1 - IsV1() bool +func (_self *TypeTag) IsU16() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16( + _pointer,_uniffiStatus) + })) } -type TransactionEffects struct { - ffiObject FfiObject + +func (_self *TypeTag) IsU256() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256( + _pointer,_uniffiStatus) + })) } +func (_self *TypeTag) IsU32() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32( + _pointer,_uniffiStatus) + })) +} -func TransactionEffectsNewV1(effects TransactionEffectsV1) *TransactionEffects { - return FfiConverterTransactionEffectsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1(FfiConverterTransactionEffectsV1INSTANCE.Lower(effects),_uniffiStatus) +func (_self *TypeTag) IsU64() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64( + _pointer,_uniffiStatus) })) } - - -func (_self *TransactionEffects) AsV1() TransactionEffectsV1 { - _pointer := _self.ffiObject.incrementPointer("*TransactionEffects") +func (_self *TypeTag) IsU8() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") defer _self.ffiObject.decrementPointer() - return FfiConverterTransactionEffectsV1INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { - return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1( - _pointer,_uniffiStatus), - } + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8( + _pointer,_uniffiStatus) })) } -func (_self *TransactionEffects) IsV1() bool { - _pointer := _self.ffiObject.incrementPointer("*TransactionEffects") +func (_self *TypeTag) IsVector() bool { + _pointer := _self.ffiObject.incrementPointer("*TypeTag") defer _self.ffiObject.decrementPointer() return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1( + return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector( _pointer,_uniffiStatus) })) } -func (object *TransactionEffects) Destroy() { +func (object *TypeTag) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterTransactionEffects struct {} +type FfiConverterTypeTag struct {} -var FfiConverterTransactionEffectsINSTANCE = FfiConverterTransactionEffects{} +var FfiConverterTypeTagINSTANCE = FfiConverterTypeTag{} -func (c FfiConverterTransactionEffects) Lift(pointer unsafe.Pointer) *TransactionEffects { - result := &TransactionEffects { +func (c FfiConverterTypeTag) Lift(pointer unsafe.Pointer) *TypeTag { + result := &TypeTag { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_transactioneffects(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_typetag(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_transactioneffects(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_typetag(pointer, status) }, ), } - runtime.SetFinalizer(result, (*TransactionEffects).Destroy) + runtime.SetFinalizer(result, (*TypeTag).Destroy) return result } -func (c FfiConverterTransactionEffects) Read(reader io.Reader) *TransactionEffects { +func (c FfiConverterTypeTag) Read(reader io.Reader) *TypeTag { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterTransactionEffects) Lower(value *TransactionEffects) unsafe.Pointer { +func (c FfiConverterTypeTag) Lower(value *TypeTag) 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("*TransactionEffects") + pointer := value.ffiObject.incrementPointer("*TypeTag") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterTransactionEffects) Write(writer io.Writer, value *TransactionEffects) { +func (c FfiConverterTypeTag) Write(writer io.Writer, value *TypeTag) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerTransactionEffects struct {} +type FfiDestroyerTypeTag struct {} -func (_ FfiDestroyerTransactionEffects) Destroy(value *TransactionEffects) { +func (_ FfiDestroyerTypeTag) Destroy(value *TypeTag) { value.Destroy() } -type TransactionEffectsDigestInterface interface { +// A signature from a user +// +// A `UserSignature` is most commonly used to authorize the execution and +// inclusion of a transaction to the blockchain. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// user-signature-bcs = bytes ; where the contents of the bytes are defined by +// user-signature = simple-signature / multisig / multisig-legacy / zklogin / passkey +// ``` +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type UserSignatureInterface interface { + AsMultisig() *MultisigAggregatedSignature + AsMultisigOpt() **MultisigAggregatedSignature + AsPasskey() *PasskeyAuthenticator + AsPasskeyOpt() **PasskeyAuthenticator + AsSimple() *SimpleSignature + AsSimpleOpt() **SimpleSignature + AsZklogin() *ZkLoginAuthenticator + AsZkloginOpt() **ZkLoginAuthenticator + IsMultisig() bool + IsPasskey() bool + IsSimple() bool + IsZklogin() bool + // Return the flag for this signature scheme + Scheme() SignatureScheme + ToBase64() string + ToBytes() []byte } -type TransactionEffectsDigest struct { +// A signature from a user +// +// A `UserSignature` is most commonly used to authorize the execution and +// inclusion of a transaction to the blockchain. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// user-signature-bcs = bytes ; where the contents of the bytes are defined by +// user-signature = simple-signature / multisig / multisig-legacy / zklogin / passkey +// ``` +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type UserSignature struct { ffiObject FfiObject } +func UserSignatureFromBase64(base64 string) (*UserSignature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_base64(FfiConverterStringINSTANCE.Lower(base64),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *UserSignature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterUserSignatureINSTANCE.Lift(_uniffiRV), nil + } +} -func (object *TransactionEffectsDigest) Destroy() { - runtime.SetFinalizer(object, nil) - object.ffiObject.destroy() +func UserSignatureFromBytes(bytes []byte) (*UserSignature, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *UserSignature + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterUserSignatureINSTANCE.Lift(_uniffiRV), nil + } } -type FfiConverterTransactionEffectsDigest struct {} -var FfiConverterTransactionEffectsDigestINSTANCE = FfiConverterTransactionEffectsDigest{} +func (_self *UserSignature) AsMultisig() *MultisigAggregatedSignature { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterMultisigAggregatedSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig( + _pointer,_uniffiStatus) + })) +} -func (c FfiConverterTransactionEffectsDigest) Lift(pointer unsafe.Pointer) *TransactionEffectsDigest { - result := &TransactionEffectsDigest { - newFfiObject( - pointer, - func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(pointer, status) - }, - func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_transactioneffectsdigest(pointer, status) - }, - ), +func (_self *UserSignature) AsMultisigOpt() **MultisigAggregatedSignature { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalMultisigAggregatedSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig_opt( + _pointer,_uniffiStatus), } - runtime.SetFinalizer(result, (*TransactionEffectsDigest).Destroy) - return result + })) } -func (c FfiConverterTransactionEffectsDigest) Read(reader io.Reader) *TransactionEffectsDigest { - return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) +func (_self *UserSignature) AsPasskey() *PasskeyAuthenticator { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterPasskeyAuthenticatorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey( + _pointer,_uniffiStatus) + })) } -func (c FfiConverterTransactionEffectsDigest) Lower(value *TransactionEffectsDigest) 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("*TransactionEffectsDigest") - defer value.ffiObject.decrementPointer() - return pointer +func (_self *UserSignature) AsPasskeyOpt() **PasskeyAuthenticator { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalPasskeyAuthenticatorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey_opt( + _pointer,_uniffiStatus), + } + })) +} +func (_self *UserSignature) AsSimple() *SimpleSignature { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSimpleSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple( + _pointer,_uniffiStatus) + })) } -func (c FfiConverterTransactionEffectsDigest) Write(writer io.Writer, value *TransactionEffectsDigest) { - writeUint64(writer, uint64(uintptr(c.Lower(value)))) +func (_self *UserSignature) AsSimpleOpt() **SimpleSignature { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalSimpleSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple_opt( + _pointer,_uniffiStatus), + } + })) } -type FfiDestroyerTransactionEffectsDigest struct {} +func (_self *UserSignature) AsZklogin() *ZkLoginAuthenticator { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterZkLoginAuthenticatorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin( + _pointer,_uniffiStatus) + })) +} -func (_ FfiDestroyerTransactionEffectsDigest) Destroy(value *TransactionEffectsDigest) { - value.Destroy() +func (_self *UserSignature) AsZkloginOpt() **ZkLoginAuthenticator { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterOptionalZkLoginAuthenticatorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin_opt( + _pointer,_uniffiStatus), + } + })) } +func (_self *UserSignature) IsMultisig() bool { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_is_multisig( + _pointer,_uniffiStatus) + })) +} +func (_self *UserSignature) IsPasskey() bool { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_is_passkey( + _pointer,_uniffiStatus) + })) +} -type TransactionEventsDigestInterface interface { +func (_self *UserSignature) IsSimple() bool { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_is_simple( + _pointer,_uniffiStatus) + })) } -type TransactionEventsDigest struct { - ffiObject FfiObject + +func (_self *UserSignature) IsZklogin() bool { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { + return C.uniffi_iota_sdk_ffi_fn_method_usersignature_is_zklogin( + _pointer,_uniffiStatus) + })) } +// Return the flag for this signature scheme +func (_self *UserSignature) Scheme() SignatureScheme { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterSignatureSchemeINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_usersignature_scheme( + _pointer,_uniffiStatus), + } + })) +} +func (_self *UserSignature) ToBase64() string { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_usersignature_to_base64( + _pointer,_uniffiStatus), + } + })) +} -func (object *TransactionEventsDigest) Destroy() { +func (_self *UserSignature) ToBytes() []byte { + _pointer := _self.ffiObject.incrementPointer("*UserSignature") + defer _self.ffiObject.decrementPointer() + return FfiConverterBytesINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_usersignature_to_bytes( + _pointer,_uniffiStatus), + } + })) +} +func (object *UserSignature) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterTransactionEventsDigest struct {} +type FfiConverterUserSignature struct {} -var FfiConverterTransactionEventsDigestINSTANCE = FfiConverterTransactionEventsDigest{} +var FfiConverterUserSignatureINSTANCE = FfiConverterUserSignature{} -func (c FfiConverterTransactionEventsDigest) Lift(pointer unsafe.Pointer) *TransactionEventsDigest { - result := &TransactionEventsDigest { +func (c FfiConverterUserSignature) Lift(pointer unsafe.Pointer) *UserSignature { + result := &UserSignature { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_usersignature(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_transactioneventsdigest(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_usersignature(pointer, status) }, ), } - runtime.SetFinalizer(result, (*TransactionEventsDigest).Destroy) + runtime.SetFinalizer(result, (*UserSignature).Destroy) return result } -func (c FfiConverterTransactionEventsDigest) Read(reader io.Reader) *TransactionEventsDigest { +func (c FfiConverterUserSignature) Read(reader io.Reader) *UserSignature { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterTransactionEventsDigest) Lower(value *TransactionEventsDigest) unsafe.Pointer { +func (c FfiConverterUserSignature) Lower(value *UserSignature) 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("*TransactionEventsDigest") + pointer := value.ffiObject.incrementPointer("*UserSignature") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterTransactionEventsDigest) Write(writer io.Writer, value *TransactionEventsDigest) { +func (c FfiConverterUserSignature) Write(writer io.Writer, value *UserSignature) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerTransactionEventsDigest struct {} +type FfiDestroyerUserSignature struct {} -func (_ FfiDestroyerTransactionEventsDigest) Destroy(value *TransactionEventsDigest) { +func (_ FfiDestroyerUserSignature) Destroy(value *UserSignature) { value.Destroy() } -// Transaction type +// A zklogin authenticator // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// transaction-kind = %x00 ptb -// =/ %x01 change-epoch -// =/ %x02 genesis-transaction -// =/ %x03 consensus-commit-prologue -// =/ %x04 authenticator-state-update -// =/ %x05 (vector end-of-epoch-transaction-kind) -// =/ %x06 randomness-state-update -// =/ %x07 consensus-commit-prologue-v2 -// =/ %x08 consensus-commit-prologue-v3 +// zklogin-bcs = bytes ; contents are defined by +// zklogin = zklogin-flag +// zklogin-inputs +// u64 ; max epoch +// simple-signature // ``` -type TransactionKindInterface interface { -} -// Transaction type +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type ZkLoginAuthenticatorInterface interface { + Inputs() *ZkLoginInputs + MaxEpoch() uint64 + Signature() *SimpleSignature +} +// A zklogin authenticator // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// transaction-kind = %x00 ptb -// =/ %x01 change-epoch -// =/ %x02 genesis-transaction -// =/ %x03 consensus-commit-prologue -// =/ %x04 authenticator-state-update -// =/ %x05 (vector end-of-epoch-transaction-kind) -// =/ %x06 randomness-state-update -// =/ %x07 consensus-commit-prologue-v2 -// =/ %x08 consensus-commit-prologue-v3 +// zklogin-bcs = bytes ; contents are defined by +// zklogin = zklogin-flag +// zklogin-inputs +// u64 ; max epoch +// simple-signature // ``` -type TransactionKind struct { - ffiObject FfiObject -} - - -func TransactionKindAuthenticatorStateUpdateV1(tx *AuthenticatorStateUpdateV1) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_authenticator_state_update_v1(FfiConverterAuthenticatorStateUpdateV1INSTANCE.Lower(tx),_uniffiStatus) - })) +// +// Note: Due to historical reasons, signatures are serialized slightly +// different from the majority of the types in IOTA. In particular if a +// signature is ever embedded in another structure it generally is serialized +// as `bytes` meaning it has a length prefix that defines the length of +// the completely serialized signature. +type ZkLoginAuthenticator struct { + ffiObject FfiObject } - -func TransactionKindConsensusCommitPrologueV1(tx *ConsensusCommitPrologueV1) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_consensus_commit_prologue_v1(FfiConverterConsensusCommitPrologueV1INSTANCE.Lower(tx),_uniffiStatus) +func NewZkLoginAuthenticator(inputs *ZkLoginInputs, maxEpoch uint64, signature *SimpleSignature) *ZkLoginAuthenticator { + return FfiConverterZkLoginAuthenticatorINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_zkloginauthenticator_new(FfiConverterZkLoginInputsINSTANCE.Lower(inputs), FfiConverterUint64INSTANCE.Lower(maxEpoch), FfiConverterSimpleSignatureINSTANCE.Lower(signature),_uniffiStatus) })) } -func TransactionKindEndOfEpoch(tx []*EndOfEpochTransactionKind) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch(FfiConverterSequenceEndOfEpochTransactionKindINSTANCE.Lower(tx),_uniffiStatus) - })) -} -func TransactionKindGenesis(tx *GenesisTransaction) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis(FfiConverterGenesisTransactionINSTANCE.Lower(tx),_uniffiStatus) + + +func (_self *ZkLoginAuthenticator) Inputs() *ZkLoginInputs { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginAuthenticator") + defer _self.ffiObject.decrementPointer() + return FfiConverterZkLoginInputsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_inputs( + _pointer,_uniffiStatus) })) } -func TransactionKindProgrammableTransaction(tx *ProgrammableTransaction) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction(FfiConverterProgrammableTransactionINSTANCE.Lower(tx),_uniffiStatus) +func (_self *ZkLoginAuthenticator) MaxEpoch() uint64 { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginAuthenticator") + defer _self.ffiObject.decrementPointer() + return FfiConverterUint64INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint64_t { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_max_epoch( + _pointer,_uniffiStatus) })) } -func TransactionKindRandomnessStateUpdate(tx *RandomnessStateUpdate) *TransactionKind { - return FfiConverterTransactionKindINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(FfiConverterRandomnessStateUpdateINSTANCE.Lower(tx),_uniffiStatus) +func (_self *ZkLoginAuthenticator) Signature() *SimpleSignature { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginAuthenticator") + defer _self.ffiObject.decrementPointer() + return FfiConverterSimpleSignatureINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_signature( + _pointer,_uniffiStatus) })) } - - -func (object *TransactionKind) Destroy() { +func (object *ZkLoginAuthenticator) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterTransactionKind struct {} +type FfiConverterZkLoginAuthenticator struct {} -var FfiConverterTransactionKindINSTANCE = FfiConverterTransactionKind{} +var FfiConverterZkLoginAuthenticatorINSTANCE = FfiConverterZkLoginAuthenticator{} -func (c FfiConverterTransactionKind) Lift(pointer unsafe.Pointer) *TransactionKind { - result := &TransactionKind { +func (c FfiConverterZkLoginAuthenticator) Lift(pointer unsafe.Pointer) *ZkLoginAuthenticator { + result := &ZkLoginAuthenticator { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_zkloginauthenticator(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_transactionkind(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_zkloginauthenticator(pointer, status) }, ), } - runtime.SetFinalizer(result, (*TransactionKind).Destroy) + runtime.SetFinalizer(result, (*ZkLoginAuthenticator).Destroy) return result } -func (c FfiConverterTransactionKind) Read(reader io.Reader) *TransactionKind { +func (c FfiConverterZkLoginAuthenticator) Read(reader io.Reader) *ZkLoginAuthenticator { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterTransactionKind) Lower(value *TransactionKind) unsafe.Pointer { +func (c FfiConverterZkLoginAuthenticator) Lower(value *ZkLoginAuthenticator) unsafe.Pointer { // TODO: this is bad - all synchronization from ObjectRuntime.go is discarded here, // because the pointer will be decremented immediately after this function returns, // and someone will be left holding onto a non-locked pointer. - pointer := value.ffiObject.incrementPointer("*TransactionKind") + pointer := value.ffiObject.incrementPointer("*ZkLoginAuthenticator") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterTransactionKind) Write(writer io.Writer, value *TransactionKind) { +func (c FfiConverterZkLoginAuthenticator) Write(writer io.Writer, value *ZkLoginAuthenticator) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerTransactionKind struct {} +type FfiDestroyerZkLoginAuthenticator struct {} -func (_ FfiDestroyerTransactionKind) Destroy(value *TransactionKind) { +func (_ FfiDestroyerZkLoginAuthenticator) Destroy(value *ZkLoginAuthenticator) { value.Destroy() } -// Type of a move value +// A zklogin groth16 proof and the required inputs to perform proof +// verification. // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// type-tag = type-tag-u8 \ -// type-tag-u16 \ -// type-tag-u32 \ -// type-tag-u64 \ -// type-tag-u128 \ -// type-tag-u256 \ -// type-tag-bool \ -// type-tag-address \ -// type-tag-signer \ -// type-tag-vector \ -// type-tag-struct -// -// type-tag-u8 = %x01 -// type-tag-u16 = %x08 -// type-tag-u32 = %x09 -// type-tag-u64 = %x02 -// type-tag-u128 = %x03 -// type-tag-u256 = %x0a -// type-tag-bool = %x00 -// type-tag-address = %x04 -// type-tag-signer = %x05 -// type-tag-vector = %x06 type-tag -// type-tag-struct = %x07 struct-tag +// zklogin-inputs = zklogin-proof +// zklogin-claim +// string ; base64url-unpadded encoded JwtHeader +// bn254-field-element ; address_seed // ``` -type TypeTagInterface interface { - AsStructTag() *StructTag - AsStructTagOpt() **StructTag - AsVectorTypeTag() *TypeTag - AsVectorTypeTagOpt() **TypeTag - IsAddress() bool - IsBool() bool - IsSigner() bool - IsStruct() bool - IsU128() bool - IsU16() bool - IsU256() bool - IsU32() bool - IsU64() bool - IsU8() bool - IsVector() bool -} -// Type of a move value +type ZkLoginInputsInterface interface { + AddressSeed() *Bn254FieldElement + HeaderBase64() string + IssBase64Details() ZkLoginClaim + ProofPoints() *ZkLoginProof +} +// A zklogin groth16 proof and the required inputs to perform proof +// verification. // // # BCS // // The BCS serialized form for this type is defined by the following ABNF: // // ```text -// type-tag = type-tag-u8 \ -// type-tag-u16 \ -// type-tag-u32 \ -// type-tag-u64 \ -// type-tag-u128 \ -// type-tag-u256 \ -// type-tag-bool \ -// type-tag-address \ -// type-tag-signer \ -// type-tag-vector \ -// type-tag-struct -// -// type-tag-u8 = %x01 -// type-tag-u16 = %x08 -// type-tag-u32 = %x09 -// type-tag-u64 = %x02 -// type-tag-u128 = %x03 -// type-tag-u256 = %x0a -// type-tag-bool = %x00 -// type-tag-address = %x04 -// type-tag-signer = %x05 -// type-tag-vector = %x06 type-tag -// type-tag-struct = %x07 struct-tag +// zklogin-inputs = zklogin-proof +// zklogin-claim +// string ; base64url-unpadded encoded JwtHeader +// bn254-field-element ; address_seed // ``` -type TypeTag struct { +type ZkLoginInputs struct { ffiObject FfiObject } - - -func TypeTagAddress() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_address(_uniffiStatus) - })) -} - -func TypeTagBool() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool(_uniffiStatus) - })) -} - -func TypeTagSigner() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer(_uniffiStatus) - })) -} - -func TypeTagStructTag(structTag *StructTag) *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag(FfiConverterStructTagINSTANCE.Lower(structTag),_uniffiStatus) - })) -} - -func TypeTagU128() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128(_uniffiStatus) - })) -} - -func TypeTagU16() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16(_uniffiStatus) - })) -} - -func TypeTagU256() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256(_uniffiStatus) - })) -} - -func TypeTagU32() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32(_uniffiStatus) - })) -} - -func TypeTagU64() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64(_uniffiStatus) - })) -} - -func TypeTagU8() *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8(_uniffiStatus) +func NewZkLoginInputs(proofPoints *ZkLoginProof, issBase64Details ZkLoginClaim, headerBase64 string, addressSeed *Bn254FieldElement) *ZkLoginInputs { + return FfiConverterZkLoginInputsINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_zklogininputs_new(FfiConverterZkLoginProofINSTANCE.Lower(proofPoints), FfiConverterZkLoginClaimINSTANCE.Lower(issBase64Details), FfiConverterStringINSTANCE.Lower(headerBase64), FfiConverterBn254FieldElementINSTANCE.Lower(addressSeed),_uniffiStatus) })) } -func TypeTagVector(typeTag *TypeTag) *TypeTag { - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector(FfiConverterTypeTagINSTANCE.Lower(typeTag),_uniffiStatus) - })) -} -func (_self *TypeTag) AsStructTag() *StructTag { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") +func (_self *ZkLoginInputs) AddressSeed() *Bn254FieldElement { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginInputs") defer _self.ffiObject.decrementPointer() - return FfiConverterStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag( + return FfiConverterBn254FieldElementINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zklogininputs_address_seed( _pointer,_uniffiStatus) })) } -func (_self *TypeTag) AsStructTagOpt() **StructTag { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") +func (_self *ZkLoginInputs) HeaderBase64() string { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginInputs") defer _self.ffiObject.decrementPointer() - return FfiConverterOptionalStructTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt( + inner: C.uniffi_iota_sdk_ffi_fn_method_zklogininputs_header_base64( _pointer,_uniffiStatus), } })) } -func (_self *TypeTag) AsVectorTypeTag() *TypeTag { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag( - _pointer,_uniffiStatus) - })) -} - -func (_self *TypeTag) AsVectorTypeTagOpt() **TypeTag { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") +func (_self *ZkLoginInputs) IssBase64Details() ZkLoginClaim { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginInputs") defer _self.ffiObject.decrementPointer() - return FfiConverterOptionalTypeTagINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return FfiConverterZkLoginClaimINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { return GoRustBuffer { - inner: C.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt( + inner: C.uniffi_iota_sdk_ffi_fn_method_zklogininputs_iss_base64_details( _pointer,_uniffiStatus), } })) } -func (_self *TypeTag) IsAddress() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") +func (_self *ZkLoginInputs) ProofPoints() *ZkLoginProof { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginInputs") defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_address( + return FfiConverterZkLoginProofINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zklogininputs_proof_points( _pointer,_uniffiStatus) })) } - -func (_self *TypeTag) IsBool() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool( - _pointer,_uniffiStatus) - })) +func (object *ZkLoginInputs) Destroy() { + runtime.SetFinalizer(object, nil) + object.ffiObject.destroy() } -func (_self *TypeTag) IsSigner() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer( - _pointer,_uniffiStatus) - })) -} +type FfiConverterZkLoginInputs struct {} -func (_self *TypeTag) IsStruct() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct( - _pointer,_uniffiStatus) - })) +var FfiConverterZkLoginInputsINSTANCE = FfiConverterZkLoginInputs{} + + +func (c FfiConverterZkLoginInputs) Lift(pointer unsafe.Pointer) *ZkLoginInputs { + result := &ZkLoginInputs { + newFfiObject( + pointer, + func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_clone_zklogininputs(pointer, status) + }, + func(pointer unsafe.Pointer, status *C.RustCallStatus) { + C.uniffi_iota_sdk_ffi_fn_free_zklogininputs(pointer, status) + }, + ), + } + runtime.SetFinalizer(result, (*ZkLoginInputs).Destroy) + return result } -func (_self *TypeTag) IsU128() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128( - _pointer,_uniffiStatus) - })) +func (c FfiConverterZkLoginInputs) Read(reader io.Reader) *ZkLoginInputs { + return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (_self *TypeTag) IsU16() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16( - _pointer,_uniffiStatus) - })) +func (c FfiConverterZkLoginInputs) Lower(value *ZkLoginInputs) 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("*ZkLoginInputs") + defer value.ffiObject.decrementPointer() + return pointer + } -func (_self *TypeTag) IsU256() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256( - _pointer,_uniffiStatus) - })) +func (c FfiConverterZkLoginInputs) Write(writer io.Writer, value *ZkLoginInputs) { + writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -func (_self *TypeTag) IsU32() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") - defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32( - _pointer,_uniffiStatus) +type FfiDestroyerZkLoginInputs struct {} + +func (_ FfiDestroyerZkLoginInputs) Destroy(value *ZkLoginInputs) { + value.Destroy() +} + + + +// A zklogin groth16 proof +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// zklogin-proof = circom-g1 circom-g2 circom-g1 +// ``` +type ZkLoginProofInterface interface { + A() *CircomG1 + B() *CircomG2 + C() *CircomG1 +} +// A zklogin groth16 proof +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// zklogin-proof = circom-g1 circom-g2 circom-g1 +// ``` +type ZkLoginProof struct { + ffiObject FfiObject +} +func NewZkLoginProof(a *CircomG1, b *CircomG2, c *CircomG1) *ZkLoginProof { + return FfiConverterZkLoginProofINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_zkloginproof_new(FfiConverterCircomG1INSTANCE.Lower(a), FfiConverterCircomG2INSTANCE.Lower(b), FfiConverterCircomG1INSTANCE.Lower(c),_uniffiStatus) })) } -func (_self *TypeTag) IsU64() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") + + + +func (_self *ZkLoginProof) A() *CircomG1 { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginProof") defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64( + return FfiConverterCircomG1INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginproof_a( _pointer,_uniffiStatus) })) } -func (_self *TypeTag) IsU8() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") +func (_self *ZkLoginProof) B() *CircomG2 { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginProof") defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8( + return FfiConverterCircomG2INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginproof_b( _pointer,_uniffiStatus) })) } -func (_self *TypeTag) IsVector() bool { - _pointer := _self.ffiObject.incrementPointer("*TypeTag") +func (_self *ZkLoginProof) C() *CircomG1 { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginProof") defer _self.ffiObject.decrementPointer() - return FfiConverterBoolINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector( + return FfiConverterCircomG1INSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginproof_c( _pointer,_uniffiStatus) })) } -func (object *TypeTag) Destroy() { +func (object *ZkLoginProof) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterTypeTag struct {} +type FfiConverterZkLoginProof struct {} -var FfiConverterTypeTagINSTANCE = FfiConverterTypeTag{} +var FfiConverterZkLoginProofINSTANCE = FfiConverterZkLoginProof{} -func (c FfiConverterTypeTag) Lift(pointer unsafe.Pointer) *TypeTag { - result := &TypeTag { +func (c FfiConverterZkLoginProof) Lift(pointer unsafe.Pointer) *ZkLoginProof { + result := &ZkLoginProof { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_typetag(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_zkloginproof(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_typetag(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_zkloginproof(pointer, status) }, ), } - runtime.SetFinalizer(result, (*TypeTag).Destroy) + runtime.SetFinalizer(result, (*ZkLoginProof).Destroy) return result } -func (c FfiConverterTypeTag) Read(reader io.Reader) *TypeTag { +func (c FfiConverterZkLoginProof) Read(reader io.Reader) *ZkLoginProof { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterTypeTag) Lower(value *TypeTag) unsafe.Pointer { +func (c FfiConverterZkLoginProof) Lower(value *ZkLoginProof) 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("*TypeTag") + pointer := value.ffiObject.incrementPointer("*ZkLoginProof") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterTypeTag) Write(writer io.Writer, value *TypeTag) { +func (c FfiConverterZkLoginProof) Write(writer io.Writer, value *ZkLoginProof) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerTypeTag struct {} +type FfiDestroyerZkLoginProof struct {} -func (_ FfiDestroyerTypeTag) Destroy(value *TypeTag) { +func (_ FfiDestroyerZkLoginProof) Destroy(value *ZkLoginProof) { value.Destroy() } -type UserSignatureInterface interface { +// Public Key equivalent for Zklogin authenticators +// +// A `ZkLoginPublicIdentifier` is the equivalent of a public key for other +// account authenticators, and contains the information required to derive the +// onchain account [`Address`] for a Zklogin authenticator. +// +// ## Note +// +// Due to a historical bug that was introduced in the IOTA Typescript SDK when +// the zklogin authenticator was first introduced, there are now possibly two +// "valid" addresses for each zklogin authenticator depending on the +// bit-pattern of the `address_seed` value. +// +// The original bug incorrectly derived a zklogin's address by stripping any +// leading zero-bytes that could have been present in the 32-byte length +// `address_seed` value prior to hashing, leading to a different derived +// address. This incorrectly derived address was presented to users of various +// wallets, leading them to sending funds to these addresses that they couldn't +// access. Instead of letting these users lose any assets that were sent to +// these addresses, the IOTA network decided to change the protocol to allow +// for a zklogin authenticator who's `address_seed` value had leading +// zero-bytes be authorized to sign for both the addresses derived from both +// the unpadded and padded `address_seed` value. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// zklogin-public-identifier-bcs = bytes ; where the contents are defined by +// ; +// +// zklogin-public-identifier = zklogin-public-identifier-iss +// address-seed +// +// zklogin-public-identifier-unpadded = zklogin-public-identifier-iss +// address-seed-unpadded +// +// ; The iss, or issuer, is a utf8 string that is less than 255 bytes long +// ; and is serialized with the iss's length in bytes as a u8 followed by +// ; the bytes of the iss +// zklogin-public-identifier-iss = u8 *255(OCTET) +// +// ; A Bn254FieldElement serialized as a 32-byte big-endian value +// address-seed = 32(OCTET) +// +// ; A Bn254FieldElement serialized as a 32-byte big-endian value +// ; with any leading zero bytes stripped +// address-seed-unpadded = %x00 / %x01-ff *31(OCTET) +// ``` +// +// [`Address`]: crate::Address +type ZkLoginPublicIdentifierInterface interface { + AddressSeed() *Bn254FieldElement + Iss() string } -type UserSignature struct { +// Public Key equivalent for Zklogin authenticators +// +// A `ZkLoginPublicIdentifier` is the equivalent of a public key for other +// account authenticators, and contains the information required to derive the +// onchain account [`Address`] for a Zklogin authenticator. +// +// ## Note +// +// Due to a historical bug that was introduced in the IOTA Typescript SDK when +// the zklogin authenticator was first introduced, there are now possibly two +// "valid" addresses for each zklogin authenticator depending on the +// bit-pattern of the `address_seed` value. +// +// The original bug incorrectly derived a zklogin's address by stripping any +// leading zero-bytes that could have been present in the 32-byte length +// `address_seed` value prior to hashing, leading to a different derived +// address. This incorrectly derived address was presented to users of various +// wallets, leading them to sending funds to these addresses that they couldn't +// access. Instead of letting these users lose any assets that were sent to +// these addresses, the IOTA network decided to change the protocol to allow +// for a zklogin authenticator who's `address_seed` value had leading +// zero-bytes be authorized to sign for both the addresses derived from both +// the unpadded and padded `address_seed` value. +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// zklogin-public-identifier-bcs = bytes ; where the contents are defined by +// ; +// +// zklogin-public-identifier = zklogin-public-identifier-iss +// address-seed +// +// zklogin-public-identifier-unpadded = zklogin-public-identifier-iss +// address-seed-unpadded +// +// ; The iss, or issuer, is a utf8 string that is less than 255 bytes long +// ; and is serialized with the iss's length in bytes as a u8 followed by +// ; the bytes of the iss +// zklogin-public-identifier-iss = u8 *255(OCTET) +// +// ; A Bn254FieldElement serialized as a 32-byte big-endian value +// address-seed = 32(OCTET) +// +// ; A Bn254FieldElement serialized as a 32-byte big-endian value +// ; with any leading zero bytes stripped +// address-seed-unpadded = %x00 / %x01-ff *31(OCTET) +// ``` +// +// [`Address`]: crate::Address +type ZkLoginPublicIdentifier struct { ffiObject FfiObject } +func NewZkLoginPublicIdentifier(iss string, addressSeed *Bn254FieldElement) (*ZkLoginPublicIdentifier, error) { + _uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_constructor_zkloginpublicidentifier_new(FfiConverterStringINSTANCE.Lower(iss), FfiConverterBn254FieldElementINSTANCE.Lower(addressSeed),_uniffiStatus) + }) + if _uniffiErr != nil { + var _uniffiDefaultValue *ZkLoginPublicIdentifier + return _uniffiDefaultValue, _uniffiErr + } else { + return FfiConverterZkLoginPublicIdentifierINSTANCE.Lift(_uniffiRV), nil + } +} -func (object *UserSignature) Destroy() { + +func (_self *ZkLoginPublicIdentifier) AddressSeed() *Bn254FieldElement { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginPublicIdentifier") + defer _self.ffiObject.decrementPointer() + return FfiConverterBn254FieldElementINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { + return C.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_address_seed( + _pointer,_uniffiStatus) + })) +} + +func (_self *ZkLoginPublicIdentifier) Iss() string { + _pointer := _self.ffiObject.incrementPointer("*ZkLoginPublicIdentifier") + defer _self.ffiObject.decrementPointer() + return FfiConverterStringINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) RustBufferI { + return GoRustBuffer { + inner: C.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_iss( + _pointer,_uniffiStatus), + } + })) +} +func (object *ZkLoginPublicIdentifier) Destroy() { runtime.SetFinalizer(object, nil) object.ffiObject.destroy() } -type FfiConverterUserSignature struct {} +type FfiConverterZkLoginPublicIdentifier struct {} -var FfiConverterUserSignatureINSTANCE = FfiConverterUserSignature{} +var FfiConverterZkLoginPublicIdentifierINSTANCE = FfiConverterZkLoginPublicIdentifier{} -func (c FfiConverterUserSignature) Lift(pointer unsafe.Pointer) *UserSignature { - result := &UserSignature { +func (c FfiConverterZkLoginPublicIdentifier) Lift(pointer unsafe.Pointer) *ZkLoginPublicIdentifier { + result := &ZkLoginPublicIdentifier { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) unsafe.Pointer { - return C.uniffi_iota_sdk_ffi_fn_clone_usersignature(pointer, status) + return C.uniffi_iota_sdk_ffi_fn_clone_zkloginpublicidentifier(pointer, status) }, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.uniffi_iota_sdk_ffi_fn_free_usersignature(pointer, status) + C.uniffi_iota_sdk_ffi_fn_free_zkloginpublicidentifier(pointer, status) }, ), } - runtime.SetFinalizer(result, (*UserSignature).Destroy) + runtime.SetFinalizer(result, (*ZkLoginPublicIdentifier).Destroy) return result } -func (c FfiConverterUserSignature) Read(reader io.Reader) *UserSignature { +func (c FfiConverterZkLoginPublicIdentifier) Read(reader io.Reader) *ZkLoginPublicIdentifier { return c.Lift(unsafe.Pointer(uintptr(readUint64(reader)))) } -func (c FfiConverterUserSignature) Lower(value *UserSignature) unsafe.Pointer { +func (c FfiConverterZkLoginPublicIdentifier) Lower(value *ZkLoginPublicIdentifier) 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("*UserSignature") + pointer := value.ffiObject.incrementPointer("*ZkLoginPublicIdentifier") defer value.ffiObject.decrementPointer() return pointer } -func (c FfiConverterUserSignature) Write(writer io.Writer, value *UserSignature) { +func (c FfiConverterZkLoginPublicIdentifier) Write(writer io.Writer, value *ZkLoginPublicIdentifier) { writeUint64(writer, uint64(uintptr(c.Lower(value)))) } -type FfiDestroyerUserSignature struct {} +type FfiDestroyerZkLoginPublicIdentifier struct {} -func (_ FfiDestroyerUserSignature) Destroy(value *UserSignature) { +func (_ FfiDestroyerZkLoginPublicIdentifier) Destroy(value *ZkLoginPublicIdentifier) { value.Destroy() } @@ -9411,6 +14322,72 @@ type FfiDestroyerMovePackagePage struct {} func (_ FfiDestroyerMovePackagePage) Destroy(value MovePackagePage) { value.Destroy() } +// A move struct +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// object-move-struct = compressed-struct-tag bool u64 object-contents +// +// compressed-struct-tag = other-struct-type / gas-coin-type / staked-iota-type / coin-type +// other-struct-type = %x00 struct-tag +// gas-coin-type = %x01 +// staked-iota-type = %x02 +// coin-type = %x03 type-tag +// +// ; first 32 bytes of the contents are the object's object-id +// object-contents = uleb128 (object-id *OCTET) ; length followed by contents +// ``` +type MoveStruct struct { + // The type of this object + StructType *StructTag + // Number that increases each time a tx takes this object as a mutable + // input This is a lamport timestamp, not a sequentially increasing + // version + Version uint64 + // BCS bytes of a Move struct value + Contents []byte +} + +func (r *MoveStruct) Destroy() { + FfiDestroyerStructTag{}.Destroy(r.StructType); + FfiDestroyerUint64{}.Destroy(r.Version); + FfiDestroyerBytes{}.Destroy(r.Contents); +} + +type FfiConverterMoveStruct struct {} + +var FfiConverterMoveStructINSTANCE = FfiConverterMoveStruct{} + +func (c FfiConverterMoveStruct) Lift(rb RustBufferI) MoveStruct { + return LiftFromRustBuffer[MoveStruct](c, rb) +} + +func (c FfiConverterMoveStruct) Read(reader io.Reader) MoveStruct { + return MoveStruct { + FfiConverterStructTagINSTANCE.Read(reader), + FfiConverterUint64INSTANCE.Read(reader), + FfiConverterBytesINSTANCE.Read(reader), + } +} + +func (c FfiConverterMoveStruct) Lower(value MoveStruct) C.RustBuffer { + return LowerIntoRustBuffer[MoveStruct](c, value) +} + +func (c FfiConverterMoveStruct) Write(writer io.Writer, value MoveStruct) { + FfiConverterStructTagINSTANCE.Write(writer, value.StructType); + FfiConverterUint64INSTANCE.Write(writer, value.Version); + FfiConverterBytesINSTANCE.Write(writer, value.Contents); +} + +type FfiDestroyerMoveStruct struct {} + +func (_ FfiDestroyerMoveStruct) Destroy(value MoveStruct) { + value.Destroy() +} type ObjectFilter struct { TypeTag *string Owner **Address @@ -10141,39 +15118,56 @@ type FfiDestroyerTransactionsFilter struct {} func (_ FfiDestroyerTransactionsFilter) Destroy(value TransactionsFilter) { value.Destroy() } -type TypeParseError struct { - Source string +// Identifies a struct and the module it was defined in +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// type-origin = identifier identifier object-id +// ``` +type TypeOrigin struct { + ModuleName *Identifier + StructName *Identifier + Package *ObjectId } -func (r *TypeParseError) Destroy() { - FfiDestroyerString{}.Destroy(r.Source); +func (r *TypeOrigin) Destroy() { + FfiDestroyerIdentifier{}.Destroy(r.ModuleName); + FfiDestroyerIdentifier{}.Destroy(r.StructName); + FfiDestroyerObjectId{}.Destroy(r.Package); } -type FfiConverterTypeParseError struct {} +type FfiConverterTypeOrigin struct {} -var FfiConverterTypeParseErrorINSTANCE = FfiConverterTypeParseError{} +var FfiConverterTypeOriginINSTANCE = FfiConverterTypeOrigin{} -func (c FfiConverterTypeParseError) Lift(rb RustBufferI) TypeParseError { - return LiftFromRustBuffer[TypeParseError](c, rb) +func (c FfiConverterTypeOrigin) Lift(rb RustBufferI) TypeOrigin { + return LiftFromRustBuffer[TypeOrigin](c, rb) } -func (c FfiConverterTypeParseError) Read(reader io.Reader) TypeParseError { - return TypeParseError { - FfiConverterStringINSTANCE.Read(reader), +func (c FfiConverterTypeOrigin) Read(reader io.Reader) TypeOrigin { + return TypeOrigin { + FfiConverterIdentifierINSTANCE.Read(reader), + FfiConverterIdentifierINSTANCE.Read(reader), + FfiConverterObjectIdINSTANCE.Read(reader), } } -func (c FfiConverterTypeParseError) Lower(value TypeParseError) C.RustBuffer { - return LowerIntoRustBuffer[TypeParseError](c, value) +func (c FfiConverterTypeOrigin) Lower(value TypeOrigin) C.RustBuffer { + return LowerIntoRustBuffer[TypeOrigin](c, value) } -func (c FfiConverterTypeParseError) Write(writer io.Writer, value TypeParseError) { - FfiConverterStringINSTANCE.Write(writer, value.Source); +func (c FfiConverterTypeOrigin) Write(writer io.Writer, value TypeOrigin) { + FfiConverterIdentifierINSTANCE.Write(writer, value.ModuleName); + FfiConverterIdentifierINSTANCE.Write(writer, value.StructName); + FfiConverterObjectIdINSTANCE.Write(writer, value.Package); } -type FfiDestroyerTypeParseError struct {} +type FfiDestroyerTypeOrigin struct {} -func (_ FfiDestroyerTypeParseError) Destroy(value TypeParseError) { +func (_ FfiDestroyerTypeOrigin) Destroy(value TypeOrigin) { value.Destroy() } // A shared object that wasn't changed during execution @@ -10224,6 +15218,56 @@ type FfiDestroyerUnchangedSharedObject struct {} func (_ FfiDestroyerUnchangedSharedObject) Destroy(value UnchangedSharedObject) { value.Destroy() } +// Upgraded package info for the linkage table +// +// # BCS +// +// The BCS serialized form for this type is defined by the following ABNF: +// +// ```text +// upgrade-info = object-id u64 +// ``` +type UpgradeInfo struct { + // Id of the upgraded packages + UpgradedId *ObjectId + // Version of the upgraded package + UpgradedVersion uint64 +} + +func (r *UpgradeInfo) Destroy() { + FfiDestroyerObjectId{}.Destroy(r.UpgradedId); + FfiDestroyerUint64{}.Destroy(r.UpgradedVersion); +} + +type FfiConverterUpgradeInfo struct {} + +var FfiConverterUpgradeInfoINSTANCE = FfiConverterUpgradeInfo{} + +func (c FfiConverterUpgradeInfo) Lift(rb RustBufferI) UpgradeInfo { + return LiftFromRustBuffer[UpgradeInfo](c, rb) +} + +func (c FfiConverterUpgradeInfo) Read(reader io.Reader) UpgradeInfo { + return UpgradeInfo { + FfiConverterObjectIdINSTANCE.Read(reader), + FfiConverterUint64INSTANCE.Read(reader), + } +} + +func (c FfiConverterUpgradeInfo) Lower(value UpgradeInfo) C.RustBuffer { + return LowerIntoRustBuffer[UpgradeInfo](c, value) +} + +func (c FfiConverterUpgradeInfo) Write(writer io.Writer, value UpgradeInfo) { + FfiConverterObjectIdINSTANCE.Write(writer, value.UpgradedId); + FfiConverterUint64INSTANCE.Write(writer, value.UpgradedVersion); +} + +type FfiDestroyerUpgradeInfo struct {} + +func (_ FfiDestroyerUpgradeInfo) Destroy(value UpgradeInfo) { + value.Destroy() +} // Represents a validator in the system. type Validator struct { // The APY of this validator in basis points. @@ -10609,6 +15653,45 @@ type FfiDestroyerValidatorSet struct {} func (_ FfiDestroyerValidatorSet) Destroy(value ValidatorSet) { value.Destroy() } +type ZkLoginClaim struct { + Value string + IndexMod4 uint8 +} + +func (r *ZkLoginClaim) Destroy() { + FfiDestroyerString{}.Destroy(r.Value); + FfiDestroyerUint8{}.Destroy(r.IndexMod4); +} + +type FfiConverterZkLoginClaim struct {} + +var FfiConverterZkLoginClaimINSTANCE = FfiConverterZkLoginClaim{} + +func (c FfiConverterZkLoginClaim) Lift(rb RustBufferI) ZkLoginClaim { + return LiftFromRustBuffer[ZkLoginClaim](c, rb) +} + +func (c FfiConverterZkLoginClaim) Read(reader io.Reader) ZkLoginClaim { + return ZkLoginClaim { + FfiConverterStringINSTANCE.Read(reader), + FfiConverterUint8INSTANCE.Read(reader), + } +} + +func (c FfiConverterZkLoginClaim) Lower(value ZkLoginClaim) C.RustBuffer { + return LowerIntoRustBuffer[ZkLoginClaim](c, value) +} + +func (c FfiConverterZkLoginClaim) Write(writer io.Writer, value ZkLoginClaim) { + FfiConverterStringINSTANCE.Write(writer, value.Value); + FfiConverterUint8INSTANCE.Write(writer, value.IndexMod4); +} + +type FfiDestroyerZkLoginClaim struct {} + +func (_ FfiDestroyerZkLoginClaim) Destroy(value ZkLoginClaim) { + value.Destroy() +} type CommandArgumentError interface { @@ -12025,18 +17108,56 @@ func (c FfiConverterSdkFfiError) Write(writer io.Writer, value *SdkFfiError) { } } -type FfiDestroyerSdkFfiError struct {} +type FfiDestroyerSdkFfiError struct {} + +func (_ FfiDestroyerSdkFfiError) Destroy(value *SdkFfiError) { + switch variantValue := value.err.(type) { + case SdkFfiErrorGeneric: + variantValue.destroy() + default: + _ = variantValue + panic(fmt.Sprintf("invalid error value `%v` in FfiDestroyerSdkFfiError.Destroy", value)) + } +} + + + +type SignatureScheme uint + +const ( + SignatureSchemeEd25519 SignatureScheme = 1 + SignatureSchemeSecp256k1 SignatureScheme = 2 + SignatureSchemeSecp256r1 SignatureScheme = 3 + SignatureSchemeMultisig SignatureScheme = 4 + SignatureSchemeBls12381 SignatureScheme = 5 + SignatureSchemeZkLogin SignatureScheme = 6 + SignatureSchemePasskey SignatureScheme = 7 +) + +type FfiConverterSignatureScheme struct {} + +var FfiConverterSignatureSchemeINSTANCE = FfiConverterSignatureScheme{} + +func (c FfiConverterSignatureScheme) Lift(rb RustBufferI) SignatureScheme { + return LiftFromRustBuffer[SignatureScheme](c, rb) +} + +func (c FfiConverterSignatureScheme) Lower(value SignatureScheme) C.RustBuffer { + return LowerIntoRustBuffer[SignatureScheme](c, value) +} +func (FfiConverterSignatureScheme) Read(reader io.Reader) SignatureScheme { + id := readInt32(reader) + return SignatureScheme(id) +} -func (_ FfiDestroyerSdkFfiError) Destroy(value *SdkFfiError) { - switch variantValue := value.err.(type) { - case SdkFfiErrorGeneric: - variantValue.destroy() - default: - _ = variantValue - panic(fmt.Sprintf("invalid error value `%v` in FfiDestroyerSdkFfiError.Destroy", value)) - } +func (FfiConverterSignatureScheme) Write(writer io.Writer, value SignatureScheme) { + writeInt32(writer, int32(value)) } +type FfiDestroyerSignatureScheme struct {} + +func (_ FfiDestroyerSignatureScheme) Destroy(value SignatureScheme) { +} type TransactionBlockKindInput uint @@ -12714,6 +17835,80 @@ func (_ FfiDestroyerOptionalCoinMetadata) Destroy(value **CoinMetadata) { } } +type FfiConverterOptionalEd25519PublicKey struct{} + +var FfiConverterOptionalEd25519PublicKeyINSTANCE = FfiConverterOptionalEd25519PublicKey{} + +func (c FfiConverterOptionalEd25519PublicKey) Lift(rb RustBufferI) **Ed25519PublicKey { + return LiftFromRustBuffer[**Ed25519PublicKey](c, rb) +} + +func (_ FfiConverterOptionalEd25519PublicKey) Read(reader io.Reader) **Ed25519PublicKey { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterEd25519PublicKeyINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalEd25519PublicKey) Lower(value **Ed25519PublicKey) C.RustBuffer { + return LowerIntoRustBuffer[**Ed25519PublicKey](c, value) +} + +func (_ FfiConverterOptionalEd25519PublicKey) Write(writer io.Writer, value **Ed25519PublicKey) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterEd25519PublicKeyINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalEd25519PublicKey struct {} + +func (_ FfiDestroyerOptionalEd25519PublicKey) Destroy(value **Ed25519PublicKey) { + if value != nil { + FfiDestroyerEd25519PublicKey{}.Destroy(*value) + } +} + +type FfiConverterOptionalEd25519Signature struct{} + +var FfiConverterOptionalEd25519SignatureINSTANCE = FfiConverterOptionalEd25519Signature{} + +func (c FfiConverterOptionalEd25519Signature) Lift(rb RustBufferI) **Ed25519Signature { + return LiftFromRustBuffer[**Ed25519Signature](c, rb) +} + +func (_ FfiConverterOptionalEd25519Signature) Read(reader io.Reader) **Ed25519Signature { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterEd25519SignatureINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalEd25519Signature) Lower(value **Ed25519Signature) C.RustBuffer { + return LowerIntoRustBuffer[**Ed25519Signature](c, value) +} + +func (_ FfiConverterOptionalEd25519Signature) Write(writer io.Writer, value **Ed25519Signature) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterEd25519SignatureINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalEd25519Signature struct {} + +func (_ FfiDestroyerOptionalEd25519Signature) Destroy(value **Ed25519Signature) { + if value != nil { + FfiDestroyerEd25519Signature{}.Destroy(*value) + } +} + type FfiConverterOptionalEffectsAuxiliaryDataDigest struct{} var FfiConverterOptionalEffectsAuxiliaryDataDigestINSTANCE = FfiConverterOptionalEffectsAuxiliaryDataDigest{} @@ -12915,172 +18110,394 @@ func (_ FfiConverterOptionalMovePackage) Read(reader io.Reader) **MovePackage { return &temp } -func (c FfiConverterOptionalMovePackage) Lower(value **MovePackage) C.RustBuffer { - return LowerIntoRustBuffer[**MovePackage](c, value) +func (c FfiConverterOptionalMovePackage) Lower(value **MovePackage) C.RustBuffer { + return LowerIntoRustBuffer[**MovePackage](c, value) +} + +func (_ FfiConverterOptionalMovePackage) Write(writer io.Writer, value **MovePackage) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterMovePackageINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalMovePackage struct {} + +func (_ FfiDestroyerOptionalMovePackage) Destroy(value **MovePackage) { + if value != nil { + FfiDestroyerMovePackage{}.Destroy(*value) + } +} + +type FfiConverterOptionalMultisigAggregatedSignature struct{} + +var FfiConverterOptionalMultisigAggregatedSignatureINSTANCE = FfiConverterOptionalMultisigAggregatedSignature{} + +func (c FfiConverterOptionalMultisigAggregatedSignature) Lift(rb RustBufferI) **MultisigAggregatedSignature { + return LiftFromRustBuffer[**MultisigAggregatedSignature](c, rb) +} + +func (_ FfiConverterOptionalMultisigAggregatedSignature) Read(reader io.Reader) **MultisigAggregatedSignature { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterMultisigAggregatedSignatureINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalMultisigAggregatedSignature) Lower(value **MultisigAggregatedSignature) C.RustBuffer { + return LowerIntoRustBuffer[**MultisigAggregatedSignature](c, value) +} + +func (_ FfiConverterOptionalMultisigAggregatedSignature) Write(writer io.Writer, value **MultisigAggregatedSignature) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterMultisigAggregatedSignatureINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalMultisigAggregatedSignature struct {} + +func (_ FfiDestroyerOptionalMultisigAggregatedSignature) Destroy(value **MultisigAggregatedSignature) { + if value != nil { + FfiDestroyerMultisigAggregatedSignature{}.Destroy(*value) + } +} + +type FfiConverterOptionalObject struct{} + +var FfiConverterOptionalObjectINSTANCE = FfiConverterOptionalObject{} + +func (c FfiConverterOptionalObject) Lift(rb RustBufferI) **Object { + return LiftFromRustBuffer[**Object](c, rb) +} + +func (_ FfiConverterOptionalObject) Read(reader io.Reader) **Object { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterObjectINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalObject) Lower(value **Object) C.RustBuffer { + return LowerIntoRustBuffer[**Object](c, value) +} + +func (_ FfiConverterOptionalObject) Write(writer io.Writer, value **Object) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterObjectINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalObject struct {} + +func (_ FfiDestroyerOptionalObject) Destroy(value **Object) { + if value != nil { + FfiDestroyerObject{}.Destroy(*value) + } +} + +type FfiConverterOptionalObjectId struct{} + +var FfiConverterOptionalObjectIdINSTANCE = FfiConverterOptionalObjectId{} + +func (c FfiConverterOptionalObjectId) Lift(rb RustBufferI) **ObjectId { + return LiftFromRustBuffer[**ObjectId](c, rb) +} + +func (_ FfiConverterOptionalObjectId) Read(reader io.Reader) **ObjectId { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterObjectIdINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalObjectId) Lower(value **ObjectId) C.RustBuffer { + return LowerIntoRustBuffer[**ObjectId](c, value) +} + +func (_ FfiConverterOptionalObjectId) Write(writer io.Writer, value **ObjectId) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterObjectIdINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalObjectId struct {} + +func (_ FfiDestroyerOptionalObjectId) Destroy(value **ObjectId) { + if value != nil { + FfiDestroyerObjectId{}.Destroy(*value) + } +} + +type FfiConverterOptionalPasskeyAuthenticator struct{} + +var FfiConverterOptionalPasskeyAuthenticatorINSTANCE = FfiConverterOptionalPasskeyAuthenticator{} + +func (c FfiConverterOptionalPasskeyAuthenticator) Lift(rb RustBufferI) **PasskeyAuthenticator { + return LiftFromRustBuffer[**PasskeyAuthenticator](c, rb) +} + +func (_ FfiConverterOptionalPasskeyAuthenticator) Read(reader io.Reader) **PasskeyAuthenticator { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterPasskeyAuthenticatorINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalPasskeyAuthenticator) Lower(value **PasskeyAuthenticator) C.RustBuffer { + return LowerIntoRustBuffer[**PasskeyAuthenticator](c, value) +} + +func (_ FfiConverterOptionalPasskeyAuthenticator) Write(writer io.Writer, value **PasskeyAuthenticator) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterPasskeyAuthenticatorINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalPasskeyAuthenticator struct {} + +func (_ FfiDestroyerOptionalPasskeyAuthenticator) Destroy(value **PasskeyAuthenticator) { + if value != nil { + FfiDestroyerPasskeyAuthenticator{}.Destroy(*value) + } +} + +type FfiConverterOptionalProtocolConfigs struct{} + +var FfiConverterOptionalProtocolConfigsINSTANCE = FfiConverterOptionalProtocolConfigs{} + +func (c FfiConverterOptionalProtocolConfigs) Lift(rb RustBufferI) **ProtocolConfigs { + return LiftFromRustBuffer[**ProtocolConfigs](c, rb) +} + +func (_ FfiConverterOptionalProtocolConfigs) Read(reader io.Reader) **ProtocolConfigs { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterProtocolConfigsINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalProtocolConfigs) Lower(value **ProtocolConfigs) C.RustBuffer { + return LowerIntoRustBuffer[**ProtocolConfigs](c, value) +} + +func (_ FfiConverterOptionalProtocolConfigs) Write(writer io.Writer, value **ProtocolConfigs) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterProtocolConfigsINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalProtocolConfigs struct {} + +func (_ FfiDestroyerOptionalProtocolConfigs) Destroy(value **ProtocolConfigs) { + if value != nil { + FfiDestroyerProtocolConfigs{}.Destroy(*value) + } +} + +type FfiConverterOptionalSecp256k1PublicKey struct{} + +var FfiConverterOptionalSecp256k1PublicKeyINSTANCE = FfiConverterOptionalSecp256k1PublicKey{} + +func (c FfiConverterOptionalSecp256k1PublicKey) Lift(rb RustBufferI) **Secp256k1PublicKey { + return LiftFromRustBuffer[**Secp256k1PublicKey](c, rb) +} + +func (_ FfiConverterOptionalSecp256k1PublicKey) Read(reader io.Reader) **Secp256k1PublicKey { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterSecp256k1PublicKeyINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalSecp256k1PublicKey) Lower(value **Secp256k1PublicKey) C.RustBuffer { + return LowerIntoRustBuffer[**Secp256k1PublicKey](c, value) } -func (_ FfiConverterOptionalMovePackage) Write(writer io.Writer, value **MovePackage) { +func (_ FfiConverterOptionalSecp256k1PublicKey) Write(writer io.Writer, value **Secp256k1PublicKey) { if value == nil { writeInt8(writer, 0) } else { writeInt8(writer, 1) - FfiConverterMovePackageINSTANCE.Write(writer, *value) + FfiConverterSecp256k1PublicKeyINSTANCE.Write(writer, *value) } } -type FfiDestroyerOptionalMovePackage struct {} +type FfiDestroyerOptionalSecp256k1PublicKey struct {} -func (_ FfiDestroyerOptionalMovePackage) Destroy(value **MovePackage) { +func (_ FfiDestroyerOptionalSecp256k1PublicKey) Destroy(value **Secp256k1PublicKey) { if value != nil { - FfiDestroyerMovePackage{}.Destroy(*value) + FfiDestroyerSecp256k1PublicKey{}.Destroy(*value) } } -type FfiConverterOptionalMoveStruct struct{} +type FfiConverterOptionalSecp256k1Signature struct{} -var FfiConverterOptionalMoveStructINSTANCE = FfiConverterOptionalMoveStruct{} +var FfiConverterOptionalSecp256k1SignatureINSTANCE = FfiConverterOptionalSecp256k1Signature{} -func (c FfiConverterOptionalMoveStruct) Lift(rb RustBufferI) **MoveStruct { - return LiftFromRustBuffer[**MoveStruct](c, rb) +func (c FfiConverterOptionalSecp256k1Signature) Lift(rb RustBufferI) **Secp256k1Signature { + return LiftFromRustBuffer[**Secp256k1Signature](c, rb) } -func (_ FfiConverterOptionalMoveStruct) Read(reader io.Reader) **MoveStruct { +func (_ FfiConverterOptionalSecp256k1Signature) Read(reader io.Reader) **Secp256k1Signature { if readInt8(reader) == 0 { return nil } - temp := FfiConverterMoveStructINSTANCE.Read(reader) + temp := FfiConverterSecp256k1SignatureINSTANCE.Read(reader) return &temp } -func (c FfiConverterOptionalMoveStruct) Lower(value **MoveStruct) C.RustBuffer { - return LowerIntoRustBuffer[**MoveStruct](c, value) +func (c FfiConverterOptionalSecp256k1Signature) Lower(value **Secp256k1Signature) C.RustBuffer { + return LowerIntoRustBuffer[**Secp256k1Signature](c, value) } -func (_ FfiConverterOptionalMoveStruct) Write(writer io.Writer, value **MoveStruct) { +func (_ FfiConverterOptionalSecp256k1Signature) Write(writer io.Writer, value **Secp256k1Signature) { if value == nil { writeInt8(writer, 0) } else { writeInt8(writer, 1) - FfiConverterMoveStructINSTANCE.Write(writer, *value) + FfiConverterSecp256k1SignatureINSTANCE.Write(writer, *value) } } -type FfiDestroyerOptionalMoveStruct struct {} +type FfiDestroyerOptionalSecp256k1Signature struct {} -func (_ FfiDestroyerOptionalMoveStruct) Destroy(value **MoveStruct) { +func (_ FfiDestroyerOptionalSecp256k1Signature) Destroy(value **Secp256k1Signature) { if value != nil { - FfiDestroyerMoveStruct{}.Destroy(*value) + FfiDestroyerSecp256k1Signature{}.Destroy(*value) } } -type FfiConverterOptionalObject struct{} +type FfiConverterOptionalSecp256r1PublicKey struct{} -var FfiConverterOptionalObjectINSTANCE = FfiConverterOptionalObject{} +var FfiConverterOptionalSecp256r1PublicKeyINSTANCE = FfiConverterOptionalSecp256r1PublicKey{} -func (c FfiConverterOptionalObject) Lift(rb RustBufferI) **Object { - return LiftFromRustBuffer[**Object](c, rb) +func (c FfiConverterOptionalSecp256r1PublicKey) Lift(rb RustBufferI) **Secp256r1PublicKey { + return LiftFromRustBuffer[**Secp256r1PublicKey](c, rb) } -func (_ FfiConverterOptionalObject) Read(reader io.Reader) **Object { +func (_ FfiConverterOptionalSecp256r1PublicKey) Read(reader io.Reader) **Secp256r1PublicKey { if readInt8(reader) == 0 { return nil } - temp := FfiConverterObjectINSTANCE.Read(reader) + temp := FfiConverterSecp256r1PublicKeyINSTANCE.Read(reader) return &temp } -func (c FfiConverterOptionalObject) Lower(value **Object) C.RustBuffer { - return LowerIntoRustBuffer[**Object](c, value) +func (c FfiConverterOptionalSecp256r1PublicKey) Lower(value **Secp256r1PublicKey) C.RustBuffer { + return LowerIntoRustBuffer[**Secp256r1PublicKey](c, value) } -func (_ FfiConverterOptionalObject) Write(writer io.Writer, value **Object) { +func (_ FfiConverterOptionalSecp256r1PublicKey) Write(writer io.Writer, value **Secp256r1PublicKey) { if value == nil { writeInt8(writer, 0) } else { writeInt8(writer, 1) - FfiConverterObjectINSTANCE.Write(writer, *value) + FfiConverterSecp256r1PublicKeyINSTANCE.Write(writer, *value) } } -type FfiDestroyerOptionalObject struct {} +type FfiDestroyerOptionalSecp256r1PublicKey struct {} -func (_ FfiDestroyerOptionalObject) Destroy(value **Object) { +func (_ FfiDestroyerOptionalSecp256r1PublicKey) Destroy(value **Secp256r1PublicKey) { if value != nil { - FfiDestroyerObject{}.Destroy(*value) + FfiDestroyerSecp256r1PublicKey{}.Destroy(*value) } } -type FfiConverterOptionalObjectId struct{} +type FfiConverterOptionalSecp256r1Signature struct{} -var FfiConverterOptionalObjectIdINSTANCE = FfiConverterOptionalObjectId{} +var FfiConverterOptionalSecp256r1SignatureINSTANCE = FfiConverterOptionalSecp256r1Signature{} -func (c FfiConverterOptionalObjectId) Lift(rb RustBufferI) **ObjectId { - return LiftFromRustBuffer[**ObjectId](c, rb) +func (c FfiConverterOptionalSecp256r1Signature) Lift(rb RustBufferI) **Secp256r1Signature { + return LiftFromRustBuffer[**Secp256r1Signature](c, rb) } -func (_ FfiConverterOptionalObjectId) Read(reader io.Reader) **ObjectId { +func (_ FfiConverterOptionalSecp256r1Signature) Read(reader io.Reader) **Secp256r1Signature { if readInt8(reader) == 0 { return nil } - temp := FfiConverterObjectIdINSTANCE.Read(reader) + temp := FfiConverterSecp256r1SignatureINSTANCE.Read(reader) return &temp } -func (c FfiConverterOptionalObjectId) Lower(value **ObjectId) C.RustBuffer { - return LowerIntoRustBuffer[**ObjectId](c, value) +func (c FfiConverterOptionalSecp256r1Signature) Lower(value **Secp256r1Signature) C.RustBuffer { + return LowerIntoRustBuffer[**Secp256r1Signature](c, value) } -func (_ FfiConverterOptionalObjectId) Write(writer io.Writer, value **ObjectId) { +func (_ FfiConverterOptionalSecp256r1Signature) Write(writer io.Writer, value **Secp256r1Signature) { if value == nil { writeInt8(writer, 0) } else { writeInt8(writer, 1) - FfiConverterObjectIdINSTANCE.Write(writer, *value) + FfiConverterSecp256r1SignatureINSTANCE.Write(writer, *value) } } -type FfiDestroyerOptionalObjectId struct {} +type FfiDestroyerOptionalSecp256r1Signature struct {} -func (_ FfiDestroyerOptionalObjectId) Destroy(value **ObjectId) { +func (_ FfiDestroyerOptionalSecp256r1Signature) Destroy(value **Secp256r1Signature) { if value != nil { - FfiDestroyerObjectId{}.Destroy(*value) + FfiDestroyerSecp256r1Signature{}.Destroy(*value) } } -type FfiConverterOptionalProtocolConfigs struct{} +type FfiConverterOptionalSimpleSignature struct{} -var FfiConverterOptionalProtocolConfigsINSTANCE = FfiConverterOptionalProtocolConfigs{} +var FfiConverterOptionalSimpleSignatureINSTANCE = FfiConverterOptionalSimpleSignature{} -func (c FfiConverterOptionalProtocolConfigs) Lift(rb RustBufferI) **ProtocolConfigs { - return LiftFromRustBuffer[**ProtocolConfigs](c, rb) +func (c FfiConverterOptionalSimpleSignature) Lift(rb RustBufferI) **SimpleSignature { + return LiftFromRustBuffer[**SimpleSignature](c, rb) } -func (_ FfiConverterOptionalProtocolConfigs) Read(reader io.Reader) **ProtocolConfigs { +func (_ FfiConverterOptionalSimpleSignature) Read(reader io.Reader) **SimpleSignature { if readInt8(reader) == 0 { return nil } - temp := FfiConverterProtocolConfigsINSTANCE.Read(reader) + temp := FfiConverterSimpleSignatureINSTANCE.Read(reader) return &temp } -func (c FfiConverterOptionalProtocolConfigs) Lower(value **ProtocolConfigs) C.RustBuffer { - return LowerIntoRustBuffer[**ProtocolConfigs](c, value) +func (c FfiConverterOptionalSimpleSignature) Lower(value **SimpleSignature) C.RustBuffer { + return LowerIntoRustBuffer[**SimpleSignature](c, value) } -func (_ FfiConverterOptionalProtocolConfigs) Write(writer io.Writer, value **ProtocolConfigs) { +func (_ FfiConverterOptionalSimpleSignature) Write(writer io.Writer, value **SimpleSignature) { if value == nil { writeInt8(writer, 0) } else { writeInt8(writer, 1) - FfiConverterProtocolConfigsINSTANCE.Write(writer, *value) + FfiConverterSimpleSignatureINSTANCE.Write(writer, *value) } } -type FfiDestroyerOptionalProtocolConfigs struct {} +type FfiDestroyerOptionalSimpleSignature struct {} -func (_ FfiDestroyerOptionalProtocolConfigs) Destroy(value **ProtocolConfigs) { +func (_ FfiDestroyerOptionalSimpleSignature) Destroy(value **SimpleSignature) { if value != nil { - FfiDestroyerProtocolConfigs{}.Destroy(*value) + FfiDestroyerSimpleSignature{}.Destroy(*value) } } @@ -13232,6 +18649,80 @@ func (_ FfiDestroyerOptionalTypeTag) Destroy(value **TypeTag) { } } +type FfiConverterOptionalZkLoginAuthenticator struct{} + +var FfiConverterOptionalZkLoginAuthenticatorINSTANCE = FfiConverterOptionalZkLoginAuthenticator{} + +func (c FfiConverterOptionalZkLoginAuthenticator) Lift(rb RustBufferI) **ZkLoginAuthenticator { + return LiftFromRustBuffer[**ZkLoginAuthenticator](c, rb) +} + +func (_ FfiConverterOptionalZkLoginAuthenticator) Read(reader io.Reader) **ZkLoginAuthenticator { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterZkLoginAuthenticatorINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalZkLoginAuthenticator) Lower(value **ZkLoginAuthenticator) C.RustBuffer { + return LowerIntoRustBuffer[**ZkLoginAuthenticator](c, value) +} + +func (_ FfiConverterOptionalZkLoginAuthenticator) Write(writer io.Writer, value **ZkLoginAuthenticator) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterZkLoginAuthenticatorINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalZkLoginAuthenticator struct {} + +func (_ FfiDestroyerOptionalZkLoginAuthenticator) Destroy(value **ZkLoginAuthenticator) { + if value != nil { + FfiDestroyerZkLoginAuthenticator{}.Destroy(*value) + } +} + +type FfiConverterOptionalZkLoginPublicIdentifier struct{} + +var FfiConverterOptionalZkLoginPublicIdentifierINSTANCE = FfiConverterOptionalZkLoginPublicIdentifier{} + +func (c FfiConverterOptionalZkLoginPublicIdentifier) Lift(rb RustBufferI) **ZkLoginPublicIdentifier { + return LiftFromRustBuffer[**ZkLoginPublicIdentifier](c, rb) +} + +func (_ FfiConverterOptionalZkLoginPublicIdentifier) Read(reader io.Reader) **ZkLoginPublicIdentifier { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterZkLoginPublicIdentifierINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalZkLoginPublicIdentifier) Lower(value **ZkLoginPublicIdentifier) C.RustBuffer { + return LowerIntoRustBuffer[**ZkLoginPublicIdentifier](c, value) +} + +func (_ FfiConverterOptionalZkLoginPublicIdentifier) Write(writer io.Writer, value **ZkLoginPublicIdentifier) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterZkLoginPublicIdentifierINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalZkLoginPublicIdentifier struct {} + +func (_ FfiDestroyerOptionalZkLoginPublicIdentifier) Destroy(value **ZkLoginPublicIdentifier) { + if value != nil { + FfiDestroyerZkLoginPublicIdentifier{}.Destroy(*value) + } +} + type FfiConverterOptionalCheckpointSummary struct{} var FfiConverterOptionalCheckpointSummaryINSTANCE = FfiConverterOptionalCheckpointSummary{} @@ -13454,6 +18945,43 @@ func (_ FfiDestroyerOptionalMoveLocation) Destroy(value *MoveLocation) { } } +type FfiConverterOptionalMoveStruct struct{} + +var FfiConverterOptionalMoveStructINSTANCE = FfiConverterOptionalMoveStruct{} + +func (c FfiConverterOptionalMoveStruct) Lift(rb RustBufferI) *MoveStruct { + return LiftFromRustBuffer[*MoveStruct](c, rb) +} + +func (_ FfiConverterOptionalMoveStruct) Read(reader io.Reader) *MoveStruct { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterMoveStructINSTANCE.Read(reader) + return &temp +} + +func (c FfiConverterOptionalMoveStruct) Lower(value *MoveStruct) C.RustBuffer { + return LowerIntoRustBuffer[*MoveStruct](c, value) +} + +func (_ FfiConverterOptionalMoveStruct) Write(writer io.Writer, value *MoveStruct) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterMoveStructINSTANCE.Write(writer, *value) + } +} + +type FfiDestroyerOptionalMoveStruct struct {} + +func (_ FfiDestroyerOptionalMoveStruct) Destroy(value *MoveStruct) { + if value != nil { + FfiDestroyerMoveStruct{}.Destroy(*value) + } +} + type FfiConverterOptionalObjectFilter struct{} var FfiConverterOptionalObjectFilterINSTANCE = FfiConverterOptionalObjectFilter{} @@ -14119,6 +19647,92 @@ func (FfiDestroyerSequenceMovePackage) Destroy(sequence []*MovePackage) { } } +type FfiConverterSequenceMultisigMember struct{} + +var FfiConverterSequenceMultisigMemberINSTANCE = FfiConverterSequenceMultisigMember{} + +func (c FfiConverterSequenceMultisigMember) Lift(rb RustBufferI) []*MultisigMember { + return LiftFromRustBuffer[[]*MultisigMember](c, rb) +} + +func (c FfiConverterSequenceMultisigMember) Read(reader io.Reader) []*MultisigMember { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*MultisigMember, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterMultisigMemberINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceMultisigMember) Lower(value []*MultisigMember) C.RustBuffer { + return LowerIntoRustBuffer[[]*MultisigMember](c, value) +} + +func (c FfiConverterSequenceMultisigMember) Write(writer io.Writer, value []*MultisigMember) { + if len(value) > math.MaxInt32 { + panic("[]*MultisigMember is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterMultisigMemberINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceMultisigMember struct {} + +func (FfiDestroyerSequenceMultisigMember) Destroy(sequence []*MultisigMember) { + for _, value := range sequence { + FfiDestroyerMultisigMember{}.Destroy(value) + } +} + +type FfiConverterSequenceMultisigMemberSignature struct{} + +var FfiConverterSequenceMultisigMemberSignatureINSTANCE = FfiConverterSequenceMultisigMemberSignature{} + +func (c FfiConverterSequenceMultisigMemberSignature) Lift(rb RustBufferI) []*MultisigMemberSignature { + return LiftFromRustBuffer[[]*MultisigMemberSignature](c, rb) +} + +func (c FfiConverterSequenceMultisigMemberSignature) Read(reader io.Reader) []*MultisigMemberSignature { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]*MultisigMemberSignature, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterMultisigMemberSignatureINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceMultisigMemberSignature) Lower(value []*MultisigMemberSignature) C.RustBuffer { + return LowerIntoRustBuffer[[]*MultisigMemberSignature](c, value) +} + +func (c FfiConverterSequenceMultisigMemberSignature) Write(writer io.Writer, value []*MultisigMemberSignature) { + if len(value) > math.MaxInt32 { + panic("[]*MultisigMemberSignature is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterMultisigMemberSignatureINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceMultisigMemberSignature struct {} + +func (FfiDestroyerSequenceMultisigMemberSignature) Destroy(sequence []*MultisigMemberSignature) { + for _, value := range sequence { + FfiDestroyerMultisigMemberSignature{}.Destroy(value) + } +} + type FfiConverterSequenceObject struct{} var FfiConverterSequenceObjectINSTANCE = FfiConverterSequenceObject{} @@ -14721,6 +20335,49 @@ func (FfiDestroyerSequenceTransactionDataEffects) Destroy(sequence []Transaction } } +type FfiConverterSequenceTypeOrigin struct{} + +var FfiConverterSequenceTypeOriginINSTANCE = FfiConverterSequenceTypeOrigin{} + +func (c FfiConverterSequenceTypeOrigin) Lift(rb RustBufferI) []TypeOrigin { + return LiftFromRustBuffer[[]TypeOrigin](c, rb) +} + +func (c FfiConverterSequenceTypeOrigin) Read(reader io.Reader) []TypeOrigin { + length := readInt32(reader) + if length == 0 { + return nil + } + result := make([]TypeOrigin, 0, length) + for i := int32(0); i < length; i++ { + result = append(result, FfiConverterTypeOriginINSTANCE.Read(reader)) + } + return result +} + +func (c FfiConverterSequenceTypeOrigin) Lower(value []TypeOrigin) C.RustBuffer { + return LowerIntoRustBuffer[[]TypeOrigin](c, value) +} + +func (c FfiConverterSequenceTypeOrigin) Write(writer io.Writer, value []TypeOrigin) { + if len(value) > math.MaxInt32 { + panic("[]TypeOrigin is too large to fit into Int32") + } + + writeInt32(writer, int32(len(value))) + for _, item := range value { + FfiConverterTypeOriginINSTANCE.Write(writer, item) + } +} + +type FfiDestroyerSequenceTypeOrigin struct {} + +func (FfiDestroyerSequenceTypeOrigin) Destroy(sequence []TypeOrigin) { + for _, value := range sequence { + FfiDestroyerTypeOrigin{}.Destroy(value) + } +} + type FfiConverterSequenceUnchangedSharedObject struct{} var FfiConverterSequenceUnchangedSharedObjectINSTANCE = FfiConverterSequenceUnchangedSharedObject{} @@ -14849,6 +20506,94 @@ func (FfiDestroyerSequenceValidatorCommitteeMember) Destroy(sequence []Validator FfiDestroyerValidatorCommitteeMember{}.Destroy(value) } } + +type FfiConverterMapIdentifierBytes struct {} + +var FfiConverterMapIdentifierBytesINSTANCE = FfiConverterMapIdentifierBytes{} + +func (c FfiConverterMapIdentifierBytes) Lift(rb RustBufferI) map[*Identifier][]byte { + return LiftFromRustBuffer[map[*Identifier][]byte](c, rb) +} + +func (_ FfiConverterMapIdentifierBytes) Read(reader io.Reader) map[*Identifier][]byte { + result := make(map[*Identifier][]byte) + length := readInt32(reader) + for i := int32(0); i < length; i++ { + key := FfiConverterIdentifierINSTANCE.Read(reader) + value := FfiConverterBytesINSTANCE.Read(reader) + result[key] = value + } + return result +} + +func (c FfiConverterMapIdentifierBytes) Lower(value map[*Identifier][]byte) C.RustBuffer { + return LowerIntoRustBuffer[map[*Identifier][]byte](c, value) +} + +func (_ FfiConverterMapIdentifierBytes) Write(writer io.Writer, mapValue map[*Identifier][]byte) { + if len(mapValue) > math.MaxInt32 { + panic("map[*Identifier][]byte is too large to fit into Int32") + } + + writeInt32(writer, int32(len(mapValue))) + for key, value := range mapValue { + FfiConverterIdentifierINSTANCE.Write(writer, key) + FfiConverterBytesINSTANCE.Write(writer, value) + } +} + +type FfiDestroyerMapIdentifierBytes struct {} + +func (_ FfiDestroyerMapIdentifierBytes) Destroy(mapValue map[*Identifier][]byte) { + for key, value := range mapValue { + FfiDestroyerIdentifier{}.Destroy(key) + FfiDestroyerBytes{}.Destroy(value) + } +} + +type FfiConverterMapObjectIdUpgradeInfo struct {} + +var FfiConverterMapObjectIdUpgradeInfoINSTANCE = FfiConverterMapObjectIdUpgradeInfo{} + +func (c FfiConverterMapObjectIdUpgradeInfo) Lift(rb RustBufferI) map[*ObjectId]UpgradeInfo { + return LiftFromRustBuffer[map[*ObjectId]UpgradeInfo](c, rb) +} + +func (_ FfiConverterMapObjectIdUpgradeInfo) Read(reader io.Reader) map[*ObjectId]UpgradeInfo { + result := make(map[*ObjectId]UpgradeInfo) + length := readInt32(reader) + for i := int32(0); i < length; i++ { + key := FfiConverterObjectIdINSTANCE.Read(reader) + value := FfiConverterUpgradeInfoINSTANCE.Read(reader) + result[key] = value + } + return result +} + +func (c FfiConverterMapObjectIdUpgradeInfo) Lower(value map[*ObjectId]UpgradeInfo) C.RustBuffer { + return LowerIntoRustBuffer[map[*ObjectId]UpgradeInfo](c, value) +} + +func (_ FfiConverterMapObjectIdUpgradeInfo) Write(writer io.Writer, mapValue map[*ObjectId]UpgradeInfo) { + if len(mapValue) > math.MaxInt32 { + panic("map[*ObjectId]UpgradeInfo is too large to fit into Int32") + } + + writeInt32(writer, int32(len(mapValue))) + for key, value := range mapValue { + FfiConverterObjectIdINSTANCE.Write(writer, key) + FfiConverterUpgradeInfoINSTANCE.Write(writer, value) + } +} + +type FfiDestroyerMapObjectIdUpgradeInfo struct {} + +func (_ FfiDestroyerMapObjectIdUpgradeInfo) Destroy(mapValue map[*ObjectId]UpgradeInfo) { + for key, value := range mapValue { + FfiDestroyerObjectId{}.Destroy(key) + FfiDestroyerUpgradeInfo{}.Destroy(value) + } +} /** * Typealias from the type name used in the UDL file to the builtin type. This * is needed because the UDL type name is used in function/method signatures. diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index d50b71c3c..8ea984b69 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -475,6 +475,72 @@ void* uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate(RustCallStat RustBuffer uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_BLS12381SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_BLS12381SIGNATURE +void* uniffi_iota_sdk_ffi_fn_clone_bls12381signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_BLS12381SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_BLS12381SIGNATURE +void uniffi_iota_sdk_ffi_fn_free_bls12381signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BLS12381SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BLS12381SIGNATURE_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BLS12381SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BLS12381SIGNATURE_FROM_STR +void* uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_str(RustBuffer s, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BLS12381SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BLS12381SIGNATURE_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_BLS12381SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_BLS12381SIGNATURE_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_bls12381signature_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_BN254FIELDELEMENT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_BN254FIELDELEMENT +void* uniffi_iota_sdk_ffi_fn_clone_bn254fieldelement(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_BN254FIELDELEMENT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_BN254FIELDELEMENT +void uniffi_iota_sdk_ffi_fn_free_bn254fieldelement(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BN254FIELDELEMENT_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BN254FIELDELEMENT_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR +void* uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str(RustBuffer s, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR_RADIX_10 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR_RADIX_10 +void* uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str_radix_10(RustBuffer s, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_BN254FIELDELEMENT_PADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_BN254FIELDELEMENT_PADDED +RustBuffer uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_padded(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_BN254FIELDELEMENT_UNPADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_BN254FIELDELEMENT_UNPADDED +RustBuffer uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_unpadded(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHANGEEPOCH #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHANGEEPOCH void* uniffi_iota_sdk_ffi_fn_clone_changeepoch(void* ptr, RustCallStatus *out_status @@ -525,6 +591,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_checkpointcontentsdigest(void* ptr, RustCallS void uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTSDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTSDIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTSDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTCONTENTSDIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTDIGEST #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CHECKPOINTDIGEST void* uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(void* ptr, RustCallStatus *out_status @@ -535,6 +627,62 @@ void* uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(void* ptr, RustCallStatus *o void uniffi_iota_sdk_ffi_fn_free_checkpointdigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CHECKPOINTDIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTDIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CHECKPOINTDIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_bytes(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 +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CIRCOMG1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CIRCOMG1 +void uniffi_iota_sdk_ffi_fn_free_circomg1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CIRCOMG1_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CIRCOMG1_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_circomg1_new(void* el_0, void* el_1, void* el_2, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CIRCOMG2 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CIRCOMG2 +void* uniffi_iota_sdk_ffi_fn_clone_circomg2(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CIRCOMG2 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_CIRCOMG2 +void uniffi_iota_sdk_ffi_fn_free_circomg2(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CIRCOMG2_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CIRCOMG2_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_circomg2_new(void* el_0_0, void* el_0_1, void* el_1_0, void* el_1_1, void* el_2_0, void* el_2_1, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_COIN #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_COIN void* uniffi_iota_sdk_ffi_fn_clone_coin(void* ptr, RustCallStatus *out_status @@ -585,6 +733,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(void* ptr, RustCallStat void uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CONSENSUSCOMMITDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CONSENSUSCOMMITDIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CONSENSUSCOMMITDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_CONSENSUSCOMMITDIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CONSENSUSCOMMITPROLOGUEV1 #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_CONSENSUSCOMMITPROLOGUEV1 void* uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1(void* ptr, RustCallStatus *out_status @@ -605,6 +779,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_digest(void* ptr, RustCallStatus *out_status void uniffi_iota_sdk_ffi_fn_free_digest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_DIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_DIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_digest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_DIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_DIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_digest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_DIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_DIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_digest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_DIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_DIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_digest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_DIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_DIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_digest_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ED25519PUBLICKEY #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ED25519PUBLICKEY void* uniffi_iota_sdk_ffi_fn_clone_ed25519publickey(void* ptr, RustCallStatus *out_status @@ -636,6 +836,37 @@ void* uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_generate(RustCallStatu RustBuffer uniffi_iota_sdk_ffi_fn_method_ed25519publickey_to_bytes(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ED25519SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ED25519SIGNATURE +void* uniffi_iota_sdk_ffi_fn_clone_ed25519signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ED25519SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ED25519SIGNATURE +void uniffi_iota_sdk_ffi_fn_free_ed25519signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ED25519SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ED25519SIGNATURE_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ED25519SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ED25519SIGNATURE_FROM_STR +void* uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_str(RustBuffer s, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ED25519SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ED25519SIGNATURE_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ED25519SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ED25519SIGNATURE_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_ed25519signature_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_EFFECTSAUXILIARYDATADIGEST #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_EFFECTSAUXILIARYDATADIGEST void* uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(void* ptr, RustCallStatus *out_status @@ -646,6 +877,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(void* ptr, RustCal void uniffi_iota_sdk_ffi_fn_free_effectsauxiliarydatadigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ENDOFEPOCHTRANSACTIONKIND #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ENDOFEPOCHTRANSACTIONKIND void* uniffi_iota_sdk_ffi_fn_clone_endofepochtransactionkind(void* ptr, RustCallStatus *out_status @@ -1034,6 +1291,16 @@ void* uniffi_iota_sdk_ffi_fn_clone_identifier(void* ptr, RustCallStatus *out_sta void uniffi_iota_sdk_ffi_fn_free_identifier(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_IDENTIFIER_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_IDENTIFIER_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_identifier_new(RustBuffer identifier, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_IDENTIFIER_AS_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_IDENTIFIER_AS_STR +RustBuffer uniffi_iota_sdk_ffi_fn_method_identifier_as_str(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVEFUNCTION #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVEFUNCTION void* uniffi_iota_sdk_ffi_fn_clone_movefunction(void* ptr, RustCallStatus *out_status @@ -1064,14 +1331,239 @@ void* uniffi_iota_sdk_ffi_fn_clone_movepackage(void* ptr, RustCallStatus *out_st void uniffi_iota_sdk_ffi_fn_free_movepackage(void* ptr, RustCallStatus *out_status ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVESTRUCT -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MOVESTRUCT -void* uniffi_iota_sdk_ffi_fn_clone_movestruct(void* ptr, RustCallStatus *out_status +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MOVEPACKAGE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MOVEPACKAGE_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_movepackage_new(void* id, uint64_t version, RustBuffer modules, RustBuffer type_origin_table, RustBuffer linkage_table, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGAGGREGATEDSIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGAGGREGATEDSIGNATURE +void* uniffi_iota_sdk_ffi_fn_clone_multisigaggregatedsignature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGAGGREGATEDSIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGAGGREGATEDSIGNATURE +void uniffi_iota_sdk_ffi_fn_free_multisigaggregatedsignature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MULTISIGAGGREGATEDSIGNATURE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MULTISIGAGGREGATEDSIGNATURE_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_multisigaggregatedsignature_new(void* committee, RustBuffer signatures, uint16_t bitmap, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGAGGREGATEDSIGNATURE_BITMAP +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGAGGREGATEDSIGNATURE_BITMAP +uint16_t uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_bitmap(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGAGGREGATEDSIGNATURE_COMMITTEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGAGGREGATEDSIGNATURE_COMMITTEE +void* uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_committee(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGAGGREGATEDSIGNATURE_SIGNATURES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGAGGREGATEDSIGNATURE_SIGNATURES +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_signatures(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGCOMMITTEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGCOMMITTEE +void* uniffi_iota_sdk_ffi_fn_clone_multisigcommittee(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGCOMMITTEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGCOMMITTEE +void uniffi_iota_sdk_ffi_fn_free_multisigcommittee(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MULTISIGCOMMITTEE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MULTISIGCOMMITTEE_NEW +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_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 +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_MEMBERS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_MEMBERS +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigcommittee_members(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_SCHEME +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigcommittee_scheme(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_THRESHOLD +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGCOMMITTEE_THRESHOLD +uint16_t uniffi_iota_sdk_ffi_fn_method_multisigcommittee_threshold(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGMEMBER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGMEMBER +void* uniffi_iota_sdk_ffi_fn_clone_multisigmember(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGMEMBER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGMEMBER +void uniffi_iota_sdk_ffi_fn_free_multisigmember(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MULTISIGMEMBER_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_MULTISIGMEMBER_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_multisigmember_new(void* public_key, uint8_t weight, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBER_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBER_PUBLIC_KEY +void* uniffi_iota_sdk_ffi_fn_method_multisigmember_public_key(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBER_WEIGHT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBER_WEIGHT +uint8_t uniffi_iota_sdk_ffi_fn_method_multisigmember_weight(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGMEMBERPUBLICKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGMEMBERPUBLICKEY +void* uniffi_iota_sdk_ffi_fn_clone_multisigmemberpublickey(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGMEMBERPUBLICKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGMEMBERPUBLICKEY +void uniffi_iota_sdk_ffi_fn_free_multisigmemberpublickey(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519 +void* uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1 +void* uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1 +void* uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN +void* uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ED25519 +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_ed25519(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256K1 +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256k1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256R1 +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256r1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ZKLOGIN +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_zklogin(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGMEMBERSIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_MULTISIGMEMBERSIGNATURE +void* uniffi_iota_sdk_ffi_fn_clone_multisigmembersignature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGMEMBERSIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MULTISIGMEMBERSIGNATURE +void uniffi_iota_sdk_ffi_fn_free_multisigmembersignature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519 +void* uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1 +void* uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1 +void* uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN +void* uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_ED25519 +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_ed25519(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256K1 +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256k1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256R1 +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256r1(void* ptr, RustCallStatus *out_status ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MOVESTRUCT -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_MOVESTRUCT -void uniffi_iota_sdk_ffi_fn_free_movestruct(void* ptr, RustCallStatus *out_status +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_MULTISIGMEMBERSIGNATURE_IS_ZKLOGIN +int8_t uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_zklogin(void* ptr, RustCallStatus *out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_OBJECT @@ -1149,6 +1641,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_objectdigest(void* ptr, RustCallStatus *out_s void uniffi_iota_sdk_ffi_fn_free_objectdigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTDIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTDIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_OBJECTDIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_objectdigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTDIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_objectdigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_OBJECTDIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_objectdigest_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_OBJECTID #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_OBJECTID void* uniffi_iota_sdk_ffi_fn_clone_objectid(void* ptr, RustCallStatus *out_status @@ -1204,6 +1722,36 @@ void* uniffi_iota_sdk_ffi_fn_clone_owner(void* ptr, RustCallStatus *out_status void uniffi_iota_sdk_ffi_fn_free_owner(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PASSKEYAUTHENTICATOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PASSKEYAUTHENTICATOR +void* uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PASSKEYAUTHENTICATOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_PASSKEYAUTHENTICATOR +void uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_AUTHENTICATOR_DATA +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_AUTHENTICATOR_DATA +RustBuffer uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_authenticator_data(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_CHALLENGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_CHALLENGE +RustBuffer uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_CLIENT_DATA_JSON +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_PASSKEYAUTHENTICATOR_CLIENT_DATA_JSON +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_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_PROGRAMMABLETRANSACTION #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_PROGRAMMABLETRANSACTION void* uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(void* ptr, RustCallStatus *out_status @@ -1265,6 +1813,37 @@ void* uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate(RustCallSta RustBuffer uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SECP256K1SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SECP256K1SIGNATURE +void* uniffi_iota_sdk_ffi_fn_clone_secp256k1signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SECP256K1SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SECP256K1SIGNATURE +void uniffi_iota_sdk_ffi_fn_free_secp256k1signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_STR +void* uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_str(RustBuffer s, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256K1SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256K1SIGNATURE_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SECP256K1SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SECP256K1SIGNATURE_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_secp256k1signature_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SECP256R1PUBLICKEY #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SECP256R1PUBLICKEY void* uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(void* ptr, RustCallStatus *out_status @@ -1296,6 +1875,37 @@ void* uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate(RustCallSta RustBuffer uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SECP256R1SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SECP256R1SIGNATURE +void* uniffi_iota_sdk_ffi_fn_clone_secp256r1signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SECP256R1SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SECP256R1SIGNATURE +void uniffi_iota_sdk_ffi_fn_free_secp256r1signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_STR +void* uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_str(RustBuffer s, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256R1SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_SECP256R1SIGNATURE_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SECP256R1SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SECP256R1SIGNATURE_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SERVICECONFIG #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SERVICECONFIG void* uniffi_iota_sdk_ffi_fn_clone_serviceconfig(void* ptr, RustCallStatus *out_status @@ -1306,14 +1916,109 @@ void* uniffi_iota_sdk_ffi_fn_clone_serviceconfig(void* ptr, RustCallStatus *out_ void uniffi_iota_sdk_ffi_fn_free_serviceconfig(void* ptr, RustCallStatus *out_status ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_STRUCTTAG -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_STRUCTTAG -void* uniffi_iota_sdk_ffi_fn_clone_structtag(void* ptr, RustCallStatus *out_status +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SIMPLESIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_SIMPLESIGNATURE +void* uniffi_iota_sdk_ffi_fn_clone_simplesignature(void* ptr, RustCallStatus *out_status ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_STRUCTTAG -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_STRUCTTAG -void uniffi_iota_sdk_ffi_fn_free_structtag(void* ptr, RustCallStatus *out_status +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SIMPLESIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_SIMPLESIGNATURE +void uniffi_iota_sdk_ffi_fn_free_simplesignature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY +void* uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_SIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_SIG +void* uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_SIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_ED25519_SIG_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_IS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_IS_ED25519 +int8_t uniffi_iota_sdk_ffi_fn_method_simplesignature_is_ed25519(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_IS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_IS_SECP256K1 +int8_t uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256k1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_IS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_IS_SECP256R1 +int8_t uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256r1(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SCHEME +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_scheme(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY +void* uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_SIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_SIG +void* uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_SIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256K1_SIG_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY +void* uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_SIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_SIG +void* uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_SIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_SECP256R1_SIG_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_SIMPLESIGNATURE_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_STRUCTTAG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_STRUCTTAG +void* uniffi_iota_sdk_ffi_fn_clone_structtag(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_STRUCTTAG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_STRUCTTAG +void uniffi_iota_sdk_ffi_fn_free_structtag(void* ptr, RustCallStatus *out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_STRUCTTAG_COIN @@ -1398,6 +2103,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_transactiondigest(void* ptr, RustCallStatus * void uniffi_iota_sdk_ffi_fn_free_transactiondigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONDIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONDIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONDIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONEFFECTS #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONEFFECTS void* uniffi_iota_sdk_ffi_fn_clone_transactioneffects(void* ptr, RustCallStatus *out_status @@ -1433,6 +2164,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(void* ptr, RustCallS void uniffi_iota_sdk_ffi_fn_free_transactioneffectsdigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTSDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTSDIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTSDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEFFECTSDIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONEVENTSDIGEST #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_TRANSACTIONEVENTSDIGEST void* uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(void* ptr, RustCallStatus *out_status @@ -1443,6 +2200,32 @@ void* uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(void* ptr, RustCallSt void uniffi_iota_sdk_ffi_fn_free_transactioneventsdigest(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BASE58 +void* uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_base58(RustBuffer base58, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_GENERATE +void* uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_generate(RustCallStatus *out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTSDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTSDIGEST_TO_BASE58 +RustBuffer uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_base58(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTSDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONEVENTSDIGEST_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_bytes(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 @@ -1642,6 +2425,211 @@ void* uniffi_iota_sdk_ffi_fn_clone_usersignature(void* ptr, RustCallStatus *out_ void uniffi_iota_sdk_ffi_fn_free_usersignature(void* ptr, RustCallStatus *out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_USERSIGNATURE_FROM_BASE64 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_USERSIGNATURE_FROM_BASE64 +void* uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_base64(RustBuffer base64, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_USERSIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_USERSIGNATURE_FROM_BYTES +void* uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_bytes(RustBuffer bytes, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_MULTISIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_MULTISIG +void* uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_MULTISIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_MULTISIG_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_PASSKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_PASSKEY +void* uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_PASSKEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_PASSKEY_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_SIMPLE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_SIMPLE +void* uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_SIMPLE_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_SIMPLE_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_ZKLOGIN +void* uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_ZKLOGIN_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_AS_ZKLOGIN_OPT +RustBuffer uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin_opt(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_MULTISIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_MULTISIG +int8_t uniffi_iota_sdk_ffi_fn_method_usersignature_is_multisig(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_PASSKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_PASSKEY +int8_t uniffi_iota_sdk_ffi_fn_method_usersignature_is_passkey(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_SIMPLE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_SIMPLE +int8_t uniffi_iota_sdk_ffi_fn_method_usersignature_is_simple(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_IS_ZKLOGIN +int8_t uniffi_iota_sdk_ffi_fn_method_usersignature_is_zklogin(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_SCHEME +RustBuffer uniffi_iota_sdk_ffi_fn_method_usersignature_scheme(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_TO_BASE64 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_TO_BASE64 +RustBuffer uniffi_iota_sdk_ffi_fn_method_usersignature_to_base64(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_USERSIGNATURE_TO_BYTES +RustBuffer uniffi_iota_sdk_ffi_fn_method_usersignature_to_bytes(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGINAUTHENTICATOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGINAUTHENTICATOR +void* uniffi_iota_sdk_ffi_fn_clone_zkloginauthenticator(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGINAUTHENTICATOR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGINAUTHENTICATOR +void uniffi_iota_sdk_ffi_fn_free_zkloginauthenticator(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGINAUTHENTICATOR_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGINAUTHENTICATOR_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_zkloginauthenticator_new(void* inputs, uint64_t max_epoch, void* signature, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINAUTHENTICATOR_INPUTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINAUTHENTICATOR_INPUTS +void* uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_inputs(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINAUTHENTICATOR_MAX_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINAUTHENTICATOR_MAX_EPOCH +uint64_t uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_max_epoch(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINAUTHENTICATOR_SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINAUTHENTICATOR_SIGNATURE +void* uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_signature(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGININPUTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGININPUTS +void* uniffi_iota_sdk_ffi_fn_clone_zklogininputs(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGININPUTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGININPUTS +void uniffi_iota_sdk_ffi_fn_free_zklogininputs(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGININPUTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGININPUTS_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_zklogininputs_new(void* proof_points, RustBuffer iss_base64_details, RustBuffer header_base64, void* address_seed, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_ADDRESS_SEED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_ADDRESS_SEED +void* uniffi_iota_sdk_ffi_fn_method_zklogininputs_address_seed(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_HEADER_BASE64 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_HEADER_BASE64 +RustBuffer uniffi_iota_sdk_ffi_fn_method_zklogininputs_header_base64(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_ISS_BASE64_DETAILS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_ISS_BASE64_DETAILS +RustBuffer uniffi_iota_sdk_ffi_fn_method_zklogininputs_iss_base64_details(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_PROOF_POINTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGININPUTS_PROOF_POINTS +void* uniffi_iota_sdk_ffi_fn_method_zklogininputs_proof_points(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGINPROOF +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGINPROOF +void* uniffi_iota_sdk_ffi_fn_clone_zkloginproof(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGINPROOF +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGINPROOF +void uniffi_iota_sdk_ffi_fn_free_zkloginproof(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGINPROOF_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGINPROOF_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_zkloginproof_new(void* a, void* b, void* c, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPROOF_A +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPROOF_A +void* uniffi_iota_sdk_ffi_fn_method_zkloginproof_a(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPROOF_B +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPROOF_B +void* uniffi_iota_sdk_ffi_fn_method_zkloginproof_b(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPROOF_C +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPROOF_C +void* uniffi_iota_sdk_ffi_fn_method_zkloginproof_c(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGINPUBLICIDENTIFIER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CLONE_ZKLOGINPUBLICIDENTIFIER +void* uniffi_iota_sdk_ffi_fn_clone_zkloginpublicidentifier(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGINPUBLICIDENTIFIER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_FREE_ZKLOGINPUBLICIDENTIFIER +void uniffi_iota_sdk_ffi_fn_free_zkloginpublicidentifier(void* ptr, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGINPUBLICIDENTIFIER_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_CONSTRUCTOR_ZKLOGINPUBLICIDENTIFIER_NEW +void* uniffi_iota_sdk_ffi_fn_constructor_zkloginpublicidentifier_new(RustBuffer iss, void* address_seed, RustCallStatus *out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_ADDRESS_SEED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_ZKLOGINPUBLICIDENTIFIER_ADDRESS_SEED +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_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 +); +#endif #ifndef UNIFFI_FFIDEF_FFI_IOTA_SDK_FFI_RUSTBUFFER_ALLOC #define UNIFFI_FFIDEF_FFI_IOTA_SDK_FFI_RUSTBUFFER_ALLOC RustBuffer ffi_iota_sdk_ffi_rustbuffer_alloc(uint64_t size, RustCallStatus *out_status @@ -1938,6 +2926,24 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_address_to_hex(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BLS12381PUBLICKEY_TO_BYTES uint16_t uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BLS12381SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BLS12381SIGNATURE_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_bls12381signature_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BN254FIELDELEMENT_PADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BN254FIELDELEMENT_PADDED +uint16_t uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_padded(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BN254FIELDELEMENT_UNPADDED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_BN254FIELDELEMENT_UNPADDED +uint16_t uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_unpadded(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCOMMITMENT_AS_ECMH_LIVE_OBJECT_SET_DIGEST @@ -1950,6 +2956,30 @@ 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_CHECKPOINTCONTENTSDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCONTENTSDIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCONTENTSDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTCONTENTSDIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTDIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CHECKPOINTDIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_bytes(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_COIN_BALANCE @@ -1968,12 +2998,54 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_coin_coin_type(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_COIN_ID uint16_t uniffi_iota_sdk_ffi_checksum_method_coin_id(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CONSENSUSCOMMITDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CONSENSUSCOMMITDIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CONSENSUSCOMMITDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_CONSENSUSCOMMITDIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_DIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_DIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_digest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_DIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_DIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_digest_to_bytes(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ED25519PUBLICKEY_TO_BYTES #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ED25519PUBLICKEY_TO_BYTES uint16_t uniffi_iota_sdk_ffi_checksum_method_ed25519publickey_to_bytes(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ED25519SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ED25519SIGNATURE_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_ed25519signature_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_EFFECTSAUXILIARYDATADIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_bytes(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_FAUCETCLIENT_REQUEST @@ -2258,115 +3330,469 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects( ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_AS_STRUCT -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_AS_STRUCT -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_as_struct(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_IDENTIFIER_AS_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_IDENTIFIER_AS_STR +uint16_t uniffi_iota_sdk_ffi_checksum_method_identifier_as_str(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_DATA -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_DATA -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_data(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATEDSIGNATURE_BITMAP +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATEDSIGNATURE_BITMAP +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_ID -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_ID -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_object_id(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATEDSIGNATURE_COMMITTEE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATEDSIGNATURE_COMMITTEE +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_committee(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_TYPE -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_TYPE -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_object_type(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATEDSIGNATURE_SIGNATURES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGAGGREGATEDSIGNATURE_SIGNATURES +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_signatures(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OWNER -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OWNER -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_owner(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_IS_VALID +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_IS_VALID +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_PREVIOUS_TRANSACTION -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_PREVIOUS_TRANSACTION -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_MEMBERS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_MEMBERS +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_members(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_STORAGE_REBATE -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_STORAGE_REBATE -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_SCHEME +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_scheme(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_VERSION -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_VERSION -uint16_t uniffi_iota_sdk_ffi_checksum_method_object_version(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_THRESHOLD +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGCOMMITTEE_THRESHOLD +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_threshold(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_ADDRESS -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_ADDRESS -uint16_t uniffi_iota_sdk_ffi_checksum_method_objectid_to_address(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBER_PUBLIC_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBER_PUBLIC_KEY +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmember_public_key(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_BYTES -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_BYTES -uint16_t uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBER_WEIGHT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBER_WEIGHT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmember_weight(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_HEX -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_HEX -uint16_t uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256K1PUBLICKEY_TO_BYTES -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256K1PUBLICKEY_TO_BYTES -uint16_t uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ED25519_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519_opt(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256R1PUBLICKEY_TO_BYTES -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256R1PUBLICKEY_TO_BYTES -uint16_t uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_ADDRESS -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_ADDRESS -uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_address(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256K1_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1_opt(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE -uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE_OPT -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE_OPT -uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_SECP256R1_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1_opt(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_EXPIRATION -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_EXPIRATION -uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_expiration(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_GAS_PAYMENT -#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_GAS_PAYMENT -uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment(void +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_AS_ZKLOGIN_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin_opt(void ); #endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_KIND +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ED25519 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_ed25519(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256K1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256k1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_SECP256R1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256r1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERPUBLICKEY_IS_ZKLOGIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_zklogin(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ED25519_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256K1_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_SECP256R1_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_AS_ZKLOGIN_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_ED25519 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_ed25519(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256K1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256k1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_SECP256R1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256r1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_MULTISIGMEMBERSIGNATURE_IS_ZKLOGIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_zklogin(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_AS_STRUCT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_AS_STRUCT +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_as_struct(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_DATA +#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_OBJECT_ID +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_ID +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_object_id(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_TYPE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OBJECT_TYPE +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_object_type(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OWNER +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_OWNER +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_owner(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_PREVIOUS_TRANSACTION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_PREVIOUS_TRANSACTION +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_STORAGE_REBATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_STORAGE_REBATE +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_VERSION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECT_VERSION +uint16_t uniffi_iota_sdk_ffi_checksum_method_object_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTDIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTDIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_ADDRESS +uint16_t uniffi_iota_sdk_ffi_checksum_method_objectid_to_address(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_HEX +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_OBJECTID_TO_HEX +uint16_t uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_AUTHENTICATOR_DATA +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_AUTHENTICATOR_DATA +uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_CHALLENGE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_CHALLENGE +uint16_t uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_PASSKEYAUTHENTICATOR_CLIENT_DATA_JSON +#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_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_SECP256K1PUBLICKEY_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256K1PUBLICKEY_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256K1SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256K1SIGNATURE_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_secp256k1signature_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256R1PUBLICKEY_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256R1PUBLICKEY_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256R1SIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SECP256R1SIGNATURE_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_secp256r1signature_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_PUB_KEY_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_SIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_SIG +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_SIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_ED25519_SIG_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_IS_ED25519 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_IS_ED25519 +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_ed25519(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_IS_SECP256K1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_IS_SECP256K1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256k1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_IS_SECP256R1 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_IS_SECP256R1 +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256r1(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SCHEME +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_scheme(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_PUB_KEY_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_SIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_SIG +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_SIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256K1_SIG_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_PUB_KEY_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_SIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_SIG +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_SIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_SECP256R1_SIG_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_SIMPLESIGNATURE_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_ADDRESS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_ADDRESS +uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_address(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE +uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_STRUCTTAG_COIN_TYPE_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_EXPIRATION +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_EXPIRATION +uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_expiration(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_GAS_PAYMENT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_GAS_PAYMENT +uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_KIND #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTION_KIND uint16_t uniffi_iota_sdk_ffi_checksum_method_transaction_kind(void @@ -2376,6 +3802,18 @@ 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_TRANSACTIONDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONDIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONDIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_bytes(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTS_AS_V1 @@ -2388,6 +3826,30 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1(void #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_TRANSACTIONEFFECTSDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTSDIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTSDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEFFECTSDIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTSDIGEST_TO_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTSDIGEST_TO_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTSDIGEST_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONEVENTSDIGEST_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TYPETAG_AS_STRUCT_TAG @@ -2478,6 +3940,168 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TYPETAG_IS_VECTOR uint16_t uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_MULTISIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_MULTISIG +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_MULTISIG_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_MULTISIG_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_PASSKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_PASSKEY +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_PASSKEY_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_PASSKEY_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_SIMPLE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_SIMPLE +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_SIMPLE_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_SIMPLE_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_ZKLOGIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_ZKLOGIN_OPT +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_AS_ZKLOGIN_OPT +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin_opt(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_MULTISIG +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_MULTISIG +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_is_multisig(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_PASSKEY +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_PASSKEY +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_is_passkey(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_SIMPLE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_SIMPLE +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_is_simple(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_ZKLOGIN +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_IS_ZKLOGIN +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_is_zklogin(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_SCHEME +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_SCHEME +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_scheme(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_TO_BASE64 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_TO_BASE64 +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_to_base64(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_TO_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_USERSIGNATURE_TO_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_method_usersignature_to_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINAUTHENTICATOR_INPUTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINAUTHENTICATOR_INPUTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_inputs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINAUTHENTICATOR_MAX_EPOCH +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINAUTHENTICATOR_MAX_EPOCH +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_max_epoch(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINAUTHENTICATOR_SIGNATURE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINAUTHENTICATOR_SIGNATURE +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_signature(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_ADDRESS_SEED +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_ADDRESS_SEED +uint16_t uniffi_iota_sdk_ffi_checksum_method_zklogininputs_address_seed(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_HEADER_BASE64 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_HEADER_BASE64 +uint16_t uniffi_iota_sdk_ffi_checksum_method_zklogininputs_header_base64(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_ISS_BASE64_DETAILS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_ISS_BASE64_DETAILS +uint16_t uniffi_iota_sdk_ffi_checksum_method_zklogininputs_iss_base64_details(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_PROOF_POINTS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGININPUTS_PROOF_POINTS +uint16_t uniffi_iota_sdk_ffi_checksum_method_zklogininputs_proof_points(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPROOF_A +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPROOF_A +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginproof_a(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPROOF_B +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPROOF_B +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginproof_b(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPROOF_C +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPROOF_C +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginproof_c(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_ADDRESS_SEED +#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_ISS +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_ZKLOGINPUBLICIDENTIFIER_ISS +uint16_t uniffi_iota_sdk_ffi_checksum_method_zkloginpublicidentifier_iss(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ADDRESS_FROM_BYTES @@ -2514,12 +4138,132 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str(voi #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381PUBLICKEY_GENERATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381SIGNATURE_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381SIGNATURE_FROM_STR +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_str(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BLS12381SIGNATURE_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_generate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BN254FIELDELEMENT_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BN254FIELDELEMENT_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR_RADIX_10 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_BN254FIELDELEMENT_FROM_STR_RADIX_10 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str_radix_10(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTCONTENTSDIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_generate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTDIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CHECKPOINTDIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_generate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CIRCOMG1_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CIRCOMG1_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CIRCOMG2_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CIRCOMG2_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COIN_TRY_FROM_OBJECT #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_COIN_TRY_FROM_OBJECT uint16_t uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_CONSENSUSCOMMITDIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_generate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_DIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_DIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_digest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_DIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_DIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_digest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_DIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_DIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_digest_generate(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519PUBLICKEY_FROM_BYTES @@ -2538,6 +4282,42 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519PUBLICKEY_GENERATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519SIGNATURE_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519SIGNATURE_FROM_STR +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_str(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ED25519SIGNATURE_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_generate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_EFFECTSAUXILIARYDATADIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_generate(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ENDOFEPOCHTRANSACTIONKIND_AUTHENTICATOR_STATE_CREATE @@ -2616,12 +4396,60 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_GRAPHQLCLIENT_NEW_TESTNET uint16_t uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_IDENTIFIER_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_IDENTIFIER_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_identifier_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MOVEPACKAGE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MOVEPACKAGE_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MULTISIGAGGREGATEDSIGNATURE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MULTISIGAGGREGATEDSIGNATURE_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MULTISIGCOMMITTEE_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MULTISIGCOMMITTEE_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_multisigcommittee_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MULTISIGMEMBER_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_MULTISIGMEMBER_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_multisigmember_new(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECT_NEW #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECT_NEW uint16_t uniffi_iota_sdk_ffi_checksum_constructor_object_new(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTDIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_generate(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_OBJECTID_FROM_BYTES @@ -2652,6 +4480,24 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str(vo #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1PUBLICKEY_GENERATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1SIGNATURE_FROM_STR +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_str(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256K1SIGNATURE_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_generate(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1PUBLICKEY_FROM_BYTES @@ -2670,6 +4516,24 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str(vo #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1PUBLICKEY_GENERATE uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_STR +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1SIGNATURE_FROM_STR +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_str(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1SIGNATURE_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_SECP256R1SIGNATURE_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_STRUCTTAG_COIN @@ -2700,12 +4564,66 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTION_NEW uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transaction_new(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONDIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONDIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_generate(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEFFECTS_NEW_V1 #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_TRANSACTIONEFFECTSDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEFFECTSDIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_generate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BASE58 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BASE58 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_base58(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONEVENTSDIGEST_GENERATE +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_generate(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TRANSACTIONKIND_AUTHENTICATOR_STATE_UPDATE_V1 @@ -2808,6 +4726,42 @@ uint16_t uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8(void #define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_TYPETAG_VECTOR uint16_t uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_USERSIGNATURE_FROM_BASE64 +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_USERSIGNATURE_FROM_BASE64 +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_USERSIGNATURE_FROM_BYTES +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_USERSIGNATURE_FROM_BYTES +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGINAUTHENTICATOR_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGINAUTHENTICATOR_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_zkloginauthenticator_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGININPUTS_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGININPUTS_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_zklogininputs_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGINPROOF_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGINPROOF_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_zkloginproof_new(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGINPUBLICIDENTIFIER_NEW +#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_CONSTRUCTOR_ZKLOGINPUBLICIDENTIFIER_NEW +uint16_t uniffi_iota_sdk_ffi_checksum_constructor_zkloginpublicidentifier_new(void + ); #endif #ifndef UNIFFI_FFIDEF_FFI_IOTA_SDK_FFI_UNIFFI_CONTRACT_VERSION diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index 1448509e1..6f5880155 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -1063,531 +1063,1413 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { -// For large crates we prevent `MethodTooLargeException` (see #2340) -// N.B. the name of the extension is very misleading, since it is -// rather `InterfaceTooLargeException`, caused by too many methods -// in the interface for large crates. -// -// By splitting the otherwise huge interface into two parts -// * UniffiLib -// * IntegrityCheckingUniffiLib (this) -// we allow for ~2x as many methods in the UniffiLib interface. -// -// The `ffi_uniffi_contract_version` method and all checksum methods are put -// into `IntegrityCheckingUniffiLib` and these methods are called only once, -// when the library is loaded. -internal interface IntegrityCheckingUniffiLib : Library { - // Integrity check functions only - fun uniffi_iota_sdk_ffi_checksum_method_address_to_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_address_to_hex( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_coin_balance( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_coin_coin_type( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_coin_id( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_ed25519publickey_to_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_faucetclient_request( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_and_wait( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_active_validators( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_balance( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_chain_id( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_checkpoints( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_transaction_blocks( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_events( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_latest_checkpoint_sequence_number( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_max_page_size( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents_bcs( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_function( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_module( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_latest( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_versions( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_packages( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_protocol_config( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_reference_gas_price( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_set_rpc_server( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_supply( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_digest( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_seq_num( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_data_effects( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_effects( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_data_effects( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects( -): Short -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_object_id( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_object_object_type( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_object_owner( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_object_version( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_address( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_signedtransaction_signatures( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_signedtransaction_transaction( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_transaction_expiration( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment( -): Short -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_transactiondataeffects_effects( -): Short -fun uniffi_iota_sdk_ffi_checksum_method_transactiondataeffects_tx( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_address_generate( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_object_new( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_signedtransaction_new( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transaction_new( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transactiondataeffects_new( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction( -): Short -fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update( -): Short -fun ffi_iota_sdk_ffi_uniffi_contract_version( -): Int -} -// A JNA Library to expose the extern-C FFI definitions. -// This is an implementation detail which will be called internally by the public API. -internal interface UniffiLib : Library { - companion object { - internal val INSTANCE: UniffiLib by lazy { - val componentName = "iota_sdk_ffi" - // For large crates we prevent `MethodTooLargeException` (see #2340) - // N.B. the name of the extension is very misleading, since it is - // rather `InterfaceTooLargeException`, caused by too many methods - // in the interface for large crates. - // - // By splitting the otherwise huge interface into two parts - // * UniffiLib (this) - // * IntegrityCheckingUniffiLib - // And all checksum methods are put into `IntegrityCheckingUniffiLib` - // we allow for ~2x as many methods in the UniffiLib interface. - // - // Thus we first load the library with `loadIndirect` as `IntegrityCheckingUniffiLib` - // so that we can (optionally!) call `uniffiCheckApiChecksums`... - loadIndirect(componentName) - .also { lib: IntegrityCheckingUniffiLib -> - uniffiCheckContractApiVersion(lib) - uniffiCheckApiChecksums(lib) - } - // ... and then we load the library as `UniffiLib` - // N.B. we cannot use `loadIndirect` once and then try to cast it to `UniffiLib` - // => results in `java.lang.ClassCastException: com.sun.proxy.$Proxy cannot be cast to ...` - // error. So we must call `loadIndirect` twice. For crates large enough - // to trigger this issue, the performance impact is negligible, running on - // a macOS M1 machine the `loadIndirect` call takes ~50ms. - val lib = loadIndirect(componentName) - // No need to check the contract version and checksums, since - // we already did that with `IntegrityCheckingUniffiLib` above. - // Loading of library with integrity check done. - lib - } - - // The Cleaner for the whole library - internal val CLEANER: UniffiCleaner by lazy { - UniffiCleaner.create() - } - } - // FFI functions - fun uniffi_iota_sdk_ffi_fn_clone_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_address_from_hex(`hex`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_address_generate(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_method_address_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): RustBuffer.ByValue -fun uniffi_iota_sdk_ffi_fn_method_address_to_hex(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): RustBuffer.ByValue -fun uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_batchsendstatus(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_bls12381publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): RustBuffer.ByValue -fun uniffi_iota_sdk_ffi_fn_clone_changeepoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_changeepoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_changeepochv2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_changeepochv2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): 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_checkpointcontentsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_checkpointdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_coin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_coin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_coin_try_from_object(`object`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_method_coin_balance(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Long -fun uniffi_iota_sdk_ffi_fn_method_coin_coin_type(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_method_coin_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_clone_coinmetadata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_coinmetadata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_consensuscommitprologuev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_dryrunresult(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_dryrunresult(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_ed25519publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_ed25519publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_generate(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_method_ed25519publickey_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): RustBuffer.ByValue -fun uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_effectsauxiliarydatadigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_endofepochtransactionkind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_endofepochtransactionkind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_create(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_expire(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch_v2(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_clone_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_event(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_event(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_executiontimeobservations(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_executiontimeobservations(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_faucetclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_faucetclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_devnet(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_local(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_new(`faucetUrl`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_testnet(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_method_faucetclient_request(`ptr`: Pointer,`address`: Pointer, -): Long -fun uniffi_iota_sdk_ffi_fn_method_faucetclient_request_and_wait(`ptr`: Pointer,`address`: Pointer, -): Long -fun uniffi_iota_sdk_ffi_fn_method_faucetclient_request_status(`ptr`: Pointer,`id`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_clone_faucetreceipt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_faucetreceipt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_genesistransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_genesistransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_clone_graphqlclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_graphqlclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new(`server`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_devnet(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_localhost(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_mainnet(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_testnet(uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_active_validators(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue,`epoch`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_balance(`ptr`: Pointer,`address`: Pointer,`coinType`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_chain_id(`ptr`: Pointer, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoint(`ptr`: Pointer,`digest`: RustBuffer.ByValue,`seqNum`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoints(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata(`ptr`: Pointer,`coinType`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins(`ptr`: Pointer,`owner`: Pointer,`paginationFilter`: RustBuffer.ByValue,`coinType`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(`ptr`: Pointer,`tx`: Pointer,`skipChecks`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(`ptr`: Pointer,`txKind`: Pointer,`txMeta`: RustBuffer.ByValue,`skipChecks`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field(`ptr`: Pointer,`address`: Pointer,`typeTag`: Pointer,`name`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_fields(`ptr`: Pointer,`address`: Pointer,`paginationFilter`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_object_field(`ptr`: Pointer,`address`: Pointer,`typeTag`: Pointer,`name`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch(`ptr`: Pointer,`epoch`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_checkpoints(`ptr`: Pointer,`epoch`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_transaction_blocks(`ptr`: Pointer,`epoch`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_events(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue,`filter`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx(`ptr`: Pointer,`signatures`: RustBuffer.ByValue,`tx`: Pointer, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_latest_checkpoint_sequence_number(`ptr`: Pointer, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_max_page_size(`ptr`: Pointer, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents(`ptr`: Pointer,`objectId`: Pointer,`version`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents_bcs(`ptr`: Pointer,`objectId`: Pointer,`version`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_function(`ptr`: Pointer,`package`: RustBuffer.ByValue,`module`: RustBuffer.ByValue,`function`: RustBuffer.ByValue,`version`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_module(`ptr`: Pointer,`package`: RustBuffer.ByValue,`module`: RustBuffer.ByValue,`paginationFilterEnums`: RustBuffer.ByValue,`paginationFilterFriends`: RustBuffer.ByValue,`paginationFilterFunctions`: RustBuffer.ByValue,`paginationFilterStructs`: RustBuffer.ByValue,`version`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_object(`ptr`: Pointer,`objectId`: Pointer,`version`: RustBuffer.ByValue, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_object_bcs(`ptr`: Pointer,`objectId`: Pointer, -): Long -fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue,`filter`: RustBuffer.ByValue, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// For large crates we prevent `MethodTooLargeException` (see #2340) +// N.B. the name of the extension is very misleading, since it is +// rather `InterfaceTooLargeException`, caused by too many methods +// in the interface for large crates. +// +// By splitting the otherwise huge interface into two parts +// * UniffiLib +// * IntegrityCheckingUniffiLib (this) +// we allow for ~2x as many methods in the UniffiLib interface. +// +// The `ffi_uniffi_contract_version` method and all checksum methods are put +// into `IntegrityCheckingUniffiLib` and these methods are called only once, +// when the library is loaded. +internal interface IntegrityCheckingUniffiLib : Library { + // Integrity check functions only + fun uniffi_iota_sdk_ffi_checksum_method_address_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_address_to_hex( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_bls12381signature_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_padded( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_unpadded( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_is_ecmh_live_object_set( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_coin_balance( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_coin_coin_type( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_coin_id( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_digest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_digest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_ed25519publickey_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_ed25519signature_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_faucetclient_request( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_and_wait( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_active_validators( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_balance( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_chain_id( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_checkpoints( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_transaction_blocks( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_events( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_latest_checkpoint_sequence_number( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_max_page_size( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_function( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_module( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_latest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_versions( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_packages( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_protocol_config( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_reference_gas_price( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_set_rpc_server( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_supply( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_digest( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_seq_num( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_data_effects( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_effects( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_data_effects( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_identifier_as_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_committee( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_signatures( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_members( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_scheme( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_threshold( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmember_public_key( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmember_weight( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_ed25519( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256k1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256r1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_zklogin( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_ed25519( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256k1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256r1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_zklogin( +): Short +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_object_id( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_object_object_type( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_object_owner( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_object_version( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_address( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data( +): Short +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_signature( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_secp256k1signature_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_secp256r1signature_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_ed25519( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256k1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256r1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_scheme( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_structtag_address( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transaction_expiration( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment( +): Short +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_transactiondigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactioneffects_as_v1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactioneffects_is_v1( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_address( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin_opt( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_is_multisig( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_is_passkey( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_is_simple( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_is_zklogin( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_scheme( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_to_base64( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_usersignature_to_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_inputs( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_max_epoch( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_signature( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zklogininputs_address_seed( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zklogininputs_header_base64( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zklogininputs_iss_base64_details( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zklogininputs_proof_points( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginproof_a( +): Short +fun uniffi_iota_sdk_ffi_checksum_method_zkloginproof_b( +): Short +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_iss( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_address_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str_radix_10( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_circomg1_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_digest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_digest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_digest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_identifier_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_multisigcommittee_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_multisigmember_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_object_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_str( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transaction_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_base58( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_generate( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_address( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_bytes( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_zkloginauthenticator_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_zklogininputs_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_zkloginproof_new( +): Short +fun uniffi_iota_sdk_ffi_checksum_constructor_zkloginpublicidentifier_new( +): Short +fun ffi_iota_sdk_ffi_uniffi_contract_version( +): Int + +} + +// A JNA Library to expose the extern-C FFI definitions. +// This is an implementation detail which will be called internally by the public API. +internal interface UniffiLib : Library { + companion object { + internal val INSTANCE: UniffiLib by lazy { + val componentName = "iota_sdk_ffi" + // For large crates we prevent `MethodTooLargeException` (see #2340) + // N.B. the name of the extension is very misleading, since it is + // rather `InterfaceTooLargeException`, caused by too many methods + // in the interface for large crates. + // + // By splitting the otherwise huge interface into two parts + // * UniffiLib (this) + // * IntegrityCheckingUniffiLib + // And all checksum methods are put into `IntegrityCheckingUniffiLib` + // we allow for ~2x as many methods in the UniffiLib interface. + // + // Thus we first load the library with `loadIndirect` as `IntegrityCheckingUniffiLib` + // so that we can (optionally!) call `uniffiCheckApiChecksums`... + loadIndirect(componentName) + .also { lib: IntegrityCheckingUniffiLib -> + uniffiCheckContractApiVersion(lib) + uniffiCheckApiChecksums(lib) + } + // ... and then we load the library as `UniffiLib` + // N.B. we cannot use `loadIndirect` once and then try to cast it to `UniffiLib` + // => results in `java.lang.ClassCastException: com.sun.proxy.$Proxy cannot be cast to ...` + // error. So we must call `loadIndirect` twice. For crates large enough + // to trigger this issue, the performance impact is negligible, running on + // a macOS M1 machine the `loadIndirect` call takes ~50ms. + val lib = loadIndirect(componentName) + // No need to check the contract version and checksums, since + // we already did that with `IntegrityCheckingUniffiLib` above. + // Loading of library with integrity check done. + lib + } + + // The Cleaner for the whole library + internal val CLEANER: UniffiCleaner by lazy { + UniffiCleaner.create() + } + } + + // FFI functions + fun uniffi_iota_sdk_ffi_fn_clone_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_address_from_hex(`hex`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_address_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_address_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_address_to_hex(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_batchsendstatus(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_bls12381publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_bls12381signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_bls12381signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_bls12381signature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_bn254fieldelement(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_bn254fieldelement(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str_radix_10(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_padded(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_unpadded(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_changeepoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_changeepoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_changeepochv2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_changeepochv2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): 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_checkpointcontentsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_checkpointdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +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, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_circomg1_new(`el0`: Pointer,`el1`: Pointer,`el2`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_circomg2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_circomg2(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_circomg2_new(`el00`: Pointer,`el01`: Pointer,`el10`: Pointer,`el11`: Pointer,`el20`: Pointer,`el21`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_coin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_coin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_coin_try_from_object(`object`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_coin_balance(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_coin_coin_type(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_coin_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_coinmetadata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_coinmetadata(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_consensuscommitdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_consensuscommitprologuev1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_digest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_digest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_digest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_digest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_digest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_digest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_ed25519publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_ed25519publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_ed25519publickey_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_ed25519signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_ed25519signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_ed25519signature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_effectsauxiliarydatadigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_endofepochtransactionkind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_endofepochtransactionkind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_create(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_expire(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch_v2(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_executiontimeobservations(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_executiontimeobservations(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_faucetclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_faucetclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_devnet(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_local(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_new(`faucetUrl`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_faucetclient_testnet(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_faucetclient_request(`ptr`: Pointer,`address`: Pointer, +): Long +fun uniffi_iota_sdk_ffi_fn_method_faucetclient_request_and_wait(`ptr`: Pointer,`address`: Pointer, +): Long +fun uniffi_iota_sdk_ffi_fn_method_faucetclient_request_status(`ptr`: Pointer,`id`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_clone_faucetreceipt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_faucetreceipt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_genesistransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_genesistransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_clone_graphqlclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_graphqlclient(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new(`server`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_devnet(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_localhost(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_mainnet(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_testnet(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_active_validators(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue,`epoch`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_balance(`ptr`: Pointer,`address`: Pointer,`coinType`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_chain_id(`ptr`: Pointer, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoint(`ptr`: Pointer,`digest`: RustBuffer.ByValue,`seqNum`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoints(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata(`ptr`: Pointer,`coinType`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins(`ptr`: Pointer,`owner`: Pointer,`paginationFilter`: RustBuffer.ByValue,`coinType`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx(`ptr`: Pointer,`tx`: Pointer,`skipChecks`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind(`ptr`: Pointer,`txKind`: Pointer,`txMeta`: RustBuffer.ByValue,`skipChecks`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field(`ptr`: Pointer,`address`: Pointer,`typeTag`: Pointer,`name`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_fields(`ptr`: Pointer,`address`: Pointer,`paginationFilter`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_object_field(`ptr`: Pointer,`address`: Pointer,`typeTag`: Pointer,`name`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch(`ptr`: Pointer,`epoch`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_checkpoints(`ptr`: Pointer,`epoch`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_transaction_blocks(`ptr`: Pointer,`epoch`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_events(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue,`filter`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx(`ptr`: Pointer,`signatures`: RustBuffer.ByValue,`tx`: Pointer, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_latest_checkpoint_sequence_number(`ptr`: Pointer, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_max_page_size(`ptr`: Pointer, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents(`ptr`: Pointer,`objectId`: Pointer,`version`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents_bcs(`ptr`: Pointer,`objectId`: Pointer,`version`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_function(`ptr`: Pointer,`package`: RustBuffer.ByValue,`module`: RustBuffer.ByValue,`function`: RustBuffer.ByValue,`version`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_module(`ptr`: Pointer,`package`: RustBuffer.ByValue,`module`: RustBuffer.ByValue,`paginationFilterEnums`: RustBuffer.ByValue,`paginationFilterFriends`: RustBuffer.ByValue,`paginationFilterFunctions`: RustBuffer.ByValue,`paginationFilterStructs`: RustBuffer.ByValue,`version`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_object(`ptr`: Pointer,`objectId`: Pointer,`version`: RustBuffer.ByValue, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_object_bcs(`ptr`: Pointer,`objectId`: Pointer, +): Long +fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue,`filter`: RustBuffer.ByValue, ): Long fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_package(`ptr`: Pointer,`address`: Pointer,`version`: RustBuffer.ByValue, ): Long @@ -1625,6 +2507,14 @@ fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_data_effects(`ptr`: ): Long fun uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects(`ptr`: Pointer,`paginationFilter`: RustBuffer.ByValue,`filter`: RustBuffer.ByValue, ): Long +fun uniffi_iota_sdk_ffi_fn_clone_identifier(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_identifier(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_identifier_new(`identifier`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_identifier_as_str(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_movefunction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_movefunction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -1637,10 +2527,100 @@ fun uniffi_iota_sdk_ffi_fn_clone_movepackage(`ptr`: Pointer,uniffi_out_err: Unif ): Pointer fun uniffi_iota_sdk_ffi_fn_free_movepackage(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit -fun uniffi_iota_sdk_ffi_fn_clone_movestruct(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_constructor_movepackage_new(`id`: Pointer,`version`: Long,`modules`: RustBuffer.ByValue,`typeOriginTable`: RustBuffer.ByValue,`linkageTable`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_multisigaggregatedsignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_multisigaggregatedsignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_multisigaggregatedsignature_new(`committee`: Pointer,`signatures`: RustBuffer.ByValue,`bitmap`: Short,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_bitmap(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Short +fun uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_committee(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_signatures(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_multisigcommittee(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_multisigcommittee(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): 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_is_valid(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_multisigcommittee_members(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigcommittee_scheme(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigcommittee_threshold(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Short +fun uniffi_iota_sdk_ffi_fn_clone_multisigmember(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_multisigmember(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_multisigmember_new(`publicKey`: Pointer,`weight`: Byte,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmember_public_key(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmember_weight(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_clone_multisigmemberpublickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_multisigmemberpublickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_ed25519(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256k1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256r1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_zklogin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_clone_multisigmembersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_free_movestruct(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_free_multisigmembersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_ed25519(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256k1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256r1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_zklogin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte fun uniffi_iota_sdk_ffi_fn_clone_object(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_object(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -1671,6 +2651,16 @@ fun uniffi_iota_sdk_ffi_fn_clone_objectdigest(`ptr`: Pointer,uniffi_out_err: Uni ): Pointer fun uniffi_iota_sdk_ffi_fn_free_objectdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_objectdigest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_objectdigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_objectdigest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_objectid(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_objectid(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -1685,10 +2675,6 @@ fun uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes(`ptr`: Pointer,uniffi_out_er ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_objectid_to_hex(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue -fun uniffi_iota_sdk_ffi_fn_clone_objectref(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_objectref(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit fun uniffi_iota_sdk_ffi_fn_clone_objecttype(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_objecttype(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -1697,6 +2683,18 @@ fun uniffi_iota_sdk_ffi_fn_clone_owner(`ptr`: Pointer,uniffi_out_err: UniffiRust ): Pointer fun uniffi_iota_sdk_ffi_fn_free_owner(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_authenticator_data(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): 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_signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer 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, @@ -1721,6 +2719,18 @@ fun uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate(uniffi_out_er ): Pointer fun uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_secp256k1signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_secp256k1signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_secp256k1signature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_secp256r1publickey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -1733,64 +2743,144 @@ fun uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate(uniffi_out_er ): Pointer fun uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_secp256r1signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_secp256r1signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_str(`s`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_serviceconfig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_serviceconfig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit -fun uniffi_iota_sdk_ffi_fn_clone_signedtransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_clone_simplesignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_free_signedtransaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_free_simplesignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_signedtransaction_new(`transaction`: Pointer,`signatures`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_is_ed25519(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256k1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256r1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_scheme(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_method_signedtransaction_signatures(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue -fun uniffi_iota_sdk_ffi_fn_method_signedtransaction_transaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_clone_structtag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_iota_sdk_ffi_fn_free_structtag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_structtag_coin(`typeTag`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_structtag_new(`address`: Pointer,`module`: Pointer,`name`: Pointer,`typeParams`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_structtag_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_structtag_coin_type(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_transaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_transaction(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_transaction_new(`kind`: Pointer,`sender`: Pointer,`gasPayment`: RustBuffer.ByValue,`expiration`: Pointer,uniffi_out_err: UniffiRustCallStatus, +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_expiration(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_method_transaction_kind(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_method_transaction_sender(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_clone_transactiondataeffects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_clone_transactiondigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_free_transactiondataeffects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_free_transactiondigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit -fun uniffi_iota_sdk_ffi_fn_constructor_transactiondataeffects_new(`tx`: Pointer,`effects`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_effects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_tx(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_generate(uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_clone_transactiondigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_iota_sdk_ffi_fn_free_transactiondigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit +fun uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_transactioneffects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_transactioneffects(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1(`effects`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): 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_is_v1(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte fun uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_transactioneffectsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_iota_sdk_ffi_fn_free_transactioneventsdigest(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit -fun uniffi_iota_sdk_ffi_fn_clone_transactionexpiration(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_base58(`base58`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_free_transactionexpiration(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_generate(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_base58(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_bytes(`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, @@ -1799,22 +2889,156 @@ fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_authenticator_state_updat ): Pointer fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_consensus_commit_prologue_v1(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch(`tx`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch(`tx`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_typetag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_typetag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_address(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_bool(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_signer(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag(`structTag`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_u128(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_u16(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_u256(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_u32(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_u64(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_u8(uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_typetag_vector(`typeTag`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_address(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_bool(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_signer(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_struct(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_u128(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_u16(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_u256(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_u32(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_u64(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_u8(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_typetag_is_vector(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_clone_usersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_usersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_base64(`base64`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_bytes(`bytes`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin_opt(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_usersignature_is_multisig(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_usersignature_is_passkey(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_usersignature_is_simple(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_usersignature_is_zklogin(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Byte +fun uniffi_iota_sdk_ffi_fn_method_usersignature_scheme(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_usersignature_to_base64(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_usersignature_to_bytes(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_clone_zkloginauthenticator(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_zkloginauthenticator(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_zkloginauthenticator_new(`inputs`: Pointer,`maxEpoch`: Long,`signature`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_inputs(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_max_epoch(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Long +fun uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_signature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_zklogininputs(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_zklogininputs(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_zklogininputs_new(`proofPoints`: Pointer,`issBase64Details`: RustBuffer.ByValue,`headerBase64`: RustBuffer.ByValue,`addressSeed`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_zklogininputs_address_seed(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_method_zklogininputs_header_base64(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_zklogininputs_iss_base64_details(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_iota_sdk_ffi_fn_method_zklogininputs_proof_points(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_clone_zkloginproof(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_iota_sdk_ffi_fn_free_zkloginproof(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_iota_sdk_ffi_fn_constructor_zkloginproof_new(`a`: Pointer,`b`: Pointer,`c`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_method_zkloginproof_a(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_method_zkloginproof_b(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update(`tx`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_method_zkloginproof_c(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_clone_typetag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_clone_zkloginpublicidentifier(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_free_typetag(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_free_zkloginpublicidentifier(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit -fun uniffi_iota_sdk_ffi_fn_clone_usersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_iota_sdk_ffi_fn_constructor_zkloginpublicidentifier_new(`iss`: RustBuffer.ByValue,`addressSeed`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_iota_sdk_ffi_fn_free_usersignature(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, -): Unit +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_iss(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun ffi_iota_sdk_ffi_rustbuffer_alloc(`size`: Long,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun ffi_iota_sdk_ffi_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,uniffi_out_err: UniffiRustCallStatus, @@ -1928,721 +3152,6115 @@ fun ffi_iota_sdk_ffi_rust_future_free_void(`handle`: Long, fun ffi_iota_sdk_ffi_rust_future_complete_void(`handle`: Long,uniffi_out_err: UniffiRustCallStatus, ): Unit -} +} + +private fun uniffiCheckContractApiVersion(lib: IntegrityCheckingUniffiLib) { + // Get the bindings contract version from our ComponentInterface + val bindings_contract_version = 29 + // Get the scaffolding contract version by calling the into the dylib + val scaffolding_contract_version = lib.ffi_iota_sdk_ffi_uniffi_contract_version() + if (bindings_contract_version != scaffolding_contract_version) { + throw RuntimeException("UniFFI contract version mismatch: try cleaning and rebuilding your project") + } +} +@Suppress("UNUSED_PARAMETER") +private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_address_to_bytes() != 57710.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_address_to_hex() != 22032.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes() != 9890.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_bls12381signature_to_bytes() != 56969.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_padded() != 44301.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_bn254fieldelement_unpadded() != 33350.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest() != 41616.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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_checkpointcontentsdigest_to_base58() != 60951.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcontentsdigest_to_bytes() != 51343.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_base58() != 40700.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointdigest_to_bytes() != 48082.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") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_coin_coin_type() != 18211.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_coin_id() != 40013.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_base58() != 7053.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_consensuscommitdigest_to_bytes() != 5048.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_digest_to_base58() != 54638.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_digest_to_bytes() != 14244.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_ed25519publickey_to_bytes() != 16656.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_ed25519signature_to_bytes() != 31911.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_base58() != 56652.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_effectsauxiliarydatadigest_to_bytes() != 12259.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request() != 13326.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_and_wait() != 48304.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status() != 42353.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_active_validators() != 26965.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_balance() != 9953.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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() != 33658.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()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 34454.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 48442.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 12272.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 40594.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 29988.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 43452.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 47284.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch() != 46788.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_checkpoints() != 29086.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_transaction_blocks() != 61978.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_events() != 41916.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx() != 41079.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_latest_checkpoint_sequence_number() != 40336.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_max_page_size() != 44733.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents() != 40412.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents_bcs() != 49694.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_function() != 49066.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_module() != 6413.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object() != 51508.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs() != 1970.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 37555.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package() != 7913.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_latest() != 55024.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_versions() != 33869.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_packages() != 3319.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_protocol_config() != 23389.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_reference_gas_price() != 39065.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config() != 24210.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_set_rpc_server() != 31958.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_supply() != 21504.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks() != 9583.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_digest() != 64969.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_seq_num() != 18624.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction() != 35048.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_data_effects() != 7442.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_effects() != 56760.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions() != 31273.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_data_effects() != 14121.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects() != 2687.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_identifier_as_str() != 63815.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_bitmap() != 41489.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_committee() != 17432.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregatedsignature_signatures() != 5488.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") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_members() != 62870.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_scheme() != 15458.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_threshold() != 21653.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmember_public_key() != 7804.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmember_weight() != 57194.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519() != 8241.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_ed25519_opt() != 28021.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1() != 52073.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256k1_opt() != 40194.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1() != 38170.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_secp256r1_opt() != 28963.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin() != 17714.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_as_zklogin_opt() != 23106.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_ed25519() != 1939.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256k1() != 49521.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_secp256r1() != 16265.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmemberpublickey_is_zklogin() != 37193.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519() != 22855.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_ed25519_opt() != 56690.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1() != 49085.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256k1_opt() != 26984.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1() != 57510.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_secp256r1_opt() != 12419.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin() != 39624.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_as_zklogin_opt() != 34526.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_ed25519() != 18913.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256k1() != 16841.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_secp256r1() != 51171.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigmembersignature_is_zklogin() != 65193.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_object_as_struct() != 37303.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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_object_id() != 6575.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_object_object_type() != 1843.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_object_owner() != 3724.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction() != 455.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate() != 24969.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_object_version() != 18433.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_base58() != 2414.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_objectdigest_to_bytes() != 31732.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") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes() != 38367.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex() != 4418.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data() != 55474.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge() != 28147.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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_signature() != 5489.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes() != 49170.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_secp256k1signature_to_bytes() != 49705.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes() != 21066.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_secp256r1signature_to_bytes() != 64948.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key() != 36693.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_pub_key_opt() != 11858.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig() != 56126.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_ed25519_sig_opt() != 33862.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_ed25519() != 64494.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256k1() != 39262.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_is_secp256r1() != 49536.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_scheme() != 30423.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key() != 51778.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_pub_key_opt() != 20475.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig() != 36141.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256k1_sig_opt() != 16111.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key() != 25197.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_pub_key_opt() != 22487.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig() != 30390.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_secp256r1_sig_opt() != 51961.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_simplesignature_to_bytes() != 28081.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_structtag_address() != 18393.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type() != 37745.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_structtag_coin_type_opt() != 65306.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() != 47752.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment() != 5316.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_kind() != 49492.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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_transactiondigest_to_base58() != 22119.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactiondigest_to_bytes() != 3253.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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_is_v1() != 39808.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_base58() != 38601.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneffectsdigest_to_bytes() != 43744.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_base58() != 54162.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_transactioneventsdigest_to_bytes() != 6773.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag() != 1715.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_struct_tag_opt() != 15734.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag() != 20180.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_as_vector_type_tag_opt() != 55130.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_address() != 38219.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_bool() != 30264.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_signer() != 57678.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_struct() != 39029.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u128() != 65460.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u16() != 34540.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u256() != 65130.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u32() != 40795.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u64() != 28705.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_u8() != 18761.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_typetag_is_vector() != 49992.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig() != 36332.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_multisig_opt() != 21895.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey() != 17710.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_passkey_opt() != 53755.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple() != 57455.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_simple_opt() != 47248.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin() != 53484.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_as_zklogin_opt() != 43934.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_multisig() != 61839.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_passkey() != 35671.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_simple() != 58211.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_is_zklogin() != 38693.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_scheme() != 25381.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_to_base64() != 33757.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_usersignature_to_bytes() != 58893.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_inputs() != 1512.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_max_epoch() != 9769.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginauthenticator_signature() != 18838.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_address_seed() != 4892.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_header_base64() != 32056.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_iss_base64_details() != 20914.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zklogininputs_proof_points() != 28172.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginproof_a() != 6891.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginproof_b() != 36477.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_method_zkloginproof_c() != 10897.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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_iss() != 58864.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes() != 58901.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex() != 63442.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_address_generate() != 48865.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes() != 6069.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str() != 26128.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate() != 30791.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_bytes() != 42745.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_from_str() != 5412.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381signature_generate() != 58435.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_bytes() != 3672.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str() != 21214.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bn254fieldelement_from_str_radix_10() != 17556.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_base58() != 33027.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_from_bytes() != 37261.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointcontentsdigest_generate() != 79.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_base58() != 65453.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_from_bytes() != 24226.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_checkpointdigest_generate() != 13389.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") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_circomg2_new() != 50489.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object() != 35349.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_base58() != 17742.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_from_bytes() != 58221.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_consensuscommitdigest_generate() != 49846.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_digest_from_base58() != 41234.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_digest_from_bytes() != 65530.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_digest_generate() != 8094.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes() != 60403.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str() != 38751.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate() != 46412.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_bytes() != 61841.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_from_str() != 39607.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519signature_generate() != 41607.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_base58() != 31144.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_from_bytes() != 36699.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_effectsauxiliarydatadigest_generate() != 28926.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create() != 18946.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire() != 49861.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch() != 16640.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2() != 17262.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet() != 37366.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local() != 55393.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() != 13557.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet() != 16109.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new() != 32097.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet() != 6494.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost() != 5570.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet() != 3613.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet() != 48529.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_identifier_new() != 9398.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_movepackage_new() != 17506.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_multisigaggregatedsignature_new() != 3396.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_multisigcommittee_new() != 40069.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_multisigmember_new() != 63622.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_object_new() != 56232.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_base58() != 57967.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_from_bytes() != 62288.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectdigest_generate() != 61181.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") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex() != 30954.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes() != 20339.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str() != 24158.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate() != 36411.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_bytes() != 36237.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_from_str() != 16397.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1signature_generate() != 63087.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes() != 60002.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str() != 27991.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate() != 49992.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_bytes() != 8469.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_from_str() != 15312.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1signature_generate() != 40260.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_coin() != 13756.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_gas_coin() != 37848.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_new() != 20682.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_structtag_staked_iota() != 30839.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() != 4081.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_base58() != 15069.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_from_bytes() != 43656.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_generate() != 14578.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + 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_transactioneffectsdigest_from_base58() != 63406.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_bytes() != 51937.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_generate() != 11715.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_base58() != 56954.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_from_bytes() != 4647.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneventsdigest_generate() != 18224.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1() != 37860.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1() != 50635.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch() != 65525.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis() != 65272.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction() != 51205.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update() != 45772.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_address() != 44901.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_bool() != 19366.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_signer() != 12676.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_struct_tag() != 53303.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u128() != 41280.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u16() != 13801.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u256() != 13310.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u32() != 9870.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u64() != 59470.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_u8() != 9403.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_typetag_vector() != 46548.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_base64() != 8029.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_usersignature_from_bytes() != 37499.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_zkloginauthenticator_new() != 32812.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_zklogininputs_new() != 54245.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_zkloginproof_new() != 19950.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_zkloginpublicidentifier_new() != 53294.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } +} + +/** + * @suppress + */ +public fun uniffiEnsureInitialized() { + UniffiLib.INSTANCE +} + +// Async support +// Async return type handlers + +internal const val UNIFFI_RUST_FUTURE_POLL_READY = 0.toByte() +internal const val UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1.toByte() + +internal val uniffiContinuationHandleMap = UniffiHandleMap>() + +// FFI type for Rust future continuations +internal object uniffiRustFutureContinuationCallbackImpl: UniffiRustFutureContinuationCallback { + override fun callback(data: Long, pollResult: Byte) { + uniffiContinuationHandleMap.remove(data).resume(pollResult) + } +} + +internal suspend fun uniffiRustCallAsync( + rustFuture: Long, + pollFunc: (Long, UniffiRustFutureContinuationCallback, Long) -> Unit, + completeFunc: (Long, UniffiRustCallStatus) -> F, + freeFunc: (Long) -> Unit, + liftFunc: (F) -> T, + errorHandler: UniffiRustCallStatusErrorHandler +): T { + try { + do { + val pollResult = suspendCancellableCoroutine { continuation -> + pollFunc( + rustFuture, + uniffiRustFutureContinuationCallbackImpl, + uniffiContinuationHandleMap.insert(continuation) + ) + } + } while (pollResult != UNIFFI_RUST_FUTURE_POLL_READY); + + return liftFunc( + uniffiRustCallWithError(errorHandler, { status -> completeFunc(rustFuture, status) }) + ) + } finally { + freeFunc(rustFuture) + } +} + +// Public interface members begin here. + + +// Interface implemented by anything that can contain an object reference. +// +// Such types expose a `destroy()` method that must be called to cleanly +// dispose of the contained objects. Failure to call this method may result +// in memory leaks. +// +// The easiest way to ensure this method is called is to use the `.use` +// helper method to execute a block and destroy the object at the end. +interface Disposable { + fun destroy() + companion object { + fun destroy(vararg args: Any?) { + for (arg in args) { + when (arg) { + is Disposable -> arg.destroy() + is ArrayList<*> -> { + for (idx in arg.indices) { + val element = arg[idx] + if (element is Disposable) { + element.destroy() + } + } + } + is Map<*, *> -> { + for (element in arg.values) { + if (element is Disposable) { + element.destroy() + } + } + } + is Iterable<*> -> { + for (element in arg) { + if (element is Disposable) { + element.destroy() + } + } + } + } + } + } + } +} + +/** + * @suppress + */ +inline fun T.use(block: (T) -> R) = + try { + block(this) + } finally { + try { + // N.B. our implementation is on the nullable type `Disposable?`. + this?.destroy() + } catch (e: Throwable) { + // swallow + } + } + +/** + * Used to instantiate an interface without an actual pointer, for fakes in tests, mostly. + * + * @suppress + * */ +object NoPointer +/** + * The cleaner interface for Object finalization code to run. + * This is the entry point to any implementation that we're using. + * + * The cleaner registers objects and returns cleanables, so now we are + * defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the + * different implmentations available at compile time. + * + * @suppress + */ +interface UniffiCleaner { + interface Cleanable { + fun clean() + } + + fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable + + companion object +} + +// The fallback Jna cleaner, which is available for both Android, and the JVM. +private class UniffiJnaCleaner : UniffiCleaner { + private val cleaner = com.sun.jna.internal.Cleaner.getCleaner() + + override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = + UniffiJnaCleanable(cleaner.register(value, cleanUpTask)) +} + +private class UniffiJnaCleanable( + private val cleanable: com.sun.jna.internal.Cleaner.Cleanable, +) : UniffiCleaner.Cleanable { + override fun clean() = cleanable.clean() +} + + +// We decide at uniffi binding generation time whether we were +// using Android or not. +// There are further runtime checks to chose the correct implementation +// of the cleaner. +private fun UniffiCleaner.Companion.create(): UniffiCleaner = + try { + // For safety's sake: if the library hasn't been run in android_cleaner = true + // mode, but is being run on Android, then we still need to think about + // Android API versions. + // So we check if java.lang.ref.Cleaner is there, and use that… + java.lang.Class.forName("java.lang.ref.Cleaner") + JavaLangRefCleaner() + } catch (e: ClassNotFoundException) { + // … otherwise, fallback to the JNA cleaner. + UniffiJnaCleaner() + } + +private class JavaLangRefCleaner : UniffiCleaner { + val cleaner = java.lang.ref.Cleaner.create() + + override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = + JavaLangRefCleanable(cleaner.register(value, cleanUpTask)) +} + +private class JavaLangRefCleanable( + val cleanable: java.lang.ref.Cleaner.Cleanable +) : UniffiCleaner.Cleanable { + override fun clean() = cleanable.clean() +} + +/** + * @suppress + */ +public object FfiConverterUByte: FfiConverter { + override fun lift(value: Byte): UByte { + return value.toUByte() + } + + override fun read(buf: ByteBuffer): UByte { + return lift(buf.get()) + } + + override fun lower(value: UByte): Byte { + return value.toByte() + } + + override fun allocationSize(value: UByte) = 1UL + + override fun write(value: UByte, buf: ByteBuffer) { + buf.put(value.toByte()) + } +} + +/** + * @suppress + */ +public object FfiConverterUShort: FfiConverter { + override fun lift(value: Short): UShort { + return value.toUShort() + } + + override fun read(buf: ByteBuffer): UShort { + return lift(buf.getShort()) + } + + override fun lower(value: UShort): Short { + return value.toShort() + } + + override fun allocationSize(value: UShort) = 2UL + + override fun write(value: UShort, buf: ByteBuffer) { + buf.putShort(value.toShort()) + } +} + +/** + * @suppress + */ +public object FfiConverterUInt: FfiConverter { + override fun lift(value: Int): UInt { + return value.toUInt() + } + + override fun read(buf: ByteBuffer): UInt { + return lift(buf.getInt()) + } + + override fun lower(value: UInt): Int { + return value.toInt() + } + + override fun allocationSize(value: UInt) = 4UL + + override fun write(value: UInt, buf: ByteBuffer) { + buf.putInt(value.toInt()) + } +} + +/** + * @suppress + */ +public object FfiConverterInt: FfiConverter { + override fun lift(value: Int): Int { + return value + } + + override fun read(buf: ByteBuffer): Int { + return buf.getInt() + } + + override fun lower(value: Int): Int { + return value + } + + override fun allocationSize(value: Int) = 4UL + + override fun write(value: Int, buf: ByteBuffer) { + buf.putInt(value) + } +} + +/** + * @suppress + */ +public object FfiConverterULong: FfiConverter { + override fun lift(value: Long): ULong { + return value.toULong() + } + + override fun read(buf: ByteBuffer): ULong { + return lift(buf.getLong()) + } + + override fun lower(value: ULong): Long { + return value.toLong() + } + + override fun allocationSize(value: ULong) = 8UL + + override fun write(value: ULong, buf: ByteBuffer) { + buf.putLong(value.toLong()) + } +} + +/** + * @suppress + */ +public object FfiConverterLong: FfiConverter { + override fun lift(value: Long): Long { + return value + } + + override fun read(buf: ByteBuffer): Long { + return buf.getLong() + } + + override fun lower(value: Long): Long { + return value + } + + override fun allocationSize(value: Long) = 8UL + + override fun write(value: Long, buf: ByteBuffer) { + buf.putLong(value) + } +} + +/** + * @suppress + */ +public object FfiConverterBoolean: FfiConverter { + override fun lift(value: Byte): Boolean { + return value.toInt() != 0 + } + + override fun read(buf: ByteBuffer): Boolean { + return lift(buf.get()) + } + + override fun lower(value: Boolean): Byte { + return if (value) 1.toByte() else 0.toByte() + } + + override fun allocationSize(value: Boolean) = 1UL + + override fun write(value: Boolean, buf: ByteBuffer) { + buf.put(lower(value)) + } +} + +/** + * @suppress + */ +public object FfiConverterString: FfiConverter { + // Note: we don't inherit from FfiConverterRustBuffer, because we use a + // special encoding when lowering/lifting. We can use `RustBuffer.len` to + // store our length and avoid writing it out to the buffer. + override fun lift(value: RustBuffer.ByValue): String { + try { + val byteArr = ByteArray(value.len.toInt()) + value.asByteBuffer()!!.get(byteArr) + return byteArr.toString(Charsets.UTF_8) + } finally { + RustBuffer.free(value) + } + } + + override fun read(buf: ByteBuffer): String { + val len = buf.getInt() + val byteArr = ByteArray(len) + buf.get(byteArr) + return byteArr.toString(Charsets.UTF_8) + } + + fun toUtf8(value: String): ByteBuffer { + // Make sure we don't have invalid UTF-16, check for lone surrogates. + return Charsets.UTF_8.newEncoder().run { + onMalformedInput(CodingErrorAction.REPORT) + encode(CharBuffer.wrap(value)) + } + } + + override fun lower(value: String): RustBuffer.ByValue { + val byteBuf = toUtf8(value) + // Ideally we'd pass these bytes to `ffi_bytebuffer_from_bytes`, but doing so would require us + // to copy them into a JNA `Memory`. So we might as well directly copy them into a `RustBuffer`. + val rbuf = RustBuffer.alloc(byteBuf.limit().toULong()) + rbuf.asByteBuffer()!!.put(byteBuf) + return rbuf + } + + // We aren't sure exactly how many bytes our string will be once it's UTF-8 + // encoded. Allocate 3 bytes per UTF-16 code unit which will always be + // enough. + override fun allocationSize(value: String): ULong { + val sizeForLength = 4UL + val sizeForString = value.length.toULong() * 3UL + return sizeForLength + sizeForString + } + + override fun write(value: String, buf: ByteBuffer) { + val byteBuf = toUtf8(value) + buf.putInt(byteBuf.limit()) + buf.put(byteBuf) + } +} + +/** + * @suppress + */ +public object FfiConverterByteArray: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ByteArray { + val len = buf.getInt() + val byteArr = ByteArray(len) + buf.get(byteArr) + return byteArr + } + override fun allocationSize(value: ByteArray): ULong { + return 4UL + value.size.toULong() + } + override fun write(value: ByteArray, buf: ByteBuffer) { + buf.putInt(value.size) + buf.put(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 +// + + +/** + * Unique identifier for an Account on the IOTA blockchain. + * + * An `Address` is a 32-byte pseudonymous identifier used to uniquely identify + * an account and asset-ownership on the IOTA blockchain. Often, human-readable + * addresses are encoded in hexadecimal with a `0x` prefix. For example, this + * is a valid IOTA address: + * `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. + * + * ``` + * use iota_types::Address; + * + * let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; + * let address = Address::from_hex(hex).unwrap(); + * println!("Address: {}", address); + * assert_eq!(hex, address.to_string()); + * ``` + * + * # Deriving an Address + * + * Addresses are cryptographically derived from a number of user account + * authenticators, the simplest of which is an + * [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). + * + * Deriving an address consists of the Blake2b256 hash of the sequence of bytes + * of its corresponding authenticator, prefixed with a domain-separator (except + * ed25519, for compatability reasons). For each other authenticator, this + * domain-separator is the single byte-value of its + * [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature + * schema flag || authenticator bytes)`. + * + * Each authenticator has a method for deriving its `Address` as well as + * documentation for the specifics of how the derivation is done. See + * [`Ed25519PublicKey::derive_address`] for an example. + * + * [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address + * + * ## Relationship to ObjectIds + * + * [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but + * are derived leveraging different domain-separator values to ensure that, + * cryptographically, there won't be any overlap, e.g. there can't be a + * valid `Object` who's `ObjectId` is equal to that of the `Address` of a user + * account. + * + * [`ObjectId`]: iota_types::ObjectId + * + * # BCS + * + * An `Address`'s BCS serialized form is defined by the following: + * + * ```text + * address = 32OCTET + * ``` + */ +public interface AddressInterface { + + fun `toBytes`(): kotlin.ByteArray + + fun `toHex`(): kotlin.String + + companion object +} + +/** + * Unique identifier for an Account on the IOTA blockchain. + * + * An `Address` is a 32-byte pseudonymous identifier used to uniquely identify + * an account and asset-ownership on the IOTA blockchain. Often, human-readable + * addresses are encoded in hexadecimal with a `0x` prefix. For example, this + * is a valid IOTA address: + * `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. + * + * ``` + * use iota_types::Address; + * + * let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; + * let address = Address::from_hex(hex).unwrap(); + * println!("Address: {}", address); + * assert_eq!(hex, address.to_string()); + * ``` + * + * # Deriving an Address + * + * Addresses are cryptographically derived from a number of user account + * authenticators, the simplest of which is an + * [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). + * + * Deriving an address consists of the Blake2b256 hash of the sequence of bytes + * of its corresponding authenticator, prefixed with a domain-separator (except + * ed25519, for compatability reasons). For each other authenticator, this + * domain-separator is the single byte-value of its + * [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature + * schema flag || authenticator bytes)`. + * + * Each authenticator has a method for deriving its `Address` as well as + * documentation for the specifics of how the derivation is done. See + * [`Ed25519PublicKey::derive_address`] for an example. + * + * [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address + * + * ## Relationship to ObjectIds + * + * [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but + * are derived leveraging different domain-separator values to ensure that, + * cryptographically, there won't be any overlap, e.g. there can't be a + * valid `Object` who's `ObjectId` is equal to that of the `Address` of a user + * account. + * + * [`ObjectId`]: iota_types::ObjectId + * + * # BCS + * + * An `Address`'s BCS serialized form is defined by the following: + * + * ```text + * address = 32OCTET + * ``` + */ +open class Address: Disposable, AutoCloseable, AddressInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_address(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_address(pointer!!, status) + } + } + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_address_to_bytes( + it, _status) +} + } + ) + } + + + override fun `toHex`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_address_to_hex( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Address { + return FfiConverterTypeAddress.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromHex`(`hex`: kotlin.String): Address { + return FfiConverterTypeAddress.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_address_from_hex( + FfiConverterString.lower(`hex`),_status) +} + ) + } + + + fun `generate`(): Address { + return FfiConverterTypeAddress.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_address_generate( + _status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeAddress: FfiConverter { + + override fun lower(value: Address): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): Address { + return Address(value) + } + + override fun read(buf: ByteBuffer): Address { + // 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: Address) = 8UL + + override fun write(value: Address, 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 AuthenticatorStateExpireInterface { + + companion object +} + +open class AuthenticatorStateExpire: Disposable, AutoCloseable, AuthenticatorStateExpireInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(pointer!!, status) + } + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeAuthenticatorStateExpire: FfiConverter { + + override fun lower(value: AuthenticatorStateExpire): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): AuthenticatorStateExpire { + return AuthenticatorStateExpire(value) + } + + override fun read(buf: ByteBuffer): AuthenticatorStateExpire { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: AuthenticatorStateExpire) = 8UL + + override fun write(value: AuthenticatorStateExpire, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 AuthenticatorStateUpdateV1Interface { + + companion object +} + +open class AuthenticatorStateUpdateV1: Disposable, AutoCloseable, AuthenticatorStateUpdateV1Interface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(pointer!!, status) + } + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeAuthenticatorStateUpdateV1: FfiConverter { + + override fun lower(value: AuthenticatorStateUpdateV1): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): AuthenticatorStateUpdateV1 { + return AuthenticatorStateUpdateV1(value) + } + + override fun read(buf: ByteBuffer): AuthenticatorStateUpdateV1 { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: AuthenticatorStateUpdateV1) = 8UL + + override fun write(value: AuthenticatorStateUpdateV1, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 BatchSendStatusInterface { + + companion object +} + +open class BatchSendStatus: Disposable, AutoCloseable, BatchSendStatusInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_batchsendstatus(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(pointer!!, status) + } + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeBatchSendStatus: FfiConverter { + + override fun lower(value: BatchSendStatus): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): BatchSendStatus { + return BatchSendStatus(value) + } + + override fun read(buf: ByteBuffer): BatchSendStatus { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: BatchSendStatus) = 8UL + + override fun write(value: BatchSendStatus, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 bls12381 min-sig public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * bls-public-key = %x60 96OCTECT + * ``` + * + * Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a + * fixed-length of 96, IOTA's binary representation of a min-sig + * `Bls12381PublicKey` is prefixed with its length meaning its serialized + * binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. + */ +public interface Bls12381PublicKeyInterface { + + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +/** + * A bls12381 min-sig public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * bls-public-key = %x60 96OCTECT + * ``` + * + * Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a + * fixed-length of 96, IOTA's binary representation of a min-sig + * `Bls12381PublicKey` is prefixed with its length meaning its serialized + * binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. + */ +open class Bls12381PublicKey: Disposable, AutoCloseable, Bls12381PublicKeyInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bls12381publickey(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(pointer!!, status) + } + } + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bls12381PublicKey { + return FfiConverterTypeBls12381PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bls12381PublicKey { + return FfiConverterTypeBls12381PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + fun `generate`(): Bls12381PublicKey { + return FfiConverterTypeBls12381PublicKey.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate( + _status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeBls12381PublicKey: FfiConverter { + + override fun lower(value: Bls12381PublicKey): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): Bls12381PublicKey { + return Bls12381PublicKey(value) + } + + override fun read(buf: ByteBuffer): Bls12381PublicKey { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: Bls12381PublicKey) = 8UL + + override fun write(value: Bls12381PublicKey, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 bls12381 min-sig public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * bls-public-key = %x60 96OCTECT + * ``` + * + * Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a + * fixed-length of 96, IOTA's binary representation of a min-sig + * `Bls12381PublicKey` is prefixed with its length meaning its serialized + * binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. + */ +public interface Bls12381SignatureInterface { + + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +/** + * A bls12381 min-sig public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * bls-public-key = %x60 96OCTECT + * ``` + * + * Due to historical reasons, even though a min-sig `Bls12381PublicKey` has a + * fixed-length of 96, IOTA's binary representation of a min-sig + * `Bls12381PublicKey` is prefixed with its length meaning its serialized + * binary form (in bcs) is 97 bytes long vs a more compact 96 bytes. + */ +open class Bls12381Signature: Disposable, AutoCloseable, Bls12381SignatureInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bls12381signature(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bls12381signature(pointer!!, status) + } + } + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bls12381signature_to_bytes( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bls12381Signature { + return FfiConverterTypeBls12381Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bls12381Signature { + return FfiConverterTypeBls12381Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + fun `generate`(): Bls12381Signature { + return FfiConverterTypeBls12381Signature.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381signature_generate( + _status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeBls12381Signature: FfiConverter { + + override fun lower(value: Bls12381Signature): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): Bls12381Signature { + return Bls12381Signature(value) + } + + override fun read(buf: ByteBuffer): Bls12381Signature { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: Bls12381Signature) = 8UL + + override fun write(value: Bls12381Signature, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 point on the BN254 elliptic curve. + * + * This is a 32-byte, or 256-bit, value that is generally represented as + * radix10 when a human-readable display format is needed, and is represented + * as a 32-byte big-endian value while in memory. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * bn254-field-element = *DIGIT ; which is then interpreted as a radix10 encoded 32-byte value + * ``` + */ +public interface Bn254FieldElementInterface { + + fun `padded`(): kotlin.ByteArray + + fun `unpadded`(): kotlin.ByteArray + + companion object +} + +/** + * A point on the BN254 elliptic curve. + * + * This is a 32-byte, or 256-bit, value that is generally represented as + * radix10 when a human-readable display format is needed, and is represented + * as a 32-byte big-endian value while in memory. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * bn254-field-element = *DIGIT ; which is then interpreted as a radix10 encoded 32-byte value + * ``` + */ +open class Bn254FieldElement: Disposable, AutoCloseable, Bn254FieldElementInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bn254fieldelement(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bn254fieldelement(pointer!!, status) + } + } + + override fun `padded`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_padded( + it, _status) +} + } + ) + } + + + override fun `unpadded`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bn254fieldelement_unpadded( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStrRadix10`(`s`: kotlin.String): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bn254fieldelement_from_str_radix_10( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeBn254FieldElement: FfiConverter { + + override fun lower(value: Bn254FieldElement): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): Bn254FieldElement { + return Bn254FieldElement(value) + } + + override fun read(buf: ByteBuffer): Bn254FieldElement { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: Bn254FieldElement) = 8UL + + override fun write(value: Bn254FieldElement, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 ChangeEpochInterface { + + companion object +} + +open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepoch(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepoch(pointer!!, status) + } + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeChangeEpoch: FfiConverter { + + override fun lower(value: ChangeEpoch): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): ChangeEpoch { + return ChangeEpoch(value) + } + + override fun read(buf: ByteBuffer): ChangeEpoch { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: ChangeEpoch) = 8UL + + override fun write(value: ChangeEpoch, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 ChangeEpochV2Interface { + + companion object +} + +open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepochv2(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepochv2(pointer!!, status) + } + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeChangeEpochV2: FfiConverter { + + override fun lower(value: ChangeEpochV2): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): ChangeEpochV2 { + return ChangeEpochV2(value) + } + + override fun read(buf: ByteBuffer): ChangeEpochV2 { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: ChangeEpochV2) = 8UL + + override fun write(value: ChangeEpochV2, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 +// + -private fun uniffiCheckContractApiVersion(lib: IntegrityCheckingUniffiLib) { - // Get the bindings contract version from our ComponentInterface - val bindings_contract_version = 29 - // Get the scaffolding contract version by calling the into the dylib - val scaffolding_contract_version = lib.ffi_iota_sdk_ffi_uniffi_contract_version() - if (bindings_contract_version != scaffolding_contract_version) { - throw RuntimeException("UniFFI contract version mismatch: try cleaning and rebuilding your project") - } +public interface CheckpointCommitmentInterface { + + fun `asEcmhLiveObjectSetDigest`(): Digest + + fun `isEcmhLiveObjectSet`(): kotlin.Boolean + + companion object } -@Suppress("UNUSED_PARAMETER") -private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { - if (lib.uniffi_iota_sdk_ffi_checksum_method_address_to_bytes() != 57710.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_address_to_hex() != 22032.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_bls12381publickey_to_bytes() != 9890.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_checkpointcommitment_as_ecmh_live_object_set_digest() != 41616.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - 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_coin_balance() != 29928.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_coin_coin_type() != 18211.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_coin_id() != 40013.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_ed25519publickey_to_bytes() != 16656.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request() != 13326.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_and_wait() != 48304.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status() != 42353.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_active_validators() != 26965.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_balance() != 9953.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - 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() != 33658.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()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 34454.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 48442.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +open class CheckpointCommitment: Disposable, AutoCloseable, CheckpointCommitmentInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 62890.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + /** + * 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 47707.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 29988.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + @Synchronized + override fun close() { + this.destroy() } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 43452.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 47284.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + // 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_checkpointcommitment(ptr, status) + } + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch() != 46788.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(pointer!!, status) + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_checkpoints() != 29086.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun `asEcmhLiveObjectSetDigest`(): Digest { + return FfiConverterTypeDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch_total_transaction_blocks() != 61978.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_events() != 41916.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + override fun `isEcmhLiveObjectSet`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_execute_tx() != 41079.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_latest_checkpoint_sequence_number() != 40336.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeCheckpointCommitment: FfiConverter { + + override fun lower(value: CheckpointCommitment): Pointer { + return value.uniffiClonePointer() } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_max_page_size() != 44733.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun lift(value: Pointer): CheckpointCommitment { + return CheckpointCommitment(value) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents() != 40412.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun read(buf: ByteBuffer): CheckpointCommitment { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_move_object_contents_bcs() != 49694.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun allocationSize(value: CheckpointCommitment) = 8UL + + override fun write(value: CheckpointCommitment, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_function() != 49066.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") +} + + +// 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 CheckpointContentsDigestInterface { + + fun `toBase58`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +open class CheckpointContentsDigest: Disposable, AutoCloseable, CheckpointContentsDigestInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_module() != 6413.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + /** + * 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object() != 51508.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs() != 1970.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + @Synchronized + override fun close() { + this.destroy() } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 37555.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package() != 7913.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + // 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_checkpointcontentsdigest(ptr, status) + } + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_latest() != 55024.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcontentsdigest(pointer!!, status) + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package_versions() != 33869.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_base58( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_packages() != 3319.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_protocol_config() != 23389.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcontentsdigest_to_bytes( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_reference_gas_price() != 39065.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_service_config() != 24210.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): CheckpointContentsDigest { + return FfiConverterTypeCheckpointContentsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_set_rpc_server() != 31958.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): CheckpointContentsDigest { + return FfiConverterTypeCheckpointContentsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_supply() != 21504.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + fun `generate`(): CheckpointContentsDigest { + return FfiConverterTypeCheckpointContentsDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointcontentsdigest_generate( + _status) +} + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks() != 9583.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_digest() != 64969.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +} + +/** + * @suppress + */ +public object FfiConverterTypeCheckpointContentsDigest: FfiConverter { + + override fun lower(value: CheckpointContentsDigest): Pointer { + return value.uniffiClonePointer() } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_total_transaction_blocks_by_seq_num() != 18624.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun lift(value: Pointer): CheckpointContentsDigest { + return CheckpointContentsDigest(value) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction() != 54687.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun read(buf: ByteBuffer): CheckpointContentsDigest { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_data_effects() != 57979.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun allocationSize(value: CheckpointContentsDigest) = 8UL + + override fun write(value: CheckpointContentsDigest, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transaction_effects() != 56760.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") +} + + +// 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 CheckpointDigestInterface { + + fun `toBase58`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions() != 31273.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + /** + * 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_data_effects() != 14121.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_transactions_effects() != 2687.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + @Synchronized + override fun close() { + this.destroy() } - if (lib.uniffi_iota_sdk_ffi_checksum_method_object_as_struct() != 2473.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_object_data() != 4330.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + // 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_checkpointdigest(ptr, status) + } + } + } } - 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") + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(pointer!!, status) + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_object_object_type() != 1843.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_base58( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_method_object_owner() != 3724.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_object_previous_transaction() != 455.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointdigest_to_bytes( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_method_object_storage_rebate() != 24969.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_object_version() != 18433.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): CheckpointDigest { + return FfiConverterTypeCheckpointDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) } - 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") + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): CheckpointDigest { + return FfiConverterTypeCheckpointDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_bytes() != 38367.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + fun `generate`(): CheckpointDigest { + return FfiConverterTypeCheckpointDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_checkpointdigest_generate( + _status) +} + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_objectid_to_hex() != 4418.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + } - if (lib.uniffi_iota_sdk_ffi_checksum_method_secp256k1publickey_to_bytes() != 49170.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +} + +/** + * @suppress + */ +public object FfiConverterTypeCheckpointDigest: FfiConverter { + + override fun lower(value: CheckpointDigest): Pointer { + return value.uniffiClonePointer() } - if (lib.uniffi_iota_sdk_ffi_checksum_method_secp256r1publickey_to_bytes() != 21066.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun lift(value: Pointer): CheckpointDigest { + return CheckpointDigest(value) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_signedtransaction_signatures() != 59055.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun read(buf: ByteBuffer): CheckpointDigest { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_signedtransaction_transaction() != 60873.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun allocationSize(value: CheckpointDigest) = 8UL + + override fun write(value: CheckpointDigest, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_expiration() != 4282.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") +} + + +// 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_gas_payment() != 5316.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + /** + * 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_kind() != 49492.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_transaction_sender() != 38190.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + @Synchronized + override fun close() { + this.destroy() } - if (lib.uniffi_iota_sdk_ffi_checksum_method_transactiondataeffects_effects() != 62613.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_method_transactiondataeffects_tx() != 13303.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + // 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) + } + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes() != 58901.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_address_from_hex() != 63442.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun lift(value: Pointer): CircomG1 { + return CircomG1(value) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_address_generate() != 48865.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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())) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_bytes() != 6069.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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))) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_from_str() != 26128.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") +} + + +// 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_bls12381publickey_generate() != 30791.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + /** + * 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_coin_try_from_object() != 35349.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + 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) +} + ) + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_bytes() != 60403.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + @Synchronized + override fun close() { + this.destroy() } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_from_str() != 38751.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_ed25519publickey_generate() != 46412.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + // 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_circomg2(ptr, status) + } + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_create() != 18946.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_circomg2(pointer!!, status) + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_authenticator_state_expire() != 49861.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeCircomG2: FfiConverter { + + override fun lower(value: CircomG2): Pointer { + return value.uniffiClonePointer() } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch() != 16640.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun lift(value: Pointer): CircomG2 { + return CircomG2(value) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_endofepochtransactionkind_change_epoch_v2() != 17262.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun read(buf: ByteBuffer): CircomG2 { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_devnet() != 37366.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun allocationSize(value: CircomG2) = 8UL + + override fun write(value: CircomG2, 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))) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_local() != 55393.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") +} + + +// 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 CoinInterface { + + fun `balance`(): kotlin.ULong + + fun `coinType`(): TypeTag + + fun `id`(): ObjectId + + companion object +} + +open class Coin: Disposable, AutoCloseable, CoinInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() != 13557.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + /** + * 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_testnet() != 16109.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new() != 32097.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + @Synchronized + override fun close() { + this.destroy() } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_devnet() != 6494.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_localhost() != 5570.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + // 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_coin(ptr, status) + } + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_mainnet() != 3613.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_coin(pointer!!, status) + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_graphqlclient_new_testnet() != 48529.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun `balance`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_coin_balance( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_object_new() != 56232.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") + + + override fun `coinType`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_coin_coin_type( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_objectid_from_hex() != 30954.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_bytes() != 20339.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + override fun `id`(): ObjectId { + return FfiConverterTypeObjectId.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_coin_id( + it, _status) +} } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_from_str() != 24158.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256k1publickey_generate() != 36411.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + + + + companion object { + + @Throws(SdkFfiException::class) fun `tryFromObject`(`object`: Object): Coin { + return FfiConverterTypeCoin.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_coin_try_from_object( + FfiConverterTypeObject.lower(`object`),_status) +} + ) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_bytes() != 60002.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + + } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_from_str() != 27991.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + +} + +/** + * @suppress + */ +public object FfiConverterTypeCoin: FfiConverter { + + override fun lower(value: Coin): Pointer { + return value.uniffiClonePointer() } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_secp256r1publickey_generate() != 49992.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun lift(value: Pointer): Coin { + return Coin(value) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_signedtransaction_new() != 6988.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun read(buf: ByteBuffer): Coin { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transaction_new() != 36271.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + override fun allocationSize(value: Coin) = 8UL + + override fun write(value: Coin, 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))) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactiondataeffects_new() != 30302.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") +} + + +// 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 CoinMetadataInterface { + + companion object +} + +open class CoinMetadata: Disposable, AutoCloseable, CoinMetadataInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_authenticator_state_update_v1() != 37860.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + /** + * 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)) } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_consensus_commit_prologue_v1() != 50635.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_end_of_epoch() != 65525.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + @Synchronized + override fun close() { + this.destroy() } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_genesis() != 65272.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + 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() + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_programmable_transaction() != 51205.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + // 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_coinmetadata(ptr, status) + } + } + } } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_transactionkind_randomness_state_update() != 45772.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_coinmetadata(pointer!!, status) + } } + + + + + + companion object + } /** * @suppress */ -public fun uniffiEnsureInitialized() { - UniffiLib.INSTANCE -} - -// Async support -// Async return type handlers +public object FfiConverterTypeCoinMetadata: FfiConverter { -internal const val UNIFFI_RUST_FUTURE_POLL_READY = 0.toByte() -internal const val UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1.toByte() + override fun lower(value: CoinMetadata): Pointer { + return value.uniffiClonePointer() + } -internal val uniffiContinuationHandleMap = UniffiHandleMap>() + override fun lift(value: Pointer): CoinMetadata { + return CoinMetadata(value) + } -// FFI type for Rust future continuations -internal object uniffiRustFutureContinuationCallbackImpl: UniffiRustFutureContinuationCallback { - override fun callback(data: Long, pollResult: Byte) { - uniffiContinuationHandleMap.remove(data).resume(pollResult) + override fun read(buf: ByteBuffer): CoinMetadata { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) } -} -internal suspend fun uniffiRustCallAsync( - rustFuture: Long, - pollFunc: (Long, UniffiRustFutureContinuationCallback, Long) -> Unit, - completeFunc: (Long, UniffiRustCallStatus) -> F, - freeFunc: (Long) -> Unit, - liftFunc: (F) -> T, - errorHandler: UniffiRustCallStatusErrorHandler -): T { - try { - do { - val pollResult = suspendCancellableCoroutine { continuation -> - pollFunc( - rustFuture, - uniffiRustFutureContinuationCallbackImpl, - uniffiContinuationHandleMap.insert(continuation) - ) - } - } while (pollResult != UNIFFI_RUST_FUTURE_POLL_READY); + override fun allocationSize(value: CoinMetadata) = 8UL - return liftFunc( - uniffiRustCallWithError(errorHandler, { status -> completeFunc(rustFuture, status) }) - ) - } finally { - freeFunc(rustFuture) + override fun write(value: CoinMetadata, 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))) } } -// Public interface members begin here. - -// Interface implemented by anything that can contain an object reference. +// 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. // -// Such types expose a `destroy()` method that must be called to cleanly -// dispose of the contained objects. Failure to call this method may result -// in memory leaks. +// 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. // -// The easiest way to ensure this method is called is to use the `.use` -// helper method to execute a block and destroy the object at the end. -interface Disposable { - fun destroy() - companion object { - fun destroy(vararg args: Any?) { - for (arg in args) { - when (arg) { - is Disposable -> arg.destroy() - is ArrayList<*> -> { - for (idx in arg.indices) { - val element = arg[idx] - if (element is Disposable) { - element.destroy() - } - } - } - is Map<*, *> -> { - for (element in arg.values) { - if (element is Disposable) { - element.destroy() - } - } - } - is Iterable<*> -> { - for (element in arg) { - if (element is Disposable) { - element.destroy() - } - } - } - } +// There's some subtlety here, because we have to be careful not to operate on a Rust +// struct after it has been dropped, and because we must expose a public API for freeing +// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: +// +// * Each instance holds an opaque pointer to the underlying Rust struct. +// Method calls need to read this pointer from the object's state and pass it in to +// the Rust FFI. +// +// * When an instance is no longer needed, its pointer should be passed to a +// special destructor function provided by the Rust FFI, which will drop the +// underlying Rust struct. +// +// * Given an instance, calling code is expected to call the special +// `destroy` method in order to free it after use, either by calling it explicitly +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. +// +// * We can't assume that calling code will do the right thing, and must be prepared +// to handle Kotlin method calls executing concurrently with or even after a call to +// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. +// +// * We must never allow Rust code to operate on the underlying Rust struct after +// the destructor has been called, and must never call the destructor more than once. +// Doing so may trigger memory unsafety. +// +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// +// If we try to implement this with mutual exclusion on access to the pointer, there is the +// possibility of a race between a method call and a concurrent call to `destroy`: +// +// * Thread A starts a method call, reads the value of the pointer, but is interrupted +// before it can pass the pointer over the FFI to Rust. +// * Thread B calls `destroy` and frees the underlying Rust struct. +// * Thread A resumes, passing the already-read pointer value to Rust and triggering +// a use-after-free. +// +// One possible solution would be to use a `ReadWriteLock`, with each method call taking +// a read lock (and thus allowed to run concurrently) and the special `destroy` method +// taking a write lock (and thus blocking on live method calls). However, we aim not to +// generate methods with any hidden blocking semantics, and a `destroy` method that might +// block if called incorrectly seems to meet that bar. +// +// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track +// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` +// has been called. These are updated according to the following rules: +// +// * The initial value of the counter is 1, indicating a live object with no in-flight calls. +// The initial value for the flag is false. +// +// * At the start of each method call, we atomically check the counter. +// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. +// If it is nonzero them we atomically increment it by 1 and proceed with the method call. +// +// * At the end of each method call, we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// * When `destroy` is called, we atomically flip the flag from false to true. +// If the flag was already true we silently fail. +// Otherwise we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, +// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. +// +// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been +// called *and* all in-flight method calls have completed, avoiding violating any of the expectations +// of the underlying Rust code. +// +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. +// +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. +// +// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 +// + + +public interface ConsensusCommitDigestInterface { + + fun `toBase58`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +open class ConsensusCommitDigest: Disposable, AutoCloseable, ConsensusCommitDigestInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() } } } -} -/** - * @suppress - */ -inline fun T.use(block: (T) -> R) = - try { - block(this) - } finally { - try { - // N.B. our implementation is on the nullable type `Disposable?`. - this?.destroy() - } catch (e: Throwable) { - // swallow + // 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_consensuscommitdigest(ptr, status) + } + } } } -/** - * Used to instantiate an interface without an actual pointer, for fakes in tests, mostly. - * - * @suppress - * */ -object NoPointer -/** - * The cleaner interface for Object finalization code to run. - * This is the entry point to any implementation that we're using. - * - * The cleaner registers objects and returns cleanables, so now we are - * defining a `UniffiCleaner` with a `UniffiClenaer.Cleanable` to abstract the - * different implmentations available at compile time. - * - * @suppress - */ -interface UniffiCleaner { - interface Cleanable { - fun clean() + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(pointer!!, status) + } } - fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_base58( + it, _status) +} + } + ) + } + - companion object + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_consensuscommitdigest_to_bytes( + it, _status) } + } + ) + } + -// The fallback Jna cleaner, which is available for both Android, and the JVM. -private class UniffiJnaCleaner : UniffiCleaner { - private val cleaner = com.sun.jna.internal.Cleaner.getCleaner() + - override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = - UniffiJnaCleanable(cleaner.register(value, cleanUpTask)) + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): ConsensusCommitDigest { + return FfiConverterTypeConsensusCommitDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_base58( + FfiConverterString.lower(`base58`),_status) } + ) + } + -private class UniffiJnaCleanable( - private val cleanable: com.sun.jna.internal.Cleaner.Cleanable, -) : UniffiCleaner.Cleanable { - override fun clean() = cleanable.clean() + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ConsensusCommitDigest { + return FfiConverterTypeConsensusCommitDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } - - -// We decide at uniffi binding generation time whether we were -// using Android or not. -// There are further runtime checks to chose the correct implementation -// of the cleaner. -private fun UniffiCleaner.Companion.create(): UniffiCleaner = - try { - // For safety's sake: if the library hasn't been run in android_cleaner = true - // mode, but is being run on Android, then we still need to think about - // Android API versions. - // So we check if java.lang.ref.Cleaner is there, and use that… - java.lang.Class.forName("java.lang.ref.Cleaner") - JavaLangRefCleaner() - } catch (e: ClassNotFoundException) { - // … otherwise, fallback to the JNA cleaner. - UniffiJnaCleaner() + ) } + -private class JavaLangRefCleaner : UniffiCleaner { - val cleaner = java.lang.ref.Cleaner.create() - - override fun register(value: Any, cleanUpTask: Runnable): UniffiCleaner.Cleanable = - JavaLangRefCleanable(cleaner.register(value, cleanUpTask)) + fun `generate`(): ConsensusCommitDigest { + return FfiConverterTypeConsensusCommitDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_consensuscommitdigest_generate( + _status) } + ) + } + -private class JavaLangRefCleanable( - val cleanable: java.lang.ref.Cleaner.Cleanable -) : UniffiCleaner.Cleanable { - override fun clean() = cleanable.clean() + + } + } /** * @suppress */ -public object FfiConverterInt: FfiConverter { - override fun lift(value: Int): Int { - return value +public object FfiConverterTypeConsensusCommitDigest: FfiConverter { + + override fun lower(value: ConsensusCommitDigest): Pointer { + return value.uniffiClonePointer() } - override fun read(buf: ByteBuffer): Int { - return buf.getInt() + override fun lift(value: Pointer): ConsensusCommitDigest { + return ConsensusCommitDigest(value) } - override fun lower(value: Int): Int { - return value + override fun read(buf: ByteBuffer): ConsensusCommitDigest { + // 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: Int) = 4UL + override fun allocationSize(value: ConsensusCommitDigest) = 8UL - override fun write(value: Int, buf: ByteBuffer) { - buf.putInt(value) + override fun write(value: ConsensusCommitDigest, 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))) } } -/** - * @suppress - */ -public object FfiConverterULong: FfiConverter { - override fun lift(value: Long): ULong { - return value.toULong() - } - - override fun read(buf: ByteBuffer): ULong { - return lift(buf.getLong()) - } - override fun lower(value: ULong): Long { - return value.toLong() - } +// 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 +// - override fun allocationSize(value: ULong) = 8UL - override fun write(value: ULong, buf: ByteBuffer) { - buf.putLong(value.toLong()) - } +public interface ConsensusCommitPrologueV1Interface { + + companion object } -/** - * @suppress - */ -public object FfiConverterLong: FfiConverter { - override fun lift(value: Long): Long { - return value - } - - override fun read(buf: ByteBuffer): Long { - return buf.getLong() - } +open class ConsensusCommitPrologueV1: Disposable, AutoCloseable, ConsensusCommitPrologueV1Interface +{ - override fun lower(value: Long): Long { - return value + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - override fun allocationSize(value: Long) = 8UL - - override fun write(value: Long, buf: ByteBuffer) { - buf.putLong(value) + /** + * 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)) } -} -/** - * @suppress - */ -public object FfiConverterBoolean: FfiConverter { - override fun lift(value: Byte): Boolean { - return value.toInt() != 0 - } + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable - override fun read(buf: ByteBuffer): Boolean { - return lift(buf.get()) - } + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) - override fun lower(value: Boolean): Byte { - return if (value) 1.toByte() else 0.toByte() + 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() + } + } } - override fun allocationSize(value: Boolean) = 1UL - - override fun write(value: Boolean, buf: ByteBuffer) { - buf.put(lower(value)) + @Synchronized + override fun close() { + this.destroy() } -} -/** - * @suppress - */ -public object FfiConverterString: FfiConverter { - // Note: we don't inherit from FfiConverterRustBuffer, because we use a - // special encoding when lowering/lifting. We can use `RustBuffer.len` to - // store our length and avoid writing it out to the buffer. - override fun lift(value: RustBuffer.ByValue): String { + 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 { - val byteArr = ByteArray(value.len.toInt()) - value.asByteBuffer()!!.get(byteArr) - return byteArr.toString(Charsets.UTF_8) + return block(this.uniffiClonePointer()) } finally { - RustBuffer.free(value) + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } } } - override fun read(buf: ByteBuffer): String { - val len = buf.getInt() - val byteArr = ByteArray(len) - buf.get(byteArr) - return byteArr.toString(Charsets.UTF_8) - } - - fun toUtf8(value: String): ByteBuffer { - // Make sure we don't have invalid UTF-16, check for lone surrogates. - return Charsets.UTF_8.newEncoder().run { - onMalformedInput(CodingErrorAction.REPORT) - encode(CharBuffer.wrap(value)) + // 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_consensuscommitprologuev1(ptr, status) + } + } } } - override fun lower(value: String): RustBuffer.ByValue { - val byteBuf = toUtf8(value) - // Ideally we'd pass these bytes to `ffi_bytebuffer_from_bytes`, but doing so would require us - // to copy them into a JNA `Memory`. So we might as well directly copy them into a `RustBuffer`. - val rbuf = RustBuffer.alloc(byteBuf.limit().toULong()) - rbuf.asByteBuffer()!!.put(byteBuf) - return rbuf + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1(pointer!!, status) + } } - // We aren't sure exactly how many bytes our string will be once it's UTF-8 - // encoded. Allocate 3 bytes per UTF-16 code unit which will always be - // enough. - override fun allocationSize(value: String): ULong { - val sizeForLength = 4UL - val sizeForString = value.length.toULong() * 3UL - return sizeForLength + sizeForString - } + - override fun write(value: String, buf: ByteBuffer) { - val byteBuf = toUtf8(value) - buf.putInt(byteBuf.limit()) - buf.put(byteBuf) - } + + + companion object + } /** * @suppress */ -public object FfiConverterByteArray: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ByteArray { - val len = buf.getInt() - val byteArr = ByteArray(len) - buf.get(byteArr) - return byteArr +public object FfiConverterTypeConsensusCommitPrologueV1: FfiConverter { + + override fun lower(value: ConsensusCommitPrologueV1): Pointer { + return value.uniffiClonePointer() } - override fun allocationSize(value: ByteArray): ULong { - return 4UL + value.size.toULong() + + override fun lift(value: Pointer): ConsensusCommitPrologueV1 { + return ConsensusCommitPrologueV1(value) } - override fun write(value: ByteArray, buf: ByteBuffer) { - buf.putInt(value.size) - buf.put(value) + + override fun read(buf: ByteBuffer): ConsensusCommitPrologueV1 { + // 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: ConsensusCommitPrologueV1) = 8UL + + override fun write(value: ConsensusCommitPrologueV1, 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))) } } @@ -2718,153 +9336,75 @@ public object FfiConverterByteArray: FfiConverterRustBuffer { // * 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 -// - - -/** - * Unique identifier for an Account on the IOTA blockchain. - * - * An `Address` is a 32-byte pseudonymous identifier used to uniquely identify - * an account and asset-ownership on the IOTA blockchain. Often, human-readable - * addresses are encoded in hexadecimal with a `0x` prefix. For example, this - * is a valid IOTA address: - * `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. - * - * ``` - * use iota_types::Address; - * - * let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; - * let address = Address::from_hex(hex).unwrap(); - * println!("Address: {}", address); - * assert_eq!(hex, address.to_string()); - * ``` - * - * # Deriving an Address - * - * Addresses are cryptographically derived from a number of user account - * authenticators, the simplest of which is an - * [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). - * - * Deriving an address consists of the Blake2b256 hash of the sequence of bytes - * of its corresponding authenticator, prefixed with a domain-separator (except - * ed25519, for compatability reasons). For each other authenticator, this - * domain-separator is the single byte-value of its - * [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature - * schema flag || authenticator bytes)`. - * - * Each authenticator has a method for deriving its `Address` as well as - * documentation for the specifics of how the derivation is done. See - * [`Ed25519PublicKey::derive_address`] for an example. - * - * [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address - * - * ## Relationship to ObjectIds - * - * [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but - * are derived leveraging different domain-separator values to ensure that, - * cryptographically, there won't be any overlap, e.g. there can't be a - * valid `Object` who's `ObjectId` is equal to that of the `Address` of a user - * account. - * - * [`ObjectId`]: iota_types::ObjectId +// 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 32-byte Blake2b256 hash output. * * # BCS * - * An `Address`'s BCS serialized form is defined by the following: + * A `Digest`'s BCS serialized form is defined by the following: * * ```text - * address = 32OCTET + * digest = %x20 32OCTET * ``` + * + * Due to historical reasons, even though a `Digest` has a fixed-length of 32, + * IOTA's binary representation of a `Digest` is prefixed with its length + * meaning its serialized binary form (in bcs) is 33 bytes long vs a more + * compact 32 bytes. */ -public interface AddressInterface { +public interface DigestInterface { - fun `toBytes`(): kotlin.ByteArray + fun `toBase58`(): kotlin.String - fun `toHex`(): kotlin.String + fun `toBytes`(): kotlin.ByteArray companion object } /** - * Unique identifier for an Account on the IOTA blockchain. - * - * An `Address` is a 32-byte pseudonymous identifier used to uniquely identify - * an account and asset-ownership on the IOTA blockchain. Often, human-readable - * addresses are encoded in hexadecimal with a `0x` prefix. For example, this - * is a valid IOTA address: - * `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. - * - * ``` - * use iota_types::Address; - * - * let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; - * let address = Address::from_hex(hex).unwrap(); - * println!("Address: {}", address); - * assert_eq!(hex, address.to_string()); - * ``` - * - * # Deriving an Address - * - * Addresses are cryptographically derived from a number of user account - * authenticators, the simplest of which is an - * [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). - * - * Deriving an address consists of the Blake2b256 hash of the sequence of bytes - * of its corresponding authenticator, prefixed with a domain-separator (except - * ed25519, for compatability reasons). For each other authenticator, this - * domain-separator is the single byte-value of its - * [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature - * schema flag || authenticator bytes)`. - * - * Each authenticator has a method for deriving its `Address` as well as - * documentation for the specifics of how the derivation is done. See - * [`Ed25519PublicKey::derive_address`] for an example. - * - * [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address - * - * ## Relationship to ObjectIds - * - * [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but - * are derived leveraging different domain-separator values to ensure that, - * cryptographically, there won't be any overlap, e.g. there can't be a - * valid `Object` who's `ObjectId` is equal to that of the `Address` of a user - * account. - * - * [`ObjectId`]: iota_types::ObjectId + * A 32-byte Blake2b256 hash output. * * # BCS * - * An `Address`'s BCS serialized form is defined by the following: + * A `Digest`'s BCS serialized form is defined by the following: * * ```text - * address = 32OCTET + * digest = %x20 32OCTET * ``` + * + * Due to historical reasons, even though a `Digest` has a fixed-length of 32, + * IOTA's binary representation of a `Digest` is prefixed with its length + * meaning its serialized binary form (in bcs) is 33 bytes long vs a more + * compact 32 bytes. */ -open class Address: Disposable, AutoCloseable, AddressInterface +open class Digest: Disposable, AutoCloseable, DigestInterface { constructor(pointer: Pointer) { @@ -2934,7 +9474,7 @@ open class Address: Disposable, AutoCloseable, AddressInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_address(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_digest(ptr, status) } } } @@ -2942,15 +9482,15 @@ open class Address: Disposable, AutoCloseable, AddressInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_address(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_digest(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_address_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_digest_to_base58( it, _status) } } @@ -2958,11 +9498,11 @@ open class Address: Disposable, AutoCloseable, AddressInterface } - override fun `toHex`(): kotlin.String { - return FfiConverterString.lift( + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_address_to_hex( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_digest_to_bytes( it, _status) } } @@ -2975,31 +9515,31 @@ open class Address: Disposable, AutoCloseable, AddressInterface companion object { - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Address { - return FfiConverterTypeAddress.lift( + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): Digest { + return FfiConverterTypeDigest.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_digest_from_base58( + FfiConverterString.lower(`base58`),_status) } ) } - @Throws(SdkFfiException::class) fun `fromHex`(`hex`: kotlin.String): Address { - return FfiConverterTypeAddress.lift( + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Digest { + return FfiConverterTypeDigest.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_address_from_hex( - FfiConverterString.lower(`hex`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_digest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } ) } - fun `generate`(): Address { - return FfiConverterTypeAddress.lift( + fun `generate`(): Digest { + return FfiConverterTypeDigest.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_address_generate( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_digest_generate( _status) } ) @@ -3014,25 +9554,25 @@ open class Address: Disposable, AutoCloseable, AddressInterface /** * @suppress */ -public object FfiConverterTypeAddress: FfiConverter { +public object FfiConverterTypeDigest: FfiConverter { - override fun lower(value: Address): Pointer { + override fun lower(value: Digest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Address { - return Address(value) + override fun lift(value: Pointer): Digest { + return Digest(value) } - override fun read(buf: ByteBuffer): Address { + override fun read(buf: ByteBuffer): Digest { // 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: Address) = 8UL + override fun allocationSize(value: Digest) = 8UL - override fun write(value: Address, buf: ByteBuffer) { + override fun write(value: Digest, 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))) @@ -3138,12 +9678,36 @@ public object FfiConverterTypeAddress: FfiConverter { // -public interface AuthenticatorStateExpireInterface { +/** + * An ed25519 public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * ed25519-public-key = 32OCTECT + * ``` + */ +public interface Ed25519PublicKeyInterface { + + fun `toBytes`(): kotlin.ByteArray companion object } -open class AuthenticatorStateExpire: Disposable, AutoCloseable, AuthenticatorStateExpireInterface +/** + * An ed25519 public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * ed25519-public-key = 32OCTECT + * ``` + */ +open class Ed25519PublicKey: Disposable, AutoCloseable, Ed25519PublicKeyInterface { constructor(pointer: Pointer) { @@ -3213,7 +9777,7 @@ open class AuthenticatorStateExpire: Disposable, AutoCloseable, AuthenticatorSta override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateexpire(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_ed25519publickey(ptr, status) } } } @@ -3221,40 +9785,85 @@ open class AuthenticatorStateExpire: Disposable, AutoCloseable, AuthenticatorSta fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateexpire(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_ed25519publickey(pointer!!, status) } } + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_ed25519publickey_to_bytes( + it, _status) +} + } + ) + } + - companion object + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Ed25519PublicKey { + return FfiConverterTypeEd25519PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Ed25519PublicKey { + return FfiConverterTypeEd25519PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + fun `generate`(): Ed25519PublicKey { + return FfiConverterTypeEd25519PublicKey.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeAuthenticatorStateExpire: FfiConverter { +public object FfiConverterTypeEd25519PublicKey: FfiConverter { - override fun lower(value: AuthenticatorStateExpire): Pointer { + override fun lower(value: Ed25519PublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): AuthenticatorStateExpire { - return AuthenticatorStateExpire(value) + override fun lift(value: Pointer): Ed25519PublicKey { + return Ed25519PublicKey(value) } - override fun read(buf: ByteBuffer): AuthenticatorStateExpire { + override fun read(buf: ByteBuffer): Ed25519PublicKey { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: AuthenticatorStateExpire) = 8UL + override fun allocationSize(value: Ed25519PublicKey) = 8UL - override fun write(value: AuthenticatorStateExpire, buf: ByteBuffer) { + override fun write(value: Ed25519PublicKey, 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))) @@ -3360,12 +9969,36 @@ public object FfiConverterTypeAuthenticatorStateExpire: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_authenticatorstateupdatev1(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_ed25519signature(ptr, status) } } } @@ -3443,40 +10076,85 @@ open class AuthenticatorStateUpdateV1: Disposable, AutoCloseable, AuthenticatorS fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_authenticatorstateupdatev1(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_ed25519signature(pointer!!, status) } } + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_ed25519signature_to_bytes( + it, _status) +} + } + ) + } + - companion object + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Ed25519Signature { + return FfiConverterTypeEd25519Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Ed25519Signature { + return FfiConverterTypeEd25519Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + fun `generate`(): Ed25519Signature { + return FfiConverterTypeEd25519Signature.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519signature_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeAuthenticatorStateUpdateV1: FfiConverter { +public object FfiConverterTypeEd25519Signature: FfiConverter { - override fun lower(value: AuthenticatorStateUpdateV1): Pointer { + override fun lower(value: Ed25519Signature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): AuthenticatorStateUpdateV1 { - return AuthenticatorStateUpdateV1(value) + override fun lift(value: Pointer): Ed25519Signature { + return Ed25519Signature(value) } - override fun read(buf: ByteBuffer): AuthenticatorStateUpdateV1 { + override fun read(buf: ByteBuffer): Ed25519Signature { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: AuthenticatorStateUpdateV1) = 8UL + override fun allocationSize(value: Ed25519Signature) = 8UL - override fun write(value: AuthenticatorStateUpdateV1, buf: ByteBuffer) { + override fun write(value: Ed25519Signature, 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))) @@ -3582,12 +10260,16 @@ public object FfiConverterTypeAuthenticatorStateUpdateV1: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_batchsendstatus(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_effectsauxiliarydatadigest(ptr, status) } } } @@ -3665,40 +10347,97 @@ open class BatchSendStatus: Disposable, AutoCloseable, BatchSendStatusInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_batchsendstatus(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(pointer!!, status) } } + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_base58( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_effectsauxiliarydatadigest_to_bytes( + it, _status) +} + } + ) + } + - companion object + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): EffectsAuxiliaryDataDigest { + return FfiConverterTypeEffectsAuxiliaryDataDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): EffectsAuxiliaryDataDigest { + return FfiConverterTypeEffectsAuxiliaryDataDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): EffectsAuxiliaryDataDigest { + return FfiConverterTypeEffectsAuxiliaryDataDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_effectsauxiliarydatadigest_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeBatchSendStatus: FfiConverter { +public object FfiConverterTypeEffectsAuxiliaryDataDigest: FfiConverter { - override fun lower(value: BatchSendStatus): Pointer { + override fun lower(value: EffectsAuxiliaryDataDigest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): BatchSendStatus { - return BatchSendStatus(value) + override fun lift(value: Pointer): EffectsAuxiliaryDataDigest { + return EffectsAuxiliaryDataDigest(value) } - override fun read(buf: ByteBuffer): BatchSendStatus { + override fun read(buf: ByteBuffer): EffectsAuxiliaryDataDigest { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: BatchSendStatus) = 8UL + override fun allocationSize(value: EffectsAuxiliaryDataDigest) = 8UL - override fun write(value: BatchSendStatus, buf: ByteBuffer) { + override fun write(value: EffectsAuxiliaryDataDigest, 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))) @@ -3805,45 +10544,65 @@ public object FfiConverterTypeBatchSendStatus: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_bls12381publickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_endofepochtransactionkind(ptr, status) } } } @@ -3921,53 +10680,49 @@ open class Bls12381PublicKey: Disposable, AutoCloseable, Bls12381PublicKeyInterf fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_bls12381publickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_endofepochtransactionkind(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( - callWithPointer { + + + + companion object { + fun `authenticatorStateCreate`(): EndOfEpochTransactionKind { + return FfiConverterTypeEndOfEpochTransactionKind.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_bls12381publickey_to_bytes( - it, _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_create( + _status) } - } ) } - - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Bls12381PublicKey { - return FfiConverterTypeBls12381PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + fun `authenticatorStateExpire`(`tx`: AuthenticatorStateExpire): EndOfEpochTransactionKind { + return FfiConverterTypeEndOfEpochTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_expire( + FfiConverterTypeAuthenticatorStateExpire.lower(`tx`),_status) } ) } - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Bls12381PublicKey { - return FfiConverterTypeBls12381PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_from_str( - FfiConverterString.lower(`s`),_status) + fun `changeEpoch`(`tx`: ChangeEpoch): EndOfEpochTransactionKind { + return FfiConverterTypeEndOfEpochTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch( + FfiConverterTypeChangeEpoch.lower(`tx`),_status) } ) } - fun `generate`(): Bls12381PublicKey { - return FfiConverterTypeBls12381PublicKey.lift( + fun `changeEpochV2`(`tx`: ChangeEpochV2): EndOfEpochTransactionKind { + return FfiConverterTypeEndOfEpochTransactionKind.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_bls12381publickey_generate( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch_v2( + FfiConverterTypeChangeEpochV2.lower(`tx`),_status) } ) } @@ -3981,25 +10736,25 @@ open class Bls12381PublicKey: Disposable, AutoCloseable, Bls12381PublicKeyInterf /** * @suppress */ -public object FfiConverterTypeBls12381PublicKey: FfiConverter { +public object FfiConverterTypeEndOfEpochTransactionKind: FfiConverter { - override fun lower(value: Bls12381PublicKey): Pointer { + override fun lower(value: EndOfEpochTransactionKind): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Bls12381PublicKey { - return Bls12381PublicKey(value) + override fun lift(value: Pointer): EndOfEpochTransactionKind { + return EndOfEpochTransactionKind(value) } - override fun read(buf: ByteBuffer): Bls12381PublicKey { + override fun read(buf: ByteBuffer): EndOfEpochTransactionKind { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Bls12381PublicKey) = 8UL + override fun allocationSize(value: EndOfEpochTransactionKind) = 8UL - override fun write(value: Bls12381PublicKey, buf: ByteBuffer) { + override fun write(value: EndOfEpochTransactionKind, 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))) @@ -4105,12 +10860,12 @@ public object FfiConverterTypeBls12381PublicKey: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepoch(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_epoch(ptr, status) } } } @@ -4188,7 +10943,7 @@ open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepoch(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_epoch(pointer!!, status) } } @@ -4203,25 +10958,25 @@ open class ChangeEpoch: Disposable, AutoCloseable, ChangeEpochInterface /** * @suppress */ -public object FfiConverterTypeChangeEpoch: FfiConverter { +public object FfiConverterTypeEpoch: FfiConverter { - override fun lower(value: ChangeEpoch): Pointer { + override fun lower(value: Epoch): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ChangeEpoch { - return ChangeEpoch(value) + override fun lift(value: Pointer): Epoch { + return Epoch(value) } - override fun read(buf: ByteBuffer): ChangeEpoch { + override fun read(buf: ByteBuffer): Epoch { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ChangeEpoch) = 8UL + override fun allocationSize(value: Epoch) = 8UL - override fun write(value: ChangeEpoch, buf: ByteBuffer) { + override fun write(value: Epoch, 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))) @@ -4327,12 +11082,12 @@ public object FfiConverterTypeChangeEpoch: FfiConverter { // -public interface ChangeEpochV2Interface { +public interface ExecutionTimeObservationsInterface { companion object } -open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface +open class ExecutionTimeObservations: Disposable, AutoCloseable, ExecutionTimeObservationsInterface { constructor(pointer: Pointer) { @@ -4402,7 +11157,7 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_changeepochv2(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_executiontimeobservations(ptr, status) } } } @@ -4410,7 +11165,7 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_changeepochv2(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_executiontimeobservations(pointer!!, status) } } @@ -4425,25 +11180,25 @@ open class ChangeEpochV2: Disposable, AutoCloseable, ChangeEpochV2Interface /** * @suppress */ -public object FfiConverterTypeChangeEpochV2: FfiConverter { +public object FfiConverterTypeExecutionTimeObservations: FfiConverter { - override fun lower(value: ChangeEpochV2): Pointer { + override fun lower(value: ExecutionTimeObservations): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ChangeEpochV2 { - return ChangeEpochV2(value) + override fun lift(value: Pointer): ExecutionTimeObservations { + return ExecutionTimeObservations(value) } - override fun read(buf: ByteBuffer): ChangeEpochV2 { + override fun read(buf: ByteBuffer): ExecutionTimeObservations { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ChangeEpochV2) = 8UL + override fun allocationSize(value: ExecutionTimeObservations) = 8UL - override fun write(value: ChangeEpochV2, buf: ByteBuffer) { + override fun write(value: ExecutionTimeObservations, 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))) @@ -4549,16 +11304,37 @@ public object FfiConverterTypeChangeEpochV2: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_new( + FfiConverterString.lower(`faucetUrl`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -4628,7 +11420,7 @@ open class CheckpointCommitment: Disposable, AutoCloseable, CheckpointCommitment override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointcommitment(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_faucetclient(ptr, status) } } } @@ -4636,64 +11428,162 @@ open class CheckpointCommitment: Disposable, AutoCloseable, CheckpointCommitment fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcommitment(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_faucetclient(pointer!!, status) } } - override fun `asEcmhLiveObjectSetDigest`(): Digest { - return FfiConverterTypeDigest.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_as_ecmh_live_object_set_digest( - it, _status) -} + + /** + * Request gas from the faucet. Note that this will return the UUID of the + * request and not wait until the token is received. Use + * `request_and_wait` to wait for the token. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `request`(`address`: Address) : kotlin.String? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_faucetclient_request( + thisPtr, + FfiConverterTypeAddress.lower(`address`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalString.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } + + + /** + * Request gas from the faucet and wait until the request is completed and + * token is transferred. Returns `FaucetReceipt` if the request is + * successful, which contains the list of tokens transferred, and the + * transaction digest. + * + * Note that the faucet is heavily rate-limited, so calling repeatedly the + * faucet would likely result in a 429 code or 502 code. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `requestAndWait`(`address`: Address) : FaucetReceipt? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_and_wait( + thisPtr, + FfiConverterTypeAddress.lower(`address`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeFaucetReceipt.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } + + + /** + * Check the faucet request status. + * + * Possible statuses are defined in: [`BatchSendStatusType`] + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `requestStatus`(`id`: kotlin.String) : BatchSendStatus? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_status( + thisPtr, + FfiConverterString.lower(`id`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeBatchSendStatus.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, ) } + - override fun `isEcmhLiveObjectSet`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { + + companion object { + + /** + * Set to devnet faucet. + */ fun `devnet`(): FaucetClient { + return FfiConverterTypeFaucetClient.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_checkpointcommitment_is_ecmh_live_object_set( - it, _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_devnet( + _status) } - } ) } + + /** + * Set to local faucet. + */ fun `local`(): FaucetClient { + return FfiConverterTypeFaucetClient.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_local( + _status) +} + ) + } + + /** + * Set to testnet faucet. + */ fun `testnet`(): FaucetClient { + return FfiConverterTypeFaucetClient.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_testnet( + _status) +} + ) + } - - companion object + + + } } /** * @suppress */ -public object FfiConverterTypeCheckpointCommitment: FfiConverter { +public object FfiConverterTypeFaucetClient: FfiConverter { - override fun lower(value: CheckpointCommitment): Pointer { + override fun lower(value: FaucetClient): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): CheckpointCommitment { - return CheckpointCommitment(value) + override fun lift(value: Pointer): FaucetClient { + return FaucetClient(value) } - override fun read(buf: ByteBuffer): CheckpointCommitment { + override fun read(buf: ByteBuffer): FaucetClient { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: CheckpointCommitment) = 8UL + override fun allocationSize(value: FaucetClient) = 8UL - override fun write(value: CheckpointCommitment, buf: ByteBuffer) { + override fun write(value: FaucetClient, 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))) @@ -4799,12 +11689,12 @@ public object FfiConverterTypeCheckpointCommitment: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointcontentsdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_faucetreceipt(ptr, status) } } } @@ -4882,7 +11772,7 @@ open class CheckpointContentsDigest: Disposable, AutoCloseable, CheckpointConten fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointcontentsdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_faucetreceipt(pointer!!, status) } } @@ -4897,25 +11787,25 @@ open class CheckpointContentsDigest: Disposable, AutoCloseable, CheckpointConten /** * @suppress */ -public object FfiConverterTypeCheckpointContentsDigest: FfiConverter { +public object FfiConverterTypeFaucetReceipt: FfiConverter { - override fun lower(value: CheckpointContentsDigest): Pointer { + override fun lower(value: FaucetReceipt): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): CheckpointContentsDigest { - return CheckpointContentsDigest(value) + override fun lift(value: Pointer): FaucetReceipt { + return FaucetReceipt(value) } - override fun read(buf: ByteBuffer): CheckpointContentsDigest { + override fun read(buf: ByteBuffer): FaucetReceipt { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: CheckpointContentsDigest) = 8UL + override fun allocationSize(value: FaucetReceipt) = 8UL - override fun write(value: CheckpointContentsDigest, buf: ByteBuffer) { + override fun write(value: FaucetReceipt, 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))) @@ -5021,12 +11911,12 @@ public object FfiConverterTypeCheckpointContentsDigest: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_checkpointdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_genesistransaction(ptr, status) } } } @@ -5104,7 +11994,7 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_checkpointdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_genesistransaction(pointer!!, status) } } @@ -5119,25 +12009,25 @@ open class CheckpointDigest: Disposable, AutoCloseable, CheckpointDigestInterfac /** * @suppress */ -public object FfiConverterTypeCheckpointDigest: FfiConverter { +public object FfiConverterTypeGenesisTransaction: FfiConverter { - override fun lower(value: CheckpointDigest): Pointer { + override fun lower(value: GenesisTransaction): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): CheckpointDigest { - return CheckpointDigest(value) + override fun lift(value: Pointer): GenesisTransaction { + return GenesisTransaction(value) } - override fun read(buf: ByteBuffer): CheckpointDigest { + override fun read(buf: ByteBuffer): GenesisTransaction { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: CheckpointDigest) = 8UL + override fun allocationSize(value: GenesisTransaction) = 8UL - override fun write(value: CheckpointDigest, buf: ByteBuffer) { + override fun write(value: GenesisTransaction, 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))) @@ -5243,18 +12133,351 @@ public object FfiConverterTypeCheckpointDigest: FfiConverter` + * if not provided. + */ + suspend fun `balance`(`address`: Address, `coinType`: kotlin.String? = null): kotlin.ULong? + + /** + * Get the chain identifier. + */ + suspend fun `chainId`(): kotlin.String + + /** + * Get the [`CheckpointSummary`] for a given checkpoint digest or + * checkpoint id. If none is provided, it will use the last known + * checkpoint id. + */ + suspend fun `checkpoint`(`digest`: CheckpointContentsDigest? = null, `seqNum`: kotlin.ULong? = null): CheckpointSummary? + + /** + * Get a page of [`CheckpointSummary`] for the provided parameters. + */ + suspend fun `checkpoints`(`paginationFilter`: PaginationFilter): CheckpointSummaryPage + + /** + * Get the coin metadata for the coin type. + */ + suspend fun `coinMetadata`(`coinType`: kotlin.String): CoinMetadata? + + /** + * Get the list of coins for the specified address. + * + * If `coin_type` is not provided, it will default to `0x2::coin::Coin`, + * which will return all coins. For IOTA coin, pass in the coin type: + * `0x2::coin::Coin<0x2::iota::IOTA>`. + */ + suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter, `coinType`: kotlin.String? = null): CoinPage + + /** + * Dry run a [`Transaction`] and return the transaction effects and dry run + * error (if any). + * + * `skipChecks` optional flag disables the usual verification checks that + * prevent access to objects that are owned by addresses other than the + * sender, and calling non-public, non-entry functions, and some other + * checks. Defaults to false. + */ + suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean? = null): DryRunResult + + /** + * Dry run a [`TransactionKind`] and return the transaction effects and dry + * run error (if any). + * + * `skipChecks` optional flag disables the usual verification checks that + * prevent access to objects that are owned by addresses other than the + * sender, and calling non-public, non-entry functions, and some other + * checks. Defaults to false. + * + * `tx_meta` is the transaction metadata. + */ + suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean? = null): DryRunResult + + /** + * Access a dynamic field on an object using its name. Names are arbitrary + * Move values whose type have copy, drop, and store, and are specified + * using their type, and their BCS contents, Base64 encoded. + * + * The `name` argument is a json serialized type. + * + * This returns [`DynamicFieldOutput`] which contains the name, the value + * as json, and object. + * + * # Example + * ```rust,ignore + * + * let client = iota_graphql_client::Client::new_devnet(); + * let address = Address::from_str("0x5").unwrap(); + * let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); + * + * # alternatively, pass in the bcs bytes + * let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); + * let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); + * ``` + */ + suspend fun `dynamicField`(`address`: Address, `typeTag`: TypeTag, `name`: Value): DynamicFieldOutput? + + /** + * Get a page of dynamic fields for the provided address. Note that this + * will also fetch dynamic fields on wrapped objects. + * + * This returns [`Page`] of [`DynamicFieldOutput`]s. + */ + suspend fun `dynamicFields`(`address`: Address, `paginationFilter`: PaginationFilter): DynamicFieldOutputPage + + /** + * Access a dynamic object field on an object using its name. Names are + * arbitrary Move values whose type have copy, drop, and store, and are + * specified using their type, and their BCS contents, Base64 encoded. + * + * The `name` argument is a json serialized type. + * + * This returns [`DynamicFieldOutput`] which contains the name, the value + * as json, and object. + */ + suspend fun `dynamicObjectField`(`address`: Address, `typeTag`: TypeTag, `name`: Value): DynamicFieldOutput? + + /** + * Return the epoch information for the provided epoch. If no epoch is + * provided, it will return the last known epoch. + */ + suspend fun `epoch`(`epoch`: kotlin.ULong? = null): Epoch? + + /** + * Return the number of checkpoints in this epoch. This will return + * `Ok(None)` if the epoch requested is not available in the GraphQL + * service (e.g., due to pruning). + */ + suspend fun `epochTotalCheckpoints`(`epoch`: kotlin.ULong? = null): kotlin.ULong? + + /** + * Return the number of transaction blocks in this epoch. This will return + * `Ok(None)` if the epoch requested is not available in the GraphQL + * service (e.g., due to pruning). + */ + suspend fun `epochTotalTransactionBlocks`(`epoch`: kotlin.ULong? = null): kotlin.ULong? + + /** + * Return a page of tuple (event, transaction digest) based on the + * (optional) event filter. + */ + suspend fun `events`(`paginationFilter`: PaginationFilter, `filter`: EventFilter? = null): EventPage + + /** + * Execute a transaction. + */ + suspend fun `executeTx`(`signatures`: List, `tx`: Transaction): TransactionEffects? + + /** + * Return the sequence number of the latest checkpoint that has been + * executed. + */ + suspend fun `latestCheckpointSequenceNumber`(): kotlin.ULong? + + /** + * Lazily fetch the max page size + */ + suspend fun `maxPageSize`(): kotlin.Int + + /** + * Return the contents' JSON of an object that is a Move object. + * + * If the object does not exist (e.g., due to pruning), this will return + * `Ok(None)`. Similarly, if this is not an object but an address, it + * will return `Ok(None)`. + */ + suspend fun `moveObjectContents`(`objectId`: ObjectId, `version`: kotlin.ULong? = null): Value? + + /** + * Return the BCS of an object that is a Move object. + * + * If the object does not exist (e.g., due to pruning), this will return + * `Ok(None)`. Similarly, if this is not an object but an address, it + * will return `Ok(None)`. + */ + suspend fun `moveObjectContentsBcs`(`objectId`: ObjectId, `version`: kotlin.ULong? = null): kotlin.ByteArray? + + /** + * Return the normalized Move function data for the provided package, + * module, and function. + */ + suspend fun `normalizedMoveFunction`(`package`: kotlin.String, `module`: kotlin.String, `function`: kotlin.String, `version`: kotlin.ULong? = null): MoveFunction? + + /** + * Return the normalized Move module data for the provided module. + */ + suspend fun `normalizedMoveModule`(`package`: kotlin.String, `module`: kotlin.String, `paginationFilterEnums`: PaginationFilter, `paginationFilterFriends`: PaginationFilter, `paginationFilterFunctions`: PaginationFilter, `paginationFilterStructs`: PaginationFilter, `version`: kotlin.ULong? = null): MoveModule? + + /** + * Return an object based on the provided [`Address`]. + * + * If the object does not exist (e.g., due to pruning), this will return + * `Ok(None)`. Similarly, if this is not an object but an address, it + * will return `Ok(None)`. + */ + suspend fun `object`(`objectId`: ObjectId, `version`: kotlin.ULong? = null): Object? + + /** + * Return the object's bcs content [`Vec`] based on the provided + * [`Address`]. + */ + suspend fun `objectBcs`(`objectId`: ObjectId): kotlin.ByteArray? + + /** + * Return a page of objects based on the provided parameters. + * + * Use this function together with the [`ObjectFilter::owner`] to get the + * objects owned by an address. + * + * # Example + * + * ```rust,ignore + * let filter = ObjectFilter { + * type_tag: None, + * owner: Some(Address::from_str("test").unwrap().into()), + * object_ids: None, + * }; + * + * let owned_objects = client.objects(None, None, Some(filter), None, None).await; + * ``` + */ + suspend fun `objects`(`paginationFilter`: PaginationFilter, `filter`: ObjectFilter? = null): ObjectPage + + /** + * The package corresponding to the given address (at the optionally given + * version). When no version is given, the package is loaded directly + * from the address given. Otherwise, the address is translated before + * loading to point to the package whose original ID matches + * the package at address, but whose version is version. For non-system + * packages, this might result in a different address than address + * because different versions of a package, introduced by upgrades, + * exist at distinct addresses. + * + * Note that this interpretation of version is different from a historical + * object read (the interpretation of version for the object query). + */ + suspend fun `package`(`address`: Address, `version`: kotlin.ULong? = null): MovePackage? + + /** + * Fetch the latest version of the package at address. + * This corresponds to the package with the highest version that shares its + * original ID with the package at address. + */ + suspend fun `packageLatest`(`address`: Address): MovePackage? + + /** + * Fetch all versions of package at address (packages that share this + * package's original ID), optionally bounding the versions exclusively + * from below with afterVersion, or from above with beforeVersion. + */ + suspend fun `packageVersions`(`address`: Address, `paginationFilter`: PaginationFilter, `afterVersion`: kotlin.ULong? = null, `beforeVersion`: kotlin.ULong? = null): MovePackagePage - fun `balance`(): kotlin.ULong + /** + * The Move packages that exist in the network, optionally filtered to be + * strictly before beforeCheckpoint and/or strictly after + * afterCheckpoint. + * + * This query returns all versions of a given user package that appear + * between the specified checkpoints, but only records the latest + * versions of system packages. + */ + suspend fun `packages`(`paginationFilter`: PaginationFilter, `afterCheckpoint`: kotlin.ULong? = null, `beforeCheckpoint`: kotlin.ULong? = null): MovePackagePage - fun `coinType`(): TypeTag + /** + * Get the protocol configuration. + */ + suspend fun `protocolConfig`(`version`: kotlin.ULong? = null): ProtocolConfigs? - fun `id`(): ObjectId + /** + * Get the reference gas price for the provided epoch or the last known one + * if no epoch is provided. + * + * This will return `Ok(None)` if the epoch requested is not available in + * the GraphQL service (e.g., due to pruning). + */ + suspend fun `referenceGasPrice`(`epoch`: kotlin.ULong? = null): kotlin.ULong? + + /** + * Get the GraphQL service configuration, including complexity limits, read + * and mutation limits, supported versions, and others. + */ + suspend fun `serviceConfig`(): ServiceConfig + + /** + * Set the server address for the GraphQL GraphQL client. It should be a + * valid URL with a host and optionally a port number. + */ + suspend fun `setRpcServer`(`server`: kotlin.String) + + /** + * Get total supply for the coin type. + */ + suspend fun `totalSupply`(`coinType`: kotlin.String): kotlin.ULong? + + /** + * The total number of transaction blocks in the network by the end of the + * last known checkpoint. + */ + suspend fun `totalTransactionBlocks`(): kotlin.ULong? + + /** + * The total number of transaction blocks in the network by the end of the + * provided checkpoint digest. + */ + suspend fun `totalTransactionBlocksByDigest`(`digest`: CheckpointContentsDigest): kotlin.ULong? + + /** + * The total number of transaction blocks in the network by the end of the + * provided checkpoint sequence number. + */ + suspend fun `totalTransactionBlocksBySeqNum`(`seqNum`: kotlin.ULong): kotlin.ULong? + + /** + * Get a transaction by its digest. + */ + suspend fun `transaction`(`digest`: TransactionDigest): SignedTransaction? + + /** + * Get a transaction's data and effects by its digest. + */ + suspend fun `transactionDataEffects`(`digest`: TransactionDigest): TransactionDataEffects? + + /** + * Get a transaction's effects by its digest. + */ + suspend fun `transactionEffects`(`digest`: TransactionDigest): TransactionEffects? + + /** + * Get a page of transactions based on the provided filters. + */ + suspend fun `transactions`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter? = null): SignedTransactionPage + + /** + * Get a page of transactions' data and effects based on the provided + * filters. + */ + suspend fun `transactionsDataEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter? = null): TransactionDataEffectsPage + + /** + * Get a page of transactions' effects based on the provided filters. + */ + suspend fun `transactionsEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter? = null): TransactionEffectsPage companion object } -open class Coin: Disposable, AutoCloseable, CoinInterface +open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface { constructor(pointer: Pointer) { @@ -5272,6 +12495,16 @@ open class Coin: Disposable, AutoCloseable, CoinInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + /** + * Create a new GraphQL client with the provided server address. + */ + constructor(`server`: kotlin.String) : + this( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new( + FfiConverterString.lower(`server`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -5324,7 +12557,7 @@ open class Coin: Disposable, AutoCloseable, CoinInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_coin(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_graphqlclient(ptr, status) } } } @@ -5332,754 +12565,1273 @@ open class Coin: Disposable, AutoCloseable, CoinInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_coin(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_graphqlclient(pointer!!, status) } } - override fun `balance`(): kotlin.ULong { - return FfiConverterULong.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_coin_balance( - it, _status) -} + + /** + * Get the list of active validators for the provided epoch, including + * related metadata. If no epoch is provided, it will return the active + * validators for the current epoch. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `activeValidators`(`paginationFilter`: PaginationFilter, `epoch`: kotlin.ULong?) : ValidatorPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_active_validators( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalULong.lower(`epoch`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeValidatorPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } + + + /** + * Get the balance of all the coins owned by address for the provided coin + * type. Coin type will default to `0x2::coin::Coin<0x2::iota::IOTA>` + * if not provided. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `balance`(`address`: Address, `coinType`: kotlin.String?) : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_balance( + thisPtr, + FfiConverterTypeAddress.lower(`address`),FfiConverterOptionalString.lower(`coinType`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, ) } + + /** + * Get the chain identifier. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `chainId`() : kotlin.String { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_chain_id( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterString.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } - override fun `coinType`(): TypeTag { - return FfiConverterTypeTypeTag.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_coin_coin_type( - it, _status) -} + + /** + * Get the [`CheckpointSummary`] for a given checkpoint digest or + * checkpoint id. If none is provided, it will use the last known + * checkpoint id. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `checkpoint`(`digest`: CheckpointContentsDigest?, `seqNum`: kotlin.ULong?) : CheckpointSummary? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoint( + thisPtr, + FfiConverterOptionalTypeCheckpointContentsDigest.lower(`digest`),FfiConverterOptionalULong.lower(`seqNum`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeCheckpointSummary.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } + + + /** + * Get a page of [`CheckpointSummary`] for the provided parameters. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `checkpoints`(`paginationFilter`: PaginationFilter) : CheckpointSummaryPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoints( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeCheckpointSummaryPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } + + + /** + * Get the coin metadata for the coin type. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `coinMetadata`(`coinType`: kotlin.String) : CoinMetadata? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata( + thisPtr, + FfiConverterString.lower(`coinType`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeCoinMetadata.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, ) } - - override fun `id`(): ObjectId { - return FfiConverterTypeObjectId.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_coin_id( - it, _status) -} - } + + /** + * Get the list of coins for the specified address. + * + * If `coin_type` is not provided, it will default to `0x2::coin::Coin`, + * which will return all coins. For IOTA coin, pass in the coin type: + * `0x2::coin::Coin<0x2::iota::IOTA>`. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter, `coinType`: kotlin.String?) : CoinPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins( + thisPtr, + FfiConverterTypeAddress.lower(`owner`),FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalString.lower(`coinType`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeCoinPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, ) } - - - - companion object { - - @Throws(SdkFfiException::class) fun `tryFromObject`(`object`: Object): Coin { - return FfiConverterTypeCoin.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_coin_try_from_object( - FfiConverterTypeObject.lower(`object`),_status) -} + /** + * Dry run a [`Transaction`] and return the transaction effects and dry run + * error (if any). + * + * `skipChecks` optional flag disables the usual verification checks that + * prevent access to objects that are owned by addresses other than the + * sender, and calling non-public, non-entry functions, and some other + * checks. Defaults to false. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean?) : DryRunResult { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx( + thisPtr, + FfiConverterTypeTransaction.lower(`tx`),FfiConverterOptionalBoolean.lower(`skipChecks`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeDryRunResult.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, ) } - - - } -} - -/** - * @suppress - */ -public object FfiConverterTypeCoin: FfiConverter { - - override fun lower(value: Coin): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Coin { - return Coin(value) - } - - override fun read(buf: ByteBuffer): Coin { - // 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: Coin) = 8UL - - override fun write(value: Coin, 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))) + /** + * Dry run a [`TransactionKind`] and return the transaction effects and dry + * run error (if any). + * + * `skipChecks` optional flag disables the usual verification checks that + * prevent access to objects that are owned by addresses other than the + * sender, and calling non-public, non-entry functions, and some other + * checks. Defaults to false. + * + * `tx_meta` is the transaction metadata. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean?) : DryRunResult { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind( + thisPtr, + FfiConverterTypeTransactionKind.lower(`txKind`),FfiConverterTypeTransactionMetadata.lower(`txMeta`),FfiConverterOptionalBoolean.lower(`skipChecks`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeDryRunResult.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } -} - - -// 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 -// + + /** + * Access a dynamic field on an object using its name. Names are arbitrary + * Move values whose type have copy, drop, and store, and are specified + * using their type, and their BCS contents, Base64 encoded. + * + * The `name` argument is a json serialized type. + * + * This returns [`DynamicFieldOutput`] which contains the name, the value + * as json, and object. + * + * # Example + * ```rust,ignore + * + * let client = iota_graphql_client::Client::new_devnet(); + * let address = Address::from_str("0x5").unwrap(); + * let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); + * + * # alternatively, pass in the bcs bytes + * let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); + * let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); + * ``` + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `dynamicField`(`address`: Address, `typeTag`: TypeTag, `name`: Value) : DynamicFieldOutput? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field( + thisPtr, + FfiConverterTypeAddress.lower(`address`),FfiConverterTypeTypeTag.lower(`typeTag`),FfiConverterTypeValue.lower(`name`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeDynamicFieldOutput.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } -public interface CoinMetadataInterface { - companion object -} - -open class CoinMetadata: Disposable, AutoCloseable, CoinMetadataInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + /** + * Get a page of dynamic fields for the provided address. Note that this + * will also fetch dynamic fields on wrapped objects. + * + * This returns [`Page`] of [`DynamicFieldOutput`]s. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `dynamicFields`(`address`: Address, `paginationFilter`: PaginationFilter) : DynamicFieldOutputPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_fields( + thisPtr, + FfiConverterTypeAddress.lower(`address`),FfiConverterTypePaginationFilter.lower(`paginationFilter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeDynamicFieldOutputPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } + /** - * 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. + * Access a dynamic object field on an object using its name. Names are + * arbitrary Move values whose type have copy, drop, and store, and are + * specified using their type, and their BCS contents, Base64 encoded. + * + * The `name` argument is a json serialized type. + * + * This returns [`DynamicFieldOutput`] which contains the name, the value + * as json, and object. */ - @Suppress("UNUSED_PARAMETER") - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `dynamicObjectField`(`address`: Address, `typeTag`: TypeTag, `name`: Value) : DynamicFieldOutput? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_object_field( + thisPtr, + FfiConverterTypeAddress.lower(`address`),FfiConverterTypeTypeTag.lower(`typeTag`),FfiConverterTypeValue.lower(`name`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeDynamicFieldOutput.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - 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() - } - } + + /** + * Return the epoch information for the provided epoch. If no epoch is + * provided, it will return the last known epoch. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `epoch`(`epoch`: kotlin.ULong?) : Epoch? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch( + thisPtr, + FfiConverterOptionalULong.lower(`epoch`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeEpoch.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - @Synchronized - override fun close() { - this.destroy() + + /** + * Return the number of checkpoints in this epoch. This will return + * `Ok(None)` if the epoch requested is not available in the GraphQL + * service (e.g., due to pruning). + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `epochTotalCheckpoints`(`epoch`: kotlin.ULong?) : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_checkpoints( + thisPtr, + FfiConverterOptionalULong.lower(`epoch`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - 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() - } - } + + /** + * Return the number of transaction blocks in this epoch. This will return + * `Ok(None)` if the epoch requested is not available in the GraphQL + * service (e.g., due to pruning). + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `epochTotalTransactionBlocks`(`epoch`: kotlin.ULong?) : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_transaction_blocks( + thisPtr, + FfiConverterOptionalULong.lower(`epoch`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - // 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_coinmetadata(ptr, status) - } - } - } + + /** + * Return a page of tuple (event, transaction digest) based on the + * (optional) event filter. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `events`(`paginationFilter`: PaginationFilter, `filter`: EventFilter?) : EventPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_events( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeEventFilter.lower(`filter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeEventPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_coinmetadata(pointer!!, status) - } + + /** + * Execute a transaction. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `executeTx`(`signatures`: List, `tx`: Transaction) : TransactionEffects? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx( + thisPtr, + FfiConverterSequenceTypeUserSignature.lower(`signatures`),FfiConverterTypeTransaction.lower(`tx`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeTransactionEffects.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - - - - companion object - -} - -/** - * @suppress - */ -public object FfiConverterTypeCoinMetadata: FfiConverter { - - override fun lower(value: CoinMetadata): Pointer { - return value.uniffiClonePointer() + /** + * Return the sequence number of the latest checkpoint that has been + * executed. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `latestCheckpointSequenceNumber`() : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_latest_checkpoint_sequence_number( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - override fun lift(value: Pointer): CoinMetadata { - return CoinMetadata(value) + + /** + * Lazily fetch the max page size + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `maxPageSize`() : kotlin.Int { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_max_page_size( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_i32(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_i32(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_i32(future) }, + // lift function + { FfiConverterInt.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - override fun read(buf: ByteBuffer): CoinMetadata { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) + + /** + * Return the contents' JSON of an object that is a Move object. + * + * If the object does not exist (e.g., due to pruning), this will return + * `Ok(None)`. Similarly, if this is not an object but an address, it + * will return `Ok(None)`. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `moveObjectContents`(`objectId`: ObjectId, `version`: kotlin.ULong?) : Value? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents( + thisPtr, + FfiConverterTypeObjectId.lower(`objectId`),FfiConverterOptionalULong.lower(`version`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeValue.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - override fun allocationSize(value: CoinMetadata) = 8UL - - override fun write(value: CoinMetadata, 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))) + + /** + * Return the BCS of an object that is a Move object. + * + * If the object does not exist (e.g., due to pruning), this will return + * `Ok(None)`. Similarly, if this is not an object but an address, it + * will return `Ok(None)`. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `moveObjectContentsBcs`(`objectId`: ObjectId, `version`: kotlin.ULong?) : kotlin.ByteArray? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents_bcs( + thisPtr, + FfiConverterTypeObjectId.lower(`objectId`),FfiConverterOptionalULong.lower(`version`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalByteArray.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } -} - - -// This template implements a class for working with a Rust struct via a Pointer/Arc -// to the live Rust struct on the other side of the FFI. -// -// Each instance implements core operations for working with the Rust `Arc` and the -// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. -// -// There's some subtlety here, because we have to be careful not to operate on a Rust -// struct after it has been dropped, and because we must expose a public API for freeing -// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: -// -// * Each instance holds an opaque pointer to the underlying Rust struct. -// Method calls need to read this pointer from the object's state and pass it in to -// the Rust FFI. -// -// * When an instance is no longer needed, its pointer should be passed to a -// special destructor function provided by the Rust FFI, which will drop the -// underlying Rust struct. -// -// * Given an instance, calling code is expected to call the special -// `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so risks -// leaking the underlying Rust struct. -// -// * We can't assume that calling code will do the right thing, and must be prepared -// to handle Kotlin method calls executing concurrently with or even after a call to -// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. -// -// * We must never allow Rust code to operate on the underlying Rust struct after -// the destructor has been called, and must never call the destructor more than once. -// Doing so may trigger memory unsafety. -// -// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` -// is implemented to call the destructor when the Kotlin object becomes unreachable. -// This is done in a background thread. This is not a panacea, and client code should be aware that -// 1. the thread may starve if some there are objects that have poorly performing -// `drop` methods or do significant work in their `drop` methods. -// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, -// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). -// -// If we try to implement this with mutual exclusion on access to the pointer, there is the -// possibility of a race between a method call and a concurrent call to `destroy`: -// -// * Thread A starts a method call, reads the value of the pointer, but is interrupted -// before it can pass the pointer over the FFI to Rust. -// * Thread B calls `destroy` and frees the underlying Rust struct. -// * Thread A resumes, passing the already-read pointer value to Rust and triggering -// a use-after-free. -// -// One possible solution would be to use a `ReadWriteLock`, with each method call taking -// a read lock (and thus allowed to run concurrently) and the special `destroy` method -// taking a write lock (and thus blocking on live method calls). However, we aim not to -// generate methods with any hidden blocking semantics, and a `destroy` method that might -// block if called incorrectly seems to meet that bar. -// -// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track -// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` -// has been called. These are updated according to the following rules: -// -// * The initial value of the counter is 1, indicating a live object with no in-flight calls. -// The initial value for the flag is false. -// -// * At the start of each method call, we atomically check the counter. -// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. -// If it is nonzero them we atomically increment it by 1 and proceed with the method call. -// -// * At the end of each method call, we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// * When `destroy` is called, we atomically flip the flag from false to true. -// If the flag was already true we silently fail. -// Otherwise we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, -// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. -// -// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been -// called *and* all in-flight method calls have completed, avoiding violating any of the expectations -// of the underlying Rust code. -// -// This makes a cleaner a better alternative to _not_ calling `destroy()` as -// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` -// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner -// thread may be starved, and the app will leak memory. -// -// In this case, `destroy`ing manually may be a better solution. -// -// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects -// with Rust peers are reclaimed: -// -// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: -// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: -// 3. The memory is reclaimed when the process terminates. -// -// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 -// - -public interface ConsensusCommitDigestInterface { - companion object -} - -open class ConsensusCommitDigest: Disposable, AutoCloseable, ConsensusCommitDigestInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + /** + * Return the normalized Move function data for the provided package, + * module, and function. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `normalizedMoveFunction`(`package`: kotlin.String, `module`: kotlin.String, `function`: kotlin.String, `version`: kotlin.ULong?) : MoveFunction? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_function( + thisPtr, + FfiConverterString.lower(`package`),FfiConverterString.lower(`module`),FfiConverterString.lower(`function`),FfiConverterOptionalULong.lower(`version`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeMoveFunction.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } + /** - * 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. + * Return the normalized Move module data for the provided module. */ - @Suppress("UNUSED_PARAMETER") - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `normalizedMoveModule`(`package`: kotlin.String, `module`: kotlin.String, `paginationFilterEnums`: PaginationFilter, `paginationFilterFriends`: PaginationFilter, `paginationFilterFunctions`: PaginationFilter, `paginationFilterStructs`: PaginationFilter, `version`: kotlin.ULong?) : MoveModule? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_module( + thisPtr, + FfiConverterString.lower(`package`),FfiConverterString.lower(`module`),FfiConverterTypePaginationFilter.lower(`paginationFilterEnums`),FfiConverterTypePaginationFilter.lower(`paginationFilterFriends`),FfiConverterTypePaginationFilter.lower(`paginationFilterFunctions`),FfiConverterTypePaginationFilter.lower(`paginationFilterStructs`),FfiConverterOptionalULong.lower(`version`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeMoveModule.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable + + /** + * Return an object based on the provided [`Address`]. + * + * If the object does not exist (e.g., due to pruning), this will return + * `Ok(None)`. Similarly, if this is not an object but an address, it + * will return `Ok(None)`. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `object`(`objectId`: ObjectId, `version`: kotlin.ULong?) : Object? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object( + thisPtr, + FfiConverterTypeObjectId.lower(`objectId`),FfiConverterOptionalULong.lower(`version`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeObject.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) + + /** + * Return the object's bcs content [`Vec`] based on the provided + * [`Address`]. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `objectBcs`(`objectId`: ObjectId) : kotlin.ByteArray? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object_bcs( + thisPtr, + FfiConverterTypeObjectId.lower(`objectId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalByteArray.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } - 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() - } - } + + /** + * Return a page of objects based on the provided parameters. + * + * Use this function together with the [`ObjectFilter::owner`] to get the + * objects owned by an address. + * + * # Example + * + * ```rust,ignore + * let filter = ObjectFilter { + * type_tag: None, + * owner: Some(Address::from_str("test").unwrap().into()), + * object_ids: None, + * }; + * + * let owned_objects = client.objects(None, None, Some(filter), None, None).await; + * ``` + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `objects`(`paginationFilter`: PaginationFilter, `filter`: ObjectFilter?) : ObjectPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeObjectFilter.lower(`filter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeObjectPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - @Synchronized - override fun close() { - this.destroy() + + /** + * The package corresponding to the given address (at the optionally given + * version). When no version is given, the package is loaded directly + * from the address given. Otherwise, the address is translated before + * loading to point to the package whose original ID matches + * the package at address, but whose version is version. For non-system + * packages, this might result in a different address than address + * because different versions of a package, introduced by upgrades, + * exist at distinct addresses. + * + * Note that this interpretation of version is different from a historical + * object read (the interpretation of version for the object query). + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `package`(`address`: Address, `version`: kotlin.ULong?) : MovePackage? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package( + thisPtr, + FfiConverterTypeAddress.lower(`address`),FfiConverterOptionalULong.lower(`version`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeMovePackage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - 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() - } - } + + /** + * Fetch the latest version of the package at address. + * This corresponds to the package with the highest version that shares its + * original ID with the package at address. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `packageLatest`(`address`: Address) : MovePackage? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_latest( + thisPtr, + FfiConverterTypeAddress.lower(`address`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeMovePackage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - // 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_consensuscommitdigest(ptr, status) - } - } - } + + /** + * Fetch all versions of package at address (packages that share this + * package's original ID), optionally bounding the versions exclusively + * from below with afterVersion, or from above with beforeVersion. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `packageVersions`(`address`: Address, `paginationFilter`: PaginationFilter, `afterVersion`: kotlin.ULong?, `beforeVersion`: kotlin.ULong?) : MovePackagePage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_versions( + thisPtr, + FfiConverterTypeAddress.lower(`address`),FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalULong.lower(`afterVersion`),FfiConverterOptionalULong.lower(`beforeVersion`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeMovePackagePage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_consensuscommitdigest(pointer!!, status) - } + + /** + * The Move packages that exist in the network, optionally filtered to be + * strictly before beforeCheckpoint and/or strictly after + * afterCheckpoint. + * + * This query returns all versions of a given user package that appear + * between the specified checkpoints, but only records the latest + * versions of system packages. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `packages`(`paginationFilter`: PaginationFilter, `afterCheckpoint`: kotlin.ULong?, `beforeCheckpoint`: kotlin.ULong?) : MovePackagePage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_packages( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalULong.lower(`afterCheckpoint`),FfiConverterOptionalULong.lower(`beforeCheckpoint`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeMovePackagePage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - - - - companion object - -} - -/** - * @suppress - */ -public object FfiConverterTypeConsensusCommitDigest: FfiConverter { - - override fun lower(value: ConsensusCommitDigest): Pointer { - return value.uniffiClonePointer() + /** + * Get the protocol configuration. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `protocolConfig`(`version`: kotlin.ULong?) : ProtocolConfigs? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_protocol_config( + thisPtr, + FfiConverterOptionalULong.lower(`version`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeProtocolConfigs.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - override fun lift(value: Pointer): ConsensusCommitDigest { - return ConsensusCommitDigest(value) + + /** + * Get the reference gas price for the provided epoch or the last known one + * if no epoch is provided. + * + * This will return `Ok(None)` if the epoch requested is not available in + * the GraphQL service (e.g., due to pruning). + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `referenceGasPrice`(`epoch`: kotlin.ULong?) : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_reference_gas_price( + thisPtr, + FfiConverterOptionalULong.lower(`epoch`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - override fun read(buf: ByteBuffer): ConsensusCommitDigest { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) + + /** + * Get the GraphQL service configuration, including complexity limits, read + * and mutation limits, supported versions, and others. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `serviceConfig`() : ServiceConfig { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_service_config( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeServiceConfig.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - override fun allocationSize(value: ConsensusCommitDigest) = 8UL - - override fun write(value: ConsensusCommitDigest, 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))) + + /** + * Set the server address for the GraphQL GraphQL client. It should be a + * valid URL with a host and optionally a port number. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `setRpcServer`(`server`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_set_rpc_server( + thisPtr, + FfiConverterString.lower(`server`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } -} - - -// 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 -// + + /** + * Get total supply for the coin type. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `totalSupply`(`coinType`: kotlin.String) : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_supply( + thisPtr, + FfiConverterString.lower(`coinType`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } -public interface ConsensusCommitPrologueV1Interface { - companion object -} + /** + * The total number of transaction blocks in the network by the end of the + * last known checkpoint. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `totalTransactionBlocks`() : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } -open class ConsensusCommitPrologueV1: Disposable, AutoCloseable, ConsensusCommitPrologueV1Interface -{ + + /** + * The total number of transaction blocks in the network by the end of the + * provided checkpoint digest. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `totalTransactionBlocksByDigest`(`digest`: CheckpointContentsDigest) : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_digest( + thisPtr, + FfiConverterTypeCheckpointContentsDigest.lower(`digest`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + /** + * The total number of transaction blocks in the network by the end of the + * provided checkpoint sequence number. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `totalTransactionBlocksBySeqNum`(`seqNum`: kotlin.ULong) : kotlin.ULong? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_seq_num( + thisPtr, + FfiConverterULong.lower(`seqNum`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalULong.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } + /** - * 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. + * Get a transaction by its digest. */ - @Suppress("UNUSED_PARAMETER") - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `transaction`(`digest`: TransactionDigest) : SignedTransaction? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction( + thisPtr, + FfiConverterTypeTransactionDigest.lower(`digest`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeSignedTransaction.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable + + /** + * Get a transaction's data and effects by its digest. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `transactionDataEffects`(`digest`: TransactionDigest) : TransactionDataEffects? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_data_effects( + thisPtr, + FfiConverterTypeTransactionDigest.lower(`digest`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeTransactionDataEffects.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) + + /** + * Get a transaction's effects by its digest. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `transactionEffects`(`digest`: TransactionDigest) : TransactionEffects? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_effects( + thisPtr, + FfiConverterTypeTransactionDigest.lower(`digest`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalTypeTransactionEffects.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) + } - 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() - } - } + + /** + * Get a page of transactions based on the provided filters. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `transactions`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter?) : SignedTransactionPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeTransactionsFilter.lower(`filter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeSignedTransactionPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - @Synchronized - override fun close() { - this.destroy() + + /** + * Get a page of transactions' data and effects based on the provided + * filters. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `transactionsDataEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter?) : TransactionDataEffectsPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_data_effects( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeTransactionsFilter.lower(`filter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeTransactionDataEffectsPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - 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() - } - } + + /** + * Get a page of transactions' effects based on the provided filters. + */ + @Throws(SdkFfiException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `transactionsEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter?) : TransactionEffectsPage { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects( + thisPtr, + FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeTransactionsFilter.lower(`filter`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeTransactionEffectsPage.lift(it) }, + // Error FFI converter + SdkFfiException.ErrorHandler, + ) } - // 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_consensuscommitprologuev1(ptr, status) - } - } - } - } + - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_consensuscommitprologuev1(pointer!!, status) - } + + companion object { + + /** + * Create a new GraphQL client connected to the `devnet` GraphQL server: + * {DEVNET_HOST}. + */ fun `newDevnet`(): GraphQlClient { + return FfiConverterTypeGraphQLClient.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_devnet( + _status) +} + ) } + + + /** + * Create a new GraphQL client connected to the `localhost` GraphQL server: + * {DEFAULT_LOCAL_HOST}. + */ fun `newLocalhost`(): GraphQlClient { + return FfiConverterTypeGraphQLClient.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_localhost( + _status) +} + ) + } + + /** + * Create a new GraphQL client connected to the `mainnet` GraphQL server: + * {MAINNET_HOST}. + */ fun `newMainnet`(): GraphQlClient { + return FfiConverterTypeGraphQLClient.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_mainnet( + _status) +} + ) + } + + + /** + * Create a new GraphQL client connected to the `testnet` GraphQL server: + * {TESTNET_HOST}. + */ fun `newTestnet`(): GraphQlClient { + return FfiConverterTypeGraphQLClient.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_testnet( + _status) +} + ) + } - companion object + + + } } /** * @suppress */ -public object FfiConverterTypeConsensusCommitPrologueV1: FfiConverter { +public object FfiConverterTypeGraphQLClient: FfiConverter { - override fun lower(value: ConsensusCommitPrologueV1): Pointer { + override fun lower(value: GraphQlClient): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ConsensusCommitPrologueV1 { - return ConsensusCommitPrologueV1(value) + override fun lift(value: Pointer): GraphQlClient { + return GraphQlClient(value) } - override fun read(buf: ByteBuffer): ConsensusCommitPrologueV1 { + override fun read(buf: ByteBuffer): GraphQlClient { // 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: ConsensusCommitPrologueV1) = 8UL + override fun allocationSize(value: GraphQlClient) = 8UL - override fun write(value: ConsensusCommitPrologueV1, buf: ByteBuffer) { + override fun write(value: GraphQlClient, 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))) @@ -6186,43 +13938,43 @@ public object FfiConverterTypeConsensusCommitPrologueV1: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_identifier_new( + FfiConverterString.lower(`identifier`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -6292,7 +14051,7 @@ open class Digest: Disposable, AutoCloseable, DigestInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_digest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_identifier(ptr, status) } } } @@ -6300,10 +14059,22 @@ open class Digest: Disposable, AutoCloseable, DigestInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_digest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_identifier(pointer!!, status) } } + override fun `asStr`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_identifier_as_str( + it, _status) +} + } + ) + } + + @@ -6315,25 +14086,25 @@ open class Digest: Disposable, AutoCloseable, DigestInterface /** * @suppress */ -public object FfiConverterTypeDigest: FfiConverter { +public object FfiConverterTypeIdentifier: FfiConverter { - override fun lower(value: Digest): Pointer { + override fun lower(value: Identifier): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Digest { - return Digest(value) + override fun lift(value: Pointer): Identifier { + return Identifier(value) } - override fun read(buf: ByteBuffer): Digest { + override fun read(buf: ByteBuffer): Identifier { // 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: Digest) = 8UL + override fun allocationSize(value: Identifier) = 8UL - override fun write(value: Digest, buf: ByteBuffer) { + override fun write(value: Identifier, 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))) @@ -6439,12 +14210,12 @@ public object FfiConverterTypeDigest: FfiConverter { // -public interface DryRunResultInterface { +public interface MoveFunctionInterface { companion object } -open class DryRunResult: Disposable, AutoCloseable, DryRunResultInterface +open class MoveFunction: Disposable, AutoCloseable, MoveFunctionInterface { constructor(pointer: Pointer) { @@ -6514,7 +14285,7 @@ open class DryRunResult: Disposable, AutoCloseable, DryRunResultInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_dryrunresult(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movefunction(ptr, status) } } } @@ -6522,7 +14293,7 @@ open class DryRunResult: Disposable, AutoCloseable, DryRunResultInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_dryrunresult(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movefunction(pointer!!, status) } } @@ -6537,25 +14308,25 @@ open class DryRunResult: Disposable, AutoCloseable, DryRunResultInterface /** * @suppress */ -public object FfiConverterTypeDryRunResult: FfiConverter { +public object FfiConverterTypeMoveFunction: FfiConverter { - override fun lower(value: DryRunResult): Pointer { + override fun lower(value: MoveFunction): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): DryRunResult { - return DryRunResult(value) + override fun lift(value: Pointer): MoveFunction { + return MoveFunction(value) } - override fun read(buf: ByteBuffer): DryRunResult { + override fun read(buf: ByteBuffer): MoveFunction { // 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: DryRunResult) = 8UL + override fun allocationSize(value: MoveFunction) = 8UL - override fun write(value: DryRunResult, buf: ByteBuffer) { + override fun write(value: MoveFunction, 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))) @@ -6661,36 +14432,12 @@ public object FfiConverterTypeDryRunResult: FfiConverter // -/** - * An ed25519 public key. - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * ed25519-public-key = 32OCTECT - * ``` - */ -public interface Ed25519PublicKeyInterface { - - fun `toBytes`(): kotlin.ByteArray +public interface MoveModuleInterface { companion object } -/** - * An ed25519 public key. - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * ed25519-public-key = 32OCTECT - * ``` - */ -open class Ed25519PublicKey: Disposable, AutoCloseable, Ed25519PublicKeyInterface +open class MoveModule: Disposable, AutoCloseable, MoveModuleInterface { constructor(pointer: Pointer) { @@ -6760,7 +14507,7 @@ open class Ed25519PublicKey: Disposable, AutoCloseable, Ed25519PublicKeyInterfac override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_ed25519publickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movemodule(ptr, status) } } } @@ -6768,85 +14515,40 @@ open class Ed25519PublicKey: Disposable, AutoCloseable, Ed25519PublicKeyInterfac fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_ed25519publickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movemodule(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_ed25519publickey_to_bytes( - it, _status) -} - } - ) - } - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Ed25519PublicKey { - return FfiConverterTypeEd25519PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) -} - ) - } - - - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Ed25519PublicKey { - return FfiConverterTypeEd25519PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_from_str( - FfiConverterString.lower(`s`),_status) -} - ) - } - - - fun `generate`(): Ed25519PublicKey { - return FfiConverterTypeEd25519PublicKey.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_ed25519publickey_generate( - _status) -} - ) - } - - - } + companion object } /** * @suppress */ -public object FfiConverterTypeEd25519PublicKey: FfiConverter { +public object FfiConverterTypeMoveModule: FfiConverter { - override fun lower(value: Ed25519PublicKey): Pointer { + override fun lower(value: MoveModule): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Ed25519PublicKey { - return Ed25519PublicKey(value) + override fun lift(value: Pointer): MoveModule { + return MoveModule(value) } - override fun read(buf: ByteBuffer): Ed25519PublicKey { + override fun read(buf: ByteBuffer): MoveModule { // 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: Ed25519PublicKey) = 8UL + override fun allocationSize(value: MoveModule) = 8UL - override fun write(value: Ed25519PublicKey, buf: ByteBuffer) { + override fun write(value: MoveModule, 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))) @@ -6952,12 +14654,42 @@ public object FfiConverterTypeEd25519PublicKey: FfiConverter, `typeOriginTable`: List, `linkageTable`: Map) : + this( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_movepackage_new( + FfiConverterTypeObjectId.lower(`id`),FfiConverterULong.lower(`version`),FfiConverterMapTypeIdentifierByteArray.lower(`modules`),FfiConverterSequenceTypeTypeOrigin.lower(`typeOriginTable`),FfiConverterMapTypeObjectIdTypeUpgradeInfo.lower(`linkageTable`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -7027,7 +14766,7 @@ open class EffectsAuxiliaryDataDigest: Disposable, AutoCloseable, EffectsAuxilia override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_effectsauxiliarydatadigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movepackage(ptr, status) } } } @@ -7035,7 +14774,7 @@ open class EffectsAuxiliaryDataDigest: Disposable, AutoCloseable, EffectsAuxilia fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_effectsauxiliarydatadigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer!!, status) } } @@ -7050,25 +14789,25 @@ open class EffectsAuxiliaryDataDigest: Disposable, AutoCloseable, EffectsAuxilia /** * @suppress */ -public object FfiConverterTypeEffectsAuxiliaryDataDigest: FfiConverter { +public object FfiConverterTypeMovePackage: FfiConverter { - override fun lower(value: EffectsAuxiliaryDataDigest): Pointer { + override fun lower(value: MovePackage): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): EffectsAuxiliaryDataDigest { - return EffectsAuxiliaryDataDigest(value) + override fun lift(value: Pointer): MovePackage { + return MovePackage(value) } - override fun read(buf: ByteBuffer): EffectsAuxiliaryDataDigest { + override fun read(buf: ByteBuffer): MovePackage { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: EffectsAuxiliaryDataDigest) = 8UL + override fun allocationSize(value: MovePackage) = 8UL - override fun write(value: EffectsAuxiliaryDataDigest, buf: ByteBuffer) { + override fun write(value: MovePackage, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -7175,65 +14914,78 @@ public object FfiConverterTypeEffectsAuxiliaryDataDigest: FfiConverter companion object } /** - * Operation run at the end of an epoch + * Aggregated signature from members of a multisig committee. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * end-of-epoch-transaction-kind = eoe-change-epoch - * =/ eoe-authenticator-state-create - * =/ eoe-authenticator-state-expire - * =/ eoe-randomness-state-create - * =/ eoe-deny-list-state-create - * =/ eoe-bridge-state-create - * =/ eoe-bridge-committee-init - * =/ eoe-store-execution-time-observations + * multisig-aggregated-signature = (vector multisig-member-signature) + * u16 ; bitmap + * multisig-committee + * ``` * - * eoe-change-epoch = %x00 change-epoch - * eoe-authenticator-state-create = %x01 - * eoe-authenticator-state-expire = %x02 authenticator-state-expire - * eoe-randomness-state-create = %x03 - * eoe-deny-list-state-create = %x04 - * eoe-bridge-state-create = %x05 digest - * eoe-bridge-committee-init = %x06 u64 - * eoe-store-execution-time-observations = %x07 stored-execution-time-observations + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-aggregated-signature = (vector multisig-member-signature) + * roaring-bitmap ; bitmap + * legacy-multisig-committee + * roaring-bitmap = bytes ; where the contents of the bytes are valid + * ; according to the serialized spec for + * ; roaring bitmaps * ``` + * + * See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + * serialized format of RoaringBitmaps. */ -open class EndOfEpochTransactionKind: Disposable, AutoCloseable, EndOfEpochTransactionKindInterface +open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggregatedSignatureInterface { constructor(pointer: Pointer) { @@ -7251,6 +15003,22 @@ open class EndOfEpochTransactionKind: Disposable, AutoCloseable, EndOfEpochTrans this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + /** + * Construct a new aggregated multisig signature. + * + * Since the list of signatures doesn't contain sufficient information to + * identify which committee member provided the signature, it is up to + * the caller to ensure that the provided signature list is in the same + * order as it's corresponding member in the provided committee + * and that it's position in the provided bitmap is set. + */ + constructor(`committee`: MultisigCommittee, `signatures`: List, `bitmap`: kotlin.UShort) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigaggregatedsignature_new( + FfiConverterTypeMultisigCommittee.lower(`committee`),FfiConverterSequenceTypeMultisigMemberSignature.lower(`signatures`),FfiConverterUShort.lower(`bitmap`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -7303,7 +15071,7 @@ open class EndOfEpochTransactionKind: Disposable, AutoCloseable, EndOfEpochTrans override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_endofepochtransactionkind(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigaggregatedsignature(ptr, status) } } } @@ -7311,81 +15079,83 @@ open class EndOfEpochTransactionKind: Disposable, AutoCloseable, EndOfEpochTrans fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_endofepochtransactionkind(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigaggregatedsignature(pointer!!, status) } } - - - companion object { - fun `authenticatorStateCreate`(): EndOfEpochTransactionKind { - return FfiConverterTypeEndOfEpochTransactionKind.lift( + /** + * The bitmap that indicates which committee members provided their + * signature. + */override fun `bitmap`(): kotlin.UShort { + return FfiConverterUShort.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_create( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_bitmap( + it, _status) } + } ) } - fun `authenticatorStateExpire`(`tx`: AuthenticatorStateExpire): EndOfEpochTransactionKind { - return FfiConverterTypeEndOfEpochTransactionKind.lift( + override fun `committee`(): MultisigCommittee { + return FfiConverterTypeMultisigCommittee.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_authenticator_state_expire( - FfiConverterTypeAuthenticatorStateExpire.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_committee( + it, _status) } + } ) } - fun `changeEpoch`(`tx`: ChangeEpoch): EndOfEpochTransactionKind { - return FfiConverterTypeEndOfEpochTransactionKind.lift( + + /** + * The list of signatures from committee members + */override fun `signatures`(): List { + return FfiConverterSequenceTypeMultisigMemberSignature.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch( - FfiConverterTypeChangeEpoch.lower(`tx`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigaggregatedsignature_signatures( + it, _status) } + } ) } - fun `changeEpochV2`(`tx`: ChangeEpochV2): EndOfEpochTransactionKind { - return FfiConverterTypeEndOfEpochTransactionKind.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_endofepochtransactionkind_change_epoch_v2( - FfiConverterTypeChangeEpochV2.lower(`tx`),_status) -} - ) - } - - } + + + companion object } /** * @suppress */ -public object FfiConverterTypeEndOfEpochTransactionKind: FfiConverter { +public object FfiConverterTypeMultisigAggregatedSignature: FfiConverter { - override fun lower(value: EndOfEpochTransactionKind): Pointer { + override fun lower(value: MultisigAggregatedSignature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): EndOfEpochTransactionKind { - return EndOfEpochTransactionKind(value) + override fun lift(value: Pointer): MultisigAggregatedSignature { + return MultisigAggregatedSignature(value) } - override fun read(buf: ByteBuffer): EndOfEpochTransactionKind { + override fun read(buf: ByteBuffer): MultisigAggregatedSignature { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: EndOfEpochTransactionKind) = 8UL + override fun allocationSize(value: MultisigAggregatedSignature) = 8UL - override fun write(value: EndOfEpochTransactionKind, buf: ByteBuffer) { + override fun write(value: MultisigAggregatedSignature, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -7491,12 +15261,90 @@ public object FfiConverterTypeEndOfEpochTransactionKind: FfiConverter= threshold`. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * multisig-committee = (vector multisig-member) + * u16 ; threshold + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-committee = (vector legacy-multisig-member) + * u16 ; threshold + * ``` + */ +public interface MultisigCommitteeInterface { + + /** + * Checks if the Committee is valid. + * + * A valid committee is one that: + * - Has a nonzero threshold + * - Has at least one member + * - Has at most ten members + * - No member has weight 0 + * - the sum of the weights of all members must be larger than the + * threshold + * - contains no duplicate members + */ + fun `isValid`(): kotlin.Boolean + + /** + * The members of the committee + */ + fun `members`(): List + + /** + * Return the flag for this signature scheme + */ + fun `scheme`(): SignatureScheme + + /** + * The total signature weight required to authorize a transaction for the + * address corresponding to this `MultisigCommittee`. + */ + fun `threshold`(): kotlin.UShort companion object } -open class Epoch: Disposable, AutoCloseable, EpochInterface +/** + * A multisig committee + * + * A `MultisigCommittee` is a set of members who collectively control a single + * `Address` on the IOTA blockchain. The number of required signautres to + * authorize the execution of a transaction is determined by + * `(signature_0_weight + signature_1_weight ..) >= threshold`. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * multisig-committee = (vector multisig-member) + * u16 ; threshold + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-committee = (vector legacy-multisig-member) + * u16 ; threshold + * ``` + */ +open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterface { constructor(pointer: Pointer) { @@ -7514,6 +15362,20 @@ open class Epoch: Disposable, AutoCloseable, EpochInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + /** + * Construct a new committee from a list of `MultisigMember`s and a + * `threshold`. + * + * Note that the order of the members is significant towards deriving the + * `Address` governed by this committee. + */ + constructor(`members`: List, `threshold`: kotlin.UShort) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigcommittee_new( + FfiConverterSequenceTypeMultisigMember.lower(`members`),FfiConverterUShort.lower(`threshold`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -7566,7 +15428,7 @@ open class Epoch: Disposable, AutoCloseable, EpochInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_epoch(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigcommittee(ptr, status) } } } @@ -7574,11 +15436,81 @@ open class Epoch: Disposable, AutoCloseable, EpochInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_epoch(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigcommittee(pointer!!, status) } } + /** + * Checks if the Committee is valid. + * + * A valid committee is one that: + * - Has a nonzero threshold + * - Has at least one member + * - Has at most ten members + * - No member has weight 0 + * - the sum of the weights of all members must be larger than the + * threshold + * - contains no duplicate members + */override fun `isValid`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_is_valid( + it, _status) +} + } + ) + } + + + + /** + * The members of the committee + */override fun `members`(): List { + return FfiConverterSequenceTypeMultisigMember.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_members( + it, _status) +} + } + ) + } + + + + /** + * Return the flag for this signature scheme + */override fun `scheme`(): SignatureScheme { + return FfiConverterTypeSignatureScheme.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_scheme( + it, _status) +} + } + ) + } + + + + /** + * The total signature weight required to authorize a transaction for the + * address corresponding to this `MultisigCommittee`. + */override fun `threshold`(): kotlin.UShort { + return FfiConverterUShort.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigcommittee_threshold( + it, _status) +} + } + ) + } + + + @@ -7589,25 +15521,25 @@ open class Epoch: Disposable, AutoCloseable, EpochInterface /** * @suppress */ -public object FfiConverterTypeEpoch: FfiConverter { +public object FfiConverterTypeMultisigCommittee: FfiConverter { - override fun lower(value: Epoch): Pointer { + override fun lower(value: MultisigCommittee): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Epoch { - return Epoch(value) + override fun lift(value: Pointer): MultisigCommittee { + return MultisigCommittee(value) } - override fun read(buf: ByteBuffer): Epoch { + override fun read(buf: ByteBuffer): MultisigCommittee { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Epoch) = 8UL + override fun allocationSize(value: MultisigCommittee) = 8UL - override fun write(value: Epoch, buf: ByteBuffer) { + override fun write(value: MultisigCommittee, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -7713,12 +15645,60 @@ public object FfiConverterTypeEpoch: FfiConverter { // -public interface EventInterface { +/** + * A member in a multisig committee + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * multisig-member = multisig-member-public-key + * u8 ; weight + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-member = legacy-multisig-member-public-key + * u8 ; weight + * ``` + */ +public interface MultisigMemberInterface { + + /** + * This member's public key. + */ + fun `publicKey`(): MultisigMemberPublicKey + + /** + * Weight of this member's signature. + */ + fun `weight`(): kotlin.UByte companion object } -open class Event: Disposable, AutoCloseable, EventInterface +/** + * A member in a multisig committee + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * multisig-member = multisig-member-public-key + * u8 ; weight + * ``` + * + * There is also a legacy encoding for this type defined as: + * + * ```text + * legacy-multisig-member = legacy-multisig-member-public-key + * u8 ; weight + * ``` + */ +open class MultisigMember: Disposable, AutoCloseable, MultisigMemberInterface { constructor(pointer: Pointer) { @@ -7736,6 +15716,16 @@ open class Event: Disposable, AutoCloseable, EventInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + /** + * Construct a new member from a `MultisigMemberPublicKey` and a `weight`. + */ + constructor(`publicKey`: MultisigMemberPublicKey, `weight`: kotlin.UByte) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_multisigmember_new( + FfiConverterTypeMultisigMemberPublicKey.lower(`publicKey`),FfiConverterUByte.lower(`weight`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -7788,7 +15778,7 @@ open class Event: Disposable, AutoCloseable, EventInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_event(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmember(ptr, status) } } } @@ -7796,11 +15786,41 @@ open class Event: Disposable, AutoCloseable, EventInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_event(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmember(pointer!!, status) } } + /** + * This member's public key. + */override fun `publicKey`(): MultisigMemberPublicKey { + return FfiConverterTypeMultisigMemberPublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmember_public_key( + it, _status) +} + } + ) + } + + + + /** + * Weight of this member's signature. + */override fun `weight`(): kotlin.UByte { + return FfiConverterUByte.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmember_weight( + it, _status) +} + } + ) + } + + + @@ -7811,25 +15831,25 @@ open class Event: Disposable, AutoCloseable, EventInterface /** * @suppress */ -public object FfiConverterTypeEvent: FfiConverter { +public object FfiConverterTypeMultisigMember: FfiConverter { - override fun lower(value: Event): Pointer { + override fun lower(value: MultisigMember): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Event { - return Event(value) + override fun lift(value: Pointer): MultisigMember { + return MultisigMember(value) } - override fun read(buf: ByteBuffer): Event { + override fun read(buf: ByteBuffer): MultisigMember { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Event) = 8UL + override fun allocationSize(value: MultisigMember) = 8UL - override fun write(value: Event, buf: ByteBuffer) { + override fun write(value: MultisigMember, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -7935,12 +15955,36 @@ public object FfiConverterTypeEvent: FfiConverter { // -public interface ExecutionTimeObservationsInterface { +public interface MultisigMemberPublicKeyInterface { + + fun `asEd25519`(): Ed25519PublicKey + + fun `asEd25519Opt`(): Ed25519PublicKey? + + fun `asSecp256k1`(): Secp256k1PublicKey + + fun `asSecp256k1Opt`(): Secp256k1PublicKey? + + fun `asSecp256r1`(): Secp256r1PublicKey + + fun `asSecp256r1Opt`(): Secp256r1PublicKey? + + fun `asZklogin`(): ZkLoginPublicIdentifier + + fun `asZkloginOpt`(): ZkLoginPublicIdentifier? + + fun `isEd25519`(): kotlin.Boolean + + fun `isSecp256k1`(): kotlin.Boolean + + fun `isSecp256r1`(): kotlin.Boolean + + fun `isZklogin`(): kotlin.Boolean companion object } -open class ExecutionTimeObservations: Disposable, AutoCloseable, ExecutionTimeObservationsInterface +open class MultisigMemberPublicKey: Disposable, AutoCloseable, MultisigMemberPublicKeyInterface { constructor(pointer: Pointer) { @@ -8010,7 +16054,7 @@ open class ExecutionTimeObservations: Disposable, AutoCloseable, ExecutionTimeOb override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_executiontimeobservations(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmemberpublickey(ptr, status) } } } @@ -8018,10 +16062,154 @@ open class ExecutionTimeObservations: Disposable, AutoCloseable, ExecutionTimeOb fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_executiontimeobservations(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmemberpublickey(pointer!!, status) } } + override fun `asEd25519`(): Ed25519PublicKey { + return FfiConverterTypeEd25519PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519( + it, _status) +} + } + ) + } + + + override fun `asEd25519Opt`(): Ed25519PublicKey? { + return FfiConverterOptionalTypeEd25519PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_ed25519_opt( + it, _status) +} + } + ) + } + + + override fun `asSecp256k1`(): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1( + it, _status) +} + } + ) + } + + + override fun `asSecp256k1Opt`(): Secp256k1PublicKey? { + return FfiConverterOptionalTypeSecp256k1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256k1_opt( + it, _status) +} + } + ) + } + + + override fun `asSecp256r1`(): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1( + it, _status) +} + } + ) + } + + + override fun `asSecp256r1Opt`(): Secp256r1PublicKey? { + return FfiConverterOptionalTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_secp256r1_opt( + it, _status) +} + } + ) + } + + + override fun `asZklogin`(): ZkLoginPublicIdentifier { + return FfiConverterTypeZkLoginPublicIdentifier.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin( + it, _status) +} + } + ) + } + + + override fun `asZkloginOpt`(): ZkLoginPublicIdentifier? { + return FfiConverterOptionalTypeZkLoginPublicIdentifier.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_as_zklogin_opt( + it, _status) +} + } + ) + } + + + override fun `isEd25519`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_ed25519( + it, _status) +} + } + ) + } + + + override fun `isSecp256k1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256k1( + it, _status) +} + } + ) + } + + + override fun `isSecp256r1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_secp256r1( + it, _status) +} + } + ) + } + + + override fun `isZklogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmemberpublickey_is_zklogin( + it, _status) +} + } + ) + } + + @@ -8033,25 +16221,25 @@ open class ExecutionTimeObservations: Disposable, AutoCloseable, ExecutionTimeOb /** * @suppress */ -public object FfiConverterTypeExecutionTimeObservations: FfiConverter { +public object FfiConverterTypeMultisigMemberPublicKey: FfiConverter { - override fun lower(value: ExecutionTimeObservations): Pointer { + override fun lower(value: MultisigMemberPublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ExecutionTimeObservations { - return ExecutionTimeObservations(value) + override fun lift(value: Pointer): MultisigMemberPublicKey { + return MultisigMemberPublicKey(value) } - override fun read(buf: ByteBuffer): ExecutionTimeObservations { + override fun read(buf: ByteBuffer): MultisigMemberPublicKey { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ExecutionTimeObservations) = 8UL + override fun allocationSize(value: MultisigMemberPublicKey) = 8UL - override fun write(value: ExecutionTimeObservations, buf: ByteBuffer) { + override fun write(value: MultisigMemberPublicKey, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -8157,37 +16345,74 @@ public object FfiConverterTypeExecutionTimeObservations: FfiConverter - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_new( - FfiConverterString.lower(`faucetUrl`),_status) -} - ) + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -8273,7 +16482,7 @@ open class FaucetClient: Disposable, AutoCloseable, FaucetClientInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_faucetclient(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_multisigmembersignature(ptr, status) } } } @@ -8281,162 +16490,184 @@ open class FaucetClient: Disposable, AutoCloseable, FaucetClientInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_faucetclient(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_multisigmembersignature(pointer!!, status) } } + override fun `asEd25519`(): Ed25519Signature { + return FfiConverterTypeEd25519Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519( + it, _status) +} + } + ) + } - /** - * Request gas from the faucet. Note that this will return the UUID of the - * request and not wait until the token is received. Use - * `request_and_wait` to wait for the token. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `request`(`address`: Address) : kotlin.String? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_faucetclient_request( - thisPtr, - FfiConverterTypeAddress.lower(`address`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalString.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, + + override fun `asEd25519Opt`(): Ed25519Signature? { + return FfiConverterOptionalTypeEd25519Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_ed25519_opt( + it, _status) +} + } ) } + + override fun `asSecp256k1`(): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1( + it, _status) +} + } + ) + } - /** - * Request gas from the faucet and wait until the request is completed and - * token is transferred. Returns `FaucetReceipt` if the request is - * successful, which contains the list of tokens transferred, and the - * transaction digest. - * - * Note that the faucet is heavily rate-limited, so calling repeatedly the - * faucet would likely result in a 429 code or 502 code. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `requestAndWait`(`address`: Address) : FaucetReceipt? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_and_wait( - thisPtr, - FfiConverterTypeAddress.lower(`address`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeFaucetReceipt.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, + + override fun `asSecp256k1Opt`(): Secp256k1Signature? { + return FfiConverterOptionalTypeSecp256k1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256k1_opt( + it, _status) +} + } ) } + + override fun `asSecp256r1`(): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1( + it, _status) +} + } + ) + } - /** - * Check the faucet request status. - * - * Possible statuses are defined in: [`BatchSendStatusType`] - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `requestStatus`(`id`: kotlin.String) : BatchSendStatus? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_faucetclient_request_status( - thisPtr, - FfiConverterString.lower(`id`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeBatchSendStatus.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, + + override fun `asSecp256r1Opt`(): Secp256r1Signature? { + return FfiConverterOptionalTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_secp256r1_opt( + it, _status) +} + } ) } + + override fun `asZklogin`(): ZkLoginAuthenticator { + return FfiConverterTypeZkLoginAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin( + it, _status) +} + } + ) + } + override fun `asZkloginOpt`(): ZkLoginAuthenticator? { + return FfiConverterOptionalTypeZkLoginAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_as_zklogin_opt( + it, _status) +} + } + ) + } - companion object { - - /** - * Set to devnet faucet. - */ fun `devnet`(): FaucetClient { - return FfiConverterTypeFaucetClient.lift( + + override fun `isEd25519`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_devnet( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_ed25519( + it, _status) } + } ) } - - /** - * Set to local faucet. - */ fun `local`(): FaucetClient { - return FfiConverterTypeFaucetClient.lift( + override fun `isSecp256k1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_local( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256k1( + it, _status) } + } ) } - - /** - * Set to testnet faucet. - */ fun `testnet`(): FaucetClient { - return FfiConverterTypeFaucetClient.lift( + override fun `isSecp256r1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_faucetclient_testnet( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_secp256r1( + it, _status) } + } ) } - + override fun `isZklogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_multisigmembersignature_is_zklogin( + it, _status) +} + } + ) } + + + + + + companion object + } /** * @suppress */ -public object FfiConverterTypeFaucetClient: FfiConverter { +public object FfiConverterTypeMultisigMemberSignature: FfiConverter { - override fun lower(value: FaucetClient): Pointer { + override fun lower(value: MultisigMemberSignature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): FaucetClient { - return FaucetClient(value) + override fun lift(value: Pointer): MultisigMemberSignature { + return MultisigMemberSignature(value) } - override fun read(buf: ByteBuffer): FaucetClient { + override fun read(buf: ByteBuffer): MultisigMemberSignature { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: FaucetClient) = 8UL + override fun allocationSize(value: MultisigMemberSignature) = 8UL - override fun write(value: FaucetClient, buf: ByteBuffer) { + override fun write(value: MultisigMemberSignature, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -8542,12 +16773,77 @@ public object FfiConverterTypeFaucetClient: FfiConverter // -public interface FaucetReceiptInterface { +/** + * 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`(): TransactionDigest + + /** + * Return the storage rebate locked in this object + * + * Storage rebates are credited to the gas coin used in a transaction that + * deletes this object. + */ + fun `storageRebate`(): kotlin.ULong + + /** + * Return this object's version + */ + fun `version`(): kotlin.ULong companion object } -open class FaucetReceipt: Disposable, AutoCloseable, FaucetReceiptInterface +/** + * 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) { @@ -8565,6 +16861,13 @@ open class FaucetReceipt: Disposable, AutoCloseable, FaucetReceiptInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`data`: ObjectData, `owner`: Owner, `previousTransaction`: TransactionDigest, `storageRebate`: kotlin.ULong) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_object_new( + FfiConverterTypeObjectData.lower(`data`),FfiConverterTypeOwner.lower(`owner`),FfiConverterTypeTransactionDigest.lower(`previousTransaction`),FfiConverterULong.lower(`storageRebate`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -8617,7 +16920,7 @@ open class FaucetReceipt: Disposable, AutoCloseable, FaucetReceiptInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_faucetreceipt(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_object(ptr, status) } } } @@ -8625,11 +16928,134 @@ open class FaucetReceipt: Disposable, AutoCloseable, FaucetReceiptInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_faucetreceipt(pointer!!, 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( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_as_struct( + it, _status) +} + } + ) + } + + + + /** + * Return this object's data + */override fun `data`(): ObjectData { + return FfiConverterTypeObjectData.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_data( + it, _status) +} + } + ) + } + + + + /** + * Return this object's id + */override fun `objectId`(): ObjectId { + return FfiConverterTypeObjectId.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_id( + it, _status) +} + } + ) + } + + + + /** + * Return this object's type + */override fun `objectType`(): ObjectType { + return FfiConverterTypeObjectType.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_type( + it, _status) +} + } + ) + } + + + + /** + * Return this object's owner + */override fun `owner`(): Owner { + return FfiConverterTypeOwner.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_owner( + it, _status) +} + } + ) + } + + + + /** + * Return the digest of the transaction that last modified this object + */override fun `previousTransaction`(): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_previous_transaction( + it, _status) +} + } + ) + } + + + + /** + * Return the storage rebate locked in this object + * + * Storage rebates are credited to the gas coin used in a transaction that + * deletes this object. + */override fun `storageRebate`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_storage_rebate( + it, _status) +} + } + ) + } + + + + /** + * Return this object's version + */override fun `version`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_version( + it, _status) +} + } + ) + } + + + @@ -8640,25 +17066,25 @@ open class FaucetReceipt: Disposable, AutoCloseable, FaucetReceiptInterface /** * @suppress */ -public object FfiConverterTypeFaucetReceipt: FfiConverter { +public object FfiConverterTypeObject: FfiConverter { - override fun lower(value: FaucetReceipt): Pointer { + override fun lower(value: Object): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): FaucetReceipt { - return FaucetReceipt(value) + override fun lift(value: Pointer): Object { + return Object(value) } - override fun read(buf: ByteBuffer): FaucetReceipt { + override fun read(buf: ByteBuffer): Object { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: FaucetReceipt) = 8UL + override fun allocationSize(value: Object) = 8UL - override fun write(value: FaucetReceipt, buf: ByteBuffer) { + override fun write(value: Object, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -8764,12 +17190,12 @@ public object FfiConverterTypeFaucetReceipt: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_genesistransaction(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdata(ptr, status) } } } @@ -8847,7 +17273,7 @@ open class GenesisTransaction: Disposable, AutoCloseable, GenesisTransactionInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_genesistransaction(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdata(pointer!!, status) } } @@ -8862,25 +17288,25 @@ open class GenesisTransaction: Disposable, AutoCloseable, GenesisTransactionInte /** * @suppress */ -public object FfiConverterTypeGenesisTransaction: FfiConverter { +public object FfiConverterTypeObjectData: FfiConverter { - override fun lower(value: GenesisTransaction): Pointer { + override fun lower(value: ObjectData): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): GenesisTransaction { - return GenesisTransaction(value) + override fun lift(value: Pointer): ObjectData { + return ObjectData(value) } - override fun read(buf: ByteBuffer): GenesisTransaction { + override fun read(buf: ByteBuffer): ObjectData { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: GenesisTransaction) = 8UL + override fun allocationSize(value: ObjectData) = 8UL - override fun write(value: GenesisTransaction, buf: ByteBuffer) { + override fun write(value: ObjectData, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -8958,379 +17384,1181 @@ public object FfiConverterTypeGenesisTransaction: FfiConverter` 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 GraphQlClientInterface { - - /** - * Get the list of active validators for the provided epoch, including - * related metadata. If no epoch is provided, it will return the active - * validators for the current epoch. - */ - suspend fun `activeValidators`(`paginationFilter`: PaginationFilter, `epoch`: kotlin.ULong? = null): ValidatorPage - - /** - * Get the balance of all the coins owned by address for the provided coin - * type. Coin type will default to `0x2::coin::Coin<0x2::iota::IOTA>` - * if not provided. - */ - suspend fun `balance`(`address`: Address, `coinType`: kotlin.String? = null): kotlin.ULong? - - /** - * Get the chain identifier. - */ - suspend fun `chainId`(): kotlin.String - - /** - * Get the [`CheckpointSummary`] for a given checkpoint digest or - * checkpoint id. If none is provided, it will use the last known - * checkpoint id. - */ - suspend fun `checkpoint`(`digest`: CheckpointContentsDigest? = null, `seqNum`: kotlin.ULong? = null): CheckpointSummary? - - /** - * Get a page of [`CheckpointSummary`] for the provided parameters. - */ - suspend fun `checkpoints`(`paginationFilter`: PaginationFilter): CheckpointSummaryPage - - /** - * Get the coin metadata for the coin type. - */ - suspend fun `coinMetadata`(`coinType`: kotlin.String): CoinMetadata? - - /** - * Get the list of coins for the specified address. - * - * If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - * which will return all coins. For IOTA coin, pass in the coin type: - * `0x2::coin::Coin<0x2::iota::IOTA>`. - */ - suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter, `coinType`: kotlin.String? = null): CoinPage +// 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 ObjectDigestInterface { - /** - * Dry run a [`Transaction`] and return the transaction effects and dry run - * error (if any). - * - * `skipChecks` optional flag disables the usual verification checks that - * prevent access to objects that are owned by addresses other than the - * sender, and calling non-public, non-entry functions, and some other - * checks. Defaults to false. - */ - suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean? = null): DryRunResult + fun `toBase58`(): kotlin.String - /** - * Dry run a [`TransactionKind`] and return the transaction effects and dry - * run error (if any). - * - * `skipChecks` optional flag disables the usual verification checks that - * prevent access to objects that are owned by addresses other than the - * sender, and calling non-public, non-entry functions, and some other - * checks. Defaults to false. - * - * `tx_meta` is the transaction metadata. - */ - suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean? = null): DryRunResult + fun `toBytes`(): kotlin.ByteArray + companion object +} + +open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + /** - * Access a dynamic field on an object using its name. Names are arbitrary - * Move values whose type have copy, drop, and store, and are specified - * using their type, and their BCS contents, Base64 encoded. - * - * The `name` argument is a json serialized type. - * - * This returns [`DynamicFieldOutput`] which contains the name, the value - * as json, and object. - * - * # Example - * ```rust,ignore - * - * let client = iota_graphql_client::Client::new_devnet(); - * let address = Address::from_str("0x5").unwrap(); - * let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); - * - * # alternatively, pass in the bcs bytes - * let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); - * let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); - * ``` + * 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. */ - suspend fun `dynamicField`(`address`: Address, `typeTag`: TypeTag, `name`: Value): DynamicFieldOutput? + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdigest(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdigest(pointer!!, status) + } + } + + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_base58( + it, _status) +} + } + ) + } - /** - * Get a page of dynamic fields for the provided address. Note that this - * will also fetch dynamic fields on wrapped objects. - * - * This returns [`Page`] of [`DynamicFieldOutput`]s. - */ - suspend fun `dynamicFields`(`address`: Address, `paginationFilter`: PaginationFilter): DynamicFieldOutputPage + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectdigest_to_bytes( + it, _status) +} + } + ) + } - /** - * Access a dynamic object field on an object using its name. Names are - * arbitrary Move values whose type have copy, drop, and store, and are - * specified using their type, and their BCS contents, Base64 encoded. - * - * The `name` argument is a json serialized type. - * - * This returns [`DynamicFieldOutput`] which contains the name, the value - * as json, and object. - */ - suspend fun `dynamicObjectField`(`address`: Address, `typeTag`: TypeTag, `name`: Value): DynamicFieldOutput? + - /** - * Return the epoch information for the provided epoch. If no epoch is - * provided, it will return the last known epoch. - */ - suspend fun `epoch`(`epoch`: kotlin.ULong? = null): Epoch? + - /** - * Return the number of checkpoints in this epoch. This will return - * `Ok(None)` if the epoch requested is not available in the GraphQL - * service (e.g., due to pruning). - */ - suspend fun `epochTotalCheckpoints`(`epoch`: kotlin.ULong? = null): kotlin.ULong? + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): ObjectDigest { + return FfiConverterTypeObjectDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } - /** - * Return the number of transaction blocks in this epoch. This will return - * `Ok(None)` if the epoch requested is not available in the GraphQL - * service (e.g., due to pruning). - */ - suspend fun `epochTotalTransactionBlocks`(`epoch`: kotlin.ULong? = null): kotlin.ULong? + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectDigest { + return FfiConverterTypeObjectDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } - /** - * Return a page of tuple (event, transaction digest) based on the - * (optional) event filter. - */ - suspend fun `events`(`paginationFilter`: PaginationFilter, `filter`: EventFilter? = null): EventPage + + fun `generate`(): ObjectDigest { + return FfiConverterTypeObjectDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectdigest_generate( + _status) +} + ) + } - /** - * Execute a transaction. - */ - suspend fun `executeTx`(`signatures`: List, `tx`: Transaction): TransactionEffects? + + + } - /** - * Return the sequence number of the latest checkpoint that has been - * executed. - */ - suspend fun `latestCheckpointSequenceNumber`(): kotlin.ULong? +} + +/** + * @suppress + */ +public object FfiConverterTypeObjectDigest: FfiConverter { + + override fun lower(value: ObjectDigest): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): ObjectDigest { + return ObjectDigest(value) + } + + override fun read(buf: ByteBuffer): ObjectDigest { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: ObjectDigest) = 8UL + + override fun write(value: ObjectDigest, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 `ObjectId` is a 32-byte identifier used to uniquely identify an object on + * the IOTA blockchain. + * + * ## Relationship to Address + * + * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but + * are derived leveraging different domain-separator values to ensure, + * cryptographically, that there won't be any overlap, e.g. there can't be a + * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user + * account. + * + * # BCS + * + * An `ObjectId`'s BCS serialized form is defined by the following: + * + * ```text + * object-id = 32*OCTET + * ``` + */ +public interface ObjectIdInterface { - /** - * Lazily fetch the max page size - */ - suspend fun `maxPageSize`(): kotlin.Int + fun `toAddress`(): Address - /** - * Return the contents' JSON of an object that is a Move object. - * - * If the object does not exist (e.g., due to pruning), this will return - * `Ok(None)`. Similarly, if this is not an object but an address, it - * will return `Ok(None)`. - */ - suspend fun `moveObjectContents`(`objectId`: ObjectId, `version`: kotlin.ULong? = null): Value? + fun `toBytes`(): kotlin.ByteArray - /** - * Return the BCS of an object that is a Move object. - * - * If the object does not exist (e.g., due to pruning), this will return - * `Ok(None)`. Similarly, if this is not an object but an address, it - * will return `Ok(None)`. - */ - suspend fun `moveObjectContentsBcs`(`objectId`: ObjectId, `version`: kotlin.ULong? = null): kotlin.ByteArray? + fun `toHex`(): kotlin.String + companion object +} + +/** + * An `ObjectId` is a 32-byte identifier used to uniquely identify an object on + * the IOTA blockchain. + * + * ## Relationship to Address + * + * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but + * are derived leveraging different domain-separator values to ensure, + * cryptographically, that there won't be any overlap, e.g. there can't be a + * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user + * account. + * + * # BCS + * + * An `ObjectId`'s BCS serialized form is defined by the following: + * + * ```text + * object-id = 32*OCTET + * ``` + */ +open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + /** - * Return the normalized Move function data for the provided package, - * module, and function. + * 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. */ - suspend fun `normalizedMoveFunction`(`package`: kotlin.String, `module`: kotlin.String, `function`: kotlin.String, `version`: kotlin.ULong? = null): MoveFunction? + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectid(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectid(pointer!!, status) + } + } + + override fun `toAddress`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_address( + it, _status) +} + } + ) + } - /** - * Return the normalized Move module data for the provided module. - */ - suspend fun `normalizedMoveModule`(`package`: kotlin.String, `module`: kotlin.String, `paginationFilterEnums`: PaginationFilter, `paginationFilterFriends`: PaginationFilter, `paginationFilterFunctions`: PaginationFilter, `paginationFilterStructs`: PaginationFilter, `version`: kotlin.ULong? = null): MoveModule? + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes( + it, _status) +} + } + ) + } - /** - * Return an object based on the provided [`Address`]. - * - * If the object does not exist (e.g., due to pruning), this will return - * `Ok(None)`. Similarly, if this is not an object but an address, it - * will return `Ok(None)`. - */ - suspend fun `object`(`objectId`: ObjectId, `version`: kotlin.ULong? = null): Object? + + override fun `toHex`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_hex( + it, _status) +} + } + ) + } - /** - * Return the object's bcs content [`Vec`] based on the provided - * [`Address`]. - */ - suspend fun `objectBcs`(`objectId`: ObjectId): kotlin.ByteArray? + - /** - * Return a page of objects based on the provided parameters. - * - * Use this function together with the [`ObjectFilter::owner`] to get the - * objects owned by an address. - * - * # Example - * - * ```rust,ignore - * let filter = ObjectFilter { - * type_tag: None, - * owner: Some(Address::from_str("test").unwrap().into()), - * object_ids: None, - * }; - * - * let owned_objects = client.objects(None, None, Some(filter), None, None).await; - * ``` - */ - suspend fun `objects`(`paginationFilter`: PaginationFilter, `filter`: ObjectFilter? = null): ObjectPage + - /** - * The package corresponding to the given address (at the optionally given - * version). When no version is given, the package is loaded directly - * from the address given. Otherwise, the address is translated before - * loading to point to the package whose original ID matches - * the package at address, but whose version is version. For non-system - * packages, this might result in a different address than address - * because different versions of a package, introduced by upgrades, - * exist at distinct addresses. - * - * Note that this interpretation of version is different from a historical - * object read (the interpretation of version for the object query). - */ - suspend fun `package`(`address`: Address, `version`: kotlin.ULong? = null): MovePackage? + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectId { + return FfiConverterTypeObjectId.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } - /** - * Fetch the latest version of the package at address. - * This corresponds to the package with the highest version that shares its - * original ID with the package at address. - */ - suspend fun `packageLatest`(`address`: Address): MovePackage? + + + @Throws(SdkFfiException::class) fun `fromHex`(`hex`: kotlin.String): ObjectId { + return FfiConverterTypeObjectId.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex( + FfiConverterString.lower(`hex`),_status) +} + ) + } - /** - * Fetch all versions of package at address (packages that share this - * package's original ID), optionally bounding the versions exclusively - * from below with afterVersion, or from above with beforeVersion. - */ - suspend fun `packageVersions`(`address`: Address, `paginationFilter`: PaginationFilter, `afterVersion`: kotlin.ULong? = null, `beforeVersion`: kotlin.ULong? = null): MovePackagePage + + + } - /** - * The Move packages that exist in the network, optionally filtered to be - * strictly before beforeCheckpoint and/or strictly after - * afterCheckpoint. - * - * This query returns all versions of a given user package that appear - * between the specified checkpoints, but only records the latest - * versions of system packages. - */ - suspend fun `packages`(`paginationFilter`: PaginationFilter, `afterCheckpoint`: kotlin.ULong? = null, `beforeCheckpoint`: kotlin.ULong? = null): MovePackagePage +} + +/** + * @suppress + */ +public object FfiConverterTypeObjectId: FfiConverter { + + override fun lower(value: ObjectId): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): ObjectId { + return ObjectId(value) + } + + override fun read(buf: ByteBuffer): ObjectId { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: ObjectId) = 8UL + + override fun write(value: ObjectId, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 ObjectTypeInterface { + companion object +} + +open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + /** - * Get the protocol configuration. + * 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. */ - suspend fun `protocolConfig`(`version`: kotlin.ULong? = null): ProtocolConfigs? + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objecttype(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objecttype(pointer!!, status) + } + } + - /** - * Get the reference gas price for the provided epoch or the last known one - * if no epoch is provided. - * - * This will return `Ok(None)` if the epoch requested is not available in - * the GraphQL service (e.g., due to pruning). - */ - suspend fun `referenceGasPrice`(`epoch`: kotlin.ULong? = null): kotlin.ULong? + - /** - * Get the GraphQL service configuration, including complexity limits, read - * and mutation limits, supported versions, and others. - */ - suspend fun `serviceConfig`(): ServiceConfig - /** - * Set the server address for the GraphQL GraphQL client. It should be a - * valid URL with a host and optionally a port number. - */ - suspend fun `setRpcServer`(`server`: kotlin.String) + companion object - /** - * Get total supply for the coin type. - */ - suspend fun `totalSupply`(`coinType`: kotlin.String): kotlin.ULong? +} + +/** + * @suppress + */ +public object FfiConverterTypeObjectType: FfiConverter { + + override fun lower(value: ObjectType): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): ObjectType { + return ObjectType(value) + } + + override fun read(buf: ByteBuffer): ObjectType { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: ObjectType) = 8UL + + override fun write(value: ObjectType, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 OwnerInterface { + companion object +} + +open class Owner: Disposable, AutoCloseable, OwnerInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + /** - * The total number of transaction blocks in the network by the end of the - * last known checkpoint. + * 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. */ - suspend fun `totalTransactionBlocks`(): kotlin.ULong? + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_owner(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_owner(pointer!!, status) + } + } + - /** - * The total number of transaction blocks in the network by the end of the - * provided checkpoint digest. - */ - suspend fun `totalTransactionBlocksByDigest`(`digest`: CheckpointContentsDigest): kotlin.ULong? + - /** - * The total number of transaction blocks in the network by the end of the - * provided checkpoint sequence number. - */ - suspend fun `totalTransactionBlocksBySeqNum`(`seqNum`: kotlin.ULong): kotlin.ULong? - /** - * Get a transaction by its digest. - */ - suspend fun `transaction`(`digest`: TransactionDigest): SignedTransaction? + companion object - /** - * Get a transaction's data and effects by its digest. - */ - suspend fun `transactionDataEffects`(`digest`: TransactionDigest): TransactionDataEffects? +} + +/** + * @suppress + */ +public object FfiConverterTypeOwner: FfiConverter { + + override fun lower(value: Owner): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): Owner { + return Owner(value) + } + + override fun read(buf: ByteBuffer): Owner { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: Owner) = 8UL + + override fun write(value: Owner, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 passkey authenticator. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * passkey-bcs = bytes ; where the contents of the bytes are + * ; defined by + * passkey = passkey-flag + * bytes ; passkey authenticator data + * client-data-json ; valid json + * simple-signature ; required to be a secp256r1 signature + * + * client-data-json = string ; valid json + * ``` + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + * the required json-schema for the `client-data-json` rule. In addition, IOTA + * currently requires that the `CollectedClientData.type` field is required to + * be `webauthn.get`. + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. + */ +public interface PasskeyAuthenticatorInterface { /** - * Get a transaction's effects by its digest. + * Opaque authenticator data for this passkey signature. + * + * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for + * more information on this field. */ - suspend fun `transactionEffects`(`digest`: TransactionDigest): TransactionEffects? + fun `authenticatorData`(): kotlin.ByteArray /** - * Get a page of transactions based on the provided filters. + * The parsed challenge message for this passkey signature. + * + * This is parsed by decoding the base64url data from the + * `client_data_json.challenge` field. */ - suspend fun `transactions`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter? = null): SignedTransactionPage + fun `challenge`(): kotlin.ByteArray - /** - * Get a page of transactions' data and effects based on the provided - * filters. + /** + * Structured, unparsed, JSON for this passkey signature. + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + * for more information on this field. */ - suspend fun `transactionsDataEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter? = null): TransactionDataEffectsPage + fun `clientDataJson`(): kotlin.String /** - * Get a page of transactions' effects based on the provided filters. + * The passkey signature. */ - suspend fun `transactionsEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter? = null): TransactionEffectsPage + fun `signature`(): SimpleSignature companion object } -open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface +/** + * A passkey authenticator. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * passkey-bcs = bytes ; where the contents of the bytes are + * ; defined by + * passkey = passkey-flag + * bytes ; passkey authenticator data + * client-data-json ; valid json + * simple-signature ; required to be a secp256r1 signature + * + * client-data-json = string ; valid json + * ``` + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + * the required json-schema for the `client-data-json` rule. In addition, IOTA + * currently requires that the `CollectedClientData.type` field is required to + * be `webauthn.get`. + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. + */ +open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticatorInterface { constructor(pointer: Pointer) { @@ -9348,16 +18576,6 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Create a new GraphQL client with the provided server address. - */ - constructor(`server`: kotlin.String) : - this( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new( - FfiConverterString.lower(`server`),_status) -} - ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -9410,7 +18628,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_graphqlclient(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_passkeyauthenticator(ptr, status) } } } @@ -9418,1240 +18636,1033 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_graphqlclient(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_passkeyauthenticator(pointer!!, status) } } /** - * Get the list of active validators for the provided epoch, including - * related metadata. If no epoch is provided, it will return the active - * validators for the current epoch. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `activeValidators`(`paginationFilter`: PaginationFilter, `epoch`: kotlin.ULong?) : ValidatorPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_active_validators( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalULong.lower(`epoch`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeValidatorPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, + * Opaque authenticator data for this passkey signature. + * + * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for + * more information on this field. + */override fun `authenticatorData`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_authenticator_data( + it, _status) +} + } ) } + /** - * Get the balance of all the coins owned by address for the provided coin - * type. Coin type will default to `0x2::coin::Coin<0x2::iota::IOTA>` - * if not provided. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `balance`(`address`: Address, `coinType`: kotlin.String?) : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_balance( - thisPtr, - FfiConverterTypeAddress.lower(`address`),FfiConverterOptionalString.lower(`coinType`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, + * The parsed challenge message for this passkey signature. + * + * This is parsed by decoding the base64url data from the + * `client_data_json.challenge` field. + */override fun `challenge`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_challenge( + it, _status) +} + } ) } + /** - * Get the chain identifier. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `chainId`() : kotlin.String { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_chain_id( - thisPtr, - - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterString.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, + * Structured, unparsed, JSON for this passkey signature. + * + * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + * for more information on this field. + */override fun `clientDataJson`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_client_data_json( + it, _status) +} + } ) } + /** - * Get the [`CheckpointSummary`] for a given checkpoint digest or - * checkpoint id. If none is provided, it will use the last known - * checkpoint id. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `checkpoint`(`digest`: CheckpointContentsDigest?, `seqNum`: kotlin.ULong?) : CheckpointSummary? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoint( - thisPtr, - FfiConverterOptionalTypeCheckpointContentsDigest.lower(`digest`),FfiConverterOptionalULong.lower(`seqNum`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeCheckpointSummary.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, + * The passkey signature. + */override fun `signature`(): SimpleSignature { + return FfiConverterTypeSimpleSignature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_passkeyauthenticator_signature( + it, _status) +} + } ) } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypePasskeyAuthenticator: FfiConverter { + + override fun lower(value: PasskeyAuthenticator): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): PasskeyAuthenticator { + return PasskeyAuthenticator(value) + } + + override fun read(buf: ByteBuffer): PasskeyAuthenticator { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: PasskeyAuthenticator) = 8UL + + override fun write(value: PasskeyAuthenticator, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// 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 +// - - /** - * Get a page of [`CheckpointSummary`] for the provided parameters. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `checkpoints`(`paginationFilter`: PaginationFilter) : CheckpointSummaryPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_checkpoints( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeCheckpointSummaryPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } +public interface ProgrammableTransactionInterface { - /** - * Get the coin metadata for the coin type. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `coinMetadata`(`coinType`: kotlin.String) : CoinMetadata? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coin_metadata( - thisPtr, - FfiConverterString.lower(`coinType`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeCoinMetadata.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } + companion object +} - - /** - * Get the list of coins for the specified address. - * - * If `coin_type` is not provided, it will default to `0x2::coin::Coin`, - * which will return all coins. For IOTA coin, pass in the coin type: - * `0x2::coin::Coin<0x2::iota::IOTA>`. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter, `coinType`: kotlin.String?) : CoinPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_coins( - thisPtr, - FfiConverterTypeAddress.lower(`owner`),FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalString.lower(`coinType`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeCoinPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) +open class ProgrammableTransaction: Disposable, AutoCloseable, ProgrammableTransactionInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Dry run a [`Transaction`] and return the transaction effects and dry run - * error (if any). - * - * `skipChecks` optional flag disables the usual verification checks that - * prevent access to objects that are owned by addresses other than the - * sender, and calling non-public, non-entry functions, and some other - * checks. Defaults to false. + * 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. */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean?) : DryRunResult { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx( - thisPtr, - FfiConverterTypeTransaction.lower(`tx`),FfiConverterOptionalBoolean.lower(`skipChecks`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_pointer(future) }, - // lift function - { FfiConverterTypeDryRunResult.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - - /** - * Dry run a [`TransactionKind`] and return the transaction effects and dry - * run error (if any). - * - * `skipChecks` optional flag disables the usual verification checks that - * prevent access to objects that are owned by addresses other than the - * sender, and calling non-public, non-entry functions, and some other - * checks. Defaults to false. - * - * `tx_meta` is the transaction metadata. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `dryRunTxKind`(`txKind`: TransactionKind, `txMeta`: TransactionMetadata, `skipChecks`: kotlin.Boolean?) : DryRunResult { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dry_run_tx_kind( - thisPtr, - FfiConverterTypeTransactionKind.lower(`txKind`),FfiConverterTypeTransactionMetadata.lower(`txMeta`),FfiConverterOptionalBoolean.lower(`skipChecks`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_pointer(future) }, - // lift function - { FfiConverterTypeDryRunResult.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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() + } + } } - - /** - * Access a dynamic field on an object using its name. Names are arbitrary - * Move values whose type have copy, drop, and store, and are specified - * using their type, and their BCS contents, Base64 encoded. - * - * The `name` argument is a json serialized type. - * - * This returns [`DynamicFieldOutput`] which contains the name, the value - * as json, and object. - * - * # Example - * ```rust,ignore - * - * let client = iota_graphql_client::Client::new_devnet(); - * let address = Address::from_str("0x5").unwrap(); - * let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap(); - * - * # alternatively, pass in the bcs bytes - * let bcs = base64ct::Base64::decode_vec("AgAAAAAAAAA=").unwrap(); - * let df = client.dynamic_field(address, "u64", BcsName(bcs)).await.unwrap(); - * ``` - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `dynamicField`(`address`: Address, `typeTag`: TypeTag, `name`: Value) : DynamicFieldOutput? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_field( - thisPtr, - FfiConverterTypeAddress.lower(`address`),FfiConverterTypeTypeTag.lower(`typeTag`),FfiConverterTypeValue.lower(`name`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeDynamicFieldOutput.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Synchronized + override fun close() { + this.destroy() } - - /** - * Get a page of dynamic fields for the provided address. Note that this - * will also fetch dynamic fields on wrapped objects. - * - * This returns [`Page`] of [`DynamicFieldOutput`]s. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `dynamicFields`(`address`: Address, `paginationFilter`: PaginationFilter) : DynamicFieldOutputPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_fields( - thisPtr, - FfiConverterTypeAddress.lower(`address`),FfiConverterTypePaginationFilter.lower(`paginationFilter`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeDynamicFieldOutputPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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() + } + } } - - /** - * Access a dynamic object field on an object using its name. Names are - * arbitrary Move values whose type have copy, drop, and store, and are - * specified using their type, and their BCS contents, Base64 encoded. - * - * The `name` argument is a json serialized type. - * - * This returns [`DynamicFieldOutput`] which contains the name, the value - * as json, and object. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `dynamicObjectField`(`address`: Address, `typeTag`: TypeTag, `name`: Value) : DynamicFieldOutput? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_dynamic_object_field( - thisPtr, - FfiConverterTypeAddress.lower(`address`),FfiConverterTypeTypeTag.lower(`typeTag`),FfiConverterTypeValue.lower(`name`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeDynamicFieldOutput.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + // 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_programmabletransaction(ptr, status) + } + } + } } - - /** - * Return the epoch information for the provided epoch. If no epoch is - * provided, it will return the last known epoch. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `epoch`(`epoch`: kotlin.ULong?) : Epoch? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch( - thisPtr, - FfiConverterOptionalULong.lower(`epoch`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeEpoch.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer!!, status) + } } - /** - * Return the number of checkpoints in this epoch. This will return - * `Ok(None)` if the epoch requested is not available in the GraphQL - * service (e.g., due to pruning). - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `epochTotalCheckpoints`(`epoch`: kotlin.ULong?) : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_checkpoints( - thisPtr, - FfiConverterOptionalULong.lower(`epoch`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } - /** - * Return the number of transaction blocks in this epoch. This will return - * `Ok(None)` if the epoch requested is not available in the GraphQL - * service (e.g., due to pruning). - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `epochTotalTransactionBlocks`(`epoch`: kotlin.ULong?) : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_epoch_total_transaction_blocks( - thisPtr, - FfiConverterOptionalULong.lower(`epoch`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeProgrammableTransaction: FfiConverter { + + override fun lower(value: ProgrammableTransaction): Pointer { + return value.uniffiClonePointer() } - - /** - * Return a page of tuple (event, transaction digest) based on the - * (optional) event filter. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `events`(`paginationFilter`: PaginationFilter, `filter`: EventFilter?) : EventPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_events( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeEventFilter.lower(`filter`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeEventPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + override fun lift(value: Pointer): ProgrammableTransaction { + return ProgrammableTransaction(value) + } + + override fun read(buf: ByteBuffer): ProgrammableTransaction { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: ProgrammableTransaction) = 8UL + + override fun write(value: ProgrammableTransaction, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) } +} + + +// 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 +// - - /** - * Execute a transaction. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `executeTx`(`signatures`: List, `tx`: Transaction) : TransactionEffects? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_execute_tx( - thisPtr, - FfiConverterSequenceTypeUserSignature.lower(`signatures`),FfiConverterTypeTransaction.lower(`tx`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeTransactionEffects.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } +public interface ProtocolConfigsInterface { - /** - * Return the sequence number of the latest checkpoint that has been - * executed. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `latestCheckpointSequenceNumber`() : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_latest_checkpoint_sequence_number( - thisPtr, - - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } + companion object +} - - /** - * Lazily fetch the max page size - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `maxPageSize`() : kotlin.Int { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_max_page_size( - thisPtr, - - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_i32(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_i32(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_i32(future) }, - // lift function - { FfiConverterInt.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } +open class ProtocolConfigs: Disposable, AutoCloseable, ProtocolConfigsInterface +{ - - /** - * Return the contents' JSON of an object that is a Move object. - * - * If the object does not exist (e.g., due to pruning), this will return - * `Ok(None)`. Similarly, if this is not an object but an address, it - * will return `Ok(None)`. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `moveObjectContents`(`objectId`: ObjectId, `version`: kotlin.ULong?) : Value? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents( - thisPtr, - FfiConverterTypeObjectId.lower(`objectId`),FfiConverterOptionalULong.lower(`version`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeValue.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Return the BCS of an object that is a Move object. - * - * If the object does not exist (e.g., due to pruning), this will return - * `Ok(None)`. Similarly, if this is not an object but an address, it - * will return `Ok(None)`. + * 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. */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `moveObjectContentsBcs`(`objectId`: ObjectId, `version`: kotlin.ULong?) : kotlin.ByteArray? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_move_object_contents_bcs( - thisPtr, - FfiConverterTypeObjectId.lower(`objectId`),FfiConverterOptionalULong.lower(`version`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalByteArray.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - - /** - * Return the normalized Move function data for the provided package, - * module, and function. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `normalizedMoveFunction`(`package`: kotlin.String, `module`: kotlin.String, `function`: kotlin.String, `version`: kotlin.ULong?) : MoveFunction? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_function( - thisPtr, - FfiConverterString.lower(`package`),FfiConverterString.lower(`module`),FfiConverterString.lower(`function`),FfiConverterOptionalULong.lower(`version`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeMoveFunction.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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() + } + } } - - /** - * Return the normalized Move module data for the provided module. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `normalizedMoveModule`(`package`: kotlin.String, `module`: kotlin.String, `paginationFilterEnums`: PaginationFilter, `paginationFilterFriends`: PaginationFilter, `paginationFilterFunctions`: PaginationFilter, `paginationFilterStructs`: PaginationFilter, `version`: kotlin.ULong?) : MoveModule? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_normalized_move_module( - thisPtr, - FfiConverterString.lower(`package`),FfiConverterString.lower(`module`),FfiConverterTypePaginationFilter.lower(`paginationFilterEnums`),FfiConverterTypePaginationFilter.lower(`paginationFilterFriends`),FfiConverterTypePaginationFilter.lower(`paginationFilterFunctions`),FfiConverterTypePaginationFilter.lower(`paginationFilterStructs`),FfiConverterOptionalULong.lower(`version`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeMoveModule.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Synchronized + override fun close() { + this.destroy() } - - /** - * Return an object based on the provided [`Address`]. - * - * If the object does not exist (e.g., due to pruning), this will return - * `Ok(None)`. Similarly, if this is not an object but an address, it - * will return `Ok(None)`. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `object`(`objectId`: ObjectId, `version`: kotlin.ULong?) : Object? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object( - thisPtr, - FfiConverterTypeObjectId.lower(`objectId`),FfiConverterOptionalULong.lower(`version`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeObject.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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() + } + } } - - /** - * Return the object's bcs content [`Vec`] based on the provided - * [`Address`]. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `objectBcs`(`objectId`: ObjectId) : kotlin.ByteArray? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_object_bcs( - thisPtr, - FfiConverterTypeObjectId.lower(`objectId`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalByteArray.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + // 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_protocolconfigs(ptr, status) + } + } + } } - - /** - * Return a page of objects based on the provided parameters. - * - * Use this function together with the [`ObjectFilter::owner`] to get the - * objects owned by an address. - * - * # Example - * - * ```rust,ignore - * let filter = ObjectFilter { - * type_tag: None, - * owner: Some(Address::from_str("test").unwrap().into()), - * object_ids: None, - * }; - * - * let owned_objects = client.objects(None, None, Some(filter), None, None).await; - * ``` - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `objects`(`paginationFilter`: PaginationFilter, `filter`: ObjectFilter?) : ObjectPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_objects( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeObjectFilter.lower(`filter`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeObjectPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_protocolconfigs(pointer!!, status) + } } - /** - * The package corresponding to the given address (at the optionally given - * version). When no version is given, the package is loaded directly - * from the address given. Otherwise, the address is translated before - * loading to point to the package whose original ID matches - * the package at address, but whose version is version. For non-system - * packages, this might result in a different address than address - * because different versions of a package, introduced by upgrades, - * exist at distinct addresses. - * - * Note that this interpretation of version is different from a historical - * object read (the interpretation of version for the object query). - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `package`(`address`: Address, `version`: kotlin.ULong?) : MovePackage? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package( - thisPtr, - FfiConverterTypeAddress.lower(`address`),FfiConverterOptionalULong.lower(`version`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeMovePackage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } - /** - * Fetch the latest version of the package at address. - * This corresponds to the package with the highest version that shares its - * original ID with the package at address. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `packageLatest`(`address`: Address) : MovePackage? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_latest( - thisPtr, - FfiConverterTypeAddress.lower(`address`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeMovePackage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeProtocolConfigs: FfiConverter { + + override fun lower(value: ProtocolConfigs): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): ProtocolConfigs { + return ProtocolConfigs(value) + } + + override fun read(buf: ByteBuffer): ProtocolConfigs { + // 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: ProtocolConfigs) = 8UL + + override fun write(value: ProtocolConfigs, 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 +// - - /** - * Fetch all versions of package at address (packages that share this - * package's original ID), optionally bounding the versions exclusively - * from below with afterVersion, or from above with beforeVersion. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `packageVersions`(`address`: Address, `paginationFilter`: PaginationFilter, `afterVersion`: kotlin.ULong?, `beforeVersion`: kotlin.ULong?) : MovePackagePage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_package_versions( - thisPtr, - FfiConverterTypeAddress.lower(`address`),FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalULong.lower(`afterVersion`),FfiConverterOptionalULong.lower(`beforeVersion`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeMovePackagePage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } +public interface RandomnessStateUpdateInterface { - /** - * The Move packages that exist in the network, optionally filtered to be - * strictly before beforeCheckpoint and/or strictly after - * afterCheckpoint. - * - * This query returns all versions of a given user package that appear - * between the specified checkpoints, but only records the latest - * versions of system packages. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `packages`(`paginationFilter`: PaginationFilter, `afterCheckpoint`: kotlin.ULong?, `beforeCheckpoint`: kotlin.ULong?) : MovePackagePage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_packages( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalULong.lower(`afterCheckpoint`),FfiConverterOptionalULong.lower(`beforeCheckpoint`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeMovePackagePage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } + companion object +} - - /** - * Get the protocol configuration. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `protocolConfig`(`version`: kotlin.ULong?) : ProtocolConfigs? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_protocol_config( - thisPtr, - FfiConverterOptionalULong.lower(`version`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeProtocolConfigs.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) +open class RandomnessStateUpdate: Disposable, AutoCloseable, RandomnessStateUpdateInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Get the reference gas price for the provided epoch or the last known one - * if no epoch is provided. - * - * This will return `Ok(None)` if the epoch requested is not available in - * the GraphQL service (e.g., due to pruning). + * 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. */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `referenceGasPrice`(`epoch`: kotlin.ULong?) : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_reference_gas_price( - thisPtr, - FfiConverterOptionalULong.lower(`epoch`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - - /** - * Get the GraphQL service configuration, including complexity limits, read - * and mutation limits, supported versions, and others. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `serviceConfig`() : ServiceConfig { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_service_config( - thisPtr, - - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_pointer(future) }, - // lift function - { FfiConverterTypeServiceConfig.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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() + } + } } - - /** - * Set the server address for the GraphQL GraphQL client. It should be a - * valid URL with a host and optionally a port number. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `setRpcServer`(`server`: kotlin.String) { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_set_rpc_server( - thisPtr, - FfiConverterString.lower(`server`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_void(future) }, - // lift function - { Unit }, - - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Synchronized + override fun close() { + this.destroy() } - - /** - * Get total supply for the coin type. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `totalSupply`(`coinType`: kotlin.String) : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_supply( - thisPtr, - FfiConverterString.lower(`coinType`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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() + } + } } - - /** - * The total number of transaction blocks in the network by the end of the - * last known checkpoint. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `totalTransactionBlocks`() : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks( - thisPtr, - - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + // 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_randomnessstateupdate(ptr, status) + } + } + } } - - /** - * The total number of transaction blocks in the network by the end of the - * provided checkpoint digest. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `totalTransactionBlocksByDigest`(`digest`: CheckpointContentsDigest) : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_digest( - thisPtr, - FfiConverterTypeCheckpointContentsDigest.lower(`digest`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(pointer!!, status) + } } - /** - * The total number of transaction blocks in the network by the end of the - * provided checkpoint sequence number. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `totalTransactionBlocksBySeqNum`(`seqNum`: kotlin.ULong) : kotlin.ULong? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_total_transaction_blocks_by_seq_num( - thisPtr, - FfiConverterULong.lower(`seqNum`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalULong.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) - } - /** - * Get a transaction by its digest. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `transaction`(`digest`: TransactionDigest) : SignedTransaction? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction( - thisPtr, - FfiConverterTypeTransactionDigest.lower(`digest`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeSignedTransaction.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeRandomnessStateUpdate: FfiConverter { + + override fun lower(value: RandomnessStateUpdate): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): RandomnessStateUpdate { + return RandomnessStateUpdate(value) + } + + override fun read(buf: ByteBuffer): RandomnessStateUpdate { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: RandomnessStateUpdate) = 8UL + + override fun write(value: RandomnessStateUpdate, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) } +} + + +// 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 secp256k1 signature. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256k1-signature = 64OCTECT + * ``` + */ +public interface Secp256k1PublicKeyInterface { - /** - * Get a transaction's data and effects by its digest. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `transactionDataEffects`(`digest`: TransactionDigest) : TransactionDataEffects? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_data_effects( - thisPtr, - FfiConverterTypeTransactionDigest.lower(`digest`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeTransactionDataEffects.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + fun `toBytes`(): kotlin.ByteArray + + companion object +} + +/** + * A secp256k1 signature. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256k1-signature = 64OCTECT + * ``` + */ +open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - /** - * Get a transaction's effects by its digest. + * 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. */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `transactionEffects`(`digest`: TransactionDigest) : TransactionEffects? { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transaction_effects( - thisPtr, - FfiConverterTypeTransactionDigest.lower(`digest`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterOptionalTypeTransactionEffects.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - - /** - * Get a page of transactions based on the provided filters. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `transactions`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter?) : SignedTransactionPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeTransactionsFilter.lower(`filter`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeSignedTransactionPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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() + } + } } - - /** - * Get a page of transactions' data and effects based on the provided - * filters. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `transactionsDataEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter?) : TransactionDataEffectsPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_data_effects( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeTransactionsFilter.lower(`filter`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeTransactionDataEffectsPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + @Synchronized + override fun close() { + this.destroy() } - - /** - * Get a page of transactions' effects based on the provided filters. - */ - @Throws(SdkFfiException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `transactionsEffects`(`paginationFilter`: PaginationFilter, `filter`: TransactionsFilter?) : TransactionEffectsPage { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_graphqlclient_transactions_effects( - thisPtr, - FfiConverterTypePaginationFilter.lower(`paginationFilter`),FfiConverterOptionalTypeTransactionsFilter.lower(`filter`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_iota_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeTransactionEffectsPage.lift(it) }, - // Error FFI converter - SdkFfiException.ErrorHandler, - ) + 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_secp256k1publickey(ptr, status) + } + } + } + } - - companion object { - - /** - * Create a new GraphQL client connected to the `devnet` GraphQL server: - * {DEVNET_HOST}. - */ fun `newDevnet`(): GraphQlClient { - return FfiConverterTypeGraphQLClient.lift( + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256k1publickey(pointer!!, status) + } + } + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_devnet( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes( + it, _status) } + } ) } + + + + companion object { - /** - * Create a new GraphQL client connected to the `localhost` GraphQL server: - * {DEFAULT_LOCAL_HOST}. - */ fun `newLocalhost`(): GraphQlClient { - return FfiConverterTypeGraphQLClient.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_localhost( - _status) + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) } ) } - /** - * Create a new GraphQL client connected to the `mainnet` GraphQL server: - * {MAINNET_HOST}. - */ fun `newMainnet`(): GraphQlClient { - return FfiConverterTypeGraphQLClient.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_mainnet( - _status) + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_str( + FfiConverterString.lower(`s`),_status) } ) } - - /** - * Create a new GraphQL client connected to the `testnet` GraphQL server: - * {TESTNET_HOST}. - */ fun `newTestnet`(): GraphQlClient { - return FfiConverterTypeGraphQLClient.lift( + fun `generate`(): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_graphqlclient_new_testnet( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate( _status) } ) @@ -10666,25 +19677,25 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** * @suppress */ -public object FfiConverterTypeGraphQLClient: FfiConverter { +public object FfiConverterTypeSecp256k1PublicKey: FfiConverter { - override fun lower(value: GraphQlClient): Pointer { + override fun lower(value: Secp256k1PublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): GraphQlClient { - return GraphQlClient(value) + override fun lift(value: Pointer): Secp256k1PublicKey { + return Secp256k1PublicKey(value) } - override fun read(buf: ByteBuffer): GraphQlClient { + override fun read(buf: ByteBuffer): Secp256k1PublicKey { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: GraphQlClient) = 8UL + override fun allocationSize(value: Secp256k1PublicKey) = 8UL - override fun write(value: GraphQlClient, buf: ByteBuffer) { + override fun write(value: Secp256k1PublicKey, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -10790,12 +19801,36 @@ public object FfiConverterTypeGraphQLClient: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movefunction(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256k1signature(ptr, status) } } } } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movefunction(pointer!!, status) - } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256k1signature(pointer!!, status) + } + } + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256k1signature_to_bytes( + it, _status) +} + } + ) } + + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } - companion object + + fun `generate`(): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1signature_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeMoveFunction: FfiConverter { +public object FfiConverterTypeSecp256k1Signature: FfiConverter { - override fun lower(value: MoveFunction): Pointer { + override fun lower(value: Secp256k1Signature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MoveFunction { - return MoveFunction(value) + override fun lift(value: Pointer): Secp256k1Signature { + return Secp256k1Signature(value) } - override fun read(buf: ByteBuffer): MoveFunction { + override fun read(buf: ByteBuffer): Secp256k1Signature { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: MoveFunction) = 8UL + override fun allocationSize(value: Secp256k1Signature) = 8UL - override fun write(value: MoveFunction, buf: ByteBuffer) { + override fun write(value: Secp256k1Signature, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -11012,12 +20092,36 @@ public object FfiConverterTypeMoveFunction: FfiConverter // -public interface MoveModuleInterface { +/** + * A secp256r1 signature. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256r1-signature = 64OCTECT + * ``` + */ +public interface Secp256r1PublicKeyInterface { + + fun `toBytes`(): kotlin.ByteArray companion object } -open class MoveModule: Disposable, AutoCloseable, MoveModuleInterface +/** + * A secp256r1 signature. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256r1-signature = 64OCTECT + * ``` + */ +open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInterface { constructor(pointer: Pointer) { @@ -11087,7 +20191,7 @@ open class MoveModule: Disposable, AutoCloseable, MoveModuleInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movemodule(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256r1publickey(ptr, status) } } } @@ -11095,40 +20199,85 @@ open class MoveModule: Disposable, AutoCloseable, MoveModuleInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movemodule(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(pointer!!, status) } } + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes( + it, _status) +} + } + ) + } + - companion object + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + fun `generate`(): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeMoveModule: FfiConverter { +public object FfiConverterTypeSecp256r1PublicKey: FfiConverter { - override fun lower(value: MoveModule): Pointer { + override fun lower(value: Secp256r1PublicKey): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MoveModule { - return MoveModule(value) + override fun lift(value: Pointer): Secp256r1PublicKey { + return Secp256r1PublicKey(value) } - override fun read(buf: ByteBuffer): MoveModule { + override fun read(buf: ByteBuffer): Secp256r1PublicKey { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: MoveModule) = 8UL + override fun allocationSize(value: Secp256r1PublicKey) = 8UL - override fun write(value: MoveModule, buf: ByteBuffer) { + override fun write(value: Secp256r1PublicKey, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -11234,12 +20383,36 @@ public object FfiConverterTypeMoveModule: FfiConverter { // -public interface MovePackageInterface { +/** + * A secp256r1 public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256r1-public-key = 33OCTECT + * ``` + */ +public interface Secp256r1SignatureInterface { + + fun `toBytes`(): kotlin.ByteArray companion object } -open class MovePackage: Disposable, AutoCloseable, MovePackageInterface +/** + * A secp256r1 public key. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * secp256r1-public-key = 33OCTECT + * ``` + */ +open class Secp256r1Signature: Disposable, AutoCloseable, Secp256r1SignatureInterface { constructor(pointer: Pointer) { @@ -11309,7 +20482,7 @@ open class MovePackage: Disposable, AutoCloseable, MovePackageInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movepackage(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256r1signature(ptr, status) } } } @@ -11317,40 +20490,85 @@ open class MovePackage: Disposable, AutoCloseable, MovePackageInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movepackage(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256r1signature(pointer!!, status) } } + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256r1signature_to_bytes( + it, _status) +} + } + ) + } + - companion object + companion object { + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_from_str( + FfiConverterString.lower(`s`),_status) +} + ) + } + + + fun `generate`(): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1signature_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeMovePackage: FfiConverter { +public object FfiConverterTypeSecp256r1Signature: FfiConverter { - override fun lower(value: MovePackage): Pointer { + override fun lower(value: Secp256r1Signature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MovePackage { - return MovePackage(value) + override fun lift(value: Pointer): Secp256r1Signature { + return Secp256r1Signature(value) } - override fun read(buf: ByteBuffer): MovePackage { + override fun read(buf: ByteBuffer): Secp256r1Signature { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: MovePackage) = 8UL + override fun allocationSize(value: Secp256r1Signature) = 8UL - override fun write(value: MovePackage, buf: ByteBuffer) { + override fun write(value: Secp256r1Signature, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -11456,12 +20674,12 @@ public object FfiConverterTypeMovePackage: FfiConverter { // -public interface MoveStructInterface { +public interface ServiceConfigInterface { companion object } -open class MoveStruct: Disposable, AutoCloseable, MoveStructInterface +open class ServiceConfig: Disposable, AutoCloseable, ServiceConfigInterface { constructor(pointer: Pointer) { @@ -11531,7 +20749,7 @@ open class MoveStruct: Disposable, AutoCloseable, MoveStructInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_movestruct(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_serviceconfig(ptr, status) } } } @@ -11539,7 +20757,7 @@ open class MoveStruct: Disposable, AutoCloseable, MoveStructInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_movestruct(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_serviceconfig(pointer!!, status) } } @@ -11554,25 +20772,25 @@ open class MoveStruct: Disposable, AutoCloseable, MoveStructInterface /** * @suppress */ -public object FfiConverterTypeMoveStruct: FfiConverter { +public object FfiConverterTypeServiceConfig: FfiConverter { - override fun lower(value: MoveStruct): Pointer { + override fun lower(value: ServiceConfig): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MoveStruct { - return MoveStruct(value) + override fun lift(value: Pointer): ServiceConfig { + return ServiceConfig(value) } - override fun read(buf: ByteBuffer): MoveStruct { + override fun read(buf: ByteBuffer): ServiceConfig { // 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: MoveStruct) = 8UL + override fun allocationSize(value: ServiceConfig) = 8UL - override fun write(value: MoveStruct, buf: ByteBuffer) { + override fun write(value: ServiceConfig, 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))) @@ -11679,76 +20897,93 @@ public object FfiConverterTypeMoveStruct: FfiConverter { /** - * An object on the IOTA blockchain + * A basic signature + * + * This enumeration defines the set of simple or basic signature schemes + * supported by IOTA. Most signature schemes supported by IOTA end up + * comprising of a at least one simple signature scheme. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object = object-data owner digest u64 + * simple-signature-bcs = bytes ; where the contents of the bytes are defined by + * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / + * (secp256k1-flag secp256k1-signature secp256k1-public-key) / + * (secp256r1-flag secp256r1-signature secp256r1-public-key) * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. */ -public interface ObjectInterface { +public interface SimpleSignatureInterface { - /** - * Try to interpret this object as a move struct - */ - fun `asStruct`(): MoveStruct? + fun `ed25519PubKey`(): Ed25519PublicKey - /** - * Return this object's data - */ - fun `data`(): ObjectData + fun `ed25519PubKeyOpt`(): Ed25519PublicKey? - /** - * Return this object's id - */ - fun `objectId`(): ObjectId + fun `ed25519Sig`(): Ed25519Signature - /** - * Return this object's type - */ - fun `objectType`(): ObjectType + fun `ed25519SigOpt`(): Ed25519Signature? - /** - * Return this object's owner - */ - fun `owner`(): Owner + fun `isEd25519`(): kotlin.Boolean - /** - * Return the digest of the transaction that last modified this object - */ - fun `previousTransaction`(): TransactionDigest + fun `isSecp256k1`(): kotlin.Boolean - /** - * 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 + fun `isSecp256r1`(): kotlin.Boolean + + fun `scheme`(): SignatureScheme + + fun `secp256k1PubKey`(): Secp256k1PublicKey + + fun `secp256k1PubKeyOpt`(): Secp256k1PublicKey? - /** - * Return this object's version - */ - fun `version`(): kotlin.ULong + fun `secp256k1Sig`(): Secp256k1Signature + + fun `secp256k1SigOpt`(): Secp256k1Signature? + + fun `secp256r1PubKey`(): Secp256r1PublicKey + + fun `secp256r1PubKeyOpt`(): Secp256r1PublicKey? + + fun `secp256r1Sig`(): Secp256r1Signature + + fun `secp256r1SigOpt`(): Secp256r1Signature? + + fun `toBytes`(): kotlin.ByteArray companion object } /** - * An object on the IOTA blockchain + * A basic signature + * + * This enumeration defines the set of simple or basic signature schemes + * supported by IOTA. Most signature schemes supported by IOTA end up + * comprising of a at least one simple signature scheme. * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * object = object-data owner digest u64 + * simple-signature-bcs = bytes ; where the contents of the bytes are defined by + * simple-signature = (ed25519-flag ed25519-signature ed25519-public-key) / + * (secp256k1-flag secp256k1-signature secp256k1-public-key) / + * (secp256r1-flag secp256r1-signature secp256r1-public-key) * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. */ -open class Object: Disposable, AutoCloseable, ObjectInterface +open class SimpleSignature: Disposable, AutoCloseable, SimpleSignatureInterface { constructor(pointer: Pointer) { @@ -11766,13 +21001,6 @@ open class Object: Disposable, AutoCloseable, ObjectInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - constructor(`data`: ObjectData, `owner`: Owner, `previousTransaction`: TransactionDigest, `storageRebate`: kotlin.ULong) : - this( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_object_new( - FfiConverterTypeObjectData.lower(`data`),FfiConverterTypeOwner.lower(`owner`),FfiConverterTypeTransactionDigest.lower(`previousTransaction`),FfiConverterULong.lower(`storageRebate`),_status) -} - ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -11825,7 +21053,7 @@ open class Object: Disposable, AutoCloseable, ObjectInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_object(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_simplesignature(ptr, status) } } } @@ -11833,18 +21061,27 @@ open class Object: Disposable, AutoCloseable, ObjectInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_object(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_simplesignature(pointer!!, status) } } + override fun `ed25519PubKey`(): Ed25519PublicKey { + return FfiConverterTypeEd25519PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key( + it, _status) +} + } + ) + } - /** - * Try to interpret this object as a move struct - */override fun `asStruct`(): MoveStruct? { - return FfiConverterOptionalTypeMoveStruct.lift( + + override fun `ed25519PubKeyOpt`(): Ed25519PublicKey? { + return FfiConverterOptionalTypeEd25519PublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_as_struct( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_pub_key_opt( it, _status) } } @@ -11852,14 +21089,23 @@ open class Object: Disposable, AutoCloseable, ObjectInterface } + override fun `ed25519Sig`(): Ed25519Signature { + return FfiConverterTypeEd25519Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig( + it, _status) +} + } + ) + } - /** - * Return this object's data - */override fun `data`(): ObjectData { - return FfiConverterTypeObjectData.lift( + + override fun `ed25519SigOpt`(): Ed25519Signature? { + return FfiConverterOptionalTypeEd25519Signature.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_data( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_ed25519_sig_opt( it, _status) } } @@ -11867,14 +21113,23 @@ open class Object: Disposable, AutoCloseable, ObjectInterface } + override fun `isEd25519`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_ed25519( + it, _status) +} + } + ) + } - /** - * Return this object's id - */override fun `objectId`(): ObjectId { - return FfiConverterTypeObjectId.lift( + + override fun `isSecp256k1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_id( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256k1( it, _status) } } @@ -11882,14 +21137,23 @@ open class Object: Disposable, AutoCloseable, ObjectInterface } + override fun `isSecp256r1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_is_secp256r1( + it, _status) +} + } + ) + } - /** - * Return this object's type - */override fun `objectType`(): ObjectType { - return FfiConverterTypeObjectType.lift( + + override fun `scheme`(): SignatureScheme { + return FfiConverterTypeSignatureScheme.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_object_type( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_scheme( it, _status) } } @@ -11897,14 +21161,23 @@ open class Object: Disposable, AutoCloseable, ObjectInterface } + override fun `secp256k1PubKey`(): Secp256k1PublicKey { + return FfiConverterTypeSecp256k1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key( + it, _status) +} + } + ) + } - /** - * Return this object's owner - */override fun `owner`(): Owner { - return FfiConverterTypeOwner.lift( + + override fun `secp256k1PubKeyOpt`(): Secp256k1PublicKey? { + return FfiConverterOptionalTypeSecp256k1PublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_owner( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_pub_key_opt( it, _status) } } @@ -11912,14 +21185,23 @@ open class Object: Disposable, AutoCloseable, ObjectInterface } + override fun `secp256k1Sig`(): Secp256k1Signature { + return FfiConverterTypeSecp256k1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig( + it, _status) +} + } + ) + } - /** - * Return the digest of the transaction that last modified this object - */override fun `previousTransaction`(): TransactionDigest { - return FfiConverterTypeTransactionDigest.lift( + + override fun `secp256k1SigOpt`(): Secp256k1Signature? { + return FfiConverterOptionalTypeSecp256k1Signature.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_previous_transaction( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256k1_sig_opt( it, _status) } } @@ -11927,17 +21209,35 @@ open class Object: Disposable, AutoCloseable, ObjectInterface } + override fun `secp256r1PubKey`(): Secp256r1PublicKey { + return FfiConverterTypeSecp256r1PublicKey.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key( + it, _status) +} + } + ) + } - /** - * Return the storage rebate locked in this object - * - * Storage rebates are credited to the gas coin used in a transaction that - * deletes this object. - */override fun `storageRebate`(): kotlin.ULong { - return FfiConverterULong.lift( + + override fun `secp256r1PubKeyOpt`(): Secp256r1PublicKey? { + return FfiConverterOptionalTypeSecp256r1PublicKey.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_storage_rebate( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_pub_key_opt( + it, _status) +} + } + ) + } + + + override fun `secp256r1Sig`(): Secp256r1Signature { + return FfiConverterTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig( it, _status) } } @@ -11945,14 +21245,23 @@ open class Object: Disposable, AutoCloseable, ObjectInterface } + override fun `secp256r1SigOpt`(): Secp256r1Signature? { + return FfiConverterOptionalTypeSecp256r1Signature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_secp256r1_sig_opt( + it, _status) +} + } + ) + } - /** - * Return this object's version - */override fun `version`(): kotlin.ULong { - return FfiConverterULong.lift( + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_object_version( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_simplesignature_to_bytes( it, _status) } } @@ -11971,25 +21280,25 @@ open class Object: Disposable, AutoCloseable, ObjectInterface /** * @suppress */ -public object FfiConverterTypeObject: FfiConverter { +public object FfiConverterTypeSimpleSignature: FfiConverter { - override fun lower(value: Object): Pointer { + override fun lower(value: SimpleSignature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Object { - return Object(value) + override fun lift(value: Pointer): SimpleSignature { + return SimpleSignature(value) } - override fun read(buf: ByteBuffer): Object { + override fun read(buf: ByteBuffer): SimpleSignature { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Object) = 8UL + override fun allocationSize(value: SimpleSignature) = 8UL - override fun write(value: Object, buf: ByteBuffer) { + override fun write(value: SimpleSignature, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -12095,12 +21404,52 @@ public object FfiConverterTypeObject: FfiConverter { // -public interface ObjectDataInterface { +/** + * Type information for a move struct + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * struct-tag = address ; address of the package + * identifier ; name of the module + * identifier ; name of the type + * (vector type-tag) ; type parameters + * ``` + */ +public interface StructTagInterface { + + fun `address`(): Address + + /** + * Checks if this is a Coin type + */ + fun `coinType`(): TypeTag + + /** + * Checks if this is a Coin type + */ + fun `coinTypeOpt`(): TypeTag? companion object } -open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface +/** + * Type information for a move struct + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * struct-tag = address ; address of the package + * identifier ; name of the module + * identifier ; name of the type + * (vector type-tag) ; type parameters + * ``` + */ +open class StructTag: Disposable, AutoCloseable, StructTagInterface { constructor(pointer: Pointer) { @@ -12118,6 +21467,13 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`address`: Address, `module`: Identifier, `name`: Identifier, `typeParams`: List) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_new( + FfiConverterTypeAddress.lower(`address`),FfiConverterTypeIdentifier.lower(`module`),FfiConverterTypeIdentifier.lower(`name`),FfiConverterSequenceTypeTypeTag.lower(`typeParams`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -12170,7 +21526,7 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdata(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_structtag(ptr, status) } } } @@ -12178,40 +21534,113 @@ open class ObjectData: Disposable, AutoCloseable, ObjectDataInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdata(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_structtag(pointer!!, status) } } + override fun `address`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_address( + it, _status) +} + } + ) + } + + + + /** + * Checks if this is a Coin type + */override fun `coinType`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type( + it, _status) +} + } + ) + } + + + + /** + * Checks if this is a Coin type + */override fun `coinTypeOpt`(): TypeTag? { + return FfiConverterOptionalTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_structtag_coin_type_opt( + it, _status) +} + } + ) + } + - companion object + companion object { + fun `coin`(`typeTag`: TypeTag): StructTag { + return FfiConverterTypeStructTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_coin( + FfiConverterTypeTypeTag.lower(`typeTag`),_status) +} + ) + } + + + fun `gasCoin`(): StructTag { + return FfiConverterTypeStructTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_gas_coin( + _status) +} + ) + } + + + fun `stakedIota`(): StructTag { + return FfiConverterTypeStructTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_structtag_staked_iota( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeObjectData: FfiConverter { +public object FfiConverterTypeStructTag: FfiConverter { - override fun lower(value: ObjectData): Pointer { + override fun lower(value: StructTag): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectData { - return ObjectData(value) + override fun lift(value: Pointer): StructTag { + return StructTag(value) } - override fun read(buf: ByteBuffer): ObjectData { + override fun read(buf: ByteBuffer): StructTag { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ObjectData) = 8UL + override fun allocationSize(value: StructTag) = 8UL - override fun write(value: ObjectData, buf: ByteBuffer) { + override fun write(value: StructTag, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -12317,12 +21746,46 @@ public object FfiConverterTypeObjectData: FfiConverter { // -public interface ObjectDigestInterface { +/** + * A transaction + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transaction = %x00 transaction-v1 + * + * transaction-v1 = transaction-kind address gas-payment transaction-expiration + * ``` + */ +public interface TransactionInterface { + + fun `expiration`(): TransactionExpiration + + fun `gasPayment`(): GasPayment + + fun `kind`(): TransactionKind + + fun `sender`(): Address companion object } -open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface +/** + * A transaction + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transaction = %x00 transaction-v1 + * + * transaction-v1 = transaction-kind address gas-payment transaction-expiration + * ``` + */ +open class Transaction: Disposable, AutoCloseable, TransactionInterface { constructor(pointer: Pointer) { @@ -12340,6 +21803,13 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`kind`: TransactionKind, `sender`: Address, `gasPayment`: GasPayment, `expiration`: TransactionExpiration) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transaction_new( + FfiConverterTypeTransactionKind.lower(`kind`),FfiConverterTypeAddress.lower(`sender`),FfiConverterTypeGasPayment.lower(`gasPayment`),FfiConverterTypeTransactionExpiration.lower(`expiration`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -12392,7 +21862,7 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectdigest(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transaction(ptr, status) } } } @@ -12400,10 +21870,58 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectdigest(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transaction(pointer!!, status) } } + override fun `expiration`(): TransactionExpiration { + return FfiConverterTypeTransactionExpiration.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_expiration( + it, _status) +} + } + ) + } + + + override fun `gasPayment`(): GasPayment { + return FfiConverterTypeGasPayment.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment( + it, _status) +} + } + ) + } + + + override fun `kind`(): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_kind( + it, _status) +} + } + ) + } + + + override fun `sender`(): Address { + return FfiConverterTypeAddress.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_sender( + it, _status) +} + } + ) + } + + @@ -12415,25 +21933,25 @@ open class ObjectDigest: Disposable, AutoCloseable, ObjectDigestInterface /** * @suppress */ -public object FfiConverterTypeObjectDigest: FfiConverter { +public object FfiConverterTypeTransaction: FfiConverter { - override fun lower(value: ObjectDigest): Pointer { + override fun lower(value: Transaction): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectDigest { - return ObjectDigest(value) + override fun lift(value: Pointer): Transaction { + return Transaction(value) } - override fun read(buf: ByteBuffer): ObjectDigest { + override fun read(buf: ByteBuffer): Transaction { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ObjectDigest) = 8UL + override fun allocationSize(value: Transaction) = 8UL - override fun write(value: ObjectDigest, buf: ByteBuffer) { + override fun write(value: Transaction, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -12539,58 +22057,16 @@ public object FfiConverterTypeObjectDigest: FfiConverter // -/** - * An `ObjectId` is a 32-byte identifier used to uniquely identify an object on - * the IOTA blockchain. - * - * ## Relationship to Address - * - * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but - * are derived leveraging different domain-separator values to ensure, - * cryptographically, that there won't be any overlap, e.g. there can't be a - * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user - * account. - * - * # BCS - * - * An `ObjectId`'s BCS serialized form is defined by the following: - * - * ```text - * object-id = 32*OCTET - * ``` - */ -public interface ObjectIdInterface { +public interface TransactionDigestInterface { - fun `toAddress`(): Address + fun `toBase58`(): kotlin.String fun `toBytes`(): kotlin.ByteArray - fun `toHex`(): kotlin.String - companion object } -/** - * An `ObjectId` is a 32-byte identifier used to uniquely identify an object on - * the IOTA blockchain. - * - * ## Relationship to Address - * - * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but - * are derived leveraging different domain-separator values to ensure, - * cryptographically, that there won't be any overlap, e.g. there can't be a - * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user - * account. - * - * # BCS - * - * An `ObjectId`'s BCS serialized form is defined by the following: - * - * ```text - * object-id = 32*OCTET - * ``` - */ -open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface +open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterface { constructor(pointer: Pointer) { @@ -12660,7 +22136,7 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectid(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactiondigest(ptr, status) } } } @@ -12668,15 +22144,15 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectid(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactiondigest(pointer!!, status) } } - override fun `toAddress`(): Address { - return FfiConverterTypeAddress.lift( + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_address( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_base58( it, _status) } } @@ -12688,19 +22164,7 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface return FfiConverterByteArray.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_bytes( - it, _status) -} - } - ) - } - - - override fun `toHex`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_objectid_to_hex( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondigest_to_bytes( it, _status) } } @@ -12713,22 +22177,32 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface companion object { - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): ObjectId { - return FfiConverterTypeObjectId.lift( + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_base58( + FfiConverterString.lower(`base58`),_status) } ) } - @Throws(SdkFfiException::class) fun `fromHex`(`hex`: kotlin.String): ObjectId { - return FfiConverterTypeObjectId.lift( + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_objectid_from_hex( - FfiConverterString.lower(`hex`),_status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): TransactionDigest { + return FfiConverterTypeTransactionDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondigest_generate( + _status) } ) } @@ -12742,25 +22216,25 @@ open class ObjectId: Disposable, AutoCloseable, ObjectIdInterface /** * @suppress */ -public object FfiConverterTypeObjectId: FfiConverter { +public object FfiConverterTypeTransactionDigest: FfiConverter { - override fun lower(value: ObjectId): Pointer { + override fun lower(value: TransactionDigest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectId { - return ObjectId(value) + override fun lift(value: Pointer): TransactionDigest { + return TransactionDigest(value) } - override fun read(buf: ByteBuffer): ObjectId { + override fun read(buf: ByteBuffer): TransactionDigest { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ObjectId) = 8UL + override fun allocationSize(value: TransactionDigest) = 8UL - override fun write(value: ObjectId, buf: ByteBuffer) { + override fun write(value: TransactionDigest, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -12866,12 +22340,16 @@ public object FfiConverterTypeObjectId: FfiConverter { // -public interface ObjectRefInterface { +public interface TransactionEffectsInterface { + + fun `asV1`(): TransactionEffectsV1 + + fun `isV1`(): kotlin.Boolean companion object } -open class ObjectRef: Disposable, AutoCloseable, ObjectRefInterface +open class TransactionEffects: Disposable, AutoCloseable, TransactionEffectsInterface { constructor(pointer: Pointer) { @@ -12941,7 +22419,7 @@ open class ObjectRef: Disposable, AutoCloseable, ObjectRefInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objectref(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneffects(ptr, status) } } } @@ -12949,40 +22427,75 @@ open class ObjectRef: Disposable, AutoCloseable, ObjectRefInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objectref(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffects(pointer!!, status) } } + override fun `asV1`(): TransactionEffectsV1 { + return FfiConverterTypeTransactionEffectsV1.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1( + it, _status) +} + } + ) + } + + + override fun `isV1`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffects_is_v1( + it, _status) +} + } + ) + } + + + companion object { + fun `newV1`(`effects`: TransactionEffectsV1): TransactionEffects { + return FfiConverterTypeTransactionEffects.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1( + FfiConverterTypeTransactionEffectsV1.lower(`effects`),_status) +} + ) + } - companion object + + + } } /** * @suppress */ -public object FfiConverterTypeObjectRef: FfiConverter { +public object FfiConverterTypeTransactionEffects: FfiConverter { - override fun lower(value: ObjectRef): Pointer { + override fun lower(value: TransactionEffects): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectRef { - return ObjectRef(value) + override fun lift(value: Pointer): TransactionEffects { + return TransactionEffects(value) } - override fun read(buf: ByteBuffer): ObjectRef { + override fun read(buf: ByteBuffer): TransactionEffects { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ObjectRef) = 8UL + override fun allocationSize(value: TransactionEffects) = 8UL - override fun write(value: ObjectRef, buf: ByteBuffer) { + override fun write(value: TransactionEffects, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13088,12 +22601,16 @@ public object FfiConverterTypeObjectRef: FfiConverter { // -public interface ObjectTypeInterface { +public interface TransactionEffectsDigestInterface { + + fun `toBase58`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray companion object } -open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface +open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffectsDigestInterface { constructor(pointer: Pointer) { @@ -13163,7 +22680,7 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_objecttype(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneffectsdigest(ptr, status) } } } @@ -13171,40 +22688,97 @@ open class ObjectType: Disposable, AutoCloseable, ObjectTypeInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_objecttype(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(pointer!!, status) } } + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_base58( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneffectsdigest_to_bytes( + it, _status) +} + } + ) + } + - companion object + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionEffectsDigest { + return FfiConverterTypeTransactionEffectsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionEffectsDigest { + return FfiConverterTypeTransactionEffectsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): TransactionEffectsDigest { + return FfiConverterTypeTransactionEffectsDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneffectsdigest_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeObjectType: FfiConverter { +public object FfiConverterTypeTransactionEffectsDigest: FfiConverter { - override fun lower(value: ObjectType): Pointer { + override fun lower(value: TransactionEffectsDigest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ObjectType { - return ObjectType(value) + override fun lift(value: Pointer): TransactionEffectsDigest { + return TransactionEffectsDigest(value) } - override fun read(buf: ByteBuffer): ObjectType { + override fun read(buf: ByteBuffer): TransactionEffectsDigest { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ObjectType) = 8UL + override fun allocationSize(value: TransactionEffectsDigest) = 8UL - override fun write(value: ObjectType, buf: ByteBuffer) { + override fun write(value: TransactionEffectsDigest, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13310,12 +22884,16 @@ public object FfiConverterTypeObjectType: FfiConverter { // -public interface OwnerInterface { +public interface TransactionEventsDigestInterface { + + fun `toBase58`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray companion object } -open class Owner: Disposable, AutoCloseable, OwnerInterface +open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEventsDigestInterface { constructor(pointer: Pointer) { @@ -13385,7 +22963,7 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_owner(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneventsdigest(ptr, status) } } } @@ -13393,40 +22971,97 @@ open class Owner: Disposable, AutoCloseable, OwnerInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_owner(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(pointer!!, status) } } + override fun `toBase58`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_base58( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactioneventsdigest_to_bytes( + it, _status) +} + } + ) + } + + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase58`(`base58`: kotlin.String): TransactionEventsDigest { + return FfiConverterTypeTransactionEventsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_base58( + FfiConverterString.lower(`base58`),_status) +} + ) + } - companion object + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): TransactionEventsDigest { + return FfiConverterTypeTransactionEventsDigest.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } + + + fun `generate`(): TransactionEventsDigest { + return FfiConverterTypeTransactionEventsDigest.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactioneventsdigest_generate( + _status) +} + ) + } + + + + } } /** * @suppress */ -public object FfiConverterTypeOwner: FfiConverter { +public object FfiConverterTypeTransactionEventsDigest: FfiConverter { - override fun lower(value: Owner): Pointer { + override fun lower(value: TransactionEventsDigest): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Owner { - return Owner(value) + override fun lift(value: Pointer): TransactionEventsDigest { + return TransactionEventsDigest(value) } - override fun read(buf: ByteBuffer): Owner { + override fun read(buf: ByteBuffer): TransactionEventsDigest { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Owner) = 8UL + override fun allocationSize(value: TransactionEventsDigest) = 8UL - override fun write(value: Owner, buf: ByteBuffer) { + override fun write(value: TransactionEventsDigest, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13532,12 +23167,50 @@ public object FfiConverterTypeOwner: FfiConverter { // -public interface ProgrammableTransactionInterface { +/** + * Transaction type + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transaction-kind = %x00 ptb + * =/ %x01 change-epoch + * =/ %x02 genesis-transaction + * =/ %x03 consensus-commit-prologue + * =/ %x04 authenticator-state-update + * =/ %x05 (vector end-of-epoch-transaction-kind) + * =/ %x06 randomness-state-update + * =/ %x07 consensus-commit-prologue-v2 + * =/ %x08 consensus-commit-prologue-v3 + * ``` + */ +public interface TransactionKindInterface { companion object } -open class ProgrammableTransaction: Disposable, AutoCloseable, ProgrammableTransactionInterface +/** + * Transaction type + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * transaction-kind = %x00 ptb + * =/ %x01 change-epoch + * =/ %x02 genesis-transaction + * =/ %x03 consensus-commit-prologue + * =/ %x04 authenticator-state-update + * =/ %x05 (vector end-of-epoch-transaction-kind) + * =/ %x06 randomness-state-update + * =/ %x07 consensus-commit-prologue-v2 + * =/ %x08 consensus-commit-prologue-v3 + * ``` + */ +open class TransactionKind: Disposable, AutoCloseable, TransactionKindInterface { constructor(pointer: Pointer) { @@ -13607,7 +23280,7 @@ open class ProgrammableTransaction: Disposable, AutoCloseable, ProgrammableTrans override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_programmabletransaction(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactionkind(ptr, status) } } } @@ -13615,40 +23288,101 @@ open class ProgrammableTransaction: Disposable, AutoCloseable, ProgrammableTrans fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_programmabletransaction(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer!!, status) } } + companion object { + fun `authenticatorStateUpdateV1`(`tx`: AuthenticatorStateUpdateV1): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_authenticator_state_update_v1( + FfiConverterTypeAuthenticatorStateUpdateV1.lower(`tx`),_status) +} + ) + } + + + fun `consensusCommitPrologueV1`(`tx`: ConsensusCommitPrologueV1): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_consensus_commit_prologue_v1( + FfiConverterTypeConsensusCommitPrologueV1.lower(`tx`),_status) +} + ) + } + + + fun `endOfEpoch`(`tx`: List): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch( + FfiConverterSequenceTypeEndOfEpochTransactionKind.lower(`tx`),_status) +} + ) + } + + + fun `genesis`(`tx`: GenesisTransaction): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis( + FfiConverterTypeGenesisTransaction.lower(`tx`),_status) +} + ) + } + + + fun `programmableTransaction`(`tx`: ProgrammableTransaction): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction( + FfiConverterTypeProgrammableTransaction.lower(`tx`),_status) +} + ) + } + + + fun `randomnessStateUpdate`(`tx`: RandomnessStateUpdate): TransactionKind { + return FfiConverterTypeTransactionKind.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update( + FfiConverterTypeRandomnessStateUpdate.lower(`tx`),_status) +} + ) + } - companion object + + + } } /** * @suppress */ -public object FfiConverterTypeProgrammableTransaction: FfiConverter { +public object FfiConverterTypeTransactionKind: FfiConverter { - override fun lower(value: ProgrammableTransaction): Pointer { + override fun lower(value: TransactionKind): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ProgrammableTransaction { - return ProgrammableTransaction(value) + override fun lift(value: Pointer): TransactionKind { + return TransactionKind(value) } - override fun read(buf: ByteBuffer): ProgrammableTransaction { + override fun read(buf: ByteBuffer): TransactionKind { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ProgrammableTransaction) = 8UL + override fun allocationSize(value: TransactionKind) = 8UL - override fun write(value: ProgrammableTransaction, buf: ByteBuffer) { + override fun write(value: TransactionKind, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13754,12 +23488,108 @@ public object FfiConverterTypeProgrammableTransaction: FfiConverter - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_protocolconfigs(ptr, status) - } - } - } + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_typetag(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_typetag(pointer!!, status) + } + } + + override fun `asStructTag`(): StructTag { + return FfiConverterTypeStructTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag( + it, _status) +} + } + ) + } + + + override fun `asStructTagOpt`(): StructTag? { + return FfiConverterOptionalTypeStructTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_struct_tag_opt( + it, _status) +} + } + ) + } + + + override fun `asVectorTypeTag`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag( + it, _status) +} + } + ) + } + + + override fun `asVectorTypeTagOpt`(): TypeTag? { + return FfiConverterOptionalTypeTypeTag.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_as_vector_type_tag_opt( + it, _status) +} + } + ) + } + + + override fun `isAddress`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_address( + it, _status) +} + } + ) + } + + + override fun `isBool`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_bool( + it, _status) +} + } + ) + } + + + override fun `isSigner`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_signer( + it, _status) +} + } + ) + } + + + override fun `isStruct`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_struct( + it, _status) +} + } + ) + } + + + override fun `isU128`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u128( + it, _status) +} + } + ) + } + + + override fun `isU16`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u16( + it, _status) +} + } + ) + } + + + override fun `isU256`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u256( + it, _status) +} + } + ) + } + + + override fun `isU32`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u32( + it, _status) +} + } + ) + } + + + override fun `isU64`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u64( + it, _status) +} + } + ) + } + + + override fun `isU8`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_u8( + it, _status) +} + } + ) + } + + + override fun `isVector`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_typetag_is_vector( + it, _status) +} + } + ) + } + + + + + + companion object { + fun `address`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_address( + _status) +} + ) + } + + + fun `bool`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_bool( + _status) +} + ) + } + + + fun `signer`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_signer( + _status) +} + ) + } + + + fun `structTag`(`structTag`: StructTag): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_struct_tag( + FfiConverterTypeStructTag.lower(`structTag`),_status) +} + ) + } + + + fun `u128`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u128( + _status) +} + ) + } + + + fun `u16`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u16( + _status) +} + ) + } + + + fun `u256`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u256( + _status) +} + ) } + - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_protocolconfigs(pointer!!, status) - } + fun `u32`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u32( + _status) +} + ) } + + fun `u64`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u64( + _status) +} + ) + } + fun `u8`(): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_u8( + _status) +} + ) + } + + fun `vector`(`typeTag`: TypeTag): TypeTag { + return FfiConverterTypeTypeTag.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_typetag_vector( + FfiConverterTypeTypeTag.lower(`typeTag`),_status) +} + ) + } - companion object + + + } } /** * @suppress */ -public object FfiConverterTypeProtocolConfigs: FfiConverter { +public object FfiConverterTypeTypeTag: FfiConverter { - override fun lower(value: ProtocolConfigs): Pointer { + override fun lower(value: TypeTag): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ProtocolConfigs { - return ProtocolConfigs(value) + override fun lift(value: Pointer): TypeTag { + return TypeTag(value) } - override fun read(buf: ByteBuffer): ProtocolConfigs { + override fun read(buf: ByteBuffer): TypeTag { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: ProtocolConfigs) = 8UL + override fun allocationSize(value: TypeTag) = 8UL - override fun write(value: ProtocolConfigs, buf: ByteBuffer) { + override fun write(value: TypeTag, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13976,12 +24097,87 @@ public object FfiConverterTypeProtocolConfigs: FfiConverter + * user-signature = simple-signature / multisig / multisig-legacy / zklogin / passkey + * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. + */ +public interface UserSignatureInterface { + + fun `asMultisig`(): MultisigAggregatedSignature + + fun `asMultisigOpt`(): MultisigAggregatedSignature? + + fun `asPasskey`(): PasskeyAuthenticator + + fun `asPasskeyOpt`(): PasskeyAuthenticator? + + fun `asSimple`(): SimpleSignature + + fun `asSimpleOpt`(): SimpleSignature? + + fun `asZklogin`(): ZkLoginAuthenticator + + fun `asZkloginOpt`(): ZkLoginAuthenticator? + + fun `isMultisig`(): kotlin.Boolean + + fun `isPasskey`(): kotlin.Boolean + + fun `isSimple`(): kotlin.Boolean + + fun `isZklogin`(): kotlin.Boolean + + /** + * Return the flag for this signature scheme + */ + fun `scheme`(): SignatureScheme + + fun `toBase64`(): kotlin.String + + fun `toBytes`(): kotlin.ByteArray companion object } -open class RandomnessStateUpdate: Disposable, AutoCloseable, RandomnessStateUpdateInterface +/** + * A signature from a user + * + * A `UserSignature` is most commonly used to authorize the execution and + * inclusion of a transaction to the blockchain. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * user-signature-bcs = bytes ; where the contents of the bytes are defined by + * user-signature = simple-signature / multisig / multisig-legacy / zklogin / passkey + * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. + */ +open class UserSignature: Disposable, AutoCloseable, UserSignatureInterface { constructor(pointer: Pointer) { @@ -14051,48 +24247,254 @@ open class RandomnessStateUpdate: Disposable, AutoCloseable, RandomnessStateUpda override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_randomnessstateupdate(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_usersignature(ptr, status) } } } } - - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_randomnessstateupdate(pointer!!, status) - } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_usersignature(pointer!!, status) + } + } + + override fun `asMultisig`(): MultisigAggregatedSignature { + return FfiConverterTypeMultisigAggregatedSignature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig( + it, _status) +} + } + ) + } + + + override fun `asMultisigOpt`(): MultisigAggregatedSignature? { + return FfiConverterOptionalTypeMultisigAggregatedSignature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_multisig_opt( + it, _status) +} + } + ) + } + + + override fun `asPasskey`(): PasskeyAuthenticator { + return FfiConverterTypePasskeyAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey( + it, _status) +} + } + ) + } + + + override fun `asPasskeyOpt`(): PasskeyAuthenticator? { + return FfiConverterOptionalTypePasskeyAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_passkey_opt( + it, _status) +} + } + ) + } + + + override fun `asSimple`(): SimpleSignature { + return FfiConverterTypeSimpleSignature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple( + it, _status) +} + } + ) + } + + + override fun `asSimpleOpt`(): SimpleSignature? { + return FfiConverterOptionalTypeSimpleSignature.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_simple_opt( + it, _status) +} + } + ) + } + + + override fun `asZklogin`(): ZkLoginAuthenticator { + return FfiConverterTypeZkLoginAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin( + it, _status) +} + } + ) + } + + + override fun `asZkloginOpt`(): ZkLoginAuthenticator? { + return FfiConverterOptionalTypeZkLoginAuthenticator.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_as_zklogin_opt( + it, _status) +} + } + ) + } + + + override fun `isMultisig`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_is_multisig( + it, _status) +} + } + ) + } + + + override fun `isPasskey`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_is_passkey( + it, _status) +} + } + ) + } + + + override fun `isSimple`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_is_simple( + it, _status) +} + } + ) + } + + + override fun `isZklogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_is_zklogin( + it, _status) +} + } + ) + } + + + + /** + * Return the flag for this signature scheme + */override fun `scheme`(): SignatureScheme { + return FfiConverterTypeSignatureScheme.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_scheme( + it, _status) +} + } + ) + } + + + override fun `toBase64`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_to_base64( + it, _status) +} + } + ) + } + + + override fun `toBytes`(): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_usersignature_to_bytes( + it, _status) +} + } + ) } + + companion object { + + @Throws(SdkFfiException::class) fun `fromBase64`(`base64`: kotlin.String): UserSignature { + return FfiConverterTypeUserSignature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_base64( + FfiConverterString.lower(`base64`),_status) +} + ) + } + + + + @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): UserSignature { + return FfiConverterTypeUserSignature.lift( + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_usersignature_from_bytes( + FfiConverterByteArray.lower(`bytes`),_status) +} + ) + } - companion object + + + } } /** * @suppress */ -public object FfiConverterTypeRandomnessStateUpdate: FfiConverter { +public object FfiConverterTypeUserSignature: FfiConverter { - override fun lower(value: RandomnessStateUpdate): Pointer { + override fun lower(value: UserSignature): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): RandomnessStateUpdate { - return RandomnessStateUpdate(value) + override fun lift(value: Pointer): UserSignature { + return UserSignature(value) } - override fun read(buf: ByteBuffer): RandomnessStateUpdate { + override fun read(buf: ByteBuffer): UserSignature { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: RandomnessStateUpdate) = 8UL + override fun allocationSize(value: UserSignature) = 8UL - override fun write(value: RandomnessStateUpdate, buf: ByteBuffer) { + override fun write(value: UserSignature, 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))) @@ -14199,35 +24601,59 @@ public object FfiConverterTypeRandomnessStateUpdate: FfiConverter + * zklogin = zklogin-flag + * zklogin-inputs + * u64 ; max epoch + * simple-signature * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. */ -public interface Secp256k1PublicKeyInterface { +public interface ZkLoginAuthenticatorInterface { - fun `toBytes`(): kotlin.ByteArray + fun `inputs`(): ZkLoginInputs + + fun `maxEpoch`(): kotlin.ULong + + fun `signature`(): SimpleSignature companion object } /** - * A secp256k1 signature. + * A zklogin authenticator * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * secp256k1-signature = 64OCTECT + * zklogin-bcs = bytes ; contents are defined by + * zklogin = zklogin-flag + * zklogin-inputs + * u64 ; max epoch + * simple-signature * ``` + * + * Note: Due to historical reasons, signatures are serialized slightly + * different from the majority of the types in IOTA. In particular if a + * signature is ever embedded in another structure it generally is serialized + * as `bytes` meaning it has a length prefix that defines the length of + * the completely serialized signature. */ -open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInterface +open class ZkLoginAuthenticator: Disposable, AutoCloseable, ZkLoginAuthenticatorInterface { constructor(pointer: Pointer) { @@ -14245,6 +24671,13 @@ open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInte this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } + constructor(`inputs`: ZkLoginInputs, `maxEpoch`: kotlin.ULong, `signature`: SimpleSignature) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_zkloginauthenticator_new( + FfiConverterTypeZkLoginInputs.lower(`inputs`),FfiConverterULong.lower(`maxEpoch`),FfiConverterTypeSimpleSignature.lower(`signature`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -14297,7 +24730,7 @@ open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInte override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256k1publickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_zkloginauthenticator(ptr, status) } } } @@ -14305,15 +24738,15 @@ open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256k1publickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_zkloginauthenticator(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `inputs`(): ZkLoginInputs { + return FfiConverterTypeZkLoginInputs.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256k1publickey_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_inputs( it, _status) } } @@ -14321,69 +24754,60 @@ open class Secp256k1PublicKey: Disposable, AutoCloseable, Secp256k1PublicKeyInte } - - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + override fun `maxEpoch`(): kotlin.ULong { + return FfiConverterULong.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_max_epoch( + it, _status) } - ) } - - - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_from_str( - FfiConverterString.lower(`s`),_status) -} ) } - fun `generate`(): Secp256k1PublicKey { - return FfiConverterTypeSecp256k1PublicKey.lift( + override fun `signature`(): SimpleSignature { + return FfiConverterTypeSimpleSignature.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256k1publickey_generate( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginauthenticator_signature( + it, _status) } + } ) } - - } + + + + + companion object } /** * @suppress */ -public object FfiConverterTypeSecp256k1PublicKey: FfiConverter { +public object FfiConverterTypeZkLoginAuthenticator: FfiConverter { - override fun lower(value: Secp256k1PublicKey): Pointer { + override fun lower(value: ZkLoginAuthenticator): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Secp256k1PublicKey { - return Secp256k1PublicKey(value) + override fun lift(value: Pointer): ZkLoginAuthenticator { + return ZkLoginAuthenticator(value) } - override fun read(buf: ByteBuffer): Secp256k1PublicKey { + override fun read(buf: ByteBuffer): ZkLoginAuthenticator { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Secp256k1PublicKey) = 8UL + override fun allocationSize(value: ZkLoginAuthenticator) = 8UL - override fun write(value: Secp256k1PublicKey, buf: ByteBuffer) { + override fun write(value: ZkLoginAuthenticator, 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))) @@ -14490,35 +24914,49 @@ public object FfiConverterTypeSecp256k1PublicKey: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_zklogininputs_new( + FfiConverterTypeZkLoginProof.lower(`proofPoints`),FfiConverterTypeZkLoginClaim.lower(`issBase64Details`),FfiConverterString.lower(`headerBase64`),FfiConverterTypeBn254FieldElement.lower(`addressSeed`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -14588,7 +25033,7 @@ open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInte override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_secp256r1publickey(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_zklogininputs(ptr, status) } } } @@ -14596,15 +25041,15 @@ open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_secp256r1publickey(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_zklogininputs(pointer!!, status) } } - override fun `toBytes`(): kotlin.ByteArray { - return FfiConverterByteArray.lift( + override fun `addressSeed`(): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_secp256r1publickey_to_bytes( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zklogininputs_address_seed( it, _status) } } @@ -14612,69 +25057,72 @@ open class Secp256r1PublicKey: Disposable, AutoCloseable, Secp256r1PublicKeyInte } - - - - companion object { - - @Throws(SdkFfiException::class) fun `fromBytes`(`bytes`: kotlin.ByteArray): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_bytes( - FfiConverterByteArray.lower(`bytes`),_status) + override fun `headerBase64`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zklogininputs_header_base64( + it, _status) } + } ) } - - @Throws(SdkFfiException::class) fun `fromStr`(`s`: kotlin.String): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( - uniffiRustCallWithError(SdkFfiException) { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_from_str( - FfiConverterString.lower(`s`),_status) + override fun `issBase64Details`(): ZkLoginClaim { + return FfiConverterTypeZkLoginClaim.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zklogininputs_iss_base64_details( + it, _status) } + } ) } - fun `generate`(): Secp256r1PublicKey { - return FfiConverterTypeSecp256r1PublicKey.lift( + override fun `proofPoints`(): ZkLoginProof { + return FfiConverterTypeZkLoginProof.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_secp256r1publickey_generate( - _status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zklogininputs_proof_points( + it, _status) } + } ) } - - } + + + + + companion object } /** * @suppress */ -public object FfiConverterTypeSecp256r1PublicKey: FfiConverter { +public object FfiConverterTypeZkLoginInputs: FfiConverter { - override fun lower(value: Secp256r1PublicKey): Pointer { + override fun lower(value: ZkLoginInputs): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Secp256r1PublicKey { - return Secp256r1PublicKey(value) + override fun lift(value: Pointer): ZkLoginInputs { + return ZkLoginInputs(value) } - override fun read(buf: ByteBuffer): Secp256r1PublicKey { + override fun read(buf: ByteBuffer): ZkLoginInputs { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Secp256r1PublicKey) = 8UL + override fun allocationSize(value: ZkLoginInputs) = 8UL - override fun write(value: Secp256r1PublicKey, buf: ByteBuffer) { + override fun write(value: ZkLoginInputs, 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))) @@ -14780,12 +25228,40 @@ public object FfiConverterTypeSecp256r1PublicKey: FfiConverter + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_zkloginproof_new( + FfiConverterTypeCircomG1.lower(`a`),FfiConverterTypeCircomG2.lower(`b`),FfiConverterTypeCircomG1.lower(`c`),_status) +} + ) protected val pointer: Pointer? protected val cleanable: UniffiCleaner.Cleanable @@ -14855,7 +25338,7 @@ open class ServiceConfig: Disposable, AutoCloseable, ServiceConfigInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_serviceconfig(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_zkloginproof(ptr, status) } } } @@ -14863,10 +25346,46 @@ open class ServiceConfig: Disposable, AutoCloseable, ServiceConfigInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_serviceconfig(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_zkloginproof(pointer!!, status) } } + override fun `a`(): CircomG1 { + return FfiConverterTypeCircomG1.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginproof_a( + it, _status) +} + } + ) + } + + + override fun `b`(): CircomG2 { + return FfiConverterTypeCircomG2.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginproof_b( + it, _status) +} + } + ) + } + + + override fun `c`(): CircomG1 { + return FfiConverterTypeCircomG1.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginproof_c( + it, _status) +} + } + ) + } + + @@ -14878,25 +25397,25 @@ open class ServiceConfig: Disposable, AutoCloseable, ServiceConfigInterface /** * @suppress */ -public object FfiConverterTypeServiceConfig: FfiConverter { +public object FfiConverterTypeZkLoginProof: FfiConverter { - override fun lower(value: ServiceConfig): Pointer { + override fun lower(value: ZkLoginProof): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): ServiceConfig { - return ServiceConfig(value) + override fun lift(value: Pointer): ZkLoginProof { + return ZkLoginProof(value) } - override fun read(buf: ByteBuffer): ServiceConfig { + override fun read(buf: ByteBuffer): ZkLoginProof { // 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: ServiceConfig) = 8UL + override fun allocationSize(value: ZkLoginProof) = 8UL - override fun write(value: ServiceConfig, buf: ByteBuffer) { + override fun write(value: ZkLoginProof, 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))) @@ -15002,16 +25521,124 @@ public object FfiConverterTypeServiceConfig: FfiConverter + * + * zklogin-public-identifier = zklogin-public-identifier-iss + * address-seed + * + * zklogin-public-identifier-unpadded = zklogin-public-identifier-iss + * address-seed-unpadded + * + * ; The iss, or issuer, is a utf8 string that is less than 255 bytes long + * ; and is serialized with the iss's length in bytes as a u8 followed by + * ; the bytes of the iss + * zklogin-public-identifier-iss = u8 *255(OCTET) + * + * ; A Bn254FieldElement serialized as a 32-byte big-endian value + * address-seed = 32(OCTET) + * + * ; A Bn254FieldElement serialized as a 32-byte big-endian value + * ; with any leading zero bytes stripped + * address-seed-unpadded = %x00 / %x01-ff *31(OCTET) + * ``` + * + * [`Address`]: crate::Address + */ +public interface ZkLoginPublicIdentifierInterface { - fun `signatures`(): List + fun `addressSeed`(): Bn254FieldElement - fun `transaction`(): Transaction + fun `iss`(): kotlin.String companion object } -open class SignedTransaction: Disposable, AutoCloseable, SignedTransactionInterface +/** + * Public Key equivalent for Zklogin authenticators + * + * A `ZkLoginPublicIdentifier` is the equivalent of a public key for other + * account authenticators, and contains the information required to derive the + * onchain account [`Address`] for a Zklogin authenticator. + * + * ## Note + * + * Due to a historical bug that was introduced in the IOTA Typescript SDK when + * the zklogin authenticator was first introduced, there are now possibly two + * "valid" addresses for each zklogin authenticator depending on the + * bit-pattern of the `address_seed` value. + * + * The original bug incorrectly derived a zklogin's address by stripping any + * leading zero-bytes that could have been present in the 32-byte length + * `address_seed` value prior to hashing, leading to a different derived + * address. This incorrectly derived address was presented to users of various + * wallets, leading them to sending funds to these addresses that they couldn't + * access. Instead of letting these users lose any assets that were sent to + * these addresses, the IOTA network decided to change the protocol to allow + * for a zklogin authenticator who's `address_seed` value had leading + * zero-bytes be authorized to sign for both the addresses derived from both + * the unpadded and padded `address_seed` value. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * zklogin-public-identifier-bcs = bytes ; where the contents are defined by + * ; + * + * zklogin-public-identifier = zklogin-public-identifier-iss + * address-seed + * + * zklogin-public-identifier-unpadded = zklogin-public-identifier-iss + * address-seed-unpadded + * + * ; The iss, or issuer, is a utf8 string that is less than 255 bytes long + * ; and is serialized with the iss's length in bytes as a u8 followed by + * ; the bytes of the iss + * zklogin-public-identifier-iss = u8 *255(OCTET) + * + * ; A Bn254FieldElement serialized as a 32-byte big-endian value + * address-seed = 32(OCTET) + * + * ; A Bn254FieldElement serialized as a 32-byte big-endian value + * ; with any leading zero bytes stripped + * address-seed-unpadded = %x00 / %x01-ff *31(OCTET) + * ``` + * + * [`Address`]: crate::Address + */ +open class ZkLoginPublicIdentifier: Disposable, AutoCloseable, ZkLoginPublicIdentifierInterface { constructor(pointer: Pointer) { @@ -15029,11 +25656,11 @@ open class SignedTransaction: Disposable, AutoCloseable, SignedTransactionInterf this.pointer = null this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } - constructor(`transaction`: Transaction, `signatures`: List) : + constructor(`iss`: kotlin.String, `addressSeed`: Bn254FieldElement) : this( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_signedtransaction_new( - FfiConverterTypeTransaction.lower(`transaction`),FfiConverterSequenceTypeUserSignature.lower(`signatures`),_status) + uniffiRustCallWithError(SdkFfiException) { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_zkloginpublicidentifier_new( + FfiConverterString.lower(`iss`),FfiConverterTypeBn254FieldElement.lower(`addressSeed`),_status) } ) @@ -15088,7 +25715,7 @@ open class SignedTransaction: Disposable, AutoCloseable, SignedTransactionInterf override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_signedtransaction(ptr, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_zkloginpublicidentifier(ptr, status) } } } @@ -15096,2920 +25723,3701 @@ open class SignedTransaction: Disposable, AutoCloseable, SignedTransactionInterf fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_signedtransaction(pointer!!, status) + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_zkloginpublicidentifier(pointer!!, status) } } - override fun `signatures`(): List { - return FfiConverterSequenceTypeUserSignature.lift( + override fun `addressSeed`(): Bn254FieldElement { + return FfiConverterTypeBn254FieldElement.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_address_seed( + it, _status) +} + } + ) + } + + + override fun `iss`(): kotlin.String { + return FfiConverterString.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_signedtransaction_signatures( + UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_zkloginpublicidentifier_iss( it, _status) } } ) } - + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeZkLoginPublicIdentifier: FfiConverter { + + override fun lower(value: ZkLoginPublicIdentifier): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): ZkLoginPublicIdentifier { + return ZkLoginPublicIdentifier(value) + } + + override fun read(buf: ByteBuffer): ZkLoginPublicIdentifier { + // 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: ZkLoginPublicIdentifier) = 8UL + + override fun write(value: ZkLoginPublicIdentifier, 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))) + } +} + + + +data class BigInt ( + var `value`: kotlin.String +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeBigInt: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): BigInt { + return BigInt( + FfiConverterString.read(buf), + ) + } + + override fun allocationSize(value: BigInt) = ( + FfiConverterString.allocationSize(value.`value`) + ) + + override fun write(value: BigInt, buf: ByteBuffer) { + FfiConverterString.write(value.`value`, buf) + } +} + + + +/** + * Input/output state of an object that was changed during execution + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * changed-object = object-id object-in object-out id-operation + * ``` + */ +data class ChangedObject ( + /** + * Id of the object + */ + var `objectId`: ObjectId, + /** + * State of the object in the store prior to this transaction. + */ + var `inputState`: ObjectIn, + /** + * State of the object in the store after this transaction. + */ + var `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. + */ + var `idOperation`: IdOperation +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`objectId`, + this.`inputState`, + this.`outputState`, + this.`idOperation` + ) + } + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeChangedObject: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ChangedObject { + return ChangedObject( + FfiConverterTypeObjectId.read(buf), + FfiConverterTypeObjectIn.read(buf), + FfiConverterTypeObjectOut.read(buf), + FfiConverterTypeIdOperation.read(buf), + ) + } + + override fun allocationSize(value: ChangedObject) = ( + FfiConverterTypeObjectId.allocationSize(value.`objectId`) + + FfiConverterTypeObjectIn.allocationSize(value.`inputState`) + + FfiConverterTypeObjectOut.allocationSize(value.`outputState`) + + FfiConverterTypeIdOperation.allocationSize(value.`idOperation`) + ) + + override fun write(value: ChangedObject, buf: ByteBuffer) { + FfiConverterTypeObjectId.write(value.`objectId`, buf) + FfiConverterTypeObjectIn.write(value.`inputState`, buf) + FfiConverterTypeObjectOut.write(value.`outputState`, buf) + FfiConverterTypeIdOperation.write(value.`idOperation`, buf) + } +} + + + +/** + * 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 + * ``` + */ +data class CheckpointSummary ( + /** + * Epoch that this checkpoint belongs to. + */ + var `epoch`: kotlin.ULong, + /** + * The height of this checkpoint. + */ + var `sequenceNumber`: kotlin.ULong, + /** + * Total number of transactions committed since genesis, including those in + * this checkpoint. + */ + var `networkTotalTransactions`: kotlin.ULong, + /** + * The hash of the `CheckpointContents` for this checkpoint. + */ + var `contentDigest`: CheckpointContentsDigest, + /** + * The hash of the previous `CheckpointSummary`. + * + * This will be only be `None` for the first, or genesis checkpoint. + */ + var `previousDigest`: CheckpointDigest?, + /** + * The running total gas costs of all transactions included in the current + * epoch so far until this checkpoint. + */ + var `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 + */ + var `timestampMs`: kotlin.ULong, + /** + * Commitments to checkpoint-specific state. + */ + var `checkpointCommitments`: List, + /** + * 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), + FfiConverterTypeCheckpointContentsDigest.read(buf), + FfiConverterOptionalTypeCheckpointDigest.read(buf), + FfiConverterTypeGasCostSummary.read(buf), + FfiConverterULong.read(buf), + FfiConverterSequenceTypeCheckpointCommitment.read(buf), + FfiConverterOptionalTypeEndOfEpochData.read(buf), + FfiConverterByteArray.read(buf), + ) + } - override fun `transaction`(): Transaction { - return FfiConverterTypeTransaction.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_signedtransaction_transaction( - it, _status) -} - } + override fun allocationSize(value: CheckpointSummary) = ( + FfiConverterULong.allocationSize(value.`epoch`) + + FfiConverterULong.allocationSize(value.`sequenceNumber`) + + FfiConverterULong.allocationSize(value.`networkTotalTransactions`) + + FfiConverterTypeCheckpointContentsDigest.allocationSize(value.`contentDigest`) + + FfiConverterOptionalTypeCheckpointDigest.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) + FfiConverterTypeCheckpointContentsDigest.write(value.`contentDigest`, buf) + FfiConverterOptionalTypeCheckpointDigest.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. + */ +data class CheckpointSummaryPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeSignedTransaction: FfiConverter { - - override fun lower(value: SignedTransaction): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): SignedTransaction { - return SignedTransaction(value) - } - - override fun read(buf: ByteBuffer): SignedTransaction { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +public object FfiConverterTypeCheckpointSummaryPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CheckpointSummaryPage { + return CheckpointSummaryPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeCheckpointSummary.read(buf), + ) } - override fun allocationSize(value: SignedTransaction) = 8UL + override fun allocationSize(value: CheckpointSummaryPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeCheckpointSummary.allocationSize(value.`data`) + ) - override fun write(value: SignedTransaction, 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))) + override fun write(value: CheckpointSummaryPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeCheckpointSummary.write(value.`data`, buf) } } -// This template implements a class for working with a Rust struct via a Pointer/Arc -// to the live Rust struct on the other side of the FFI. -// -// Each instance implements core operations for working with the Rust `Arc` and the -// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. -// -// There's some subtlety here, because we have to be careful not to operate on a Rust -// struct after it has been dropped, and because we must expose a public API for freeing -// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: -// -// * Each instance holds an opaque pointer to the underlying Rust struct. -// Method calls need to read this pointer from the object's state and pass it in to -// the Rust FFI. -// -// * When an instance is no longer needed, its pointer should be passed to a -// special destructor function provided by the Rust FFI, which will drop the -// underlying Rust struct. -// -// * Given an instance, calling code is expected to call the special -// `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so risks -// leaking the underlying Rust struct. -// -// * We can't assume that calling code will do the right thing, and must be prepared -// to handle Kotlin method calls executing concurrently with or even after a call to -// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. -// -// * We must never allow Rust code to operate on the underlying Rust struct after -// the destructor has been called, and must never call the destructor more than once. -// Doing so may trigger memory unsafety. -// -// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` -// is implemented to call the destructor when the Kotlin object becomes unreachable. -// This is done in a background thread. This is not a panacea, and client code should be aware that -// 1. the thread may starve if some there are objects that have poorly performing -// `drop` methods or do significant work in their `drop` methods. -// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, -// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). -// -// If we try to implement this with mutual exclusion on access to the pointer, there is the -// possibility of a race between a method call and a concurrent call to `destroy`: -// -// * Thread A starts a method call, reads the value of the pointer, but is interrupted -// before it can pass the pointer over the FFI to Rust. -// * Thread B calls `destroy` and frees the underlying Rust struct. -// * Thread A resumes, passing the already-read pointer value to Rust and triggering -// a use-after-free. -// -// One possible solution would be to use a `ReadWriteLock`, with each method call taking -// a read lock (and thus allowed to run concurrently) and the special `destroy` method -// taking a write lock (and thus blocking on live method calls). However, we aim not to -// generate methods with any hidden blocking semantics, and a `destroy` method that might -// block if called incorrectly seems to meet that bar. -// -// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track -// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` -// has been called. These are updated according to the following rules: -// -// * The initial value of the counter is 1, indicating a live object with no in-flight calls. -// The initial value for the flag is false. -// -// * At the start of each method call, we atomically check the counter. -// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. -// If it is nonzero them we atomically increment it by 1 and proceed with the method call. -// -// * At the end of each method call, we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// * When `destroy` is called, we atomically flip the flag from false to true. -// If the flag was already true we silently fail. -// Otherwise we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, -// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. -// -// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been -// called *and* all in-flight method calls have completed, avoiding violating any of the expectations -// of the underlying Rust code. -// -// This makes a cleaner a better alternative to _not_ calling `destroy()` as -// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` -// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner -// thread may be starved, and the app will leak memory. -// -// In this case, `destroy`ing manually may be a better solution. -// -// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects -// with Rust peers are reclaimed: -// -// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: -// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: -// 3. The memory is reclaimed when the process terminates. -// -// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 -// - /** - * A transaction - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * transaction = %x00 transaction-v1 - * - * transaction-v1 = transaction-kind address gas-payment transaction-expiration - * ``` + * A page of items returned by the GraphQL server. */ -public interface TransactionInterface { - - fun `expiration`(): TransactionExpiration - - fun `gasPayment`(): GasPayment - - fun `kind`(): TransactionKind +data class CoinPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { - fun `sender`(): Address + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) + } companion object } /** - * A transaction - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * transaction = %x00 transaction-v1 - * - * transaction-v1 = transaction-kind address gas-payment transaction-expiration - * ``` + * @suppress */ -open class Transaction: Disposable, AutoCloseable, TransactionInterface -{ +public object FfiConverterTypeCoinPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CoinPage { + return CoinPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeCoin.read(buf), + ) + } + + override fun allocationSize(value: CoinPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeCoin.allocationSize(value.`data`) + ) + + override fun write(value: CoinPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeCoin.write(value.`data`, buf) + } +} - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + + +data class DateTime ( + var `value`: kotlin.String +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeDateTime: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DateTime { + return DateTime( + FfiConverterString.read(buf), + ) } - /** - * 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)) + override fun allocationSize(value: DateTime) = ( + FfiConverterString.allocationSize(value.`value`) + ) + + override fun write(value: DateTime, buf: ByteBuffer) { + FfiConverterString.write(value.`value`, buf) } - constructor(`kind`: TransactionKind, `sender`: Address, `gasPayment`: GasPayment, `expiration`: TransactionExpiration) : - this( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transaction_new( - FfiConverterTypeTransactionKind.lower(`kind`),FfiConverterTypeAddress.lower(`sender`),FfiConverterTypeGasPayment.lower(`gasPayment`),FfiConverterTypeTransactionExpiration.lower(`expiration`),_status) } - ) - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) +/** + * The result of a dry run, which includes the effects of the transaction and + * any errors that may have occurred. + */ +data class DryRunResult ( + var `effects`: TransactionEffects?, + var `error`: kotlin.String? +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here 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() - } - } + + Disposable.destroy( + this.`effects`, + this.`error` + ) } + + companion object +} - @Synchronized - override fun close() { - this.destroy() +/** + * @suppress + */ +public object FfiConverterTypeDryRunResult: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DryRunResult { + return DryRunResult( + FfiConverterOptionalTypeTransactionEffects.read(buf), + FfiConverterOptionalString.read(buf), + ) } - 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() - } - } - } + override fun allocationSize(value: DryRunResult) = ( + FfiConverterOptionalTypeTransactionEffects.allocationSize(value.`effects`) + + FfiConverterOptionalString.allocationSize(value.`error`) + ) - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transaction(ptr, status) - } - } - } + override fun write(value: DryRunResult, buf: ByteBuffer) { + FfiConverterOptionalTypeTransactionEffects.write(value.`effects`, buf) + FfiConverterOptionalString.write(value.`error`, buf) } +} - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transaction(pointer!!, status) - } - } - override fun `expiration`(): TransactionExpiration { - return FfiConverterTypeTransactionExpiration.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_expiration( - it, _status) -} - } + +/** + * The name part of a dynamic field, including its type, bcs, and json + * representation. + */ +data class DynamicFieldName ( + /** + * The type name of this dynamic field name + */ + var `typeTag`: TypeTag, + /** + * The bcs bytes of this dynamic field name + */ + var `bcs`: kotlin.ByteArray, + /** + * The json representation of the dynamic field name + */ + var `json`: Value? +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`typeTag`, + this.`bcs`, + this.`json` ) } - - override fun `gasPayment`(): GasPayment { - return FfiConverterTypeGasPayment.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_gas_payment( - it, _status) + companion object } + +/** + * @suppress + */ +public object FfiConverterTypeDynamicFieldName: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DynamicFieldName { + return DynamicFieldName( + FfiConverterTypeTypeTag.read(buf), + FfiConverterByteArray.read(buf), + FfiConverterOptionalTypeValue.read(buf), + ) } + + override fun allocationSize(value: DynamicFieldName) = ( + FfiConverterTypeTypeTag.allocationSize(value.`typeTag`) + + FfiConverterByteArray.allocationSize(value.`bcs`) + + FfiConverterOptionalTypeValue.allocationSize(value.`json`) ) - } - - override fun `kind`(): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_kind( - it, _status) -} + override fun write(value: DynamicFieldName, buf: ByteBuffer) { + FfiConverterTypeTypeTag.write(value.`typeTag`, buf) + FfiConverterByteArray.write(value.`bcs`, buf) + FfiConverterOptionalTypeValue.write(value.`json`, buf) } +} + + + +/** + * The output of a dynamic field query, that includes the name, value, and + * value's json representation. + */ +data class DynamicFieldOutput ( + /** + * The name of the dynamic field + */ + var `name`: DynamicFieldName, + /** + * The dynamic field value typename and bcs + */ + var `value`: DynamicFieldValue?, + /** + * The json representation of the dynamic field value object + */ + var `valueAsJson`: Value? +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`name`, + this.`value`, + this.`valueAsJson` ) } - - override fun `sender`(): Address { - return FfiConverterTypeAddress.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transaction_sender( - it, _status) + companion object } + +/** + * @suppress + */ +public object FfiConverterTypeDynamicFieldOutput: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DynamicFieldOutput { + return DynamicFieldOutput( + FfiConverterTypeDynamicFieldName.read(buf), + FfiConverterOptionalTypeDynamicFieldValue.read(buf), + FfiConverterOptionalTypeValue.read(buf), + ) } + + override fun allocationSize(value: DynamicFieldOutput) = ( + FfiConverterTypeDynamicFieldName.allocationSize(value.`name`) + + FfiConverterOptionalTypeDynamicFieldValue.allocationSize(value.`value`) + + FfiConverterOptionalTypeValue.allocationSize(value.`valueAsJson`) ) + + override fun write(value: DynamicFieldOutput, buf: ByteBuffer) { + FfiConverterTypeDynamicFieldName.write(value.`name`, buf) + FfiConverterOptionalTypeDynamicFieldValue.write(value.`value`, buf) + FfiConverterOptionalTypeValue.write(value.`valueAsJson`, buf) } - +} + - +/** + * A page of items returned by the GraphQL server. + */ +data class DynamicFieldOutputPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTransaction: FfiConverter { - - override fun lower(value: Transaction): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): Transaction { - return Transaction(value) - } - - override fun read(buf: ByteBuffer): Transaction { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +public object FfiConverterTypeDynamicFieldOutputPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DynamicFieldOutputPage { + return DynamicFieldOutputPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeDynamicFieldOutput.read(buf), + ) } - override fun allocationSize(value: Transaction) = 8UL + override fun allocationSize(value: DynamicFieldOutputPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeDynamicFieldOutput.allocationSize(value.`data`) + ) - override fun write(value: Transaction, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) + override fun write(value: DynamicFieldOutputPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeDynamicFieldOutput.write(value.`data`, buf) } } -// 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 TransactionDataEffectsInterface { - - fun `effects`(): TransactionEffects +/** + * The value part of a dynamic field. + */ +data class DynamicFieldValue ( + var `typeTag`: TypeTag, + var `bcs`: kotlin.ByteArray +) : Disposable { - fun `tx`(): SignedTransaction + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`typeTag`, + this.`bcs` + ) + } companion object } -open class TransactionDataEffects: Disposable, AutoCloseable, TransactionDataEffectsInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) +/** + * @suppress + */ +public object FfiConverterTypeDynamicFieldValue: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DynamicFieldValue { + return DynamicFieldValue( + FfiConverterTypeTypeTag.read(buf), + FfiConverterByteArray.read(buf), + ) } - /** - * 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)) + override fun allocationSize(value: DynamicFieldValue) = ( + FfiConverterTypeTypeTag.allocationSize(value.`typeTag`) + + FfiConverterByteArray.allocationSize(value.`bcs`) + ) + + override fun write(value: DynamicFieldValue, buf: ByteBuffer) { + FfiConverterTypeTypeTag.write(value.`typeTag`, buf) + FfiConverterByteArray.write(value.`bcs`, buf) } - constructor(`tx`: SignedTransaction, `effects`: TransactionEffects) : - this( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactiondataeffects_new( - FfiConverterTypeSignedTransaction.lower(`tx`),FfiConverterTypeTransactionEffects.lower(`effects`),_status) } - ) - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) +data class EndOfEpochData ( + var `nextEpochCommittee`: List, + var `nextEpochProtocolVersion`: kotlin.ULong, + var `epochCommitments`: List, + var `epochSupplyChange`: kotlin.Long +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here 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() - } - } + + Disposable.destroy( + this.`nextEpochCommittee`, + this.`nextEpochProtocolVersion`, + this.`epochCommitments`, + this.`epochSupplyChange` + ) } + + companion object +} - // 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_transactiondataeffects(ptr, status) - } - } - } +/** + * @suppress + */ +public object FfiConverterTypeEndOfEpochData: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): EndOfEpochData { + return EndOfEpochData( + FfiConverterSequenceTypeValidatorCommitteeMember.read(buf), + FfiConverterULong.read(buf), + FfiConverterSequenceTypeCheckpointCommitment.read(buf), + FfiConverterLong.read(buf), + ) } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactiondataeffects(pointer!!, status) - } - } + override fun allocationSize(value: EndOfEpochData) = ( + FfiConverterSequenceTypeValidatorCommitteeMember.allocationSize(value.`nextEpochCommittee`) + + FfiConverterULong.allocationSize(value.`nextEpochProtocolVersion`) + + FfiConverterSequenceTypeCheckpointCommitment.allocationSize(value.`epochCommitments`) + + FfiConverterLong.allocationSize(value.`epochSupplyChange`) + ) - override fun `effects`(): TransactionEffects { - return FfiConverterTypeTransactionEffects.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_effects( - it, _status) -} + override fun write(value: EndOfEpochData, buf: ByteBuffer) { + FfiConverterSequenceTypeValidatorCommitteeMember.write(value.`nextEpochCommittee`, buf) + FfiConverterULong.write(value.`nextEpochProtocolVersion`, buf) + FfiConverterSequenceTypeCheckpointCommitment.write(value.`epochCommitments`, buf) + FfiConverterLong.write(value.`epochSupplyChange`, buf) } +} + + + +/** + * A page of items returned by the GraphQL server. + */ +data class EpochPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` ) } - - override fun `tx`(): SignedTransaction { - return FfiConverterTypeSignedTransaction.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactiondataeffects_tx( - it, _status) + companion object } + +/** + * @suppress + */ +public object FfiConverterTypeEpochPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): EpochPage { + return EpochPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeEpoch.read(buf), + ) } + + override fun allocationSize(value: EpochPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeEpoch.allocationSize(value.`data`) ) + + override fun write(value: EpochPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeEpoch.write(value.`data`, buf) } - +} + - +/** + * An event + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * event = object-id identifier address struct-tag bytes + * ``` + */ +data class Event ( + /** + * Package id of the top-level function invoked by a MoveCall command which + * triggered this event to be emitted. + */ + var `packageId`: ObjectId, + /** + * Module name of the top-level function invoked by a MoveCall command + * which triggered this event to be emitted. + */ + var `module`: kotlin.String, + /** + * Address of the account that sent the transaction where this event was + * emitted. + */ + var `sender`: Address, + /** + * The type of the event emitted + */ + var `type`: kotlin.String, + /** + * BCS serialized bytes of the event + */ + var `contents`: kotlin.ByteArray +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`packageId`, + this.`module`, + this.`sender`, + this.`type`, + this.`contents` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTransactionDataEffects: FfiConverter { - - override fun lower(value: TransactionDataEffects): Pointer { - return value.uniffiClonePointer() +public object FfiConverterTypeEvent: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Event { + return Event( + FfiConverterTypeObjectId.read(buf), + FfiConverterString.read(buf), + FfiConverterTypeAddress.read(buf), + FfiConverterString.read(buf), + FfiConverterByteArray.read(buf), + ) } - override fun lift(value: Pointer): TransactionDataEffects { - return TransactionDataEffects(value) - } + override fun allocationSize(value: Event) = ( + FfiConverterTypeObjectId.allocationSize(value.`packageId`) + + FfiConverterString.allocationSize(value.`module`) + + FfiConverterTypeAddress.allocationSize(value.`sender`) + + FfiConverterString.allocationSize(value.`type`) + + FfiConverterByteArray.allocationSize(value.`contents`) + ) - override fun read(buf: ByteBuffer): TransactionDataEffects { - // 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 write(value: Event, buf: ByteBuffer) { + FfiConverterTypeObjectId.write(value.`packageId`, buf) + FfiConverterString.write(value.`module`, buf) + FfiConverterTypeAddress.write(value.`sender`, buf) + FfiConverterString.write(value.`type`, buf) + FfiConverterByteArray.write(value.`contents`, buf) } +} - override fun allocationSize(value: TransactionDataEffects) = 8UL - override fun write(value: TransactionDataEffects, 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))) + +data class EventFilter ( + var `emittingModule`: kotlin.String? = null, + var `eventType`: kotlin.String? = null, + var `sender`: Address? = null, + var `transactionDigest`: kotlin.String? = null +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`emittingModule`, + this.`eventType`, + this.`sender`, + this.`transactionDigest` + ) } + + companion object } +/** + * @suppress + */ +public object FfiConverterTypeEventFilter: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): EventFilter { + return EventFilter( + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalTypeAddress.read(buf), + FfiConverterOptionalString.read(buf), + ) + } -// 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 -// + override fun allocationSize(value: EventFilter) = ( + FfiConverterOptionalString.allocationSize(value.`emittingModule`) + + FfiConverterOptionalString.allocationSize(value.`eventType`) + + FfiConverterOptionalTypeAddress.allocationSize(value.`sender`) + + FfiConverterOptionalString.allocationSize(value.`transactionDigest`) + ) + + override fun write(value: EventFilter, buf: ByteBuffer) { + FfiConverterOptionalString.write(value.`emittingModule`, buf) + FfiConverterOptionalString.write(value.`eventType`, buf) + FfiConverterOptionalTypeAddress.write(value.`sender`, buf) + FfiConverterOptionalString.write(value.`transactionDigest`, buf) + } +} -public interface TransactionDigestInterface { + +/** + * A page of items returned by the GraphQL server. + */ +data class EventPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) + } companion object } -open class TransactionDigest: Disposable, AutoCloseable, TransactionDigestInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) +/** + * @suppress + */ +public object FfiConverterTypeEventPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): EventPage { + return EventPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeEvent.read(buf), + ) } - /** - * 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)) + override fun allocationSize(value: EventPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeEvent.allocationSize(value.`data`) + ) + + override fun write(value: EventPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeEvent.write(value.`data`, buf) } +} - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) +data class GqlAddress ( + var `address`: Address +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here 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() - } - } + + Disposable.destroy( + this.`address` + ) } + + companion object +} - @Synchronized - override fun close() { - this.destroy() +/** + * @suppress + */ +public object FfiConverterTypeGQLAddress: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): GqlAddress { + return GqlAddress( + FfiConverterTypeAddress.read(buf), + ) } - 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() - } - } + override fun allocationSize(value: GqlAddress) = ( + FfiConverterTypeAddress.allocationSize(value.`address`) + ) + + override fun write(value: GqlAddress, buf: ByteBuffer) { + FfiConverterTypeAddress.write(value.`address`, buf) } +} - // 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_transactiondigest(ptr, status) - } - } - } + + +data class GasCostSummary ( + var `computationCost`: kotlin.ULong, + var `computationCostBurned`: kotlin.ULong, + var `storageCost`: kotlin.ULong, + var `storageRebate`: kotlin.ULong, + var `nonRefundableStorageFee`: kotlin.ULong +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeGasCostSummary: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): GasCostSummary { + return GasCostSummary( + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + ) } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactiondigest(pointer!!, status) - } + override fun allocationSize(value: GasCostSummary) = ( + FfiConverterULong.allocationSize(value.`computationCost`) + + FfiConverterULong.allocationSize(value.`computationCostBurned`) + + FfiConverterULong.allocationSize(value.`storageCost`) + + FfiConverterULong.allocationSize(value.`storageRebate`) + + FfiConverterULong.allocationSize(value.`nonRefundableStorageFee`) + ) + + override fun write(value: GasCostSummary, buf: ByteBuffer) { + FfiConverterULong.write(value.`computationCost`, buf) + FfiConverterULong.write(value.`computationCostBurned`, buf) + FfiConverterULong.write(value.`storageCost`, buf) + FfiConverterULong.write(value.`storageRebate`, buf) + FfiConverterULong.write(value.`nonRefundableStorageFee`, buf) } +} + + +/** + * Payment information for executing a transaction + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * gas-payment = (vector object-ref) ; gas coin objects + * address ; owner + * u64 ; price + * u64 ; budget + * ``` + */ +data class GasPayment ( + var `objects`: List, + var `owner`: Address, + var `price`: kotlin.ULong, + var `budget`: kotlin.ULong +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`objects`, + this.`owner`, + this.`price`, + this.`budget` + ) + } + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeGasPayment: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): GasPayment { + return GasPayment( + FfiConverterSequenceTypeObjectReference.read(buf), + FfiConverterTypeAddress.read(buf), + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + ) + } + override fun allocationSize(value: GasPayment) = ( + FfiConverterSequenceTypeObjectReference.allocationSize(value.`objects`) + + FfiConverterTypeAddress.allocationSize(value.`owner`) + + FfiConverterULong.allocationSize(value.`price`) + + FfiConverterULong.allocationSize(value.`budget`) + ) + + override fun write(value: GasPayment, buf: ByteBuffer) { + FfiConverterSequenceTypeObjectReference.write(value.`objects`, buf) + FfiConverterTypeAddress.write(value.`owner`, buf) + FfiConverterULong.write(value.`price`, buf) + FfiConverterULong.write(value.`budget`, buf) + } +} + + + +/** + * Location in move bytecode where an error occurred + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * move-location = object-id identifier u16 u16 (option identifier) + * ``` + */ +data class MoveLocation ( + /** + * The package id + */ + var `package`: ObjectId, + /** + * The module name + */ + var `module`: kotlin.String, + /** + * The function index + */ + var `function`: kotlin.UShort, + /** + * Index into the code stream for a jump. The offset is relative to the + * beginning of the instruction stream. + */ + var `instruction`: kotlin.UShort, + /** + * The name of the function if available + */ + var `functionName`: kotlin.String? +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`package`, + this.`module`, + this.`function`, + this.`instruction`, + this.`functionName` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTransactionDigest: FfiConverter { - - override fun lower(value: TransactionDigest): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): TransactionDigest { - return TransactionDigest(value) - } - - override fun read(buf: ByteBuffer): TransactionDigest { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +public object FfiConverterTypeMoveLocation: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MoveLocation { + return MoveLocation( + FfiConverterTypeObjectId.read(buf), + FfiConverterString.read(buf), + FfiConverterUShort.read(buf), + FfiConverterUShort.read(buf), + FfiConverterOptionalString.read(buf), + ) } - override fun allocationSize(value: TransactionDigest) = 8UL + override fun allocationSize(value: MoveLocation) = ( + FfiConverterTypeObjectId.allocationSize(value.`package`) + + FfiConverterString.allocationSize(value.`module`) + + FfiConverterUShort.allocationSize(value.`function`) + + FfiConverterUShort.allocationSize(value.`instruction`) + + FfiConverterOptionalString.allocationSize(value.`functionName`) + ) - override fun write(value: TransactionDigest, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) + override fun write(value: MoveLocation, buf: ByteBuffer) { + FfiConverterTypeObjectId.write(value.`package`, buf) + FfiConverterString.write(value.`module`, buf) + FfiConverterUShort.write(value.`function`, buf) + FfiConverterUShort.write(value.`instruction`, buf) + FfiConverterOptionalString.write(value.`functionName`, buf) } } -// This template implements a class for working with a Rust struct via a Pointer/Arc -// to the live Rust struct on the other side of the FFI. -// -// Each instance implements core operations for working with the Rust `Arc` and the -// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. -// -// There's some subtlety here, because we have to be careful not to operate on a Rust -// struct after it has been dropped, and because we must expose a public API for freeing -// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: -// -// * Each instance holds an opaque pointer to the underlying Rust struct. -// Method calls need to read this pointer from the object's state and pass it in to -// the Rust FFI. -// -// * When an instance is no longer needed, its pointer should be passed to a -// special destructor function provided by the Rust FFI, which will drop the -// underlying Rust struct. -// -// * Given an instance, calling code is expected to call the special -// `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so risks -// leaking the underlying Rust struct. -// -// * We can't assume that calling code will do the right thing, and must be prepared -// to handle Kotlin method calls executing concurrently with or even after a call to -// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. -// -// * We must never allow Rust code to operate on the underlying Rust struct after -// the destructor has been called, and must never call the destructor more than once. -// Doing so may trigger memory unsafety. -// -// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` -// is implemented to call the destructor when the Kotlin object becomes unreachable. -// This is done in a background thread. This is not a panacea, and client code should be aware that -// 1. the thread may starve if some there are objects that have poorly performing -// `drop` methods or do significant work in their `drop` methods. -// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, -// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). -// -// If we try to implement this with mutual exclusion on access to the pointer, there is the -// possibility of a race between a method call and a concurrent call to `destroy`: -// -// * Thread A starts a method call, reads the value of the pointer, but is interrupted -// before it can pass the pointer over the FFI to Rust. -// * Thread B calls `destroy` and frees the underlying Rust struct. -// * Thread A resumes, passing the already-read pointer value to Rust and triggering -// a use-after-free. -// -// One possible solution would be to use a `ReadWriteLock`, with each method call taking -// a read lock (and thus allowed to run concurrently) and the special `destroy` method -// taking a write lock (and thus blocking on live method calls). However, we aim not to -// generate methods with any hidden blocking semantics, and a `destroy` method that might -// block if called incorrectly seems to meet that bar. -// -// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track -// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` -// has been called. These are updated according to the following rules: -// -// * The initial value of the counter is 1, indicating a live object with no in-flight calls. -// The initial value for the flag is false. -// -// * At the start of each method call, we atomically check the counter. -// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. -// If it is nonzero them we atomically increment it by 1 and proceed with the method call. -// -// * At the end of each method call, we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// * When `destroy` is called, we atomically flip the flag from false to true. -// If the flag was already true we silently fail. -// Otherwise we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, -// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. -// -// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been -// called *and* all in-flight method calls have completed, avoiding violating any of the expectations -// of the underlying Rust code. -// -// This makes a cleaner a better alternative to _not_ calling `destroy()` as -// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` -// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner -// thread may be starved, and the app will leak memory. -// -// In this case, `destroy`ing manually may be a better solution. -// -// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects -// with Rust peers are reclaimed: -// -// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: -// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: -// 3. The memory is reclaimed when the process terminates. -// -// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 -// - -public interface TransactionEffectsInterface { +data class MoveObject ( + var `bcs`: kotlin.String? = null +) { companion object } -open class TransactionEffects: Disposable, AutoCloseable, TransactionEffectsInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) +/** + * @suppress + */ +public object FfiConverterTypeMoveObject: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MoveObject { + return MoveObject( + FfiConverterOptionalString.read(buf), + ) } - /** - * 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)) + override fun allocationSize(value: MoveObject) = ( + FfiConverterOptionalString.allocationSize(value.`bcs`) + ) + + override fun write(value: MoveObject, buf: ByteBuffer) { + FfiConverterOptionalString.write(value.`bcs`, buf) } +} - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) +/** + * A page of items returned by the GraphQL server. + */ +data class MovePackagePage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here 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() - } - } + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) } + + companion object +} - @Synchronized - override fun close() { - this.destroy() +/** + * @suppress + */ +public object FfiConverterTypeMovePackagePage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MovePackagePage { + return MovePackagePage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeMovePackage.read(buf), + ) } - 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() - } - } - } + override fun allocationSize(value: MovePackagePage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeMovePackage.allocationSize(value.`data`) + ) - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneffects(ptr, status) - } - } - } + override fun write(value: MovePackagePage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeMovePackage.write(value.`data`, buf) } +} - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffects(pointer!!, status) - } - } - +/** + * A move struct + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * object-move-struct = compressed-struct-tag bool u64 object-contents + * + * compressed-struct-tag = other-struct-type / gas-coin-type / staked-iota-type / coin-type + * other-struct-type = %x00 struct-tag + * gas-coin-type = %x01 + * staked-iota-type = %x02 + * coin-type = %x03 type-tag + * + * ; first 32 bytes of the contents are the object's object-id + * object-contents = uleb128 (object-id *OCTET) ; length followed by contents + * ``` + */ +data class MoveStruct ( + /** + * The type of this object + */ + var `structType`: StructTag, + /** + * Number that increases each time a tx takes this object as a mutable + * input This is a lamport timestamp, not a sequentially increasing + * version + */ + var `version`: kotlin.ULong, + /** + * BCS bytes of a Move struct value + */ + var `contents`: kotlin.ByteArray +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`structType`, + this.`version`, + this.`contents` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTransactionEffects: FfiConverter { - - override fun lower(value: TransactionEffects): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): TransactionEffects { - return TransactionEffects(value) - } - - override fun read(buf: ByteBuffer): TransactionEffects { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +public object FfiConverterTypeMoveStruct: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MoveStruct { + return MoveStruct( + FfiConverterTypeStructTag.read(buf), + FfiConverterULong.read(buf), + FfiConverterByteArray.read(buf), + ) } - override fun allocationSize(value: TransactionEffects) = 8UL + override fun allocationSize(value: MoveStruct) = ( + FfiConverterTypeStructTag.allocationSize(value.`structType`) + + FfiConverterULong.allocationSize(value.`version`) + + FfiConverterByteArray.allocationSize(value.`contents`) + ) - override fun write(value: TransactionEffects, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) + override fun write(value: MoveStruct, buf: ByteBuffer) { + FfiConverterTypeStructTag.write(value.`structType`, buf) + FfiConverterULong.write(value.`version`, buf) + FfiConverterByteArray.write(value.`contents`, buf) } } -// This template implements a class for working with a Rust struct via a Pointer/Arc -// to the live Rust struct on the other side of the FFI. -// -// Each instance implements core operations for working with the Rust `Arc` and the -// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. -// -// There's some subtlety here, because we have to be careful not to operate on a Rust -// struct after it has been dropped, and because we must expose a public API for freeing -// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: -// -// * Each instance holds an opaque pointer to the underlying Rust struct. -// Method calls need to read this pointer from the object's state and pass it in to -// the Rust FFI. -// -// * When an instance is no longer needed, its pointer should be passed to a -// special destructor function provided by the Rust FFI, which will drop the -// underlying Rust struct. -// -// * Given an instance, calling code is expected to call the special -// `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so risks -// leaking the underlying Rust struct. -// -// * We can't assume that calling code will do the right thing, and must be prepared -// to handle Kotlin method calls executing concurrently with or even after a call to -// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. -// -// * We must never allow Rust code to operate on the underlying Rust struct after -// the destructor has been called, and must never call the destructor more than once. -// Doing so may trigger memory unsafety. -// -// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` -// is implemented to call the destructor when the Kotlin object becomes unreachable. -// This is done in a background thread. This is not a panacea, and client code should be aware that -// 1. the thread may starve if some there are objects that have poorly performing -// `drop` methods or do significant work in their `drop` methods. -// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, -// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). -// -// If we try to implement this with mutual exclusion on access to the pointer, there is the -// possibility of a race between a method call and a concurrent call to `destroy`: -// -// * Thread A starts a method call, reads the value of the pointer, but is interrupted -// before it can pass the pointer over the FFI to Rust. -// * Thread B calls `destroy` and frees the underlying Rust struct. -// * Thread A resumes, passing the already-read pointer value to Rust and triggering -// a use-after-free. -// -// One possible solution would be to use a `ReadWriteLock`, with each method call taking -// a read lock (and thus allowed to run concurrently) and the special `destroy` method -// taking a write lock (and thus blocking on live method calls). However, we aim not to -// generate methods with any hidden blocking semantics, and a `destroy` method that might -// block if called incorrectly seems to meet that bar. -// -// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track -// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` -// has been called. These are updated according to the following rules: -// -// * The initial value of the counter is 1, indicating a live object with no in-flight calls. -// The initial value for the flag is false. -// -// * At the start of each method call, we atomically check the counter. -// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. -// If it is nonzero them we atomically increment it by 1 and proceed with the method call. -// -// * At the end of each method call, we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// * When `destroy` is called, we atomically flip the flag from false to true. -// If the flag was already true we silently fail. -// Otherwise we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, -// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. -// -// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been -// called *and* all in-flight method calls have completed, avoiding violating any of the expectations -// of the underlying Rust code. -// -// This makes a cleaner a better alternative to _not_ calling `destroy()` as -// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` -// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner -// thread may be starved, and the app will leak memory. -// -// In this case, `destroy`ing manually may be a better solution. -// -// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects -// with Rust peers are reclaimed: -// -// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: -// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: -// 3. The memory is reclaimed when the process terminates. -// -// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 -// - -public interface TransactionEffectsDigestInterface { +data class ObjectFilter ( + var `typeTag`: kotlin.String?, + var `owner`: Address?, + var `objectIds`: List? +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`typeTag`, + this.`owner`, + this.`objectIds` + ) + } companion object } -open class TransactionEffectsDigest: Disposable, AutoCloseable, TransactionEffectsDigestInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - @Suppress("UNUSED_PARAMETER") - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) +/** + * @suppress + */ +public object FfiConverterTypeObjectFilter: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ObjectFilter { + return ObjectFilter( + FfiConverterOptionalString.read(buf), + FfiConverterOptionalTypeAddress.read(buf), + FfiConverterOptionalSequenceTypeObjectId.read(buf), + ) } - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) + override fun allocationSize(value: ObjectFilter) = ( + FfiConverterOptionalString.allocationSize(value.`typeTag`) + + FfiConverterOptionalTypeAddress.allocationSize(value.`owner`) + + FfiConverterOptionalSequenceTypeObjectId.allocationSize(value.`objectIds`) + ) - 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() - } - } + override fun write(value: ObjectFilter, buf: ByteBuffer) { + FfiConverterOptionalString.write(value.`typeTag`, buf) + FfiConverterOptionalTypeAddress.write(value.`owner`, buf) + FfiConverterOptionalSequenceTypeObjectId.write(value.`objectIds`, buf) } +} - @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() - } - } + +/** + * A page of items returned by the GraphQL server. + */ +data class ObjectPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) } + + companion object +} - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneffectsdigest(ptr, status) - } - } - } +/** + * @suppress + */ +public object FfiConverterTypeObjectPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ObjectPage { + return ObjectPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeObject.read(buf), + ) } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneffectsdigest(pointer!!, status) - } + override fun allocationSize(value: ObjectPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeObject.allocationSize(value.`data`) + ) + + override fun write(value: ObjectPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeObject.write(value.`data`, buf) } +} - + +data class ObjectRef ( + var `address`: ObjectId, + var `digest`: kotlin.String, + var `version`: kotlin.ULong +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`address`, + this.`digest`, + this.`version` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTransactionEffectsDigest: FfiConverter { +public object FfiConverterTypeObjectRef: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ObjectRef { + return ObjectRef( + FfiConverterTypeObjectId.read(buf), + FfiConverterString.read(buf), + FfiConverterULong.read(buf), + ) + } - override fun lower(value: TransactionEffectsDigest): Pointer { - return value.uniffiClonePointer() + override fun allocationSize(value: ObjectRef) = ( + FfiConverterTypeObjectId.allocationSize(value.`address`) + + FfiConverterString.allocationSize(value.`digest`) + + FfiConverterULong.allocationSize(value.`version`) + ) + + override fun write(value: ObjectRef, buf: ByteBuffer) { + FfiConverterTypeObjectId.write(value.`address`, buf) + FfiConverterString.write(value.`digest`, buf) + FfiConverterULong.write(value.`version`, buf) } +} - override fun lift(value: Pointer): TransactionEffectsDigest { - return TransactionEffectsDigest(value) + + +/** + * Reference to an object + * + * Contains sufficient information to uniquely identify a specific object. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * object-ref = object-id u64 digest + * ``` + */ +data class ObjectReference ( + var `objectId`: ObjectId, + var `version`: kotlin.ULong, + var `digest`: ObjectDigest +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`objectId`, + this.`version`, + this.`digest` + ) } + + companion object +} - override fun read(buf: ByteBuffer): TransactionEffectsDigest { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +/** + * @suppress + */ +public object FfiConverterTypeObjectReference: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ObjectReference { + return ObjectReference( + FfiConverterTypeObjectId.read(buf), + FfiConverterULong.read(buf), + FfiConverterTypeObjectDigest.read(buf), + ) } - override fun allocationSize(value: TransactionEffectsDigest) = 8UL + override fun allocationSize(value: ObjectReference) = ( + FfiConverterTypeObjectId.allocationSize(value.`objectId`) + + FfiConverterULong.allocationSize(value.`version`) + + FfiConverterTypeObjectDigest.allocationSize(value.`digest`) + ) - override fun write(value: TransactionEffectsDigest, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) + override fun write(value: ObjectReference, buf: ByteBuffer) { + FfiConverterTypeObjectId.write(value.`objectId`, buf) + FfiConverterULong.write(value.`version`, buf) + FfiConverterTypeObjectDigest.write(value.`digest`, buf) } } -// This template implements a class for working with a Rust struct via a Pointer/Arc -// to the live Rust struct on the other side of the FFI. -// -// Each instance implements core operations for working with the Rust `Arc` and the -// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. -// -// There's some subtlety here, because we have to be careful not to operate on a Rust -// struct after it has been dropped, and because we must expose a public API for freeing -// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: -// -// * Each instance holds an opaque pointer to the underlying Rust struct. -// Method calls need to read this pointer from the object's state and pass it in to -// the Rust FFI. -// -// * When an instance is no longer needed, its pointer should be passed to a -// special destructor function provided by the Rust FFI, which will drop the -// underlying Rust struct. -// -// * Given an instance, calling code is expected to call the special -// `destroy` method in order to free it after use, either by calling it explicitly -// or by using a higher-level helper like the `use` method. Failing to do so risks -// leaking the underlying Rust struct. -// -// * We can't assume that calling code will do the right thing, and must be prepared -// to handle Kotlin method calls executing concurrently with or even after a call to -// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. -// -// * We must never allow Rust code to operate on the underlying Rust struct after -// the destructor has been called, and must never call the destructor more than once. -// Doing so may trigger memory unsafety. -// -// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` -// is implemented to call the destructor when the Kotlin object becomes unreachable. -// This is done in a background thread. This is not a panacea, and client code should be aware that -// 1. the thread may starve if some there are objects that have poorly performing -// `drop` methods or do significant work in their `drop` methods. -// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, -// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). -// -// If we try to implement this with mutual exclusion on access to the pointer, there is the -// possibility of a race between a method call and a concurrent call to `destroy`: -// -// * Thread A starts a method call, reads the value of the pointer, but is interrupted -// before it can pass the pointer over the FFI to Rust. -// * Thread B calls `destroy` and frees the underlying Rust struct. -// * Thread A resumes, passing the already-read pointer value to Rust and triggering -// a use-after-free. -// -// One possible solution would be to use a `ReadWriteLock`, with each method call taking -// a read lock (and thus allowed to run concurrently) and the special `destroy` method -// taking a write lock (and thus blocking on live method calls). However, we aim not to -// generate methods with any hidden blocking semantics, and a `destroy` method that might -// block if called incorrectly seems to meet that bar. -// -// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track -// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` -// has been called. These are updated according to the following rules: -// -// * The initial value of the counter is 1, indicating a live object with no in-flight calls. -// The initial value for the flag is false. -// -// * At the start of each method call, we atomically check the counter. -// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. -// If it is nonzero them we atomically increment it by 1 and proceed with the method call. -// -// * At the end of each method call, we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// * When `destroy` is called, we atomically flip the flag from false to true. -// If the flag was already true we silently fail. -// Otherwise we atomically decrement and check the counter. -// If it has reached zero then we destroy the underlying Rust struct. -// -// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, -// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. -// -// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been -// called *and* all in-flight method calls have completed, avoiding violating any of the expectations -// of the underlying Rust code. -// -// This makes a cleaner a better alternative to _not_ calling `destroy()` as -// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` -// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner -// thread may be starved, and the app will leak memory. -// -// In this case, `destroy`ing manually may be a better solution. -// -// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects -// with Rust peers are reclaimed: -// -// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: -// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: -// 3. The memory is reclaimed when the process terminates. -// -// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 -// - -public interface TransactionEventsDigestInterface { +/** + * Information about pagination in a connection. + */ +data class PageInfo ( + /** + * When paginating backwards, are there more items? + */ + var `hasPreviousPage`: kotlin.Boolean, + /** + * Are there more items when paginating forwards? + */ + var `hasNextPage`: kotlin.Boolean, + /** + * When paginating backwards, the cursor to continue. + */ + var `startCursor`: kotlin.String? = null, + /** + * When paginating forwards, the cursor to continue. + */ + var `endCursor`: kotlin.String? = null +) { companion object } -open class TransactionEventsDigest: Disposable, AutoCloseable, TransactionEventsDigestInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) +/** + * @suppress + */ +public object FfiConverterTypePageInfo: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): PageInfo { + return PageInfo( + FfiConverterBoolean.read(buf), + FfiConverterBoolean.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + ) } - /** - * 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)) + override fun allocationSize(value: PageInfo) = ( + FfiConverterBoolean.allocationSize(value.`hasPreviousPage`) + + FfiConverterBoolean.allocationSize(value.`hasNextPage`) + + FfiConverterOptionalString.allocationSize(value.`startCursor`) + + FfiConverterOptionalString.allocationSize(value.`endCursor`) + ) + + override fun write(value: PageInfo, buf: ByteBuffer) { + FfiConverterBoolean.write(value.`hasPreviousPage`, buf) + FfiConverterBoolean.write(value.`hasNextPage`, buf) + FfiConverterOptionalString.write(value.`startCursor`, buf) + FfiConverterOptionalString.write(value.`endCursor`, buf) } +} - 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() - } - } - } +/** + * Pagination options for querying the GraphQL server. It defaults to forward + * pagination with the GraphQL server's max page size. + */ +data class PaginationFilter ( + var `direction`: Direction, + var `cursor`: kotlin.String? = null, + /** + * The maximum number of items to return. If this is omitted, it will + * lazily query the service configuration for the max page size. + */ + var `limit`: kotlin.Int? = null +) { + + companion object +} - @Synchronized - override fun close() { - this.destroy() +/** + * @suppress + */ +public object FfiConverterTypePaginationFilter: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): PaginationFilter { + return PaginationFilter( + FfiConverterTypeDirection.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalInt.read(buf), + ) } - 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() - } - } - } + override fun allocationSize(value: PaginationFilter) = ( + FfiConverterTypeDirection.allocationSize(value.`direction`) + + FfiConverterOptionalString.allocationSize(value.`cursor`) + + FfiConverterOptionalInt.allocationSize(value.`limit`) + ) - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactioneventsdigest(ptr, status) - } - } - } + override fun write(value: PaginationFilter, buf: ByteBuffer) { + FfiConverterTypeDirection.write(value.`direction`, buf) + FfiConverterOptionalString.write(value.`cursor`, buf) + FfiConverterOptionalInt.write(value.`limit`, buf) } +} - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactioneventsdigest(pointer!!, status) - } - } - +data class SignedTransaction ( + var `transaction`: Transaction, + var `signatures`: List +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`transaction`, + this.`signatures` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTransactionEventsDigest: FfiConverter { - - override fun lower(value: TransactionEventsDigest): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): TransactionEventsDigest { - return TransactionEventsDigest(value) - } - - override fun read(buf: ByteBuffer): TransactionEventsDigest { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +public object FfiConverterTypeSignedTransaction: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): SignedTransaction { + return SignedTransaction( + FfiConverterTypeTransaction.read(buf), + FfiConverterSequenceTypeUserSignature.read(buf), + ) } - override fun allocationSize(value: TransactionEventsDigest) = 8UL + override fun allocationSize(value: SignedTransaction) = ( + FfiConverterTypeTransaction.allocationSize(value.`transaction`) + + FfiConverterSequenceTypeUserSignature.allocationSize(value.`signatures`) + ) - override fun write(value: TransactionEventsDigest, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) + override fun write(value: SignedTransaction, buf: ByteBuffer) { + FfiConverterTypeTransaction.write(value.`transaction`, buf) + FfiConverterSequenceTypeUserSignature.write(value.`signatures`, buf) } } -// 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 page of items returned by the GraphQL server. + */ +data class SignedTransactionPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) + } + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeSignedTransactionPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): SignedTransactionPage { + return SignedTransactionPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeSignedTransaction.read(buf), + ) + } + + override fun allocationSize(value: SignedTransactionPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeSignedTransaction.allocationSize(value.`data`) + ) + + override fun write(value: SignedTransactionPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeSignedTransaction.write(value.`data`, buf) + } +} + -public interface TransactionExpirationInterface { +data class TransactionDataEffects ( + var `tx`: SignedTransaction, + var `effects`: TransactionEffects +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`tx`, + this.`effects` + ) + } companion object } -open class TransactionExpiration: Disposable, AutoCloseable, TransactionExpirationInterface -{ +/** + * @suppress + */ +public object FfiConverterTypeTransactionDataEffects: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionDataEffects { + return TransactionDataEffects( + FfiConverterTypeSignedTransaction.read(buf), + FfiConverterTypeTransactionEffects.read(buf), + ) + } - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + override fun allocationSize(value: TransactionDataEffects) = ( + FfiConverterTypeSignedTransaction.allocationSize(value.`tx`) + + FfiConverterTypeTransactionEffects.allocationSize(value.`effects`) + ) + + override fun write(value: TransactionDataEffects, buf: ByteBuffer) { + FfiConverterTypeSignedTransaction.write(value.`tx`, buf) + FfiConverterTypeTransactionEffects.write(value.`effects`, buf) } +} + + +/** + * A page of items returned by the GraphQL server. + */ +data class TransactionDataEffectsPage ( /** - * 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. + * Information about the page, such as the cursor and whether there are + * more pages. */ - @Suppress("UNUSED_PARAMETER") - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) } + + companion object +} - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable +/** + * @suppress + */ +public object FfiConverterTypeTransactionDataEffectsPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionDataEffectsPage { + return TransactionDataEffectsPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeTransactionDataEffects.read(buf), + ) + } - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) + override fun allocationSize(value: TransactionDataEffectsPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeTransactionDataEffects.allocationSize(value.`data`) + ) + + override fun write(value: TransactionDataEffectsPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeTransactionDataEffects.write(value.`data`, buf) + } +} + + +/** + * A page of items returned by the GraphQL server. + */ +data class TransactionEffectsPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here 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() - } - } + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) } + + companion object +} - @Synchronized - override fun close() { - this.destroy() +/** + * @suppress + */ +public object FfiConverterTypeTransactionEffectsPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionEffectsPage { + return TransactionEffectsPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeTransactionEffects.read(buf), + ) } - 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() - } - } + override fun allocationSize(value: TransactionEffectsPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeTransactionEffects.allocationSize(value.`data`) + ) + + override fun write(value: TransactionEffectsPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeTransactionEffects.write(value.`data`, buf) } +} - // 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_transactionexpiration(ptr, status) - } - } - } + + +/** + * Version 1 of TransactionEffects + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * effects-v1 = execution-status + * u64 ; epoch + * gas-cost-summary + * digest ; transaction digest + * (option u32) ; gas object index + * (option digest) ; events digest + * (vector digest) ; list of transaction dependencies + * u64 ; lamport version + * (vector changed-object) + * (vector unchanged-shared-object) + * (option digest) ; auxiliary data digest + * ``` + */ +data class TransactionEffectsV1 ( + /** + * The status of the execution + */ + var `status`: ExecutionStatus, + /** + * The epoch when this transaction was executed. + */ + var `epoch`: kotlin.ULong, + /** + * The gas used by this transaction + */ + var `gasUsed`: GasCostSummary, + /** + * The transaction digest + */ + var `transactionDigest`: TransactionDigest, + /** + * The updated gas object reference, as an index into the `changed_objects` + * vector. Having a dedicated field for convenient access. + * System transaction that don't require gas will leave this as None. + */ + var `gasObjectIndex`: kotlin.UInt?, + /** + * The digest of the events emitted during execution, + * can be None if the transaction does not emit any event. + */ + var `eventsDigest`: TransactionEventsDigest?, + /** + * The set of transaction digests this transaction depends on. + */ + var `dependencies`: List, + /** + * The version number of all the written Move objects by this transaction. + */ + var `lamportVersion`: kotlin.ULong, + /** + * Objects whose state are changed in the object store. + */ + var `changedObjects`: List, + /** + * Shared objects that are not mutated in this transaction. Unlike owned + * objects, read-only shared objects' version are not committed in the + * transaction, and in order for a node to catch up and execute it + * without consensus sequencing, the version needs to be committed in + * the effects. + */ + var `unchangedSharedObjects`: List, + /** + * Auxiliary data that are not protocol-critical, generated as part of the + * effects but are stored separately. Storing it separately allows us + * to avoid bloating the effects with data that are not critical. + * It also provides more flexibility on the format and type of the data. + */ + var `auxiliaryDataDigest`: EffectsAuxiliaryDataDigest? +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`status`, + this.`epoch`, + this.`gasUsed`, + this.`transactionDigest`, + this.`gasObjectIndex`, + this.`eventsDigest`, + this.`dependencies`, + this.`lamportVersion`, + this.`changedObjects`, + this.`unchangedSharedObjects`, + this.`auxiliaryDataDigest` + ) } + + companion object +} - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactionexpiration(pointer!!, status) - } +/** + * @suppress + */ +public object FfiConverterTypeTransactionEffectsV1: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionEffectsV1 { + return TransactionEffectsV1( + FfiConverterTypeExecutionStatus.read(buf), + FfiConverterULong.read(buf), + FfiConverterTypeGasCostSummary.read(buf), + FfiConverterTypeTransactionDigest.read(buf), + FfiConverterOptionalUInt.read(buf), + FfiConverterOptionalTypeTransactionEventsDigest.read(buf), + FfiConverterSequenceTypeTransactionDigest.read(buf), + FfiConverterULong.read(buf), + FfiConverterSequenceTypeChangedObject.read(buf), + FfiConverterSequenceTypeUnchangedSharedObject.read(buf), + FfiConverterOptionalTypeEffectsAuxiliaryDataDigest.read(buf), + ) } - + override fun allocationSize(value: TransactionEffectsV1) = ( + FfiConverterTypeExecutionStatus.allocationSize(value.`status`) + + FfiConverterULong.allocationSize(value.`epoch`) + + FfiConverterTypeGasCostSummary.allocationSize(value.`gasUsed`) + + FfiConverterTypeTransactionDigest.allocationSize(value.`transactionDigest`) + + FfiConverterOptionalUInt.allocationSize(value.`gasObjectIndex`) + + FfiConverterOptionalTypeTransactionEventsDigest.allocationSize(value.`eventsDigest`) + + FfiConverterSequenceTypeTransactionDigest.allocationSize(value.`dependencies`) + + FfiConverterULong.allocationSize(value.`lamportVersion`) + + FfiConverterSequenceTypeChangedObject.allocationSize(value.`changedObjects`) + + FfiConverterSequenceTypeUnchangedSharedObject.allocationSize(value.`unchangedSharedObjects`) + + FfiConverterOptionalTypeEffectsAuxiliaryDataDigest.allocationSize(value.`auxiliaryDataDigest`) + ) + + override fun write(value: TransactionEffectsV1, buf: ByteBuffer) { + FfiConverterTypeExecutionStatus.write(value.`status`, buf) + FfiConverterULong.write(value.`epoch`, buf) + FfiConverterTypeGasCostSummary.write(value.`gasUsed`, buf) + FfiConverterTypeTransactionDigest.write(value.`transactionDigest`, buf) + FfiConverterOptionalUInt.write(value.`gasObjectIndex`, buf) + FfiConverterOptionalTypeTransactionEventsDigest.write(value.`eventsDigest`, buf) + FfiConverterSequenceTypeTransactionDigest.write(value.`dependencies`, buf) + FfiConverterULong.write(value.`lamportVersion`, buf) + FfiConverterSequenceTypeChangedObject.write(value.`changedObjects`, buf) + FfiConverterSequenceTypeUnchangedSharedObject.write(value.`unchangedSharedObjects`, buf) + FfiConverterOptionalTypeEffectsAuxiliaryDataDigest.write(value.`auxiliaryDataDigest`, buf) + } +} + + +data class TransactionMetadata ( + var `gasBudget`: kotlin.ULong? = null, + var `gasObjects`: List? = null, + var `gasPrice`: kotlin.ULong? = null, + var `gasSponsor`: Address? = null, + var `sender`: Address? = null +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`gasBudget`, + this.`gasObjects`, + this.`gasPrice`, + this.`gasSponsor`, + this.`sender` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTransactionExpiration: FfiConverter { +public object FfiConverterTypeTransactionMetadata: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionMetadata { + return TransactionMetadata( + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalSequenceTypeObjectRef.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalTypeAddress.read(buf), + FfiConverterOptionalTypeAddress.read(buf), + ) + } - override fun lower(value: TransactionExpiration): Pointer { - return value.uniffiClonePointer() + override fun allocationSize(value: TransactionMetadata) = ( + FfiConverterOptionalULong.allocationSize(value.`gasBudget`) + + FfiConverterOptionalSequenceTypeObjectRef.allocationSize(value.`gasObjects`) + + FfiConverterOptionalULong.allocationSize(value.`gasPrice`) + + FfiConverterOptionalTypeAddress.allocationSize(value.`gasSponsor`) + + FfiConverterOptionalTypeAddress.allocationSize(value.`sender`) + ) + + override fun write(value: TransactionMetadata, buf: ByteBuffer) { + FfiConverterOptionalULong.write(value.`gasBudget`, buf) + FfiConverterOptionalSequenceTypeObjectRef.write(value.`gasObjects`, buf) + FfiConverterOptionalULong.write(value.`gasPrice`, buf) + FfiConverterOptionalTypeAddress.write(value.`gasSponsor`, buf) + FfiConverterOptionalTypeAddress.write(value.`sender`, buf) } +} + + - override fun lift(value: Pointer): TransactionExpiration { - return TransactionExpiration(value) +data class TransactionsFilter ( + var `function`: kotlin.String? = null, + var `kind`: TransactionBlockKindInput? = null, + var `afterCheckpoint`: kotlin.ULong? = null, + var `atCheckpoint`: kotlin.ULong? = null, + var `beforeCheckpoint`: kotlin.ULong? = null, + var `signAddress`: Address? = null, + var `recvAddress`: Address? = null, + var `inputObject`: ObjectId? = null, + var `changedObject`: ObjectId? = null, + var `transactionIds`: List? = null, + var `wrappedOrDeletedObject`: ObjectId? = null +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`function`, + this.`kind`, + this.`afterCheckpoint`, + this.`atCheckpoint`, + this.`beforeCheckpoint`, + this.`signAddress`, + this.`recvAddress`, + this.`inputObject`, + this.`changedObject`, + this.`transactionIds`, + this.`wrappedOrDeletedObject` + ) } + + companion object +} - override fun read(buf: ByteBuffer): TransactionExpiration { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +/** + * @suppress + */ +public object FfiConverterTypeTransactionsFilter: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionsFilter { + return TransactionsFilter( + FfiConverterOptionalString.read(buf), + FfiConverterOptionalTypeTransactionBlockKindInput.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalTypeAddress.read(buf), + FfiConverterOptionalTypeAddress.read(buf), + FfiConverterOptionalTypeObjectId.read(buf), + FfiConverterOptionalTypeObjectId.read(buf), + FfiConverterOptionalSequenceString.read(buf), + FfiConverterOptionalTypeObjectId.read(buf), + ) } - override fun allocationSize(value: TransactionExpiration) = 8UL + override fun allocationSize(value: TransactionsFilter) = ( + FfiConverterOptionalString.allocationSize(value.`function`) + + FfiConverterOptionalTypeTransactionBlockKindInput.allocationSize(value.`kind`) + + FfiConverterOptionalULong.allocationSize(value.`afterCheckpoint`) + + FfiConverterOptionalULong.allocationSize(value.`atCheckpoint`) + + FfiConverterOptionalULong.allocationSize(value.`beforeCheckpoint`) + + FfiConverterOptionalTypeAddress.allocationSize(value.`signAddress`) + + FfiConverterOptionalTypeAddress.allocationSize(value.`recvAddress`) + + FfiConverterOptionalTypeObjectId.allocationSize(value.`inputObject`) + + FfiConverterOptionalTypeObjectId.allocationSize(value.`changedObject`) + + FfiConverterOptionalSequenceString.allocationSize(value.`transactionIds`) + + FfiConverterOptionalTypeObjectId.allocationSize(value.`wrappedOrDeletedObject`) + ) - override fun write(value: TransactionExpiration, 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))) + override fun write(value: TransactionsFilter, buf: ByteBuffer) { + FfiConverterOptionalString.write(value.`function`, buf) + FfiConverterOptionalTypeTransactionBlockKindInput.write(value.`kind`, buf) + FfiConverterOptionalULong.write(value.`afterCheckpoint`, buf) + FfiConverterOptionalULong.write(value.`atCheckpoint`, buf) + FfiConverterOptionalULong.write(value.`beforeCheckpoint`, buf) + FfiConverterOptionalTypeAddress.write(value.`signAddress`, buf) + FfiConverterOptionalTypeAddress.write(value.`recvAddress`, buf) + FfiConverterOptionalTypeObjectId.write(value.`inputObject`, buf) + FfiConverterOptionalTypeObjectId.write(value.`changedObject`, buf) + FfiConverterOptionalSequenceString.write(value.`transactionIds`, buf) + FfiConverterOptionalTypeObjectId.write(value.`wrappedOrDeletedObject`, buf) } } -// 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 + * Identifies a struct and the module it was defined in * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * transaction-kind = %x00 ptb - * =/ %x01 change-epoch - * =/ %x02 genesis-transaction - * =/ %x03 consensus-commit-prologue - * =/ %x04 authenticator-state-update - * =/ %x05 (vector end-of-epoch-transaction-kind) - * =/ %x06 randomness-state-update - * =/ %x07 consensus-commit-prologue-v2 - * =/ %x08 consensus-commit-prologue-v3 + * type-origin = identifier identifier object-id * ``` */ -public interface TransactionKindInterface { +data class TypeOrigin ( + var `moduleName`: Identifier, + var `structName`: Identifier, + var `package`: ObjectId +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`moduleName`, + this.`structName`, + this.`package` + ) + } companion object } /** - * Transaction type + * @suppress + */ +public object FfiConverterTypeTypeOrigin: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TypeOrigin { + return TypeOrigin( + FfiConverterTypeIdentifier.read(buf), + FfiConverterTypeIdentifier.read(buf), + FfiConverterTypeObjectId.read(buf), + ) + } + + override fun allocationSize(value: TypeOrigin) = ( + FfiConverterTypeIdentifier.allocationSize(value.`moduleName`) + + FfiConverterTypeIdentifier.allocationSize(value.`structName`) + + FfiConverterTypeObjectId.allocationSize(value.`package`) + ) + + override fun write(value: TypeOrigin, buf: ByteBuffer) { + FfiConverterTypeIdentifier.write(value.`moduleName`, buf) + FfiConverterTypeIdentifier.write(value.`structName`, buf) + FfiConverterTypeObjectId.write(value.`package`, buf) + } +} + + + +/** + * A shared object that wasn't changed during execution * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * transaction-kind = %x00 ptb - * =/ %x01 change-epoch - * =/ %x02 genesis-transaction - * =/ %x03 consensus-commit-prologue - * =/ %x04 authenticator-state-update - * =/ %x05 (vector end-of-epoch-transaction-kind) - * =/ %x06 randomness-state-update - * =/ %x07 consensus-commit-prologue-v2 - * =/ %x08 consensus-commit-prologue-v3 + * unchanged-shared-object = object-id unchanged-shared-object-kind * ``` */ -open class TransactionKind: Disposable, AutoCloseable, TransactionKindInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) - } - - /** - * This constructor can be used to instantiate a fake object. Only used for tests. Any - * attempt to actually use an object constructed this way will fail as there is no - * connected Rust object. - */ - @Suppress("UNUSED_PARAMETER") - constructor(noPointer: NoPointer) { - this.pointer = null - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) - } - - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) - +data class UnchangedSharedObject ( + var `objectId`: ObjectId, + var `kind`: UnchangedSharedKind +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here 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() - } - } + + Disposable.destroy( + this.`objectId`, + this.`kind` + ) } + + companion object +} - @Synchronized - override fun close() { - this.destroy() +/** + * @suppress + */ +public object FfiConverterTypeUnchangedSharedObject: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): UnchangedSharedObject { + return UnchangedSharedObject( + FfiConverterTypeObjectId.read(buf), + FfiConverterTypeUnchangedSharedKind.read(buf), + ) } - 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() - } - } - } + override fun allocationSize(value: UnchangedSharedObject) = ( + FfiConverterTypeObjectId.allocationSize(value.`objectId`) + + FfiConverterTypeUnchangedSharedKind.allocationSize(value.`kind`) + ) - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_transactionkind(ptr, status) - } - } - } + override fun write(value: UnchangedSharedObject, buf: ByteBuffer) { + FfiConverterTypeObjectId.write(value.`objectId`, buf) + FfiConverterTypeUnchangedSharedKind.write(value.`kind`, buf) } +} - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_transactionkind(pointer!!, status) - } - } - +/** + * Upgraded package info for the linkage table + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * upgrade-info = object-id u64 + * ``` + */ +data class UpgradeInfo ( + /** + * Id of the upgraded packages + */ + var `upgradedId`: ObjectId, + /** + * Version of the upgraded package + */ + var `upgradedVersion`: kotlin.ULong +) : Disposable { - companion object { - fun `authenticatorStateUpdateV1`(`tx`: AuthenticatorStateUpdateV1): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_authenticator_state_update_v1( - FfiConverterTypeAuthenticatorStateUpdateV1.lower(`tx`),_status) -} + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`upgradedId`, + this.`upgradedVersion` ) } - - fun `consensusCommitPrologueV1`(`tx`: ConsensusCommitPrologueV1): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_consensus_commit_prologue_v1( - FfiConverterTypeConsensusCommitPrologueV1.lower(`tx`),_status) + companion object } - ) - } - - fun `endOfEpoch`(`tx`: List): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_end_of_epoch( - FfiConverterSequenceTypeEndOfEpochTransactionKind.lower(`tx`),_status) -} - ) +/** + * @suppress + */ +public object FfiConverterTypeUpgradeInfo: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): UpgradeInfo { + return UpgradeInfo( + FfiConverterTypeObjectId.read(buf), + FfiConverterULong.read(buf), + ) } - - fun `genesis`(`tx`: GenesisTransaction): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_genesis( - FfiConverterTypeGenesisTransaction.lower(`tx`),_status) -} + override fun allocationSize(value: UpgradeInfo) = ( + FfiConverterTypeObjectId.allocationSize(value.`upgradedId`) + + FfiConverterULong.allocationSize(value.`upgradedVersion`) ) - } - - fun `programmableTransaction`(`tx`: ProgrammableTransaction): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_programmable_transaction( - FfiConverterTypeProgrammableTransaction.lower(`tx`),_status) -} - ) + override fun write(value: UpgradeInfo, buf: ByteBuffer) { + FfiConverterTypeObjectId.write(value.`upgradedId`, buf) + FfiConverterULong.write(value.`upgradedVersion`, buf) } - - - fun `randomnessStateUpdate`(`tx`: RandomnessStateUpdate): TransactionKind { - return FfiConverterTypeTransactionKind.lift( - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_constructor_transactionkind_randomness_state_update( - FfiConverterTypeRandomnessStateUpdate.lower(`tx`),_status) } - ) - } + + + +/** + * Represents a validator in the system. + */ +data class Validator ( + /** + * The APY of this validator in basis points. + * To get the APY in percentage, divide by 100. + */ + var `apy`: kotlin.Int?, + /** + * The validator's address. + */ + var `address`: Address, + /** + * The fee charged by the validator for staking services. + */ + var `commissionRate`: kotlin.Int?, + /** + * Validator's credentials. + */ + var `credentials`: ValidatorCredentials?, + /** + * Validator's description. + */ + var `description`: kotlin.String?, + /** + * Number of exchange rates in the table. + */ + var `exchangeRatesSize`: kotlin.ULong?, + /** + * The reference gas price for this epoch. + */ + var `gasPrice`: kotlin.ULong?, + /** + * Validator's name. + */ + var `name`: kotlin.String?, + /** + * Validator's url containing their custom image. + */ + var `imageUrl`: kotlin.String?, + /** + * The proposed next epoch fee for the validator's staking services. + */ + var `nextEpochCommissionRate`: kotlin.Int?, + /** + * Validator's credentials for the next epoch. + */ + var `nextEpochCredentials`: ValidatorCredentials?, + /** + * The validator's gas price quote for the next epoch. + */ + var `nextEpochGasPrice`: kotlin.ULong?, + /** + * The total number of IOTA tokens in this pool plus + * the pending stake amount for this epoch. + */ + var `nextEpochStake`: kotlin.ULong?, + /** + * The validator's current valid `Cap` object. Validators can delegate + * the operation ability to another address. The address holding this `Cap` + * object can then update the reference gas price and tallying rule on + * behalf of the validator. + */ + var `operationCap`: kotlin.ByteArray?, + /** + * Pending pool token withdrawn during the current epoch, emptied at epoch + * boundaries. + */ + var `pendingPoolTokenWithdraw`: kotlin.ULong?, + /** + * Pending stake amount for this epoch. + */ + var `pendingStake`: kotlin.ULong?, + /** + * Pending stake withdrawn during the current epoch, emptied at epoch + * boundaries. + */ + var `pendingTotalIotaWithdraw`: kotlin.ULong?, + /** + * Total number of pool tokens issued by the pool. + */ + var `poolTokenBalance`: kotlin.ULong?, + /** + * Validator's homepage URL. + */ + var `projectUrl`: kotlin.String?, + /** + * The epoch stake rewards will be added here at the end of each epoch. + */ + var `rewardsPool`: kotlin.ULong?, + /** + * The epoch at which this pool became active. + */ + var `stakingPoolActivationEpoch`: kotlin.ULong?, + /** + * The ID of this validator's `0x3::staking_pool::StakingPool`. + */ + var `stakingPoolId`: ObjectId, + /** + * The total number of IOTA tokens in this pool. + */ + var `stakingPoolIotaBalance`: kotlin.ULong?, + /** + * The voting power of this validator in basis points (e.g., 100 = 1% + * voting power). + */ + var `votingPower`: kotlin.Int? +) : Disposable { - + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + Disposable.destroy( + this.`apy`, + this.`address`, + this.`commissionRate`, + this.`credentials`, + this.`description`, + this.`exchangeRatesSize`, + this.`gasPrice`, + this.`name`, + this.`imageUrl`, + this.`nextEpochCommissionRate`, + this.`nextEpochCredentials`, + this.`nextEpochGasPrice`, + this.`nextEpochStake`, + this.`operationCap`, + this.`pendingPoolTokenWithdraw`, + this.`pendingStake`, + this.`pendingTotalIotaWithdraw`, + this.`poolTokenBalance`, + this.`projectUrl`, + this.`rewardsPool`, + this.`stakingPoolActivationEpoch`, + this.`stakingPoolId`, + this.`stakingPoolIotaBalance`, + this.`votingPower` + ) } + companion object } /** * @suppress */ -public object FfiConverterTypeTransactionKind: FfiConverter { - - override fun lower(value: TransactionKind): Pointer { - return value.uniffiClonePointer() - } - - override fun lift(value: Pointer): TransactionKind { - return TransactionKind(value) - } - - override fun read(buf: ByteBuffer): TransactionKind { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) - } - - override fun allocationSize(value: TransactionKind) = 8UL - - override fun write(value: TransactionKind, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) +public object FfiConverterTypeValidator: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Validator { + return Validator( + FfiConverterOptionalInt.read(buf), + FfiConverterTypeAddress.read(buf), + FfiConverterOptionalInt.read(buf), + FfiConverterOptionalTypeValidatorCredentials.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalInt.read(buf), + FfiConverterOptionalTypeValidatorCredentials.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalByteArray.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterTypeObjectId.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalInt.read(buf), + ) } -} + override fun allocationSize(value: Validator) = ( + FfiConverterOptionalInt.allocationSize(value.`apy`) + + FfiConverterTypeAddress.allocationSize(value.`address`) + + FfiConverterOptionalInt.allocationSize(value.`commissionRate`) + + FfiConverterOptionalTypeValidatorCredentials.allocationSize(value.`credentials`) + + FfiConverterOptionalString.allocationSize(value.`description`) + + FfiConverterOptionalULong.allocationSize(value.`exchangeRatesSize`) + + FfiConverterOptionalULong.allocationSize(value.`gasPrice`) + + FfiConverterOptionalString.allocationSize(value.`name`) + + FfiConverterOptionalString.allocationSize(value.`imageUrl`) + + FfiConverterOptionalInt.allocationSize(value.`nextEpochCommissionRate`) + + FfiConverterOptionalTypeValidatorCredentials.allocationSize(value.`nextEpochCredentials`) + + FfiConverterOptionalULong.allocationSize(value.`nextEpochGasPrice`) + + FfiConverterOptionalULong.allocationSize(value.`nextEpochStake`) + + FfiConverterOptionalByteArray.allocationSize(value.`operationCap`) + + FfiConverterOptionalULong.allocationSize(value.`pendingPoolTokenWithdraw`) + + FfiConverterOptionalULong.allocationSize(value.`pendingStake`) + + FfiConverterOptionalULong.allocationSize(value.`pendingTotalIotaWithdraw`) + + FfiConverterOptionalULong.allocationSize(value.`poolTokenBalance`) + + FfiConverterOptionalString.allocationSize(value.`projectUrl`) + + FfiConverterOptionalULong.allocationSize(value.`rewardsPool`) + + FfiConverterOptionalULong.allocationSize(value.`stakingPoolActivationEpoch`) + + FfiConverterTypeObjectId.allocationSize(value.`stakingPoolId`) + + FfiConverterOptionalULong.allocationSize(value.`stakingPoolIotaBalance`) + + FfiConverterOptionalInt.allocationSize(value.`votingPower`) + ) -// 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 -// + override fun write(value: Validator, buf: ByteBuffer) { + FfiConverterOptionalInt.write(value.`apy`, buf) + FfiConverterTypeAddress.write(value.`address`, buf) + FfiConverterOptionalInt.write(value.`commissionRate`, buf) + FfiConverterOptionalTypeValidatorCredentials.write(value.`credentials`, buf) + FfiConverterOptionalString.write(value.`description`, buf) + FfiConverterOptionalULong.write(value.`exchangeRatesSize`, buf) + FfiConverterOptionalULong.write(value.`gasPrice`, buf) + FfiConverterOptionalString.write(value.`name`, buf) + FfiConverterOptionalString.write(value.`imageUrl`, buf) + FfiConverterOptionalInt.write(value.`nextEpochCommissionRate`, buf) + FfiConverterOptionalTypeValidatorCredentials.write(value.`nextEpochCredentials`, buf) + FfiConverterOptionalULong.write(value.`nextEpochGasPrice`, buf) + FfiConverterOptionalULong.write(value.`nextEpochStake`, buf) + FfiConverterOptionalByteArray.write(value.`operationCap`, buf) + FfiConverterOptionalULong.write(value.`pendingPoolTokenWithdraw`, buf) + FfiConverterOptionalULong.write(value.`pendingStake`, buf) + FfiConverterOptionalULong.write(value.`pendingTotalIotaWithdraw`, buf) + FfiConverterOptionalULong.write(value.`poolTokenBalance`, buf) + FfiConverterOptionalString.write(value.`projectUrl`, buf) + FfiConverterOptionalULong.write(value.`rewardsPool`, buf) + FfiConverterOptionalULong.write(value.`stakingPoolActivationEpoch`, buf) + FfiConverterTypeObjectId.write(value.`stakingPoolId`, buf) + FfiConverterOptionalULong.write(value.`stakingPoolIotaBalance`, buf) + FfiConverterOptionalInt.write(value.`votingPower`, buf) + } +} -public interface TypeTagInterface { + +/** + * A member of a Validator Committee + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * validator-committee-member = bls-public-key + * u64 ; stake + * ``` + */ +data class ValidatorCommitteeMember ( + var `publicKey`: Bls12381PublicKey, + var `stake`: kotlin.ULong +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`publicKey`, + this.`stake` + ) + } companion object } -open class TypeTag: Disposable, AutoCloseable, TypeTagInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) +/** + * @suppress + */ +public object FfiConverterTypeValidatorCommitteeMember: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ValidatorCommitteeMember { + return ValidatorCommitteeMember( + FfiConverterTypeBls12381PublicKey.read(buf), + FfiConverterULong.read(buf), + ) } - /** - * 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)) + override fun allocationSize(value: ValidatorCommitteeMember) = ( + FfiConverterTypeBls12381PublicKey.allocationSize(value.`publicKey`) + + FfiConverterULong.allocationSize(value.`stake`) + ) + + override fun write(value: ValidatorCommitteeMember, buf: ByteBuffer) { + FfiConverterTypeBls12381PublicKey.write(value.`publicKey`, buf) + FfiConverterULong.write(value.`stake`, buf) } +} - protected val pointer: Pointer? - protected val cleanable: UniffiCleaner.Cleanable - private val wasDestroyed = AtomicBoolean(false) - private val callCounter = AtomicLong(1) +data class ValidatorConnection ( + var `pageInfo`: PageInfo, + var `nodes`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here 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() - } - } + + Disposable.destroy( + this.`pageInfo`, + this.`nodes` + ) } + + companion object +} - @Synchronized - override fun close() { - this.destroy() +/** + * @suppress + */ +public object FfiConverterTypeValidatorConnection: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ValidatorConnection { + return ValidatorConnection( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeValidator.read(buf), + ) } - 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() - } - } + override fun allocationSize(value: ValidatorConnection) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeValidator.allocationSize(value.`nodes`) + ) + + override fun write(value: ValidatorConnection, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeValidator.write(value.`nodes`, buf) } +} - // Use a static inner class instead of a closure so as not to accidentally - // capture `this` as part of the cleanable's action. - private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { - override fun run() { - pointer?.let { ptr -> - uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_free_typetag(ptr, status) - } - } - } + + +data class ValidatorCredentials ( + var `authorityPubKey`: Base64?, + var `networkPubKey`: Base64?, + var `protocolPubKey`: Base64?, + var `proofOfPossession`: Base64?, + var `netAddress`: kotlin.String?, + var `p2pAddress`: kotlin.String?, + var `primaryAddress`: kotlin.String? +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeValidatorCredentials: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ValidatorCredentials { + return ValidatorCredentials( + FfiConverterOptionalTypeBase64.read(buf), + FfiConverterOptionalTypeBase64.read(buf), + FfiConverterOptionalTypeBase64.read(buf), + FfiConverterOptionalTypeBase64.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + ) } - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_typetag(pointer!!, status) - } + override fun allocationSize(value: ValidatorCredentials) = ( + FfiConverterOptionalTypeBase64.allocationSize(value.`authorityPubKey`) + + FfiConverterOptionalTypeBase64.allocationSize(value.`networkPubKey`) + + FfiConverterOptionalTypeBase64.allocationSize(value.`protocolPubKey`) + + FfiConverterOptionalTypeBase64.allocationSize(value.`proofOfPossession`) + + FfiConverterOptionalString.allocationSize(value.`netAddress`) + + FfiConverterOptionalString.allocationSize(value.`p2pAddress`) + + FfiConverterOptionalString.allocationSize(value.`primaryAddress`) + ) + + override fun write(value: ValidatorCredentials, buf: ByteBuffer) { + FfiConverterOptionalTypeBase64.write(value.`authorityPubKey`, buf) + FfiConverterOptionalTypeBase64.write(value.`networkPubKey`, buf) + FfiConverterOptionalTypeBase64.write(value.`protocolPubKey`, buf) + FfiConverterOptionalTypeBase64.write(value.`proofOfPossession`, buf) + FfiConverterOptionalString.write(value.`netAddress`, buf) + FfiConverterOptionalString.write(value.`p2pAddress`, buf) + FfiConverterOptionalString.write(value.`primaryAddress`, buf) } +} - + +/** + * A page of items returned by the GraphQL server. + */ +data class ValidatorPage ( + /** + * Information about the page, such as the cursor and whether there are + * more pages. + */ + var `pageInfo`: PageInfo, + /** + * The data returned by the server. + */ + var `data`: List +) : Disposable { + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`pageInfo`, + this.`data` + ) + } companion object - } /** * @suppress */ -public object FfiConverterTypeTypeTag: FfiConverter { +public object FfiConverterTypeValidatorPage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ValidatorPage { + return ValidatorPage( + FfiConverterTypePageInfo.read(buf), + FfiConverterSequenceTypeValidator.read(buf), + ) + } - override fun lower(value: TypeTag): Pointer { - return value.uniffiClonePointer() + override fun allocationSize(value: ValidatorPage) = ( + FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + + FfiConverterSequenceTypeValidator.allocationSize(value.`data`) + ) + + override fun write(value: ValidatorPage, buf: ByteBuffer) { + FfiConverterTypePageInfo.write(value.`pageInfo`, buf) + FfiConverterSequenceTypeValidator.write(value.`data`, buf) } +} - override fun lift(value: Pointer): TypeTag { - return TypeTag(value) + + +data class ValidatorSet ( + var `activeValidators`: ValidatorConnection +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`activeValidators` + ) } + + companion object +} - override fun read(buf: ByteBuffer): TypeTag { - // The Rust code always writes pointers as 8 bytes, and will - // fail to compile if they don't fit. - return lift(Pointer(buf.getLong())) +/** + * @suppress + */ +public object FfiConverterTypeValidatorSet: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ValidatorSet { + return ValidatorSet( + FfiConverterTypeValidatorConnection.read(buf), + ) } - override fun allocationSize(value: TypeTag) = 8UL + override fun allocationSize(value: ValidatorSet) = ( + FfiConverterTypeValidatorConnection.allocationSize(value.`activeValidators`) + ) - override fun write(value: TypeTag, buf: ByteBuffer) { - // The Rust code always expects pointers written as 8 bytes, - // and will fail to compile if they don't fit. - buf.putLong(Pointer.nativeValue(lower(value))) + override fun write(value: ValidatorSet, buf: ByteBuffer) { + FfiConverterTypeValidatorConnection.write(value.`activeValidators`, buf) } } -// 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 UserSignatureInterface { +data class ZkLoginClaim ( + var `value`: kotlin.String, + var `indexMod4`: kotlin.UByte +) { companion object } -open class UserSignature: Disposable, AutoCloseable, UserSignatureInterface -{ - - constructor(pointer: Pointer) { - this.pointer = pointer - this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) +/** + * @suppress + */ +public object FfiConverterTypeZkLoginClaim: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ZkLoginClaim { + return ZkLoginClaim( + FfiConverterString.read(buf), + FfiConverterUByte.read(buf), + ) } - /** - * 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)) + override fun allocationSize(value: ZkLoginClaim) = ( + FfiConverterString.allocationSize(value.`value`) + + FfiConverterUByte.allocationSize(value.`indexMod4`) + ) + + override fun write(value: ZkLoginClaim, buf: ByteBuffer) { + FfiConverterString.write(value.`value`, buf) + FfiConverterUByte.write(value.`indexMod4`, buf) } +} - 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() - } +sealed class CommandArgumentError { + + object TypeMismatch : CommandArgumentError() + + + object InvalidBcsBytes : CommandArgumentError() + + + object InvalidUsageOfPureArgument : CommandArgumentError() + + + object InvalidArgumentToPrivateEntryFunction : CommandArgumentError() + + + data class IndexOutOfBounds( + val `index`: kotlin.UShort) : CommandArgumentError() { + companion object + } + + data class SecondaryIndexOutOfBounds( + val `result`: kotlin.UShort, + val `subresult`: kotlin.UShort) : CommandArgumentError() { + companion object + } + + data class InvalidResultArity( + val `result`: kotlin.UShort) : CommandArgumentError() { + companion object + } + + object InvalidGasCoinUsage : CommandArgumentError() + + + object InvalidValueUsage : CommandArgumentError() + + + object InvalidObjectByValue : CommandArgumentError() + + + object InvalidObjectByMutRef : CommandArgumentError() + + + object SharedObjectOperationNotAllowed : CommandArgumentError() + + + + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeCommandArgumentError : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): CommandArgumentError { + return when(buf.getInt()) { + 1 -> CommandArgumentError.TypeMismatch + 2 -> CommandArgumentError.InvalidBcsBytes + 3 -> CommandArgumentError.InvalidUsageOfPureArgument + 4 -> CommandArgumentError.InvalidArgumentToPrivateEntryFunction + 5 -> CommandArgumentError.IndexOutOfBounds( + FfiConverterUShort.read(buf), + ) + 6 -> CommandArgumentError.SecondaryIndexOutOfBounds( + FfiConverterUShort.read(buf), + FfiConverterUShort.read(buf), + ) + 7 -> CommandArgumentError.InvalidResultArity( + FfiConverterUShort.read(buf), + ) + 8 -> CommandArgumentError.InvalidGasCoinUsage + 9 -> CommandArgumentError.InvalidValueUsage + 10 -> CommandArgumentError.InvalidObjectByValue + 11 -> CommandArgumentError.InvalidObjectByMutRef + 12 -> CommandArgumentError.SharedObjectOperationNotAllowed + else -> throw RuntimeException("invalid enum value, something is very wrong!!") } } - @Synchronized - override fun close() { - this.destroy() + override fun allocationSize(value: CommandArgumentError) = when(value) { + is CommandArgumentError.TypeMismatch -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.InvalidBcsBytes -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.InvalidUsageOfPureArgument -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.InvalidArgumentToPrivateEntryFunction -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.IndexOutOfBounds -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUShort.allocationSize(value.`index`) + ) + } + is CommandArgumentError.SecondaryIndexOutOfBounds -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUShort.allocationSize(value.`result`) + + FfiConverterUShort.allocationSize(value.`subresult`) + ) + } + is CommandArgumentError.InvalidResultArity -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUShort.allocationSize(value.`result`) + ) + } + is CommandArgumentError.InvalidGasCoinUsage -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.InvalidValueUsage -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.InvalidObjectByValue -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.InvalidObjectByMutRef -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is CommandArgumentError.SharedObjectOperationNotAllowed -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } } - 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") + override fun write(value: CommandArgumentError, buf: ByteBuffer) { + when(value) { + is CommandArgumentError.TypeMismatch -> { + buf.putInt(1) + Unit } - if (c == Long.MAX_VALUE) { - throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + is CommandArgumentError.InvalidBcsBytes -> { + buf.putInt(2) + Unit } - } 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() + is CommandArgumentError.InvalidUsageOfPureArgument -> { + buf.putInt(3) + Unit } - } - } - - // 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_usersignature(ptr, status) - } + is CommandArgumentError.InvalidArgumentToPrivateEntryFunction -> { + buf.putInt(4) + Unit } - } + is CommandArgumentError.IndexOutOfBounds -> { + buf.putInt(5) + FfiConverterUShort.write(value.`index`, buf) + Unit + } + is CommandArgumentError.SecondaryIndexOutOfBounds -> { + buf.putInt(6) + FfiConverterUShort.write(value.`result`, buf) + FfiConverterUShort.write(value.`subresult`, buf) + Unit + } + is CommandArgumentError.InvalidResultArity -> { + buf.putInt(7) + FfiConverterUShort.write(value.`result`, buf) + Unit + } + is CommandArgumentError.InvalidGasCoinUsage -> { + buf.putInt(8) + Unit + } + is CommandArgumentError.InvalidValueUsage -> { + buf.putInt(9) + Unit + } + is CommandArgumentError.InvalidObjectByValue -> { + buf.putInt(10) + Unit + } + is CommandArgumentError.InvalidObjectByMutRef -> { + buf.putInt(11) + Unit + } + is CommandArgumentError.SharedObjectOperationNotAllowed -> { + buf.putInt(12) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } +} - fun uniffiClonePointer(): Pointer { - return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_clone_usersignature(pointer!!, status) - } - } - + + +/** + * Pagination direction. + */ + +enum class Direction { - + FORWARD, + BACKWARD; companion object - } + /** * @suppress */ -public object FfiConverterTypeUserSignature: FfiConverter { - - override fun lower(value: UserSignature): Pointer { - return value.uniffiClonePointer() +public object FfiConverterTypeDirection: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + Direction.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) } - override fun lift(value: Pointer): UserSignature { - return UserSignature(value) - } + override fun allocationSize(value: Direction) = 4UL - override fun read(buf: ByteBuffer): UserSignature { - // 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 write(value: Direction, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) } +} - override fun allocationSize(value: UserSignature) = 8UL - override fun write(value: UserSignature, 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))) - } -} /** - * 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. + * An error that can occur during the execution of a transaction * * # 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 + * + * execution-error = insufficient-gas + * =/ invalid-gas-object + * =/ invariant-violation + * =/ feature-not-yet-supported + * =/ object-too-big + * =/ package-too-big + * =/ circular-object-ownership + * =/ insufficient-coin-balance + * =/ coin-balance-overflow + * =/ publish-error-non-zero-address + * =/ iota-move-verification-error + * =/ move-primitive-runtime-error + * =/ move-abort + * =/ vm-verification-or-deserialization-error + * =/ vm-invariant-violation + * =/ function-not-found + * =/ arity-mismatch + * =/ type-arity-mismatch + * =/ non-entry-function-invoked + * =/ command-argument-error + * =/ type-argument-error + * =/ unused-value-without-drop + * =/ invalid-public-function-return-type + * =/ invalid-transfer-object + * =/ effects-too-large + * =/ publish-upgrade-missing-dependency + * =/ publish-upgrade-dependency-downgrade + * =/ package-upgrade-error + * =/ written-objects-too-large + * =/ certificate-denied + * =/ iota-move-verification-timeout + * =/ shared-object-operation-not-allowed + * =/ input-object-deleted + * =/ execution-cancelled-due-to-shared-object-congestion + * =/ address-denied-for-coin + * =/ coin-type-global-pause + * =/ execution-cancelled-due-to-randomness-unavailable + * + * insufficient-gas = %x00 + * invalid-gas-object = %x01 + * invariant-violation = %x02 + * feature-not-yet-supported = %x03 + * object-too-big = %x04 u64 u64 + * package-too-big = %x05 u64 u64 + * circular-object-ownership = %x06 object-id + * insufficient-coin-balance = %x07 + * coin-balance-overflow = %x08 + * publish-error-non-zero-address = %x09 + * iota-move-verification-error = %x0a + * move-primitive-runtime-error = %x0b (option move-location) + * move-abort = %x0c move-location u64 + * vm-verification-or-deserialization-error = %x0d + * vm-invariant-violation = %x0e + * function-not-found = %x0f + * arity-mismatch = %x10 + * type-arity-mismatch = %x11 + * non-entry-function-invoked = %x12 + * command-argument-error = %x13 u16 command-argument-error + * type-argument-error = %x14 u16 type-argument-error + * unused-value-without-drop = %x15 u16 u16 + * invalid-public-function-return-type = %x16 u16 + * invalid-transfer-object = %x17 + * effects-too-large = %x18 u64 u64 + * publish-upgrade-missing-dependency = %x19 + * publish-upgrade-dependency-downgrade = %x1a + * package-upgrade-error = %x1b package-upgrade-error + * written-objects-too-large = %x1c u64 u64 + * certificate-denied = %x1d + * iota-move-verification-timeout = %x1e + * shared-object-operation-not-allowed = %x1f + * input-object-deleted = %x20 + * execution-cancelled-due-to-shared-object-congestion = %x21 (vector object-id) + * address-denied-for-coin = %x22 address string + * coin-type-global-pause = %x23 string + * execution-cancelled-due-to-randomness-unavailable = %x24 * ``` */ -data class CheckpointSummary ( +sealed class ExecutionError: Disposable { + /** - * Epoch that this checkpoint belongs to. + * Insufficient Gas */ - var `epoch`: kotlin.ULong, + object InsufficientGas : ExecutionError() + + /** - * The height of this checkpoint. + * Invalid Gas Object. */ - var `sequenceNumber`: kotlin.ULong, + object InvalidGasObject : ExecutionError() + + /** - * Total number of transactions committed since genesis, including those in - * this checkpoint. + * Invariant Violation */ - var `networkTotalTransactions`: kotlin.ULong, + object InvariantViolation : ExecutionError() + + /** - * The hash of the `CheckpointContents` for this checkpoint. + * Attempted to used feature that is not supported yet */ - var `contentDigest`: CheckpointContentsDigest, + object FeatureNotYetSupported : ExecutionError() + + /** - * The hash of the previous `CheckpointSummary`. - * - * This will be only be `None` for the first, or genesis checkpoint. + * Move object is larger than the maximum allowed size */ - var `previousDigest`: CheckpointDigest?, + data class ObjectTooBig( + val `objectSize`: kotlin.ULong, + val `maxObjectSize`: kotlin.ULong) : ExecutionError() { + companion object + } + /** - * The running total gas costs of all transactions included in the current - * epoch so far until this checkpoint. + * Package is larger than the maximum allowed size */ - var `epochRollingGasCostSummary`: GasCostSummary, + data class PackageTooBig( + val `objectSize`: kotlin.ULong, + val `maxObjectSize`: kotlin.ULong) : ExecutionError() { + companion object + } + /** - * 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 + * Circular Object Ownership */ - var `timestampMs`: kotlin.ULong, + data class CircularObjectOwnership( + val `object`: ObjectId) : ExecutionError() { + companion object + } + /** - * Commitments to checkpoint-specific state. + * Insufficient coin balance for requested operation */ - var `checkpointCommitments`: List, + object InsufficientCoinBalance : ExecutionError() + + /** - * Extra data only present in the final checkpoint of an epoch. + * Coin balance overflowed an u64 */ - var `endOfEpochData`: EndOfEpochData?, + object CoinBalanceOverflow : ExecutionError() + + /** - * 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. + * Publish Error, Non-zero Address. + * The modules in the package must have their self-addresses set to zero. */ - var `versionSpecificData`: kotlin.ByteArray -) : Disposable { + object PublishErrorNonZeroAddress : ExecutionError() - @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` - ) + + /** + * IOTA Move Bytecode Verification Error. + */ + object IotaMoveVerification : ExecutionError() + + + /** + * Error from a non-abort instruction. + * Possible causes: + * Arithmetic error, stack overflow, max value depth, etc." + */ + data class MovePrimitiveRuntime( + val `location`: MoveLocation?) : ExecutionError() { + companion object } - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeCheckpointSummary: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CheckpointSummary { - return CheckpointSummary( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterTypeCheckpointContentsDigest.read(buf), - FfiConverterOptionalTypeCheckpointDigest.read(buf), - FfiConverterTypeGasCostSummary.read(buf), - FfiConverterULong.read(buf), - FfiConverterSequenceTypeCheckpointCommitment.read(buf), - FfiConverterOptionalTypeEndOfEpochData.read(buf), - FfiConverterByteArray.read(buf), - ) + /** + * Move runtime abort + */ + data class MoveAbort( + val `location`: MoveLocation, + val `code`: kotlin.ULong) : ExecutionError() { + companion object } - - override fun allocationSize(value: CheckpointSummary) = ( - FfiConverterULong.allocationSize(value.`epoch`) + - FfiConverterULong.allocationSize(value.`sequenceNumber`) + - FfiConverterULong.allocationSize(value.`networkTotalTransactions`) + - FfiConverterTypeCheckpointContentsDigest.allocationSize(value.`contentDigest`) + - FfiConverterOptionalTypeCheckpointDigest.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) - FfiConverterTypeCheckpointContentsDigest.write(value.`contentDigest`, buf) - FfiConverterOptionalTypeCheckpointDigest.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) + + /** + * Bytecode verification error. + */ + object VmVerificationOrDeserialization : ExecutionError() + + + /** + * MoveVm invariant violation + */ + object VmInvariantViolation : ExecutionError() + + + /** + * Function not found + */ + object FunctionNotFound : ExecutionError() + + + /** + * Arity mismatch for Move function. + * The number of arguments does not match the number of parameters + */ + object ArityMismatch : ExecutionError() + + + /** + * Type arity mismatch for Move function. + * Mismatch between the number of actual versus expected type arguments. + */ + object TypeArityMismatch : ExecutionError() + + + /** + * Non Entry Function Invoked. Move Call must start with an entry function. + */ + object NonEntryFunctionInvoked : ExecutionError() + + + /** + * Invalid command argument + */ + data class CommandArgument( + val `argument`: kotlin.UShort, + val `kind`: CommandArgumentError) : ExecutionError() { + companion object } -} - - - -/** - * A page of items returned by the GraphQL server. - */ -data class CheckpointSummaryPage ( + + /** + * Type argument error + */ + data class TypeArgument( + /** + * Index of the problematic type argument + */ + val `typeArgument`: kotlin.UShort, + val `kind`: TypeArgumentError) : ExecutionError() { + companion object + } + + /** + * Unused result without the drop ability. + */ + data class UnusedValueWithoutDrop( + val `result`: kotlin.UShort, + val `subresult`: kotlin.UShort) : ExecutionError() { + companion object + } + + /** + * Invalid public Move function signature. + * Unsupported return type for return value + */ + data class InvalidPublicFunctionReturnType( + val `index`: kotlin.UShort) : ExecutionError() { + companion object + } + + /** + * Invalid Transfer Object, object does not have public transfer. + */ + object InvalidTransferObject : ExecutionError() + + + /** + * Effects from the transaction are too large + */ + data class EffectsTooLarge( + val `currentSize`: kotlin.ULong, + val `maxSize`: kotlin.ULong) : ExecutionError() { + companion object + } + /** - * Information about the page, such as the cursor and whether there are - * more pages. + * Publish or Upgrade is missing dependency */ - var `pageInfo`: PageInfo, + object PublishUpgradeMissingDependency : ExecutionError() + + /** - * The data returned by the server. + * Publish or Upgrade dependency downgrade. + * + * Indirect (transitive) dependency of published or upgraded package has + * been assigned an on-chain version that is less than the version + * required by one of the package's transitive dependencies. */ - var `data`: List -) : Disposable { + object PublishUpgradeDependencyDowngrade : ExecutionError() - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`pageInfo`, - this.`data` - ) - } - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeCheckpointSummaryPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CheckpointSummaryPage { - return CheckpointSummaryPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeCheckpointSummary.read(buf), - ) - } - - override fun allocationSize(value: CheckpointSummaryPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeCheckpointSummary.allocationSize(value.`data`) - ) - - override fun write(value: CheckpointSummaryPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeCheckpointSummary.write(value.`data`, buf) + /** + * Invalid package upgrade + */ + data class PackageUpgrade( + val `kind`: PackageUpgradeError) : ExecutionError() { + companion object } -} - - - -/** - * A page of items returned by the GraphQL server. - */ -data class CoinPage ( + /** - * Information about the page, such as the cursor and whether there are - * more pages. + * Indicates the transaction tried to write objects too large to storage */ - var `pageInfo`: PageInfo, + data class WrittenObjectsTooLarge( + val `objectSize`: kotlin.ULong, + val `maxObjectSize`: kotlin.ULong) : ExecutionError() { + companion object + } + /** - * The data returned by the server. + * Certificate is on the deny list */ - var `data`: List -) : Disposable { + object CertificateDenied : ExecutionError() - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`pageInfo`, - this.`data` - ) - } - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeCoinPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CoinPage { - return CoinPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeCoin.read(buf), - ) - } - - override fun allocationSize(value: CoinPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeCoin.allocationSize(value.`data`) - ) - - override fun write(value: CoinPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeCoin.write(value.`data`, buf) - } -} - - - -/** - * The name part of a dynamic field, including its type, bcs, and json - * representation. - */ -data class DynamicFieldName ( /** - * The type name of this dynamic field name + * IOTA Move Bytecode verification timed out. */ - var `typeTag`: TypeTag, + object IotaMoveVerificationTimeout : ExecutionError() + + /** - * The bcs bytes of this dynamic field name + * The requested shared object operation is not allowed */ - var `bcs`: kotlin.ByteArray, + object SharedObjectOperationNotAllowed : ExecutionError() + + /** - * The json representation of the dynamic field name + * Requested shared object has been deleted */ - var `json`: Value? -) : Disposable { + object InputObjectDeleted : ExecutionError() - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`typeTag`, - this.`bcs`, - this.`json` - ) + + /** + * Certificate is cancelled due to congestion on shared objects + */ + data class ExecutionCancelledDueToSharedObjectCongestion( + val `congestedObjects`: List) : ExecutionError() { + companion object } - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeDynamicFieldName: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): DynamicFieldName { - return DynamicFieldName( - FfiConverterTypeTypeTag.read(buf), - FfiConverterByteArray.read(buf), - FfiConverterOptionalTypeValue.read(buf), - ) + /** + * Certificate is cancelled due to congestion on shared objects; + * suggested gas price can be used to give this certificate more priority. + */ + data class ExecutionCancelledDueToSharedObjectCongestionV2( + val `congestedObjects`: List, + val `suggestedGasPrice`: kotlin.ULong) : ExecutionError() { + companion object } - - override fun allocationSize(value: DynamicFieldName) = ( - FfiConverterTypeTypeTag.allocationSize(value.`typeTag`) + - FfiConverterByteArray.allocationSize(value.`bcs`) + - FfiConverterOptionalTypeValue.allocationSize(value.`json`) - ) - - override fun write(value: DynamicFieldName, buf: ByteBuffer) { - FfiConverterTypeTypeTag.write(value.`typeTag`, buf) - FfiConverterByteArray.write(value.`bcs`, buf) - FfiConverterOptionalTypeValue.write(value.`json`, buf) + + /** + * Address is denied for this coin type + */ + data class AddressDeniedForCoin( + val `address`: Address, + val `coinType`: kotlin.String) : ExecutionError() { + companion object } -} - - - -/** - * The output of a dynamic field query, that includes the name, value, and - * value's json representation. - */ -data class DynamicFieldOutput ( + /** - * The name of the dynamic field + * Coin type is globally paused for use */ - var `name`: DynamicFieldName, + data class CoinTypeGlobalPause( + val `coinType`: kotlin.String) : ExecutionError() { + companion object + } + /** - * The dynamic field value typename and bcs + * Certificate is cancelled because randomness could not be generated this + * epoch */ - var `value`: DynamicFieldValue?, + object ExecutionCancelledDueToRandomnessUnavailable : ExecutionError() + + /** - * The json representation of the dynamic field value object + * A valid linkage was unable to be determined for the transaction or one + * of its commands. */ - var `valueAsJson`: Value? -) : Disposable { + object InvalidLinkage : ExecutionError() + + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here override fun destroy() { - + when(this) { + is ExecutionError.InsufficientGas -> {// Nothing to destroy + } + is ExecutionError.InvalidGasObject -> {// Nothing to destroy + } + is ExecutionError.InvariantViolation -> {// Nothing to destroy + } + is ExecutionError.FeatureNotYetSupported -> {// Nothing to destroy + } + is ExecutionError.ObjectTooBig -> { + + Disposable.destroy( + this.`objectSize`, + this.`maxObjectSize` + ) + + } + is ExecutionError.PackageTooBig -> { + + Disposable.destroy( + this.`objectSize`, + this.`maxObjectSize` + ) + + } + is ExecutionError.CircularObjectOwnership -> { + + Disposable.destroy( + this.`object` + ) + + } + is ExecutionError.InsufficientCoinBalance -> {// Nothing to destroy + } + is ExecutionError.CoinBalanceOverflow -> {// Nothing to destroy + } + is ExecutionError.PublishErrorNonZeroAddress -> {// Nothing to destroy + } + is ExecutionError.IotaMoveVerification -> {// Nothing to destroy + } + is ExecutionError.MovePrimitiveRuntime -> { + + Disposable.destroy( + this.`location` + ) + + } + is ExecutionError.MoveAbort -> { + + Disposable.destroy( + this.`location`, + this.`code` + ) + + } + is ExecutionError.VmVerificationOrDeserialization -> {// Nothing to destroy + } + is ExecutionError.VmInvariantViolation -> {// Nothing to destroy + } + is ExecutionError.FunctionNotFound -> {// Nothing to destroy + } + is ExecutionError.ArityMismatch -> {// Nothing to destroy + } + is ExecutionError.TypeArityMismatch -> {// Nothing to destroy + } + is ExecutionError.NonEntryFunctionInvoked -> {// Nothing to destroy + } + is ExecutionError.CommandArgument -> { + + Disposable.destroy( + this.`argument`, + this.`kind` + ) + + } + is ExecutionError.TypeArgument -> { + + Disposable.destroy( + this.`typeArgument`, + this.`kind` + ) + + } + is ExecutionError.UnusedValueWithoutDrop -> { + + Disposable.destroy( + this.`result`, + this.`subresult` + ) + + } + is ExecutionError.InvalidPublicFunctionReturnType -> { + + Disposable.destroy( + this.`index` + ) + + } + is ExecutionError.InvalidTransferObject -> {// Nothing to destroy + } + is ExecutionError.EffectsTooLarge -> { + + Disposable.destroy( + this.`currentSize`, + this.`maxSize` + ) + + } + is ExecutionError.PublishUpgradeMissingDependency -> {// Nothing to destroy + } + is ExecutionError.PublishUpgradeDependencyDowngrade -> {// Nothing to destroy + } + is ExecutionError.PackageUpgrade -> { + + Disposable.destroy( + this.`kind` + ) + + } + is ExecutionError.WrittenObjectsTooLarge -> { + + Disposable.destroy( + this.`objectSize`, + this.`maxObjectSize` + ) + + } + is ExecutionError.CertificateDenied -> {// Nothing to destroy + } + is ExecutionError.IotaMoveVerificationTimeout -> {// Nothing to destroy + } + is ExecutionError.SharedObjectOperationNotAllowed -> {// Nothing to destroy + } + is ExecutionError.InputObjectDeleted -> {// Nothing to destroy + } + is ExecutionError.ExecutionCancelledDueToSharedObjectCongestion -> { + Disposable.destroy( - this.`name`, - this.`value`, - this.`valueAsJson` + this.`congestedObjects` ) - } - - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeDynamicFieldOutput: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): DynamicFieldOutput { - return DynamicFieldOutput( - FfiConverterTypeDynamicFieldName.read(buf), - FfiConverterOptionalTypeDynamicFieldValue.read(buf), - FfiConverterOptionalTypeValue.read(buf), - ) - } - - override fun allocationSize(value: DynamicFieldOutput) = ( - FfiConverterTypeDynamicFieldName.allocationSize(value.`name`) + - FfiConverterOptionalTypeDynamicFieldValue.allocationSize(value.`value`) + - FfiConverterOptionalTypeValue.allocationSize(value.`valueAsJson`) + + } + is ExecutionError.ExecutionCancelledDueToSharedObjectCongestionV2 -> { + + Disposable.destroy( + this.`congestedObjects`, + this.`suggestedGasPrice` ) - - override fun write(value: DynamicFieldOutput, buf: ByteBuffer) { - FfiConverterTypeDynamicFieldName.write(value.`name`, buf) - FfiConverterOptionalTypeDynamicFieldValue.write(value.`value`, buf) - FfiConverterOptionalTypeValue.write(value.`valueAsJson`, buf) - } -} - - - -/** - * A page of items returned by the GraphQL server. - */ -data class DynamicFieldOutputPage ( - /** - * Information about the page, such as the cursor and whether there are - * more pages. - */ - var `pageInfo`: PageInfo, - /** - * The data returned by the server. - */ - var `data`: List -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - + + } + is ExecutionError.AddressDeniedForCoin -> { + Disposable.destroy( - this.`pageInfo`, - this.`data` + this.`address`, + this.`coinType` + ) + + } + is ExecutionError.CoinTypeGlobalPause -> { + + Disposable.destroy( + this.`coinType` ) + + } + is ExecutionError.ExecutionCancelledDueToRandomnessUnavailable -> {// Nothing to destroy + } + is ExecutionError.InvalidLinkage -> {// Nothing to destroy + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } companion object @@ -18018,87 +29426,606 @@ data class DynamicFieldOutputPage ( /** * @suppress */ -public object FfiConverterTypeDynamicFieldOutputPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): DynamicFieldOutputPage { - return DynamicFieldOutputPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeDynamicFieldOutput.read(buf), - ) +public object FfiConverterTypeExecutionError : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): ExecutionError { + return when(buf.getInt()) { + 1 -> ExecutionError.InsufficientGas + 2 -> ExecutionError.InvalidGasObject + 3 -> ExecutionError.InvariantViolation + 4 -> ExecutionError.FeatureNotYetSupported + 5 -> ExecutionError.ObjectTooBig( + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + ) + 6 -> ExecutionError.PackageTooBig( + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + ) + 7 -> ExecutionError.CircularObjectOwnership( + FfiConverterTypeObjectId.read(buf), + ) + 8 -> ExecutionError.InsufficientCoinBalance + 9 -> ExecutionError.CoinBalanceOverflow + 10 -> ExecutionError.PublishErrorNonZeroAddress + 11 -> ExecutionError.IotaMoveVerification + 12 -> ExecutionError.MovePrimitiveRuntime( + FfiConverterOptionalTypeMoveLocation.read(buf), + ) + 13 -> ExecutionError.MoveAbort( + FfiConverterTypeMoveLocation.read(buf), + FfiConverterULong.read(buf), + ) + 14 -> ExecutionError.VmVerificationOrDeserialization + 15 -> ExecutionError.VmInvariantViolation + 16 -> ExecutionError.FunctionNotFound + 17 -> ExecutionError.ArityMismatch + 18 -> ExecutionError.TypeArityMismatch + 19 -> ExecutionError.NonEntryFunctionInvoked + 20 -> ExecutionError.CommandArgument( + FfiConverterUShort.read(buf), + FfiConverterTypeCommandArgumentError.read(buf), + ) + 21 -> ExecutionError.TypeArgument( + FfiConverterUShort.read(buf), + FfiConverterTypeTypeArgumentError.read(buf), + ) + 22 -> ExecutionError.UnusedValueWithoutDrop( + FfiConverterUShort.read(buf), + FfiConverterUShort.read(buf), + ) + 23 -> ExecutionError.InvalidPublicFunctionReturnType( + FfiConverterUShort.read(buf), + ) + 24 -> ExecutionError.InvalidTransferObject + 25 -> ExecutionError.EffectsTooLarge( + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + ) + 26 -> ExecutionError.PublishUpgradeMissingDependency + 27 -> ExecutionError.PublishUpgradeDependencyDowngrade + 28 -> ExecutionError.PackageUpgrade( + FfiConverterTypePackageUpgradeError.read(buf), + ) + 29 -> ExecutionError.WrittenObjectsTooLarge( + FfiConverterULong.read(buf), + FfiConverterULong.read(buf), + ) + 30 -> ExecutionError.CertificateDenied + 31 -> ExecutionError.IotaMoveVerificationTimeout + 32 -> ExecutionError.SharedObjectOperationNotAllowed + 33 -> ExecutionError.InputObjectDeleted + 34 -> ExecutionError.ExecutionCancelledDueToSharedObjectCongestion( + FfiConverterSequenceTypeObjectId.read(buf), + ) + 35 -> ExecutionError.ExecutionCancelledDueToSharedObjectCongestionV2( + FfiConverterSequenceTypeObjectId.read(buf), + FfiConverterULong.read(buf), + ) + 36 -> ExecutionError.AddressDeniedForCoin( + FfiConverterTypeAddress.read(buf), + FfiConverterString.read(buf), + ) + 37 -> ExecutionError.CoinTypeGlobalPause( + FfiConverterString.read(buf), + ) + 38 -> ExecutionError.ExecutionCancelledDueToRandomnessUnavailable + 39 -> ExecutionError.InvalidLinkage + else -> throw RuntimeException("invalid enum value, something is very wrong!!") + } } - override fun allocationSize(value: DynamicFieldOutputPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeDynamicFieldOutput.allocationSize(value.`data`) - ) + override fun allocationSize(value: ExecutionError) = when(value) { + is ExecutionError.InsufficientGas -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.InvalidGasObject -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.InvariantViolation -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.FeatureNotYetSupported -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.ObjectTooBig -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`objectSize`) + + FfiConverterULong.allocationSize(value.`maxObjectSize`) + ) + } + is ExecutionError.PackageTooBig -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`objectSize`) + + FfiConverterULong.allocationSize(value.`maxObjectSize`) + ) + } + is ExecutionError.CircularObjectOwnership -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeObjectId.allocationSize(value.`object`) + ) + } + is ExecutionError.InsufficientCoinBalance -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.CoinBalanceOverflow -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.PublishErrorNonZeroAddress -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.IotaMoveVerification -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.MovePrimitiveRuntime -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterOptionalTypeMoveLocation.allocationSize(value.`location`) + ) + } + is ExecutionError.MoveAbort -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeMoveLocation.allocationSize(value.`location`) + + FfiConverterULong.allocationSize(value.`code`) + ) + } + is ExecutionError.VmVerificationOrDeserialization -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.VmInvariantViolation -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.FunctionNotFound -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.ArityMismatch -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.TypeArityMismatch -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.NonEntryFunctionInvoked -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.CommandArgument -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUShort.allocationSize(value.`argument`) + + FfiConverterTypeCommandArgumentError.allocationSize(value.`kind`) + ) + } + is ExecutionError.TypeArgument -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUShort.allocationSize(value.`typeArgument`) + + FfiConverterTypeTypeArgumentError.allocationSize(value.`kind`) + ) + } + is ExecutionError.UnusedValueWithoutDrop -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUShort.allocationSize(value.`result`) + + FfiConverterUShort.allocationSize(value.`subresult`) + ) + } + is ExecutionError.InvalidPublicFunctionReturnType -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUShort.allocationSize(value.`index`) + ) + } + is ExecutionError.InvalidTransferObject -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.EffectsTooLarge -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`currentSize`) + + FfiConverterULong.allocationSize(value.`maxSize`) + ) + } + is ExecutionError.PublishUpgradeMissingDependency -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.PublishUpgradeDependencyDowngrade -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.PackageUpgrade -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypePackageUpgradeError.allocationSize(value.`kind`) + ) + } + is ExecutionError.WrittenObjectsTooLarge -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`objectSize`) + + FfiConverterULong.allocationSize(value.`maxObjectSize`) + ) + } + is ExecutionError.CertificateDenied -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.IotaMoveVerificationTimeout -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.SharedObjectOperationNotAllowed -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.InputObjectDeleted -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.ExecutionCancelledDueToSharedObjectCongestion -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterSequenceTypeObjectId.allocationSize(value.`congestedObjects`) + ) + } + is ExecutionError.ExecutionCancelledDueToSharedObjectCongestionV2 -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterSequenceTypeObjectId.allocationSize(value.`congestedObjects`) + + FfiConverterULong.allocationSize(value.`suggestedGasPrice`) + ) + } + is ExecutionError.AddressDeniedForCoin -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeAddress.allocationSize(value.`address`) + + FfiConverterString.allocationSize(value.`coinType`) + ) + } + is ExecutionError.CoinTypeGlobalPause -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterString.allocationSize(value.`coinType`) + ) + } + is ExecutionError.ExecutionCancelledDueToRandomnessUnavailable -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionError.InvalidLinkage -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + } - override fun write(value: DynamicFieldOutputPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeDynamicFieldOutput.write(value.`data`, buf) + override fun write(value: ExecutionError, buf: ByteBuffer) { + when(value) { + is ExecutionError.InsufficientGas -> { + buf.putInt(1) + Unit + } + is ExecutionError.InvalidGasObject -> { + buf.putInt(2) + Unit + } + is ExecutionError.InvariantViolation -> { + buf.putInt(3) + Unit + } + is ExecutionError.FeatureNotYetSupported -> { + buf.putInt(4) + Unit + } + is ExecutionError.ObjectTooBig -> { + buf.putInt(5) + FfiConverterULong.write(value.`objectSize`, buf) + FfiConverterULong.write(value.`maxObjectSize`, buf) + Unit + } + is ExecutionError.PackageTooBig -> { + buf.putInt(6) + FfiConverterULong.write(value.`objectSize`, buf) + FfiConverterULong.write(value.`maxObjectSize`, buf) + Unit + } + is ExecutionError.CircularObjectOwnership -> { + buf.putInt(7) + FfiConverterTypeObjectId.write(value.`object`, buf) + Unit + } + is ExecutionError.InsufficientCoinBalance -> { + buf.putInt(8) + Unit + } + is ExecutionError.CoinBalanceOverflow -> { + buf.putInt(9) + Unit + } + is ExecutionError.PublishErrorNonZeroAddress -> { + buf.putInt(10) + Unit + } + is ExecutionError.IotaMoveVerification -> { + buf.putInt(11) + Unit + } + is ExecutionError.MovePrimitiveRuntime -> { + buf.putInt(12) + FfiConverterOptionalTypeMoveLocation.write(value.`location`, buf) + Unit + } + is ExecutionError.MoveAbort -> { + buf.putInt(13) + FfiConverterTypeMoveLocation.write(value.`location`, buf) + FfiConverterULong.write(value.`code`, buf) + Unit + } + is ExecutionError.VmVerificationOrDeserialization -> { + buf.putInt(14) + Unit + } + is ExecutionError.VmInvariantViolation -> { + buf.putInt(15) + Unit + } + is ExecutionError.FunctionNotFound -> { + buf.putInt(16) + Unit + } + is ExecutionError.ArityMismatch -> { + buf.putInt(17) + Unit + } + is ExecutionError.TypeArityMismatch -> { + buf.putInt(18) + Unit + } + is ExecutionError.NonEntryFunctionInvoked -> { + buf.putInt(19) + Unit + } + is ExecutionError.CommandArgument -> { + buf.putInt(20) + FfiConverterUShort.write(value.`argument`, buf) + FfiConverterTypeCommandArgumentError.write(value.`kind`, buf) + Unit + } + is ExecutionError.TypeArgument -> { + buf.putInt(21) + FfiConverterUShort.write(value.`typeArgument`, buf) + FfiConverterTypeTypeArgumentError.write(value.`kind`, buf) + Unit + } + is ExecutionError.UnusedValueWithoutDrop -> { + buf.putInt(22) + FfiConverterUShort.write(value.`result`, buf) + FfiConverterUShort.write(value.`subresult`, buf) + Unit + } + is ExecutionError.InvalidPublicFunctionReturnType -> { + buf.putInt(23) + FfiConverterUShort.write(value.`index`, buf) + Unit + } + is ExecutionError.InvalidTransferObject -> { + buf.putInt(24) + Unit + } + is ExecutionError.EffectsTooLarge -> { + buf.putInt(25) + FfiConverterULong.write(value.`currentSize`, buf) + FfiConverterULong.write(value.`maxSize`, buf) + Unit + } + is ExecutionError.PublishUpgradeMissingDependency -> { + buf.putInt(26) + Unit + } + is ExecutionError.PublishUpgradeDependencyDowngrade -> { + buf.putInt(27) + Unit + } + is ExecutionError.PackageUpgrade -> { + buf.putInt(28) + FfiConverterTypePackageUpgradeError.write(value.`kind`, buf) + Unit + } + is ExecutionError.WrittenObjectsTooLarge -> { + buf.putInt(29) + FfiConverterULong.write(value.`objectSize`, buf) + FfiConverterULong.write(value.`maxObjectSize`, buf) + Unit + } + is ExecutionError.CertificateDenied -> { + buf.putInt(30) + Unit + } + is ExecutionError.IotaMoveVerificationTimeout -> { + buf.putInt(31) + Unit + } + is ExecutionError.SharedObjectOperationNotAllowed -> { + buf.putInt(32) + Unit + } + is ExecutionError.InputObjectDeleted -> { + buf.putInt(33) + Unit + } + is ExecutionError.ExecutionCancelledDueToSharedObjectCongestion -> { + buf.putInt(34) + FfiConverterSequenceTypeObjectId.write(value.`congestedObjects`, buf) + Unit + } + is ExecutionError.ExecutionCancelledDueToSharedObjectCongestionV2 -> { + buf.putInt(35) + FfiConverterSequenceTypeObjectId.write(value.`congestedObjects`, buf) + FfiConverterULong.write(value.`suggestedGasPrice`, buf) + Unit + } + is ExecutionError.AddressDeniedForCoin -> { + buf.putInt(36) + FfiConverterTypeAddress.write(value.`address`, buf) + FfiConverterString.write(value.`coinType`, buf) + Unit + } + is ExecutionError.CoinTypeGlobalPause -> { + buf.putInt(37) + FfiConverterString.write(value.`coinType`, buf) + Unit + } + is ExecutionError.ExecutionCancelledDueToRandomnessUnavailable -> { + buf.putInt(38) + Unit + } + is ExecutionError.InvalidLinkage -> { + buf.putInt(39) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } } + + /** - * The value part of a dynamic field. + * The status of an executed Transaction + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * execution-status = success / failure + * success = %x00 + * failure = %x01 execution-error (option u64) + * ```xx */ -data class DynamicFieldValue ( - var `typeTag`: TypeTag, - var `bcs`: kotlin.ByteArray -) : Disposable { +sealed class ExecutionStatus: Disposable { - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`typeTag`, - this.`bcs` - ) - } + /** + * The Transaction successfully executed. + */ + object Success : ExecutionStatus() - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeDynamicFieldValue: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): DynamicFieldValue { - return DynamicFieldValue( - FfiConverterTypeTypeTag.read(buf), - FfiConverterByteArray.read(buf), - ) - } - - override fun allocationSize(value: DynamicFieldValue) = ( - FfiConverterTypeTypeTag.allocationSize(value.`typeTag`) + - FfiConverterByteArray.allocationSize(value.`bcs`) - ) - - override fun write(value: DynamicFieldValue, buf: ByteBuffer) { - FfiConverterTypeTypeTag.write(value.`typeTag`, buf) - FfiConverterByteArray.write(value.`bcs`, buf) + + /** + * The Transaction didn't execute successfully. + * + * Failed transactions are still committed to the blockchain but any + * intended effects are rolled back to prior to this transaction + * executing with the caveat that gas objects are still smashed and gas + * usage is still charged. + */ + data class Failure( + /** + * The error encountered during execution. + */ + val `error`: ExecutionError, + /** + * The command, if any, during which the error occurred. + */ + val `command`: kotlin.ULong?) : ExecutionStatus() { + companion object } -} - - + -data class EndOfEpochData ( - var `nextEpochCommittee`: List, - var `nextEpochProtocolVersion`: kotlin.ULong, - var `epochCommitments`: List, - var `epochSupplyChange`: kotlin.Long -) : Disposable { @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here override fun destroy() { - + when(this) { + is ExecutionStatus.Success -> {// Nothing to destroy + } + is ExecutionStatus.Failure -> { + Disposable.destroy( - this.`nextEpochCommittee`, - this.`nextEpochProtocolVersion`, - this.`epochCommitments`, - this.`epochSupplyChange` + this.`error`, + this.`command` ) + + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } companion object @@ -18107,193 +30034,137 @@ data class EndOfEpochData ( /** * @suppress */ -public object FfiConverterTypeEndOfEpochData: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EndOfEpochData { - return EndOfEpochData( - FfiConverterSequenceTypeValidatorCommitteeMember.read(buf), - FfiConverterULong.read(buf), - FfiConverterSequenceTypeCheckpointCommitment.read(buf), - FfiConverterLong.read(buf), - ) +public object FfiConverterTypeExecutionStatus : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): ExecutionStatus { + return when(buf.getInt()) { + 1 -> ExecutionStatus.Success + 2 -> ExecutionStatus.Failure( + FfiConverterTypeExecutionError.read(buf), + FfiConverterOptionalULong.read(buf), + ) + else -> throw RuntimeException("invalid enum value, something is very wrong!!") + } } - override fun allocationSize(value: EndOfEpochData) = ( - FfiConverterSequenceTypeValidatorCommitteeMember.allocationSize(value.`nextEpochCommittee`) + - FfiConverterULong.allocationSize(value.`nextEpochProtocolVersion`) + - FfiConverterSequenceTypeCheckpointCommitment.allocationSize(value.`epochCommitments`) + - FfiConverterLong.allocationSize(value.`epochSupplyChange`) - ) - - override fun write(value: EndOfEpochData, buf: ByteBuffer) { - FfiConverterSequenceTypeValidatorCommitteeMember.write(value.`nextEpochCommittee`, buf) - FfiConverterULong.write(value.`nextEpochProtocolVersion`, buf) - FfiConverterSequenceTypeCheckpointCommitment.write(value.`epochCommitments`, buf) - FfiConverterLong.write(value.`epochSupplyChange`, buf) + override fun allocationSize(value: ExecutionStatus) = when(value) { + is ExecutionStatus.Success -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ExecutionStatus.Failure -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeExecutionError.allocationSize(value.`error`) + + FfiConverterOptionalULong.allocationSize(value.`command`) + ) + } } -} - - -/** - * A page of items returned by the GraphQL server. - */ -data class EpochPage ( - /** - * Information about the page, such as the cursor and whether there are - * more pages. - */ - var `pageInfo`: PageInfo, - /** - * The data returned by the server. - */ - var `data`: List -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`pageInfo`, - this.`data` - ) + override fun write(value: ExecutionStatus, buf: ByteBuffer) { + when(value) { + is ExecutionStatus.Success -> { + buf.putInt(1) + Unit + } + is ExecutionStatus.Failure -> { + buf.putInt(2) + FfiConverterTypeExecutionError.write(value.`error`, buf) + FfiConverterOptionalULong.write(value.`command`, buf) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } - - companion object } -/** - * @suppress - */ -public object FfiConverterTypeEpochPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EpochPage { - return EpochPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeEpoch.read(buf), - ) - } - override fun allocationSize(value: EpochPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeEpoch.allocationSize(value.`data`) - ) - override fun write(value: EpochPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeEpoch.write(value.`data`, buf) - } -} -data class EventFilter ( - var `emittingModule`: kotlin.String? = null, - var `eventType`: kotlin.String? = null, - var `sender`: Address? = null, - var `transactionDigest`: kotlin.String? = null -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`emittingModule`, - this.`eventType`, - this.`sender`, - this.`transactionDigest` - ) - } +enum class IdOperation { + NONE, + CREATED, + DELETED; companion object } + /** * @suppress */ -public object FfiConverterTypeEventFilter: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EventFilter { - return EventFilter( - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalTypeAddress.read(buf), - FfiConverterOptionalString.read(buf), - ) +public object FfiConverterTypeIdOperation: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + IdOperation.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) } - override fun allocationSize(value: EventFilter) = ( - FfiConverterOptionalString.allocationSize(value.`emittingModule`) + - FfiConverterOptionalString.allocationSize(value.`eventType`) + - FfiConverterOptionalTypeAddress.allocationSize(value.`sender`) + - FfiConverterOptionalString.allocationSize(value.`transactionDigest`) - ) + override fun allocationSize(value: IdOperation) = 4UL - override fun write(value: EventFilter, buf: ByteBuffer) { - FfiConverterOptionalString.write(value.`emittingModule`, buf) - FfiConverterOptionalString.write(value.`eventType`, buf) - FfiConverterOptionalTypeAddress.write(value.`sender`, buf) - FfiConverterOptionalString.write(value.`transactionDigest`, buf) + override fun write(value: IdOperation, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) } } + + /** - * A page of items returned by the GraphQL server. + * State of an object prior to execution + * + * If an object exists (at root-level) in the store prior to this transaction, + * it should be Exist, otherwise it's NonExist, e.g. wrapped objects should be + * NonExist. + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * object-in = object-in-not-exist / object-in-exist + * + * object-in-not-exist = %x00 + * object-in-exist = %x01 u64 digest owner + * ``` */ -data class EventPage ( - /** - * Information about the page, such as the cursor and whether there are - * more pages. - */ - var `pageInfo`: PageInfo, +sealed class ObjectIn: Disposable { + + object NotExist : ObjectIn() + + /** - * The data returned by the server. + * The old version, digest and owner. */ - var `data`: List -) : Disposable { + data class Exist( + val `version`: kotlin.ULong, + val `digest`: ObjectDigest, + val `owner`: Owner) : ObjectIn() { + companion object + } + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here override fun destroy() { - + when(this) { + is ObjectIn.NotExist -> {// Nothing to destroy + } + is ObjectIn.Exist -> { + Disposable.destroy( - this.`pageInfo`, - this.`data` - ) - } - - companion object -} - -/** - * @suppress - */ -public object FfiConverterTypeEventPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EventPage { - return EventPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeEvent.read(buf), - ) - } - - override fun allocationSize(value: EventPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeEvent.allocationSize(value.`data`) + this.`version`, + this.`digest`, + this.`owner` ) - - override fun write(value: EventPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeEvent.write(value.`data`, buf) + + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } -} - - - -data class GasCostSummary ( - var `computationCost`: kotlin.ULong, - var `computationCostBurned`: kotlin.ULong, - var `storageCost`: kotlin.ULong, - var `storageRebate`: kotlin.ULong, - var `nonRefundableStorageFee`: kotlin.ULong -) { companion object } @@ -18301,66 +30172,127 @@ data class GasCostSummary ( /** * @suppress */ -public object FfiConverterTypeGasCostSummary: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): GasCostSummary { - return GasCostSummary( - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) +public object FfiConverterTypeObjectIn : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): ObjectIn { + return when(buf.getInt()) { + 1 -> ObjectIn.NotExist + 2 -> ObjectIn.Exist( + FfiConverterULong.read(buf), + FfiConverterTypeObjectDigest.read(buf), + FfiConverterTypeOwner.read(buf), + ) + else -> throw RuntimeException("invalid enum value, something is very wrong!!") + } } - override fun allocationSize(value: GasCostSummary) = ( - FfiConverterULong.allocationSize(value.`computationCost`) + - FfiConverterULong.allocationSize(value.`computationCostBurned`) + - FfiConverterULong.allocationSize(value.`storageCost`) + - FfiConverterULong.allocationSize(value.`storageRebate`) + - FfiConverterULong.allocationSize(value.`nonRefundableStorageFee`) - ) + override fun allocationSize(value: ObjectIn) = when(value) { + is ObjectIn.NotExist -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ObjectIn.Exist -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`version`) + + FfiConverterTypeObjectDigest.allocationSize(value.`digest`) + + FfiConverterTypeOwner.allocationSize(value.`owner`) + ) + } + } - override fun write(value: GasCostSummary, buf: ByteBuffer) { - FfiConverterULong.write(value.`computationCost`, buf) - FfiConverterULong.write(value.`computationCostBurned`, buf) - FfiConverterULong.write(value.`storageCost`, buf) - FfiConverterULong.write(value.`storageRebate`, buf) - FfiConverterULong.write(value.`nonRefundableStorageFee`, buf) + override fun write(value: ObjectIn, buf: ByteBuffer) { + when(value) { + is ObjectIn.NotExist -> { + buf.putInt(1) + Unit + } + is ObjectIn.Exist -> { + buf.putInt(2) + FfiConverterULong.write(value.`version`, buf) + FfiConverterTypeObjectDigest.write(value.`digest`, buf) + FfiConverterTypeOwner.write(value.`owner`, buf) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } } + + /** - * Payment information for executing a transaction + * State of an object after execution * * # BCS * * The BCS serialized form for this type is defined by the following ABNF: * * ```text - * gas-payment = (vector object-ref) ; gas coin objects - * address ; owner - * u64 ; price - * u64 ; budget + * object-out = object-out-not-exist + * =/ object-out-object-write + * =/ object-out-package-write + * + * + * object-out-not-exist = %x00 + * object-out-object-write = %x01 digest owner + * object-out-package-write = %x02 version digest * ``` */ -data class GasPayment ( - var `objects`: List, - var `owner`: Address, - var `price`: kotlin.ULong, - var `budget`: kotlin.ULong -) : Disposable { +sealed class ObjectOut: Disposable { + + /** + * Same definition as in ObjectIn. + */ + object NotExist : ObjectOut() + + + /** + * Any written object, including all of mutated, created, unwrapped today. + */ + data class ObjectWrite( + val `digest`: ObjectDigest, + val `owner`: Owner) : ObjectOut() { + companion object + } + + /** + * Packages writes need to be tracked separately with version because + * we don't use lamport version for package publish and upgrades. + */ + data class PackageWrite( + val `version`: kotlin.ULong, + val `digest`: ObjectDigest) : ObjectOut() { + companion object + } + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here override fun destroy() { - + when(this) { + is ObjectOut.NotExist -> {// Nothing to destroy + } + is ObjectOut.ObjectWrite -> { + Disposable.destroy( - this.`objects`, - this.`owner`, - this.`price`, - this.`budget` + this.`digest`, + this.`owner` + ) + + } + is ObjectOut.PackageWrite -> { + + Disposable.destroy( + this.`version`, + this.`digest` ) + + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } companion object @@ -18369,55 +30301,189 @@ data class GasPayment ( /** * @suppress */ -public object FfiConverterTypeGasPayment: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): GasPayment { - return GasPayment( - FfiConverterSequenceTypeObjectReference.read(buf), - FfiConverterTypeAddress.read(buf), - FfiConverterULong.read(buf), - FfiConverterULong.read(buf), - ) +public object FfiConverterTypeObjectOut : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): ObjectOut { + return when(buf.getInt()) { + 1 -> ObjectOut.NotExist + 2 -> ObjectOut.ObjectWrite( + FfiConverterTypeObjectDigest.read(buf), + FfiConverterTypeOwner.read(buf), + ) + 3 -> ObjectOut.PackageWrite( + FfiConverterULong.read(buf), + FfiConverterTypeObjectDigest.read(buf), + ) + else -> throw RuntimeException("invalid enum value, something is very wrong!!") + } } - override fun allocationSize(value: GasPayment) = ( - FfiConverterSequenceTypeObjectReference.allocationSize(value.`objects`) + - FfiConverterTypeAddress.allocationSize(value.`owner`) + - FfiConverterULong.allocationSize(value.`price`) + - FfiConverterULong.allocationSize(value.`budget`) - ) + override fun allocationSize(value: ObjectOut) = when(value) { + is ObjectOut.NotExist -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is ObjectOut.ObjectWrite -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeObjectDigest.allocationSize(value.`digest`) + + FfiConverterTypeOwner.allocationSize(value.`owner`) + ) + } + is ObjectOut.PackageWrite -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`version`) + + FfiConverterTypeObjectDigest.allocationSize(value.`digest`) + ) + } + } - override fun write(value: GasPayment, buf: ByteBuffer) { - FfiConverterSequenceTypeObjectReference.write(value.`objects`, buf) - FfiConverterTypeAddress.write(value.`owner`, buf) - FfiConverterULong.write(value.`price`, buf) - FfiConverterULong.write(value.`budget`, buf) + override fun write(value: ObjectOut, buf: ByteBuffer) { + when(value) { + is ObjectOut.NotExist -> { + buf.putInt(1) + Unit + } + is ObjectOut.ObjectWrite -> { + buf.putInt(2) + FfiConverterTypeObjectDigest.write(value.`digest`, buf) + FfiConverterTypeOwner.write(value.`owner`, buf) + Unit + } + is ObjectOut.PackageWrite -> { + buf.putInt(3) + FfiConverterULong.write(value.`version`, buf) + FfiConverterTypeObjectDigest.write(value.`digest`, buf) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } } + + /** - * A page of items returned by the GraphQL server. + * An error with a upgrading a package + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * package-upgrade-error = unable-to-fetch-package / + * not-a-package / + * incompatible-upgrade / + * digest-does-not-match / + * unknown-upgrade-policy / + * package-id-does-not-match + * + * unable-to-fetch-package = %x00 object-id + * not-a-package = %x01 object-id + * incompatible-upgrade = %x02 + * digest-does-not-match = %x03 digest + * unknown-upgrade-policy = %x04 u8 + * package-id-does-not-match = %x05 object-id object-id + * ``` */ -data class MovePackagePage ( +sealed class PackageUpgradeError: Disposable { + /** - * Information about the page, such as the cursor and whether there are - * more pages. + * Unable to fetch package */ - var `pageInfo`: PageInfo, + data class UnableToFetchPackage( + val `packageId`: ObjectId) : PackageUpgradeError() { + companion object + } + /** - * The data returned by the server. + * Object is not a package */ - var `data`: List -) : Disposable { + data class NotAPackage( + val `objectId`: ObjectId) : PackageUpgradeError() { + companion object + } + + /** + * Package upgrade is incompatible with previous version + */ + object IncompatibleUpgrade : PackageUpgradeError() + + + /** + * Digest in upgrade ticket and computed digest differ + */ + data class DigestDoesNotMatch( + val `digest`: Digest) : PackageUpgradeError() { + companion object + } + + /** + * Upgrade policy is not valid + */ + data class UnknownUpgradePolicy( + val `policy`: kotlin.UByte) : PackageUpgradeError() { + companion object + } + + /** + * PackageId does not matach PackageId in upgrade ticket + */ + data class PackageIdDoesNotMatch( + val `packageId`: ObjectId, + val `ticketId`: ObjectId) : PackageUpgradeError() { + companion object + } + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here override fun destroy() { - + when(this) { + is PackageUpgradeError.UnableToFetchPackage -> { + Disposable.destroy( - this.`pageInfo`, - this.`data` + this.`packageId` + ) + + } + is PackageUpgradeError.NotAPackage -> { + + Disposable.destroy( + this.`objectId` + ) + + } + is PackageUpgradeError.IncompatibleUpgrade -> {// Nothing to destroy + } + is PackageUpgradeError.DigestDoesNotMatch -> { + + Disposable.destroy( + this.`digest` + ) + + } + is PackageUpgradeError.UnknownUpgradePolicy -> { + + Disposable.destroy( + this.`policy` ) + + } + is PackageUpgradeError.PackageIdDoesNotMatch -> { + + Disposable.destroy( + this.`packageId`, + this.`ticketId` + ) + + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } companion object @@ -18426,228 +30492,238 @@ data class MovePackagePage ( /** * @suppress */ -public object FfiConverterTypeMovePackagePage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): MovePackagePage { - return MovePackagePage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeMovePackage.read(buf), - ) +public object FfiConverterTypePackageUpgradeError : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): PackageUpgradeError { + return when(buf.getInt()) { + 1 -> PackageUpgradeError.UnableToFetchPackage( + FfiConverterTypeObjectId.read(buf), + ) + 2 -> PackageUpgradeError.NotAPackage( + FfiConverterTypeObjectId.read(buf), + ) + 3 -> PackageUpgradeError.IncompatibleUpgrade + 4 -> PackageUpgradeError.DigestDoesNotMatch( + FfiConverterTypeDigest.read(buf), + ) + 5 -> PackageUpgradeError.UnknownUpgradePolicy( + FfiConverterUByte.read(buf), + ) + 6 -> PackageUpgradeError.PackageIdDoesNotMatch( + FfiConverterTypeObjectId.read(buf), + FfiConverterTypeObjectId.read(buf), + ) + else -> throw RuntimeException("invalid enum value, something is very wrong!!") + } } - override fun allocationSize(value: MovePackagePage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeMovePackage.allocationSize(value.`data`) - ) - - override fun write(value: MovePackagePage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeMovePackage.write(value.`data`, buf) + override fun allocationSize(value: PackageUpgradeError) = when(value) { + is PackageUpgradeError.UnableToFetchPackage -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeObjectId.allocationSize(value.`packageId`) + ) + } + is PackageUpgradeError.NotAPackage -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeObjectId.allocationSize(value.`objectId`) + ) + } + is PackageUpgradeError.IncompatibleUpgrade -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is PackageUpgradeError.DigestDoesNotMatch -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeDigest.allocationSize(value.`digest`) + ) + } + is PackageUpgradeError.UnknownUpgradePolicy -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterUByte.allocationSize(value.`policy`) + ) + } + is PackageUpgradeError.PackageIdDoesNotMatch -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterTypeObjectId.allocationSize(value.`packageId`) + + FfiConverterTypeObjectId.allocationSize(value.`ticketId`) + ) + } } -} - - -data class ObjectFilter ( - var `typeTag`: kotlin.String?, - var `owner`: Address?, - var `objectIds`: List? -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`typeTag`, - this.`owner`, - this.`objectIds` - ) + override fun write(value: PackageUpgradeError, buf: ByteBuffer) { + when(value) { + is PackageUpgradeError.UnableToFetchPackage -> { + buf.putInt(1) + FfiConverterTypeObjectId.write(value.`packageId`, buf) + Unit + } + is PackageUpgradeError.NotAPackage -> { + buf.putInt(2) + FfiConverterTypeObjectId.write(value.`objectId`, buf) + Unit + } + is PackageUpgradeError.IncompatibleUpgrade -> { + buf.putInt(3) + Unit + } + is PackageUpgradeError.DigestDoesNotMatch -> { + buf.putInt(4) + FfiConverterTypeDigest.write(value.`digest`, buf) + Unit + } + is PackageUpgradeError.UnknownUpgradePolicy -> { + buf.putInt(5) + FfiConverterUByte.write(value.`policy`, buf) + Unit + } + is PackageUpgradeError.PackageIdDoesNotMatch -> { + buf.putInt(6) + FfiConverterTypeObjectId.write(value.`packageId`, buf) + FfiConverterTypeObjectId.write(value.`ticketId`, buf) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } - - companion object } -/** - * @suppress - */ -public object FfiConverterTypeObjectFilter: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ObjectFilter { - return ObjectFilter( - FfiConverterOptionalString.read(buf), - FfiConverterOptionalTypeAddress.read(buf), - FfiConverterOptionalSequenceTypeObjectId.read(buf), - ) - } - override fun allocationSize(value: ObjectFilter) = ( - FfiConverterOptionalString.allocationSize(value.`typeTag`) + - FfiConverterOptionalTypeAddress.allocationSize(value.`owner`) + - FfiConverterOptionalSequenceTypeObjectId.allocationSize(value.`objectIds`) - ) - override fun write(value: ObjectFilter, buf: ByteBuffer) { - FfiConverterOptionalString.write(value.`typeTag`, buf) - FfiConverterOptionalTypeAddress.write(value.`owner`, buf) - FfiConverterOptionalSequenceTypeObjectId.write(value.`objectIds`, buf) - } -} -/** - * A page of items returned by the GraphQL server. - */ -data class ObjectPage ( - /** - * Information about the page, such as the cursor and whether there are - * more pages. - */ - var `pageInfo`: PageInfo, - /** - * The data returned by the server. - */ - var `data`: List -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { + +sealed class SdkFfiException(message: String): kotlin.Exception(message) { - Disposable.destroy( - this.`pageInfo`, - this.`data` - ) + class Generic(message: String) : SdkFfiException(message) + + + companion object ErrorHandler : UniffiRustCallStatusErrorHandler { + override fun lift(error_buf: RustBuffer.ByValue): SdkFfiException = FfiConverterTypeSdkFfiError.lift(error_buf) } - - companion object } /** * @suppress */ -public object FfiConverterTypeObjectPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ObjectPage { - return ObjectPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeObject.read(buf), - ) +public object FfiConverterTypeSdkFfiError : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): SdkFfiException { + + return when(buf.getInt()) { + 1 -> SdkFfiException.Generic(FfiConverterString.read(buf)) + else -> throw RuntimeException("invalid error enum value, something is very wrong!!") + } + } - override fun allocationSize(value: ObjectPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeObject.allocationSize(value.`data`) - ) + override fun allocationSize(value: SdkFfiException): ULong { + return 4UL + } - override fun write(value: ObjectPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeObject.write(value.`data`, buf) + override fun write(value: SdkFfiException, buf: ByteBuffer) { + when(value) { + is SdkFfiException.Generic -> { + buf.putInt(1) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } + } -/** - * Reference to an object - * - * Contains sufficient information to uniquely identify a specific object. - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * object-ref = object-id u64 digest - * ``` - */ -data class ObjectReference ( - var `objectId`: ObjectId, - var `version`: kotlin.ULong, - var `digest`: ObjectDigest -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`objectId`, - this.`version`, - this.`digest` - ) - } + +enum class SignatureScheme { + ED25519, + SECP256K1, + SECP256R1, + MULTISIG, + BLS12381, + ZK_LOGIN, + PASSKEY; companion object } + /** * @suppress */ -public object FfiConverterTypeObjectReference: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ObjectReference { - return ObjectReference( - FfiConverterTypeObjectId.read(buf), - FfiConverterULong.read(buf), - FfiConverterTypeObjectDigest.read(buf), - ) +public object FfiConverterTypeSignatureScheme: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + SignatureScheme.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) } - override fun allocationSize(value: ObjectReference) = ( - FfiConverterTypeObjectId.allocationSize(value.`objectId`) + - FfiConverterULong.allocationSize(value.`version`) + - FfiConverterTypeObjectDigest.allocationSize(value.`digest`) - ) + override fun allocationSize(value: SignatureScheme) = 4UL - override fun write(value: ObjectReference, buf: ByteBuffer) { - FfiConverterTypeObjectId.write(value.`objectId`, buf) - FfiConverterULong.write(value.`version`, buf) - FfiConverterTypeObjectDigest.write(value.`digest`, buf) + override fun write(value: SignatureScheme, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) } } -data class PageInfo ( - var `hasPreviousPage`: kotlin.Boolean, - var `hasNextPage`: kotlin.Boolean, - var `startCursor`: kotlin.String?, - var `endCursor`: kotlin.String? -) { + + + +enum class TransactionBlockKindInput { + SYSTEM_TX, + PROGRAMMABLE_TX, + GENESIS, + CONSENSUS_COMMIT_PROLOGUE_V1, + AUTHENTICATOR_STATE_UPDATE_V1, + RANDOMNESS_STATE_UPDATE, + END_OF_EPOCH_TX; companion object } + /** * @suppress */ -public object FfiConverterTypePageInfo: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PageInfo { - return PageInfo( - FfiConverterBoolean.read(buf), - FfiConverterBoolean.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - ) +public object FfiConverterTypeTransactionBlockKindInput: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + TransactionBlockKindInput.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) } - override fun allocationSize(value: PageInfo) = ( - FfiConverterBoolean.allocationSize(value.`hasPreviousPage`) + - FfiConverterBoolean.allocationSize(value.`hasNextPage`) + - FfiConverterOptionalString.allocationSize(value.`startCursor`) + - FfiConverterOptionalString.allocationSize(value.`endCursor`) - ) + override fun allocationSize(value: TransactionBlockKindInput) = 4UL - override fun write(value: PageInfo, buf: ByteBuffer) { - FfiConverterBoolean.write(value.`hasPreviousPage`, buf) - FfiConverterBoolean.write(value.`hasNextPage`, buf) - FfiConverterOptionalString.write(value.`startCursor`, buf) - FfiConverterOptionalString.write(value.`endCursor`, buf) + override fun write(value: TransactionBlockKindInput, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) } } -data class PaginationFilter ( - var `direction`: Direction, - var `cursor`: kotlin.String? = null, - var `limit`: kotlin.Int? = null -) { + + +sealed class TransactionExpiration { + + object None : TransactionExpiration() + + + data class Epoch( + val v1: kotlin.ULong) : TransactionExpiration() { + companion object + } + + companion object } @@ -18655,103 +30731,185 @@ data class PaginationFilter ( /** * @suppress */ -public object FfiConverterTypePaginationFilter: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): PaginationFilter { - return PaginationFilter( - FfiConverterTypeDirection.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalInt.read(buf), - ) +public object FfiConverterTypeTransactionExpiration : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): TransactionExpiration { + return when(buf.getInt()) { + 1 -> TransactionExpiration.None + 2 -> TransactionExpiration.Epoch( + FfiConverterULong.read(buf), + ) + else -> throw RuntimeException("invalid enum value, something is very wrong!!") + } } - override fun allocationSize(value: PaginationFilter) = ( - FfiConverterTypeDirection.allocationSize(value.`direction`) + - FfiConverterOptionalString.allocationSize(value.`cursor`) + - FfiConverterOptionalInt.allocationSize(value.`limit`) - ) + override fun allocationSize(value: TransactionExpiration) = when(value) { + is TransactionExpiration.None -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + is TransactionExpiration.Epoch -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.v1) + ) + } + } - override fun write(value: PaginationFilter, buf: ByteBuffer) { - FfiConverterTypeDirection.write(value.`direction`, buf) - FfiConverterOptionalString.write(value.`cursor`, buf) - FfiConverterOptionalInt.write(value.`limit`, buf) + override fun write(value: TransactionExpiration, buf: ByteBuffer) { + when(value) { + is TransactionExpiration.None -> { + buf.putInt(1) + Unit + } + is TransactionExpiration.Epoch -> { + buf.putInt(2) + FfiConverterULong.write(value.v1, buf) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } } -/** - * A page of items returned by the GraphQL server. - */ -data class SignedTransactionPage ( - /** - * Information about the page, such as the cursor and whether there are - * more pages. - */ - var `pageInfo`: PageInfo, - /** - * The data returned by the server. - */ - var `data`: List -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`pageInfo`, - this.`data` - ) - } + + + +enum class TypeArgumentError { + TYPE_NOT_FOUND, + CONSTRAINT_NOT_SATISFIED; companion object } + /** * @suppress */ -public object FfiConverterTypeSignedTransactionPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): SignedTransactionPage { - return SignedTransactionPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeSignedTransaction.read(buf), - ) +public object FfiConverterTypeTypeArgumentError: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + TypeArgumentError.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) } - override fun allocationSize(value: SignedTransactionPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeSignedTransaction.allocationSize(value.`data`) - ) + override fun allocationSize(value: TypeArgumentError) = 4UL - override fun write(value: SignedTransactionPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeSignedTransaction.write(value.`data`, buf) + override fun write(value: TypeArgumentError, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) } } + + /** - * A page of items returned by the GraphQL server. + * Type of unchanged shared object + * + * # BCS + * + * The BCS serialized form for this type is defined by the following ABNF: + * + * ```text + * unchanged-shared-object-kind = read-only-root + * =/ mutate-deleted + * =/ read-deleted + * =/ cancelled + * =/ per-epoch-config + * + * read-only-root = %x00 u64 digest + * mutate-deleted = %x01 u64 + * read-deleted = %x02 u64 + * cancelled = %x03 u64 + * per-epoch-config = %x04 + * ``` */ -data class TransactionDataEffectsPage ( +sealed class UnchangedSharedKind: Disposable { + /** - * Information about the page, such as the cursor and whether there are - * more pages. + * Read-only shared objects from the input. We don't really need + * ObjectDigest for protocol correctness, but it will make it easier to + * verify untrusted read. */ - var `pageInfo`: PageInfo, + data class ReadOnlyRoot( + val `version`: kotlin.ULong, + val `digest`: ObjectDigest) : UnchangedSharedKind() { + companion object + } + /** - * The data returned by the server. + * Deleted shared objects that appear mutably/owned in the input. */ - var `data`: List -) : Disposable { + data class MutateDeleted( + val `version`: kotlin.ULong) : UnchangedSharedKind() { + companion object + } + + /** + * Deleted shared objects that appear as read-only in the input. + */ + data class ReadDeleted( + val `version`: kotlin.ULong) : UnchangedSharedKind() { + companion object + } + + /** + * Shared objects in cancelled transaction. The sequence number embed + * cancellation reason. + */ + data class Cancelled( + val `version`: kotlin.ULong) : UnchangedSharedKind() { + companion object + } + + /** + * Read of a per-epoch config object that should remain the same during an + * epoch. + */ + object PerEpochConfig : UnchangedSharedKind() + + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here override fun destroy() { - + when(this) { + is UnchangedSharedKind.ReadOnlyRoot -> { + Disposable.destroy( - this.`pageInfo`, - this.`data` + this.`version`, + this.`digest` + ) + + } + is UnchangedSharedKind.MutateDeleted -> { + + Disposable.destroy( + this.`version` + ) + + } + is UnchangedSharedKind.ReadDeleted -> { + + Disposable.destroy( + this.`version` ) + + } + is UnchangedSharedKind.Cancelled -> { + + Disposable.destroy( + this.`version` + ) + + } + is UnchangedSharedKind.PerEpochConfig -> {// Nothing to destroy + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } companion object @@ -18760,743 +30918,670 @@ data class TransactionDataEffectsPage ( /** * @suppress */ -public object FfiConverterTypeTransactionDataEffectsPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionDataEffectsPage { - return TransactionDataEffectsPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeTransactionDataEffects.read(buf), - ) +public object FfiConverterTypeUnchangedSharedKind : FfiConverterRustBuffer{ + override fun read(buf: ByteBuffer): UnchangedSharedKind { + return when(buf.getInt()) { + 1 -> UnchangedSharedKind.ReadOnlyRoot( + FfiConverterULong.read(buf), + FfiConverterTypeObjectDigest.read(buf), + ) + 2 -> UnchangedSharedKind.MutateDeleted( + FfiConverterULong.read(buf), + ) + 3 -> UnchangedSharedKind.ReadDeleted( + FfiConverterULong.read(buf), + ) + 4 -> UnchangedSharedKind.Cancelled( + FfiConverterULong.read(buf), + ) + 5 -> UnchangedSharedKind.PerEpochConfig + else -> throw RuntimeException("invalid enum value, something is very wrong!!") + } } - override fun allocationSize(value: TransactionDataEffectsPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeTransactionDataEffects.allocationSize(value.`data`) - ) + override fun allocationSize(value: UnchangedSharedKind) = when(value) { + is UnchangedSharedKind.ReadOnlyRoot -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`version`) + + FfiConverterTypeObjectDigest.allocationSize(value.`digest`) + ) + } + is UnchangedSharedKind.MutateDeleted -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`version`) + ) + } + is UnchangedSharedKind.ReadDeleted -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`version`) + ) + } + is UnchangedSharedKind.Cancelled -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + + FfiConverterULong.allocationSize(value.`version`) + ) + } + is UnchangedSharedKind.PerEpochConfig -> { + // Add the size for the Int that specifies the variant plus the size needed for all fields + ( + 4UL + ) + } + } - override fun write(value: TransactionDataEffectsPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeTransactionDataEffects.write(value.`data`, buf) + override fun write(value: UnchangedSharedKind, buf: ByteBuffer) { + when(value) { + is UnchangedSharedKind.ReadOnlyRoot -> { + buf.putInt(1) + FfiConverterULong.write(value.`version`, buf) + FfiConverterTypeObjectDigest.write(value.`digest`, buf) + Unit + } + is UnchangedSharedKind.MutateDeleted -> { + buf.putInt(2) + FfiConverterULong.write(value.`version`, buf) + Unit + } + is UnchangedSharedKind.ReadDeleted -> { + buf.putInt(3) + FfiConverterULong.write(value.`version`, buf) + Unit + } + is UnchangedSharedKind.Cancelled -> { + buf.putInt(4) + FfiConverterULong.write(value.`version`, buf) + Unit + } + is UnchangedSharedKind.PerEpochConfig -> { + buf.putInt(5) + Unit + } + }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } } } + + + /** - * A page of items returned by the GraphQL server. + * @suppress */ -data class TransactionEffectsPage ( - /** - * Information about the page, such as the cursor and whether there are - * more pages. - */ - var `pageInfo`: PageInfo, - /** - * The data returned by the server. - */ - var `data`: List -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`pageInfo`, - this.`data` - ) +public object FfiConverterOptionalUInt: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): kotlin.UInt? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterUInt.read(buf) + } + + override fun allocationSize(value: kotlin.UInt?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterUInt.allocationSize(value) + } + } + + override fun write(value: kotlin.UInt?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterUInt.write(value, buf) + } } - - companion object } + + + /** * @suppress */ -public object FfiConverterTypeTransactionEffectsPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionEffectsPage { - return TransactionEffectsPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeTransactionEffects.read(buf), - ) +public object FfiConverterOptionalInt: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): kotlin.Int? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterInt.read(buf) } - override fun allocationSize(value: TransactionEffectsPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeTransactionEffects.allocationSize(value.`data`) - ) + override fun allocationSize(value: kotlin.Int?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterInt.allocationSize(value) + } + } - override fun write(value: TransactionEffectsPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeTransactionEffects.write(value.`data`, buf) + override fun write(value: kotlin.Int?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterInt.write(value, buf) + } } } -data class TransactionMetadata ( - var `gasBudget`: kotlin.ULong? = null, - var `gasObjects`: List? = null, - var `gasPrice`: kotlin.ULong? = null, - var `gasSponsor`: Address? = null, - var `sender`: Address? = null -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`gasBudget`, - this.`gasObjects`, - this.`gasPrice`, - this.`gasSponsor`, - this.`sender` - ) - } - - companion object -} /** * @suppress */ -public object FfiConverterTypeTransactionMetadata: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionMetadata { - return TransactionMetadata( - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalSequenceTypeObjectRef.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalTypeAddress.read(buf), - FfiConverterOptionalTypeAddress.read(buf), - ) +public object FfiConverterOptionalULong: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): kotlin.ULong? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterULong.read(buf) } - override fun allocationSize(value: TransactionMetadata) = ( - FfiConverterOptionalULong.allocationSize(value.`gasBudget`) + - FfiConverterOptionalSequenceTypeObjectRef.allocationSize(value.`gasObjects`) + - FfiConverterOptionalULong.allocationSize(value.`gasPrice`) + - FfiConverterOptionalTypeAddress.allocationSize(value.`gasSponsor`) + - FfiConverterOptionalTypeAddress.allocationSize(value.`sender`) - ) - - override fun write(value: TransactionMetadata, buf: ByteBuffer) { - FfiConverterOptionalULong.write(value.`gasBudget`, buf) - FfiConverterOptionalSequenceTypeObjectRef.write(value.`gasObjects`, buf) - FfiConverterOptionalULong.write(value.`gasPrice`, buf) - FfiConverterOptionalTypeAddress.write(value.`gasSponsor`, buf) - FfiConverterOptionalTypeAddress.write(value.`sender`, buf) + override fun allocationSize(value: kotlin.ULong?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterULong.allocationSize(value) + } + } + + override fun write(value: kotlin.ULong?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterULong.write(value, buf) + } } } -data class TransactionsFilter ( - var `function`: kotlin.String? = null, - var `kind`: TransactionBlockKindInput? = null, - var `afterCheckpoint`: kotlin.ULong? = null, - var `atCheckpoint`: kotlin.ULong? = null, - var `beforeCheckpoint`: kotlin.ULong? = null, - var `signAddress`: Address? = null, - var `recvAddress`: Address? = null, - var `inputObject`: ObjectId? = null, - var `changedObject`: ObjectId? = null, - var `transactionIds`: List? = null, - var `wrappedOrDeletedObject`: ObjectId? = null -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`function`, - this.`kind`, - this.`afterCheckpoint`, - this.`atCheckpoint`, - this.`beforeCheckpoint`, - this.`signAddress`, - this.`recvAddress`, - this.`inputObject`, - this.`changedObject`, - this.`transactionIds`, - this.`wrappedOrDeletedObject` - ) - } - - companion object -} /** * @suppress */ -public object FfiConverterTypeTransactionsFilter: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionsFilter { - return TransactionsFilter( - FfiConverterOptionalString.read(buf), - FfiConverterOptionalTypeTransactionBlockKindInput.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalTypeAddress.read(buf), - FfiConverterOptionalTypeAddress.read(buf), - FfiConverterOptionalTypeObjectId.read(buf), - FfiConverterOptionalTypeObjectId.read(buf), - FfiConverterOptionalSequenceString.read(buf), - FfiConverterOptionalTypeObjectId.read(buf), - ) +public object FfiConverterOptionalBoolean: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): kotlin.Boolean? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterBoolean.read(buf) } - override fun allocationSize(value: TransactionsFilter) = ( - FfiConverterOptionalString.allocationSize(value.`function`) + - FfiConverterOptionalTypeTransactionBlockKindInput.allocationSize(value.`kind`) + - FfiConverterOptionalULong.allocationSize(value.`afterCheckpoint`) + - FfiConverterOptionalULong.allocationSize(value.`atCheckpoint`) + - FfiConverterOptionalULong.allocationSize(value.`beforeCheckpoint`) + - FfiConverterOptionalTypeAddress.allocationSize(value.`signAddress`) + - FfiConverterOptionalTypeAddress.allocationSize(value.`recvAddress`) + - FfiConverterOptionalTypeObjectId.allocationSize(value.`inputObject`) + - FfiConverterOptionalTypeObjectId.allocationSize(value.`changedObject`) + - FfiConverterOptionalSequenceString.allocationSize(value.`transactionIds`) + - FfiConverterOptionalTypeObjectId.allocationSize(value.`wrappedOrDeletedObject`) - ) + override fun allocationSize(value: kotlin.Boolean?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterBoolean.allocationSize(value) + } + } - override fun write(value: TransactionsFilter, buf: ByteBuffer) { - FfiConverterOptionalString.write(value.`function`, buf) - FfiConverterOptionalTypeTransactionBlockKindInput.write(value.`kind`, buf) - FfiConverterOptionalULong.write(value.`afterCheckpoint`, buf) - FfiConverterOptionalULong.write(value.`atCheckpoint`, buf) - FfiConverterOptionalULong.write(value.`beforeCheckpoint`, buf) - FfiConverterOptionalTypeAddress.write(value.`signAddress`, buf) - FfiConverterOptionalTypeAddress.write(value.`recvAddress`, buf) - FfiConverterOptionalTypeObjectId.write(value.`inputObject`, buf) - FfiConverterOptionalTypeObjectId.write(value.`changedObject`, buf) - FfiConverterOptionalSequenceString.write(value.`transactionIds`, buf) - FfiConverterOptionalTypeObjectId.write(value.`wrappedOrDeletedObject`, buf) + override fun write(value: kotlin.Boolean?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterBoolean.write(value, buf) + } } } + /** - * Represents a validator in the system. + * @suppress */ -data class Validator ( - /** - * The APY of this validator in basis points. - * To get the APY in percentage, divide by 100. - */ - var `apy`: kotlin.Int?, - /** - * The validator's address. - */ - var `address`: Address, - /** - * The fee charged by the validator for staking services. - */ - var `commissionRate`: kotlin.Int?, - /** - * Validator's credentials. - */ - var `credentials`: ValidatorCredentials?, - /** - * Validator's description. - */ - var `description`: kotlin.String?, - /** - * Number of exchange rates in the table. - */ - var `exchangeRatesSize`: kotlin.ULong?, - /** - * The reference gas price for this epoch. - */ - var `gasPrice`: kotlin.ULong?, - /** - * Validator's name. - */ - var `name`: kotlin.String?, - /** - * Validator's url containing their custom image. - */ - var `imageUrl`: kotlin.String?, - /** - * The proposed next epoch fee for the validator's staking services. - */ - var `nextEpochCommissionRate`: kotlin.Int?, - /** - * Validator's credentials for the next epoch. - */ - var `nextEpochCredentials`: ValidatorCredentials?, - /** - * The validator's gas price quote for the next epoch. - */ - var `nextEpochGasPrice`: kotlin.ULong?, - /** - * The total number of IOTA tokens in this pool plus - * the pending stake amount for this epoch. - */ - var `nextEpochStake`: kotlin.ULong?, - /** - * The validator's current valid `Cap` object. Validators can delegate - * the operation ability to another address. The address holding this `Cap` - * object can then update the reference gas price and tallying rule on - * behalf of the validator. - */ - var `operationCap`: kotlin.ByteArray?, - /** - * Pending pool token withdrawn during the current epoch, emptied at epoch - * boundaries. - */ - var `pendingPoolTokenWithdraw`: kotlin.ULong?, - /** - * Pending stake amount for this epoch. - */ - var `pendingStake`: kotlin.ULong?, - /** - * Pending stake withdrawn during the current epoch, emptied at epoch - * boundaries. - */ - var `pendingTotalIotaWithdraw`: kotlin.ULong?, - /** - * Total number of pool tokens issued by the pool. - */ - var `poolTokenBalance`: kotlin.ULong?, - /** - * Validator's homepage URL. - */ - var `projectUrl`: kotlin.String?, - /** - * The epoch stake rewards will be added here at the end of each epoch. - */ - var `rewardsPool`: kotlin.ULong?, - /** - * The epoch at which this pool became active. - */ - var `stakingPoolActivationEpoch`: kotlin.ULong?, - /** - * The ID of this validator's `0x3::staking_pool::StakingPool`. - */ - var `stakingPoolId`: ObjectId, - /** - * The total number of IOTA tokens in this pool. - */ - var `stakingPoolIotaBalance`: kotlin.ULong?, - /** - * The voting power of this validator in basis points (e.g., 100 = 1% - * voting power). - */ - var `votingPower`: kotlin.Int? -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`apy`, - this.`address`, - this.`commissionRate`, - this.`credentials`, - this.`description`, - this.`exchangeRatesSize`, - this.`gasPrice`, - this.`name`, - this.`imageUrl`, - this.`nextEpochCommissionRate`, - this.`nextEpochCredentials`, - this.`nextEpochGasPrice`, - this.`nextEpochStake`, - this.`operationCap`, - this.`pendingPoolTokenWithdraw`, - this.`pendingStake`, - this.`pendingTotalIotaWithdraw`, - this.`poolTokenBalance`, - this.`projectUrl`, - this.`rewardsPool`, - this.`stakingPoolActivationEpoch`, - this.`stakingPoolId`, - this.`stakingPoolIotaBalance`, - this.`votingPower` - ) +public object FfiConverterOptionalString: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): kotlin.String? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterString.read(buf) + } + + override fun allocationSize(value: kotlin.String?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterString.allocationSize(value) + } + } + + override fun write(value: kotlin.String?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterString.write(value, buf) + } } - - companion object } + + + /** * @suppress */ -public object FfiConverterTypeValidator: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Validator { - return Validator( - FfiConverterOptionalInt.read(buf), - FfiConverterTypeAddress.read(buf), - FfiConverterOptionalInt.read(buf), - FfiConverterOptionalTypeValidatorCredentials.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalInt.read(buf), - FfiConverterOptionalTypeValidatorCredentials.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalByteArray.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterTypeObjectId.read(buf), - FfiConverterOptionalULong.read(buf), - FfiConverterOptionalInt.read(buf), - ) +public object FfiConverterOptionalByteArray: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): kotlin.ByteArray? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterByteArray.read(buf) } - override fun allocationSize(value: Validator) = ( - FfiConverterOptionalInt.allocationSize(value.`apy`) + - FfiConverterTypeAddress.allocationSize(value.`address`) + - FfiConverterOptionalInt.allocationSize(value.`commissionRate`) + - FfiConverterOptionalTypeValidatorCredentials.allocationSize(value.`credentials`) + - FfiConverterOptionalString.allocationSize(value.`description`) + - FfiConverterOptionalULong.allocationSize(value.`exchangeRatesSize`) + - FfiConverterOptionalULong.allocationSize(value.`gasPrice`) + - FfiConverterOptionalString.allocationSize(value.`name`) + - FfiConverterOptionalString.allocationSize(value.`imageUrl`) + - FfiConverterOptionalInt.allocationSize(value.`nextEpochCommissionRate`) + - FfiConverterOptionalTypeValidatorCredentials.allocationSize(value.`nextEpochCredentials`) + - FfiConverterOptionalULong.allocationSize(value.`nextEpochGasPrice`) + - FfiConverterOptionalULong.allocationSize(value.`nextEpochStake`) + - FfiConverterOptionalByteArray.allocationSize(value.`operationCap`) + - FfiConverterOptionalULong.allocationSize(value.`pendingPoolTokenWithdraw`) + - FfiConverterOptionalULong.allocationSize(value.`pendingStake`) + - FfiConverterOptionalULong.allocationSize(value.`pendingTotalIotaWithdraw`) + - FfiConverterOptionalULong.allocationSize(value.`poolTokenBalance`) + - FfiConverterOptionalString.allocationSize(value.`projectUrl`) + - FfiConverterOptionalULong.allocationSize(value.`rewardsPool`) + - FfiConverterOptionalULong.allocationSize(value.`stakingPoolActivationEpoch`) + - FfiConverterTypeObjectId.allocationSize(value.`stakingPoolId`) + - FfiConverterOptionalULong.allocationSize(value.`stakingPoolIotaBalance`) + - FfiConverterOptionalInt.allocationSize(value.`votingPower`) - ) + override fun allocationSize(value: kotlin.ByteArray?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterByteArray.allocationSize(value) + } + } - override fun write(value: Validator, buf: ByteBuffer) { - FfiConverterOptionalInt.write(value.`apy`, buf) - FfiConverterTypeAddress.write(value.`address`, buf) - FfiConverterOptionalInt.write(value.`commissionRate`, buf) - FfiConverterOptionalTypeValidatorCredentials.write(value.`credentials`, buf) - FfiConverterOptionalString.write(value.`description`, buf) - FfiConverterOptionalULong.write(value.`exchangeRatesSize`, buf) - FfiConverterOptionalULong.write(value.`gasPrice`, buf) - FfiConverterOptionalString.write(value.`name`, buf) - FfiConverterOptionalString.write(value.`imageUrl`, buf) - FfiConverterOptionalInt.write(value.`nextEpochCommissionRate`, buf) - FfiConverterOptionalTypeValidatorCredentials.write(value.`nextEpochCredentials`, buf) - FfiConverterOptionalULong.write(value.`nextEpochGasPrice`, buf) - FfiConverterOptionalULong.write(value.`nextEpochStake`, buf) - FfiConverterOptionalByteArray.write(value.`operationCap`, buf) - FfiConverterOptionalULong.write(value.`pendingPoolTokenWithdraw`, buf) - FfiConverterOptionalULong.write(value.`pendingStake`, buf) - FfiConverterOptionalULong.write(value.`pendingTotalIotaWithdraw`, buf) - FfiConverterOptionalULong.write(value.`poolTokenBalance`, buf) - FfiConverterOptionalString.write(value.`projectUrl`, buf) - FfiConverterOptionalULong.write(value.`rewardsPool`, buf) - FfiConverterOptionalULong.write(value.`stakingPoolActivationEpoch`, buf) - FfiConverterTypeObjectId.write(value.`stakingPoolId`, buf) - FfiConverterOptionalULong.write(value.`stakingPoolIotaBalance`, buf) - FfiConverterOptionalInt.write(value.`votingPower`, buf) + override fun write(value: kotlin.ByteArray?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterByteArray.write(value, buf) + } } } + /** - * A member of a Validator Committee - * - * # BCS - * - * The BCS serialized form for this type is defined by the following ABNF: - * - * ```text - * validator-committee-member = bls-public-key - * u64 ; stake - * ``` + * @suppress */ -data class ValidatorCommitteeMember ( - var `publicKey`: Bls12381PublicKey, - var `stake`: kotlin.ULong -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`publicKey`, - this.`stake` - ) +public object FfiConverterOptionalTypeAddress: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Address? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeAddress.read(buf) + } + + override fun allocationSize(value: Address?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeAddress.allocationSize(value) + } + } + + override fun write(value: Address?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeAddress.write(value, buf) + } } - - companion object } + + + /** * @suppress */ -public object FfiConverterTypeValidatorCommitteeMember: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ValidatorCommitteeMember { - return ValidatorCommitteeMember( - FfiConverterTypeBls12381PublicKey.read(buf), - FfiConverterULong.read(buf), - ) +public object FfiConverterOptionalTypeBatchSendStatus: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): BatchSendStatus? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeBatchSendStatus.read(buf) } - override fun allocationSize(value: ValidatorCommitteeMember) = ( - FfiConverterTypeBls12381PublicKey.allocationSize(value.`publicKey`) + - FfiConverterULong.allocationSize(value.`stake`) - ) + override fun allocationSize(value: BatchSendStatus?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeBatchSendStatus.allocationSize(value) + } + } - override fun write(value: ValidatorCommitteeMember, buf: ByteBuffer) { - FfiConverterTypeBls12381PublicKey.write(value.`publicKey`, buf) - FfiConverterULong.write(value.`stake`, buf) + override fun write(value: BatchSendStatus?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeBatchSendStatus.write(value, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterOptionalTypeCheckpointContentsDigest: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CheckpointContentsDigest? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeCheckpointContentsDigest.read(buf) + } + + override fun allocationSize(value: CheckpointContentsDigest?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeCheckpointContentsDigest.allocationSize(value) + } + } + + override fun write(value: CheckpointContentsDigest?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeCheckpointContentsDigest.write(value, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterOptionalTypeCheckpointDigest: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CheckpointDigest? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeCheckpointDigest.read(buf) + } + + override fun allocationSize(value: CheckpointDigest?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeCheckpointDigest.allocationSize(value) + } + } + + override fun write(value: CheckpointDigest?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeCheckpointDigest.write(value, buf) + } } } -data class ValidatorCredentials ( - var `authorityPubKey`: Base64?, - var `networkPubKey`: Base64?, - var `protocolPubKey`: Base64?, - var `proofOfPossession`: Base64?, - var `netAddress`: kotlin.String?, - var `p2pAddress`: kotlin.String?, - var `primaryAddress`: kotlin.String? -) { - - companion object -} /** * @suppress */ -public object FfiConverterTypeValidatorCredentials: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ValidatorCredentials { - return ValidatorCredentials( - FfiConverterOptionalTypeBase64.read(buf), - FfiConverterOptionalTypeBase64.read(buf), - FfiConverterOptionalTypeBase64.read(buf), - FfiConverterOptionalTypeBase64.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - FfiConverterOptionalString.read(buf), - ) +public object FfiConverterOptionalTypeCoinMetadata: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CoinMetadata? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeCoinMetadata.read(buf) } - override fun allocationSize(value: ValidatorCredentials) = ( - FfiConverterOptionalTypeBase64.allocationSize(value.`authorityPubKey`) + - FfiConverterOptionalTypeBase64.allocationSize(value.`networkPubKey`) + - FfiConverterOptionalTypeBase64.allocationSize(value.`protocolPubKey`) + - FfiConverterOptionalTypeBase64.allocationSize(value.`proofOfPossession`) + - FfiConverterOptionalString.allocationSize(value.`netAddress`) + - FfiConverterOptionalString.allocationSize(value.`p2pAddress`) + - FfiConverterOptionalString.allocationSize(value.`primaryAddress`) - ) + override fun allocationSize(value: CoinMetadata?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeCoinMetadata.allocationSize(value) + } + } - override fun write(value: ValidatorCredentials, buf: ByteBuffer) { - FfiConverterOptionalTypeBase64.write(value.`authorityPubKey`, buf) - FfiConverterOptionalTypeBase64.write(value.`networkPubKey`, buf) - FfiConverterOptionalTypeBase64.write(value.`protocolPubKey`, buf) - FfiConverterOptionalTypeBase64.write(value.`proofOfPossession`, buf) - FfiConverterOptionalString.write(value.`netAddress`, buf) - FfiConverterOptionalString.write(value.`p2pAddress`, buf) - FfiConverterOptionalString.write(value.`primaryAddress`, buf) + override fun write(value: CoinMetadata?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeCoinMetadata.write(value, buf) + } } } + /** - * A page of items returned by the GraphQL server. + * @suppress */ -data class ValidatorPage ( - /** - * Information about the page, such as the cursor and whether there are - * more pages. - */ - var `pageInfo`: PageInfo, - /** - * The data returned by the server. - */ - var `data`: List -) : Disposable { - - @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here - override fun destroy() { - - Disposable.destroy( - this.`pageInfo`, - this.`data` - ) +public object FfiConverterOptionalTypeEd25519PublicKey: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Ed25519PublicKey? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeEd25519PublicKey.read(buf) + } + + override fun allocationSize(value: Ed25519PublicKey?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeEd25519PublicKey.allocationSize(value) + } + } + + override fun write(value: Ed25519PublicKey?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeEd25519PublicKey.write(value, buf) + } } - - companion object } + + + /** * @suppress */ -public object FfiConverterTypeValidatorPage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ValidatorPage { - return ValidatorPage( - FfiConverterTypePageInfo.read(buf), - FfiConverterSequenceTypeValidator.read(buf), - ) +public object FfiConverterOptionalTypeEd25519Signature: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Ed25519Signature? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeEd25519Signature.read(buf) } - override fun allocationSize(value: ValidatorPage) = ( - FfiConverterTypePageInfo.allocationSize(value.`pageInfo`) + - FfiConverterSequenceTypeValidator.allocationSize(value.`data`) - ) + override fun allocationSize(value: Ed25519Signature?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeEd25519Signature.allocationSize(value) + } + } - override fun write(value: ValidatorPage, buf: ByteBuffer) { - FfiConverterTypePageInfo.write(value.`pageInfo`, buf) - FfiConverterSequenceTypeValidator.write(value.`data`, buf) + override fun write(value: Ed25519Signature?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeEd25519Signature.write(value, buf) + } } } -enum class Direction { - - FORWARD, - BACKWARD; - companion object -} - - /** * @suppress */ -public object FfiConverterTypeDirection: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - Direction.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) +public object FfiConverterOptionalTypeEffectsAuxiliaryDataDigest: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): EffectsAuxiliaryDataDigest? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeEffectsAuxiliaryDataDigest.read(buf) } - override fun allocationSize(value: Direction) = 4UL + override fun allocationSize(value: EffectsAuxiliaryDataDigest?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeEffectsAuxiliaryDataDigest.allocationSize(value) + } + } - override fun write(value: Direction, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) + override fun write(value: EffectsAuxiliaryDataDigest?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeEffectsAuxiliaryDataDigest.write(value, buf) + } } } +/** + * @suppress + */ +public object FfiConverterOptionalTypeEpoch: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Epoch? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeEpoch.read(buf) + } + override fun allocationSize(value: Epoch?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeEpoch.allocationSize(value) + } + } - -sealed class SdkFfiException(message: String): kotlin.Exception(message) { - - class Generic(message: String) : SdkFfiException(message) - - - companion object ErrorHandler : UniffiRustCallStatusErrorHandler { - override fun lift(error_buf: RustBuffer.ByValue): SdkFfiException = FfiConverterTypeSdkFfiError.lift(error_buf) + override fun write(value: Epoch?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeEpoch.write(value, buf) + } } } + + + /** * @suppress */ -public object FfiConverterTypeSdkFfiError : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): SdkFfiException { - - return when(buf.getInt()) { - 1 -> SdkFfiException.Generic(FfiConverterString.read(buf)) - else -> throw RuntimeException("invalid error enum value, something is very wrong!!") +public object FfiConverterOptionalTypeFaucetReceipt: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FaucetReceipt? { + if (buf.get().toInt() == 0) { + return null } - + return FfiConverterTypeFaucetReceipt.read(buf) } - override fun allocationSize(value: SdkFfiException): ULong { - return 4UL + override fun allocationSize(value: FaucetReceipt?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeFaucetReceipt.allocationSize(value) + } } - override fun write(value: SdkFfiException, buf: ByteBuffer) { - when(value) { - is SdkFfiException.Generic -> { - buf.putInt(1) - Unit - } - }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ } + override fun write(value: FaucetReceipt?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeFaucetReceipt.write(value, buf) + } } - } -enum class TransactionBlockKindInput { - - SYSTEM_TX, - PROGRAMMABLE_TX, - GENESIS, - CONSENSUS_COMMIT_PROLOGUE_V1, - AUTHENTICATOR_STATE_UPDATE_V1, - RANDOMNESS_STATE_UPDATE, - END_OF_EPOCH_TX; - companion object -} - - /** - * @suppress - */ -public object FfiConverterTypeTransactionBlockKindInput: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - TransactionBlockKindInput.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) + * @suppress + */ +public object FfiConverterOptionalTypeMoveFunction: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MoveFunction? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeMoveFunction.read(buf) } - override fun allocationSize(value: TransactionBlockKindInput) = 4UL + override fun allocationSize(value: MoveFunction?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeMoveFunction.allocationSize(value) + } + } - override fun write(value: TransactionBlockKindInput, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) + override fun write(value: MoveFunction?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeMoveFunction.write(value, buf) + } } } - - /** * @suppress */ -public object FfiConverterOptionalInt: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.Int? { +public object FfiConverterOptionalTypeMoveModule: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MoveModule? { if (buf.get().toInt() == 0) { return null } - return FfiConverterInt.read(buf) + return FfiConverterTypeMoveModule.read(buf) } - override fun allocationSize(value: kotlin.Int?): ULong { + override fun allocationSize(value: MoveModule?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterInt.allocationSize(value) + return 1UL + FfiConverterTypeMoveModule.allocationSize(value) } } - override fun write(value: kotlin.Int?, buf: ByteBuffer) { + override fun write(value: MoveModule?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterInt.write(value, buf) + FfiConverterTypeMoveModule.write(value, buf) } } } @@ -19507,28 +31592,28 @@ public object FfiConverterOptionalInt: FfiConverterRustBuffer { /** * @suppress */ -public object FfiConverterOptionalULong: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.ULong? { +public object FfiConverterOptionalTypeMovePackage: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MovePackage? { if (buf.get().toInt() == 0) { return null } - return FfiConverterULong.read(buf) + return FfiConverterTypeMovePackage.read(buf) } - override fun allocationSize(value: kotlin.ULong?): ULong { + override fun allocationSize(value: MovePackage?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterULong.allocationSize(value) + return 1UL + FfiConverterTypeMovePackage.allocationSize(value) } } - override fun write(value: kotlin.ULong?, buf: ByteBuffer) { + override fun write(value: MovePackage?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterULong.write(value, buf) + FfiConverterTypeMovePackage.write(value, buf) } } } @@ -19539,28 +31624,28 @@ public object FfiConverterOptionalULong: FfiConverterRustBuffer { /** * @suppress */ -public object FfiConverterOptionalBoolean: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.Boolean? { +public object FfiConverterOptionalTypeMultisigAggregatedSignature: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MultisigAggregatedSignature? { if (buf.get().toInt() == 0) { return null } - return FfiConverterBoolean.read(buf) + return FfiConverterTypeMultisigAggregatedSignature.read(buf) } - override fun allocationSize(value: kotlin.Boolean?): ULong { + override fun allocationSize(value: MultisigAggregatedSignature?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterBoolean.allocationSize(value) + return 1UL + FfiConverterTypeMultisigAggregatedSignature.allocationSize(value) } } - override fun write(value: kotlin.Boolean?, buf: ByteBuffer) { + override fun write(value: MultisigAggregatedSignature?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterBoolean.write(value, buf) + FfiConverterTypeMultisigAggregatedSignature.write(value, buf) } } } @@ -19571,28 +31656,28 @@ public object FfiConverterOptionalBoolean: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.String? { +public object FfiConverterOptionalTypeObject: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Object? { if (buf.get().toInt() == 0) { return null } - return FfiConverterString.read(buf) + return FfiConverterTypeObject.read(buf) } - override fun allocationSize(value: kotlin.String?): ULong { + override fun allocationSize(value: Object?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterString.allocationSize(value) + return 1UL + FfiConverterTypeObject.allocationSize(value) } } - override fun write(value: kotlin.String?, buf: ByteBuffer) { + override fun write(value: Object?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterString.write(value, buf) + FfiConverterTypeObject.write(value, buf) } } } @@ -19603,28 +31688,28 @@ public object FfiConverterOptionalString: FfiConverterRustBuffer /** * @suppress */ -public object FfiConverterOptionalByteArray: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): kotlin.ByteArray? { +public object FfiConverterOptionalTypeObjectId: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ObjectId? { if (buf.get().toInt() == 0) { return null } - return FfiConverterByteArray.read(buf) + return FfiConverterTypeObjectId.read(buf) } - override fun allocationSize(value: kotlin.ByteArray?): ULong { + override fun allocationSize(value: ObjectId?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterByteArray.allocationSize(value) + return 1UL + FfiConverterTypeObjectId.allocationSize(value) } } - override fun write(value: kotlin.ByteArray?, buf: ByteBuffer) { + override fun write(value: ObjectId?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterByteArray.write(value, buf) + FfiConverterTypeObjectId.write(value, buf) } } } @@ -19635,28 +31720,28 @@ public object FfiConverterOptionalByteArray: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Address? { +public object FfiConverterOptionalTypePasskeyAuthenticator: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): PasskeyAuthenticator? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeAddress.read(buf) + return FfiConverterTypePasskeyAuthenticator.read(buf) } - override fun allocationSize(value: Address?): ULong { + override fun allocationSize(value: PasskeyAuthenticator?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeAddress.allocationSize(value) + return 1UL + FfiConverterTypePasskeyAuthenticator.allocationSize(value) } } - override fun write(value: Address?, buf: ByteBuffer) { + override fun write(value: PasskeyAuthenticator?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeAddress.write(value, buf) + FfiConverterTypePasskeyAuthenticator.write(value, buf) } } } @@ -19667,28 +31752,28 @@ public object FfiConverterOptionalTypeAddress: FfiConverterRustBuffer /** * @suppress */ -public object FfiConverterOptionalTypeBatchSendStatus: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): BatchSendStatus? { +public object FfiConverterOptionalTypeProtocolConfigs: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ProtocolConfigs? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeBatchSendStatus.read(buf) + return FfiConverterTypeProtocolConfigs.read(buf) } - override fun allocationSize(value: BatchSendStatus?): ULong { + override fun allocationSize(value: ProtocolConfigs?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeBatchSendStatus.allocationSize(value) + return 1UL + FfiConverterTypeProtocolConfigs.allocationSize(value) } } - override fun write(value: BatchSendStatus?, buf: ByteBuffer) { + override fun write(value: ProtocolConfigs?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeBatchSendStatus.write(value, buf) + FfiConverterTypeProtocolConfigs.write(value, buf) } } } @@ -19699,28 +31784,28 @@ public object FfiConverterOptionalTypeBatchSendStatus: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CheckpointContentsDigest? { +public object FfiConverterOptionalTypeSecp256k1PublicKey: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Secp256k1PublicKey? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeCheckpointContentsDigest.read(buf) + return FfiConverterTypeSecp256k1PublicKey.read(buf) } - override fun allocationSize(value: CheckpointContentsDigest?): ULong { + override fun allocationSize(value: Secp256k1PublicKey?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeCheckpointContentsDigest.allocationSize(value) + return 1UL + FfiConverterTypeSecp256k1PublicKey.allocationSize(value) } } - override fun write(value: CheckpointContentsDigest?, buf: ByteBuffer) { + override fun write(value: Secp256k1PublicKey?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeCheckpointContentsDigest.write(value, buf) + FfiConverterTypeSecp256k1PublicKey.write(value, buf) } } } @@ -19731,28 +31816,28 @@ public object FfiConverterOptionalTypeCheckpointContentsDigest: FfiConverterRust /** * @suppress */ -public object FfiConverterOptionalTypeCheckpointDigest: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CheckpointDigest? { +public object FfiConverterOptionalTypeSecp256k1Signature: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Secp256k1Signature? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeCheckpointDigest.read(buf) + return FfiConverterTypeSecp256k1Signature.read(buf) } - override fun allocationSize(value: CheckpointDigest?): ULong { + override fun allocationSize(value: Secp256k1Signature?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeCheckpointDigest.allocationSize(value) + return 1UL + FfiConverterTypeSecp256k1Signature.allocationSize(value) } } - override fun write(value: CheckpointDigest?, buf: ByteBuffer) { + override fun write(value: Secp256k1Signature?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeCheckpointDigest.write(value, buf) + FfiConverterTypeSecp256k1Signature.write(value, buf) } } } @@ -19763,28 +31848,28 @@ public object FfiConverterOptionalTypeCheckpointDigest: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CoinMetadata? { +public object FfiConverterOptionalTypeSecp256r1PublicKey: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Secp256r1PublicKey? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeCoinMetadata.read(buf) + return FfiConverterTypeSecp256r1PublicKey.read(buf) } - override fun allocationSize(value: CoinMetadata?): ULong { + override fun allocationSize(value: Secp256r1PublicKey?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeCoinMetadata.allocationSize(value) + return 1UL + FfiConverterTypeSecp256r1PublicKey.allocationSize(value) } } - override fun write(value: CoinMetadata?, buf: ByteBuffer) { + override fun write(value: Secp256r1PublicKey?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeCoinMetadata.write(value, buf) + FfiConverterTypeSecp256r1PublicKey.write(value, buf) } } } @@ -19795,28 +31880,28 @@ public object FfiConverterOptionalTypeCoinMetadata: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Epoch? { +public object FfiConverterOptionalTypeSecp256r1Signature: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): Secp256r1Signature? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeEpoch.read(buf) + return FfiConverterTypeSecp256r1Signature.read(buf) } - override fun allocationSize(value: Epoch?): ULong { + override fun allocationSize(value: Secp256r1Signature?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeEpoch.allocationSize(value) + return 1UL + FfiConverterTypeSecp256r1Signature.allocationSize(value) } } - override fun write(value: Epoch?, buf: ByteBuffer) { + override fun write(value: Secp256r1Signature?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeEpoch.write(value, buf) + FfiConverterTypeSecp256r1Signature.write(value, buf) } } } @@ -19827,28 +31912,28 @@ public object FfiConverterOptionalTypeEpoch: FfiConverterRustBuffer { /** * @suppress */ -public object FfiConverterOptionalTypeFaucetReceipt: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): FaucetReceipt? { +public object FfiConverterOptionalTypeSimpleSignature: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): SimpleSignature? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeFaucetReceipt.read(buf) + return FfiConverterTypeSimpleSignature.read(buf) } - override fun allocationSize(value: FaucetReceipt?): ULong { + override fun allocationSize(value: SimpleSignature?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeFaucetReceipt.allocationSize(value) + return 1UL + FfiConverterTypeSimpleSignature.allocationSize(value) } } - override fun write(value: FaucetReceipt?, buf: ByteBuffer) { + override fun write(value: SimpleSignature?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeFaucetReceipt.write(value, buf) + FfiConverterTypeSimpleSignature.write(value, buf) } } } @@ -19859,28 +31944,28 @@ public object FfiConverterOptionalTypeFaucetReceipt: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): MoveFunction? { +public object FfiConverterOptionalTypeStructTag: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): StructTag? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeMoveFunction.read(buf) + return FfiConverterTypeStructTag.read(buf) } - override fun allocationSize(value: MoveFunction?): ULong { + override fun allocationSize(value: StructTag?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeMoveFunction.allocationSize(value) + return 1UL + FfiConverterTypeStructTag.allocationSize(value) } } - override fun write(value: MoveFunction?, buf: ByteBuffer) { + override fun write(value: StructTag?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeMoveFunction.write(value, buf) + FfiConverterTypeStructTag.write(value, buf) } } } @@ -19891,28 +31976,28 @@ public object FfiConverterOptionalTypeMoveFunction: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): MoveModule? { +public object FfiConverterOptionalTypeTransactionEffects: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionEffects? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeMoveModule.read(buf) + return FfiConverterTypeTransactionEffects.read(buf) } - override fun allocationSize(value: MoveModule?): ULong { + override fun allocationSize(value: TransactionEffects?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeMoveModule.allocationSize(value) + return 1UL + FfiConverterTypeTransactionEffects.allocationSize(value) } } - override fun write(value: MoveModule?, buf: ByteBuffer) { + override fun write(value: TransactionEffects?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeMoveModule.write(value, buf) + FfiConverterTypeTransactionEffects.write(value, buf) } } } @@ -19923,28 +32008,28 @@ public object FfiConverterOptionalTypeMoveModule: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): MovePackage? { +public object FfiConverterOptionalTypeTransactionEventsDigest: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionEventsDigest? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeMovePackage.read(buf) + return FfiConverterTypeTransactionEventsDigest.read(buf) } - override fun allocationSize(value: MovePackage?): ULong { + override fun allocationSize(value: TransactionEventsDigest?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeMovePackage.allocationSize(value) + return 1UL + FfiConverterTypeTransactionEventsDigest.allocationSize(value) } } - override fun write(value: MovePackage?, buf: ByteBuffer) { + override fun write(value: TransactionEventsDigest?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeMovePackage.write(value, buf) + FfiConverterTypeTransactionEventsDigest.write(value, buf) } } } @@ -19955,28 +32040,28 @@ public object FfiConverterOptionalTypeMovePackage: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): MoveStruct? { +public object FfiConverterOptionalTypeTypeTag: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TypeTag? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeMoveStruct.read(buf) + return FfiConverterTypeTypeTag.read(buf) } - override fun allocationSize(value: MoveStruct?): ULong { + override fun allocationSize(value: TypeTag?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeMoveStruct.allocationSize(value) + return 1UL + FfiConverterTypeTypeTag.allocationSize(value) } } - override fun write(value: MoveStruct?, buf: ByteBuffer) { + override fun write(value: TypeTag?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeMoveStruct.write(value, buf) + FfiConverterTypeTypeTag.write(value, buf) } } } @@ -19987,28 +32072,28 @@ public object FfiConverterOptionalTypeMoveStruct: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): Object? { +public object FfiConverterOptionalTypeZkLoginAuthenticator: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ZkLoginAuthenticator? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeObject.read(buf) + return FfiConverterTypeZkLoginAuthenticator.read(buf) } - override fun allocationSize(value: Object?): ULong { + override fun allocationSize(value: ZkLoginAuthenticator?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeObject.allocationSize(value) + return 1UL + FfiConverterTypeZkLoginAuthenticator.allocationSize(value) } } - override fun write(value: Object?, buf: ByteBuffer) { + override fun write(value: ZkLoginAuthenticator?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeObject.write(value, buf) + FfiConverterTypeZkLoginAuthenticator.write(value, buf) } } } @@ -20019,28 +32104,28 @@ public object FfiConverterOptionalTypeObject: FfiConverterRustBuffer { /** * @suppress */ -public object FfiConverterOptionalTypeObjectId: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ObjectId? { +public object FfiConverterOptionalTypeZkLoginPublicIdentifier: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ZkLoginPublicIdentifier? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeObjectId.read(buf) + return FfiConverterTypeZkLoginPublicIdentifier.read(buf) } - override fun allocationSize(value: ObjectId?): ULong { + override fun allocationSize(value: ZkLoginPublicIdentifier?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeObjectId.allocationSize(value) + return 1UL + FfiConverterTypeZkLoginPublicIdentifier.allocationSize(value) } } - override fun write(value: ObjectId?, buf: ByteBuffer) { + override fun write(value: ZkLoginPublicIdentifier?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeObjectId.write(value, buf) + FfiConverterTypeZkLoginPublicIdentifier.write(value, buf) } } } @@ -20051,28 +32136,28 @@ public object FfiConverterOptionalTypeObjectId: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ProtocolConfigs? { +public object FfiConverterOptionalTypeCheckpointSummary: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): CheckpointSummary? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeProtocolConfigs.read(buf) + return FfiConverterTypeCheckpointSummary.read(buf) } - override fun allocationSize(value: ProtocolConfigs?): ULong { + override fun allocationSize(value: CheckpointSummary?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeProtocolConfigs.allocationSize(value) + return 1UL + FfiConverterTypeCheckpointSummary.allocationSize(value) } } - override fun write(value: ProtocolConfigs?, buf: ByteBuffer) { + override fun write(value: CheckpointSummary?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeProtocolConfigs.write(value, buf) + FfiConverterTypeCheckpointSummary.write(value, buf) } } } @@ -20083,28 +32168,28 @@ public object FfiConverterOptionalTypeProtocolConfigs: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): SignedTransaction? { +public object FfiConverterOptionalTypeDynamicFieldOutput: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DynamicFieldOutput? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeSignedTransaction.read(buf) + return FfiConverterTypeDynamicFieldOutput.read(buf) } - override fun allocationSize(value: SignedTransaction?): ULong { + override fun allocationSize(value: DynamicFieldOutput?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeSignedTransaction.allocationSize(value) + return 1UL + FfiConverterTypeDynamicFieldOutput.allocationSize(value) } } - override fun write(value: SignedTransaction?, buf: ByteBuffer) { + override fun write(value: DynamicFieldOutput?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeSignedTransaction.write(value, buf) + FfiConverterTypeDynamicFieldOutput.write(value, buf) } } } @@ -20115,28 +32200,28 @@ public object FfiConverterOptionalTypeSignedTransaction: FfiConverterRustBuffer< /** * @suppress */ -public object FfiConverterOptionalTypeTransactionDataEffects: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionDataEffects? { +public object FfiConverterOptionalTypeDynamicFieldValue: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): DynamicFieldValue? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeTransactionDataEffects.read(buf) + return FfiConverterTypeDynamicFieldValue.read(buf) } - override fun allocationSize(value: TransactionDataEffects?): ULong { + override fun allocationSize(value: DynamicFieldValue?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeTransactionDataEffects.allocationSize(value) + return 1UL + FfiConverterTypeDynamicFieldValue.allocationSize(value) } } - override fun write(value: TransactionDataEffects?, buf: ByteBuffer) { + override fun write(value: DynamicFieldValue?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeTransactionDataEffects.write(value, buf) + FfiConverterTypeDynamicFieldValue.write(value, buf) } } } @@ -20147,28 +32232,28 @@ public object FfiConverterOptionalTypeTransactionDataEffects: FfiConverterRustBu /** * @suppress */ -public object FfiConverterOptionalTypeTransactionEffects: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): TransactionEffects? { +public object FfiConverterOptionalTypeEndOfEpochData: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): EndOfEpochData? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeTransactionEffects.read(buf) + return FfiConverterTypeEndOfEpochData.read(buf) } - override fun allocationSize(value: TransactionEffects?): ULong { + override fun allocationSize(value: EndOfEpochData?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeTransactionEffects.allocationSize(value) + return 1UL + FfiConverterTypeEndOfEpochData.allocationSize(value) } } - override fun write(value: TransactionEffects?, buf: ByteBuffer) { + override fun write(value: EndOfEpochData?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeTransactionEffects.write(value, buf) + FfiConverterTypeEndOfEpochData.write(value, buf) } } } @@ -20179,28 +32264,28 @@ public object FfiConverterOptionalTypeTransactionEffects: FfiConverterRustBuffer /** * @suppress */ -public object FfiConverterOptionalTypeCheckpointSummary: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): CheckpointSummary? { +public object FfiConverterOptionalTypeEventFilter: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): EventFilter? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeCheckpointSummary.read(buf) + return FfiConverterTypeEventFilter.read(buf) } - override fun allocationSize(value: CheckpointSummary?): ULong { + override fun allocationSize(value: EventFilter?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeCheckpointSummary.allocationSize(value) + return 1UL + FfiConverterTypeEventFilter.allocationSize(value) } } - override fun write(value: CheckpointSummary?, buf: ByteBuffer) { + override fun write(value: EventFilter?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeCheckpointSummary.write(value, buf) + FfiConverterTypeEventFilter.write(value, buf) } } } @@ -20211,28 +32296,28 @@ public object FfiConverterOptionalTypeCheckpointSummary: FfiConverterRustBuffer< /** * @suppress */ -public object FfiConverterOptionalTypeDynamicFieldOutput: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): DynamicFieldOutput? { +public object FfiConverterOptionalTypeMoveLocation: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MoveLocation? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeDynamicFieldOutput.read(buf) + return FfiConverterTypeMoveLocation.read(buf) } - override fun allocationSize(value: DynamicFieldOutput?): ULong { + override fun allocationSize(value: MoveLocation?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeDynamicFieldOutput.allocationSize(value) + return 1UL + FfiConverterTypeMoveLocation.allocationSize(value) } } - override fun write(value: DynamicFieldOutput?, buf: ByteBuffer) { + override fun write(value: MoveLocation?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeDynamicFieldOutput.write(value, buf) + FfiConverterTypeMoveLocation.write(value, buf) } } } @@ -20243,28 +32328,28 @@ public object FfiConverterOptionalTypeDynamicFieldOutput: FfiConverterRustBuffer /** * @suppress */ -public object FfiConverterOptionalTypeDynamicFieldValue: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): DynamicFieldValue? { +public object FfiConverterOptionalTypeMoveStruct: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): MoveStruct? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeDynamicFieldValue.read(buf) + return FfiConverterTypeMoveStruct.read(buf) } - override fun allocationSize(value: DynamicFieldValue?): ULong { + override fun allocationSize(value: MoveStruct?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeDynamicFieldValue.allocationSize(value) + return 1UL + FfiConverterTypeMoveStruct.allocationSize(value) } } - override fun write(value: DynamicFieldValue?, buf: ByteBuffer) { + override fun write(value: MoveStruct?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeDynamicFieldValue.write(value, buf) + FfiConverterTypeMoveStruct.write(value, buf) } } } @@ -20275,28 +32360,28 @@ public object FfiConverterOptionalTypeDynamicFieldValue: FfiConverterRustBuffer< /** * @suppress */ -public object FfiConverterOptionalTypeEndOfEpochData: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EndOfEpochData? { +public object FfiConverterOptionalTypeObjectFilter: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): ObjectFilter? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeEndOfEpochData.read(buf) + return FfiConverterTypeObjectFilter.read(buf) } - override fun allocationSize(value: EndOfEpochData?): ULong { + override fun allocationSize(value: ObjectFilter?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeEndOfEpochData.allocationSize(value) + return 1UL + FfiConverterTypeObjectFilter.allocationSize(value) } } - override fun write(value: EndOfEpochData?, buf: ByteBuffer) { + override fun write(value: ObjectFilter?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeEndOfEpochData.write(value, buf) + FfiConverterTypeObjectFilter.write(value, buf) } } } @@ -20307,28 +32392,28 @@ public object FfiConverterOptionalTypeEndOfEpochData: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): EventFilter? { +public object FfiConverterOptionalTypeSignedTransaction: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): SignedTransaction? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeEventFilter.read(buf) + return FfiConverterTypeSignedTransaction.read(buf) } - override fun allocationSize(value: EventFilter?): ULong { + override fun allocationSize(value: SignedTransaction?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeEventFilter.allocationSize(value) + return 1UL + FfiConverterTypeSignedTransaction.allocationSize(value) } } - override fun write(value: EventFilter?, buf: ByteBuffer) { + override fun write(value: SignedTransaction?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeEventFilter.write(value, buf) + FfiConverterTypeSignedTransaction.write(value, buf) } } } @@ -20339,28 +32424,28 @@ public object FfiConverterOptionalTypeEventFilter: FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): ObjectFilter? { +public object FfiConverterOptionalTypeTransactionDataEffects: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): TransactionDataEffects? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeObjectFilter.read(buf) + return FfiConverterTypeTransactionDataEffects.read(buf) } - override fun allocationSize(value: ObjectFilter?): ULong { + override fun allocationSize(value: TransactionDataEffects?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeObjectFilter.allocationSize(value) + return 1UL + FfiConverterTypeTransactionDataEffects.allocationSize(value) } } - override fun write(value: ObjectFilter?, buf: ByteBuffer) { + override fun write(value: TransactionDataEffects?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeObjectFilter.write(value, buf) + FfiConverterTypeTransactionDataEffects.write(value, buf) } } } @@ -20635,16 +32720,212 @@ public object FfiConverterSequenceString: FfiConverterRustBuffer): ULong { + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterString.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterString.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeCheckpointCommitment: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeCheckpointCommitment.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeCheckpointCommitment.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeCheckpointCommitment.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeCoin: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeCoin.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeCoin.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeCoin.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeEndOfEpochTransactionKind: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeEndOfEpochTransactionKind.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeEndOfEpochTransactionKind.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeEndOfEpochTransactionKind.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeEpoch: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeEpoch.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeEpoch.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeEpoch.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeMovePackage: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeMovePackage.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeMovePackage.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeMovePackage.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeMultisigMember: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeMultisigMember.read(buf) + } + } + + override fun allocationSize(value: List): ULong { + val sizeForLength = 4UL + val sizeForItems = value.map { FfiConverterTypeMultisigMember.allocationSize(it) }.sum() + return sizeForLength + sizeForItems + } + + override fun write(value: List, buf: ByteBuffer) { + buf.putInt(value.size) + value.iterator().forEach { + FfiConverterTypeMultisigMember.write(it, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterSequenceTypeMultisigMemberSignature: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { + val len = buf.getInt() + return List(len) { + FfiConverterTypeMultisigMemberSignature.read(buf) + } + } + + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterString.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeMultisigMemberSignature.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterString.write(it, buf) + FfiConverterTypeMultisigMemberSignature.write(it, buf) } } } @@ -20655,24 +32936,24 @@ public object FfiConverterSequenceString: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeObject: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeCheckpointCommitment.read(buf) + return List(len) { + FfiConverterTypeObject.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeCheckpointCommitment.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeObject.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeCheckpointCommitment.write(it, buf) + FfiConverterTypeObject.write(it, buf) } } } @@ -20683,24 +32964,24 @@ public object FfiConverterSequenceTypeCheckpointCommitment: FfiConverterRustBuff /** * @suppress */ -public object FfiConverterSequenceTypeCoin: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeObjectId: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeCoin.read(buf) + return List(len) { + FfiConverterTypeObjectId.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeCoin.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeObjectId.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeCoin.write(it, buf) + FfiConverterTypeObjectId.write(it, buf) } } } @@ -20711,24 +32992,24 @@ public object FfiConverterSequenceTypeCoin: FfiConverterRustBuffer> { /** * @suppress */ -public object FfiConverterSequenceTypeEndOfEpochTransactionKind: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeTransactionDigest: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeEndOfEpochTransactionKind.read(buf) + return List(len) { + FfiConverterTypeTransactionDigest.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeEndOfEpochTransactionKind.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeTransactionDigest.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeEndOfEpochTransactionKind.write(it, buf) + FfiConverterTypeTransactionDigest.write(it, buf) } } } @@ -20739,24 +33020,24 @@ public object FfiConverterSequenceTypeEndOfEpochTransactionKind: FfiConverterRus /** * @suppress */ -public object FfiConverterSequenceTypeEpoch: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeTransactionEffects: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeEpoch.read(buf) + return List(len) { + FfiConverterTypeTransactionEffects.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeEpoch.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeTransactionEffects.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeEpoch.write(it, buf) + FfiConverterTypeTransactionEffects.write(it, buf) } } } @@ -20767,24 +33048,24 @@ public object FfiConverterSequenceTypeEpoch: FfiConverterRustBuffer> /** * @suppress */ -public object FfiConverterSequenceTypeEvent: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeTypeTag: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeEvent.read(buf) + return List(len) { + FfiConverterTypeTypeTag.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeEvent.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeTypeTag.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeEvent.write(it, buf) + FfiConverterTypeTypeTag.write(it, buf) } } } @@ -20795,24 +33076,24 @@ public object FfiConverterSequenceTypeEvent: FfiConverterRustBuffer> /** * @suppress */ -public object FfiConverterSequenceTypeMovePackage: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeUserSignature: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeMovePackage.read(buf) + return List(len) { + FfiConverterTypeUserSignature.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeMovePackage.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeUserSignature.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeMovePackage.write(it, buf) + FfiConverterTypeUserSignature.write(it, buf) } } } @@ -20823,24 +33104,24 @@ public object FfiConverterSequenceTypeMovePackage: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeChangedObject: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeObject.read(buf) + return List(len) { + FfiConverterTypeChangedObject.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeObject.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeChangedObject.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeObject.write(it, buf) + FfiConverterTypeChangedObject.write(it, buf) } } } @@ -20851,24 +33132,24 @@ public object FfiConverterSequenceTypeObject: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeCheckpointSummary: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeObjectId.read(buf) + return List(len) { + FfiConverterTypeCheckpointSummary.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeObjectId.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeCheckpointSummary.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeObjectId.write(it, buf) + FfiConverterTypeCheckpointSummary.write(it, buf) } } } @@ -20879,24 +33160,24 @@ public object FfiConverterSequenceTypeObjectId: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeDynamicFieldOutput: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeObjectRef.read(buf) + return List(len) { + FfiConverterTypeDynamicFieldOutput.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeObjectRef.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeDynamicFieldOutput.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeObjectRef.write(it, buf) + FfiConverterTypeDynamicFieldOutput.write(it, buf) } } } @@ -20907,24 +33188,24 @@ public object FfiConverterSequenceTypeObjectRef: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeEvent: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeSignedTransaction.read(buf) + return List(len) { + FfiConverterTypeEvent.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeSignedTransaction.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeEvent.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeSignedTransaction.write(it, buf) + FfiConverterTypeEvent.write(it, buf) } } } @@ -20935,24 +33216,24 @@ public object FfiConverterSequenceTypeSignedTransaction: FfiConverterRustBuffer< /** * @suppress */ -public object FfiConverterSequenceTypeTransactionDataEffects: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeObjectRef: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeTransactionDataEffects.read(buf) + return List(len) { + FfiConverterTypeObjectRef.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeTransactionDataEffects.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeObjectRef.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeTransactionDataEffects.write(it, buf) + FfiConverterTypeObjectRef.write(it, buf) } } } @@ -20963,24 +33244,24 @@ public object FfiConverterSequenceTypeTransactionDataEffects: FfiConverterRustBu /** * @suppress */ -public object FfiConverterSequenceTypeTransactionEffects: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeObjectReference: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeTransactionEffects.read(buf) + return List(len) { + FfiConverterTypeObjectReference.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeTransactionEffects.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeObjectReference.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeTransactionEffects.write(it, buf) + FfiConverterTypeObjectReference.write(it, buf) } } } @@ -20991,24 +33272,24 @@ public object FfiConverterSequenceTypeTransactionEffects: FfiConverterRustBuffer /** * @suppress */ -public object FfiConverterSequenceTypeUserSignature: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeSignedTransaction: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeUserSignature.read(buf) + return List(len) { + FfiConverterTypeSignedTransaction.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeUserSignature.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeSignedTransaction.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeUserSignature.write(it, buf) + FfiConverterTypeSignedTransaction.write(it, buf) } } } @@ -21019,24 +33300,24 @@ public object FfiConverterSequenceTypeUserSignature: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeTransactionDataEffects: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeCheckpointSummary.read(buf) + return List(len) { + FfiConverterTypeTransactionDataEffects.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeCheckpointSummary.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeTransactionDataEffects.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeCheckpointSummary.write(it, buf) + FfiConverterTypeTransactionDataEffects.write(it, buf) } } } @@ -21047,24 +33328,24 @@ public object FfiConverterSequenceTypeCheckpointSummary: FfiConverterRustBuffer< /** * @suppress */ -public object FfiConverterSequenceTypeDynamicFieldOutput: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeTypeOrigin: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeDynamicFieldOutput.read(buf) + return List(len) { + FfiConverterTypeTypeOrigin.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeDynamicFieldOutput.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeTypeOrigin.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeDynamicFieldOutput.write(it, buf) + FfiConverterTypeTypeOrigin.write(it, buf) } } } @@ -21075,24 +33356,24 @@ public object FfiConverterSequenceTypeDynamicFieldOutput: FfiConverterRustBuffer /** * @suppress */ -public object FfiConverterSequenceTypeObjectReference: FfiConverterRustBuffer> { - override fun read(buf: ByteBuffer): List { +public object FfiConverterSequenceTypeUnchangedSharedObject: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): List { val len = buf.getInt() - return List(len) { - FfiConverterTypeObjectReference.read(buf) + return List(len) { + FfiConverterTypeUnchangedSharedObject.read(buf) } } - override fun allocationSize(value: List): ULong { + override fun allocationSize(value: List): ULong { val sizeForLength = 4UL - val sizeForItems = value.map { FfiConverterTypeObjectReference.allocationSize(it) }.sum() + val sizeForItems = value.map { FfiConverterTypeUnchangedSharedObject.allocationSize(it) }.sum() return sizeForLength + sizeForItems } - override fun write(value: List, buf: ByteBuffer) { + override fun write(value: List, buf: ByteBuffer) { buf.putInt(value.size) value.iterator().forEach { - FfiConverterTypeObjectReference.write(it, buf) + FfiConverterTypeUnchangedSharedObject.write(it, buf) } } } @@ -21155,6 +33436,84 @@ public object FfiConverterSequenceTypeValidatorCommitteeMember: FfiConverterRust + +/** + * @suppress + */ +public object FfiConverterMapTypeIdentifierByteArray: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): Map { + val len = buf.getInt() + return buildMap(len) { + repeat(len) { + val k = FfiConverterTypeIdentifier.read(buf) + val v = FfiConverterByteArray.read(buf) + this[k] = v + } + } + } + + override fun allocationSize(value: Map): ULong { + val spaceForMapSize = 4UL + val spaceForChildren = value.map { (k, v) -> + FfiConverterTypeIdentifier.allocationSize(k) + + FfiConverterByteArray.allocationSize(v) + }.sum() + return spaceForMapSize + spaceForChildren + } + + override fun write(value: Map, buf: ByteBuffer) { + buf.putInt(value.size) + // The parens on `(k, v)` here ensure we're calling the right method, + // which is important for compatibility with older android devices. + // Ref https://blog.danlew.net/2017/03/16/kotlin-puzzler-whose-line-is-it-anyways/ + value.forEach { (k, v) -> + FfiConverterTypeIdentifier.write(k, buf) + FfiConverterByteArray.write(v, buf) + } + } +} + + + + +/** + * @suppress + */ +public object FfiConverterMapTypeObjectIdTypeUpgradeInfo: FfiConverterRustBuffer> { + override fun read(buf: ByteBuffer): Map { + val len = buf.getInt() + return buildMap(len) { + repeat(len) { + val k = FfiConverterTypeObjectId.read(buf) + val v = FfiConverterTypeUpgradeInfo.read(buf) + this[k] = v + } + } + } + + override fun allocationSize(value: Map): ULong { + val spaceForMapSize = 4UL + val spaceForChildren = value.map { (k, v) -> + FfiConverterTypeObjectId.allocationSize(k) + + FfiConverterTypeUpgradeInfo.allocationSize(v) + }.sum() + return spaceForMapSize + spaceForChildren + } + + override fun write(value: Map, buf: ByteBuffer) { + buf.putInt(value.size) + // The parens on `(k, v)` here ensure we're calling the right method, + // which is important for compatibility with older android devices. + // Ref https://blog.danlew.net/2017/03/16/kotlin-puzzler-whose-line-is-it-anyways/ + value.forEach { (k, v) -> + FfiConverterTypeObjectId.write(k, buf) + FfiConverterTypeUpgradeInfo.write(v, buf) + } + } +} + + + /** * Typealias from the type name used in the UDL file to the builtin type. This * is needed because the UDL type name is used in function/method signatures. diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index 125fe6faa..0d08978c8 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -1019,7 +1019,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_constructor_transactiondigest_generate() != 14578: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_v1() != 6144: + 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_transactioneffectsdigest_from_base58() != 63406: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -2950,11 +2950,11 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_iota_sdk_ffi_fn_free_transactioneffects.restype = None -_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_v1.argtypes = ( +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1.argtypes = ( _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) -_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_v1.restype = ctypes.c_void_p +_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1.restype = ctypes.c_void_p _UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactioneffects_as_v1.argtypes = ( ctypes.c_void_p, ctypes.POINTER(_UniffiRustCallStatus), @@ -4532,9 +4532,9 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure): _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_generate.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactiondigest_generate.restype = ctypes.c_uint16 -_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_v1.argtypes = ( +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1.argtypes = ( ) -_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_v1.restype = ctypes.c_uint16 +_UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffects_new_v1.restype = ctypes.c_uint16 _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_base58.argtypes = ( ) _UniffiLib.uniffi_iota_sdk_ffi_checksum_constructor_transactioneffectsdigest_from_base58.restype = ctypes.c_uint16 @@ -7271,35 +7271,6 @@ def write(value, buf): _UniffiConverterTypeObjectId.write(value.package, buf) -class TypeParseError: - source: "str" - def __init__(self, *, source: "str"): - self.source = source - - def __str__(self): - return "TypeParseError(source={})".format(self.source) - - def __eq__(self, other): - if self.source != other.source: - return False - return True - -class _UniffiConverterTypeTypeParseError(_UniffiConverterRustBuffer): - @staticmethod - def read(buf): - return TypeParseError( - source=_UniffiConverterString.read(buf), - ) - - @staticmethod - def check_lower(value): - _UniffiConverterString.check_lower(value.source) - - @staticmethod - def write(value, buf): - _UniffiConverterString.write(value.source, buf) - - class UnchangedSharedObject: """ A shared object that wasn't changed during execution @@ -21437,11 +21408,11 @@ def _make_instance_(cls, pointer): inst._pointer = pointer return inst @classmethod - def v1(cls, effects: "TransactionEffectsV1"): + def new_v1(cls, effects: "TransactionEffectsV1"): _UniffiConverterTypeTransactionEffectsV1.check_lower(effects) # Call the (fallible) function before creating any half-baked object instances. - pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_v1, + pointer = _uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_constructor_transactioneffects_new_v1, _UniffiConverterTypeTransactionEffectsV1.lower(effects)) return cls._make_instance_(pointer) @@ -23210,7 +23181,6 @@ async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, "TransactionMetadata", "TransactionsFilter", "TypeOrigin", - "TypeParseError", "UnchangedSharedObject", "UpgradeInfo", "Validator",