From 3f0d8aafb08da2bc15565dacb7f8e4cdb766e4ba Mon Sep 17 00:00:00 2001 From: semi Date: Tue, 7 May 2024 22:45:58 +0800 Subject: [PATCH] add dart sdk --- .github/workflows/build_dart_sdk.yml | 103 + .github/workflows/ci.yml | 24 + Cargo.lock | 185 +- Cargo.toml | 6 + README.md | 1 + bindings/dart/CHANGELOG.md | 2 + bindings/dart/LICENSE | 13 + bindings/dart/README.md | 4 + bindings/dart/android/CMakeLists.txt | 42 + bindings/dart/android/build.gradle | 38 + bindings/dart/android/settings.gradle | 1 + .../dart/android/src/main/AndroidManifest.xml | 3 + bindings/dart/flutter_rust_bridge.yaml | 4 + bindings/dart/ios/zklink.podspec | 29 + bindings/dart/lib/api.dart | 1059 +++ bindings/dart/lib/frb_generated.dart | 6331 +++++++++++++++++ bindings/dart/lib/frb_generated.io.dart | 4662 ++++++++++++ bindings/dart/linux/CMakeLists.txt | 36 + bindings/dart/macos/zklink.podspec | 29 + bindings/dart/pubspec.yaml | 34 + bindings/dart/rust/Cargo.toml | 17 + bindings/dart/rust/src/api.rs | 1083 +++ bindings/dart/rust/src/frb_generated.io.rs | 1904 +++++ bindings/dart/rust/src/frb_generated.rs | 3619 ++++++++++ bindings/dart/rust/src/lib.rs | 2 + bindings/dart/test/main.dart | 67 + bindings/dart/windows/CMakeLists.txt | 40 + 27 files changed, 19322 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build_dart_sdk.yml create mode 100644 bindings/dart/CHANGELOG.md create mode 100644 bindings/dart/LICENSE create mode 100644 bindings/dart/README.md create mode 100644 bindings/dart/android/CMakeLists.txt create mode 100644 bindings/dart/android/build.gradle create mode 100644 bindings/dart/android/settings.gradle create mode 100644 bindings/dart/android/src/main/AndroidManifest.xml create mode 100644 bindings/dart/flutter_rust_bridge.yaml create mode 100644 bindings/dart/ios/zklink.podspec create mode 100644 bindings/dart/lib/api.dart create mode 100644 bindings/dart/lib/frb_generated.dart create mode 100644 bindings/dart/lib/frb_generated.io.dart create mode 100644 bindings/dart/linux/CMakeLists.txt create mode 100644 bindings/dart/macos/zklink.podspec create mode 100644 bindings/dart/pubspec.yaml create mode 100644 bindings/dart/rust/Cargo.toml create mode 100644 bindings/dart/rust/src/api.rs create mode 100644 bindings/dart/rust/src/frb_generated.io.rs create mode 100644 bindings/dart/rust/src/frb_generated.rs create mode 100644 bindings/dart/rust/src/lib.rs create mode 100644 bindings/dart/test/main.dart create mode 100644 bindings/dart/windows/CMakeLists.txt diff --git a/.github/workflows/build_dart_sdk.yml b/.github/workflows/build_dart_sdk.yml new file mode 100644 index 00000000..5866efaf --- /dev/null +++ b/.github/workflows/build_dart_sdk.yml @@ -0,0 +1,103 @@ +name: build_dart_sdk + +on: + workflow_dispatch: + +jobs: + build-windows: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + target: + - x86_64-pc-windows-msvc + - i686-pc-windows-msvc + steps: + - name: Prepare + run: git config --global core.autocrlf false + - uses: actions/checkout@v4 + - name: Compile + run: | + cd bindings/dart/rust + rustup set profile minimal + rustup toolchain install stable + rustup default stable + rustup override set stable + rustup target add --toolchain stable ${{ matrix.target }} + cargo build --profile dart --target=${{ matrix.target }} + cd ../../../ + move target\${{ matrix.target }}\dart\*.dll . + 7z a ${{ matrix.target }}.7z *.dll + - name: Upload + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.target }}.7z + tag: ${{ github.ref }} + overwrite: true + file_glob: true + build-osx: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + target: + - x86_64-apple-darwin + - aarch64-apple-darwin + - aarch64-apple-ios + steps: + - uses: actions/checkout@v4 + - name: Compile + run: | + cd bindings/dart/rust + rustup set profile minimal + rustup toolchain install stable + rustup default stable + rustup override set stable + rustup target add --toolchain stable ${{ matrix.target }} + cargo build --profile dart --target=${{ matrix.target }} + cd ../../../ + mv target/${{ matrix.target }}/dart/*.dylib . + tar acf ${{ matrix.target }}.tar.xz *.dylib + - name: Upload + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.target }}.tar.xz + tag: ${{ github.ref }} + overwrite: true + file_glob: true + build-linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: + - i686-unknown-linux-gnu + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - armv7-linux-androideabi + - aarch64-linux-android + steps: + - uses: actions/checkout@v4 + - name: Compile + run: | + cd bindings/dart/rust + rustup set profile minimal + rustup toolchain install stable + rustup default stable + rustup override set stable + rustup target add --toolchain stable ${{ matrix.target }} + cargo install cross --git https://github.com/cross-rs/cross + cross build --profile dart --target=${{ matrix.target }} + cd ../../../ + mv target/${{ matrix.target }}/dart/*.so . + tar acf ${{ matrix.target }}.tar.xz *.so + - name: Upload + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.target }}.tar.xz + tag: ${{ github.ref }} + overwrite: true + file_glob: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98a9b431..11fa5e55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,30 @@ jobs: python-version: '3.10' - run: make copy_lib_to_py_example run_example_python + dart_binding: + name: dart binding + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - uses: subosito/flutter-action@v2 + with: + channel: stable + - name: build + run: | + cd bindings/dart + cargo install 'flutter_rust_bridge_codegen@2.0.0-dev.32' + flutter pub get + flutter_rust_bridge_codegen generate + cd rust + cargo build --profile dart + cd .. + cp ../../target/dart/*.so . + export LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH + dart pub add --dev test + dart test/main.dart build_wasm: name: build wasm diff --git a/Cargo.lock b/Cargo.lock index e16d3010..17fa2316 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,12 +58,41 @@ dependencies = [ "memchr", ] +[[package]] +name = "allo-isolate" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f5a5fd28223e6f3cafb7d9cd685f51eafdd71d33ca1229f8316925d5957240" +dependencies = [ + "anyhow", + "atomic", + "backtrace", +] + [[package]] name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" +[[package]] +name = "android_log-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" + +[[package]] +name = "android_logger" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c494134f746c14dc653a35a4ea5aca24ac368529da5370ecf41fe0341c35772f" +dependencies = [ + "android_log-sys", + "env_logger", + "log", + "once_cell", +] + [[package]] name = "android_system_properties" version = "0.1.5" @@ -399,6 +428,12 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + [[package]] name = "atomic-waker" version = "1.1.2" @@ -696,6 +731,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "build-target" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" + [[package]] name = "bumpalo" version = "3.13.0" @@ -716,9 +757,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -1152,12 +1193,42 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "dart-sys-fork" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "933dafff26172b719bb9695dd3715a1e7792f62dcdc8a5d4c740db7e0fedee8b" +dependencies = [ + "cc", +] + +[[package]] +name = "dashmap" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +dependencies = [ + "cfg-if 1.0.0", + "num_cpus", +] + [[package]] name = "data-encoding" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "delegate-attr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51aac4c99b2e6775164b412ea33ae8441b2fde2dbf05a20bc0052a63d08c475b" +dependencies = [ + "proc-macro2 1.0.76", + "quote 1.0.35", + "syn 2.0.48", +] + [[package]] name = "der" version = "0.6.1" @@ -1407,6 +1478,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "log", + "regex", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1903,6 +1984,44 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "flutter_rust_bridge" +version = "2.0.0-dev.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34014207992d96657886c50c90ab503bb4581cc9c2b1ea7ffad2ec12400032da" +dependencies = [ + "allo-isolate", + "android_logger", + "anyhow", + "build-target", + "bytemuck", + "byteorder", + "console_error_panic_hook", + "dart-sys-fork", + "delegate-attr", + "flutter_rust_bridge_macros", + "futures", + "js-sys", + "lazy_static", + "oslog", + "threadpool", + "tokio", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "flutter_rust_bridge_macros" +version = "2.0.0-dev.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd250246955bb9548a99733859946a5721289ec152de5fcc6eb03da7d3143dd1" +dependencies = [ + "hex", + "quote 1.0.35", + "syn 2.0.48", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2634,9 +2753,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -3220,6 +3339,17 @@ version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +[[package]] +name = "oslog" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8343ce955f18e7e68c0207dd0ea776ec453035685395ababd2ea651c569728b3" +dependencies = [ + "cc", + "dashmap", + "log", +] + [[package]] name = "pairing_ce" version = "0.24.2" @@ -4883,6 +5013,15 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.3.28" @@ -5517,9 +5656,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "serde", @@ -5529,9 +5668,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -5544,9 +5683,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -5556,9 +5695,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5566,9 +5705,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -5579,9 +5718,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-bindgen-test" @@ -5926,6 +6065,20 @@ dependencies = [ "zstd", ] +[[package]] +name = "zklink_sdk_dart" +version = "0.0.1" +dependencies = [ + "anyhow", + "flutter_rust_bridge", + "hex", + "serde_json", + "zklink_sdk_interface", + "zklink_sdk_signers", + "zklink_sdk_types", + "zklink_sdk_wallet", +] + [[package]] name = "zklink_sdk_interface" version = "2.0.0" diff --git a/Cargo.toml b/Cargo.toml index 1db19bc1..c94377c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] resolver = "2" members = [ + "bindings/dart/rust", "bindings/sdk", "bindings/wasm", "interface", @@ -69,3 +70,8 @@ strip = true # Automatically strip symbols from the binary. # debug = false # lto = true # codegen-units = 1 + +[profile.dart] +inherits = "release" +debug = false +lto = true diff --git a/README.md b/README.md index 0a5ff6ce..ae02e68c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ The codebase is primarily in Rust and provides cross-language bindings using mul - [uniffi-bindgen-go](https://github.com/NordSecurity/uniffi-bindgen-go) is used to generate bindings for Golang. - [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) is used to generate bindings for JavaScript and TypeScript to facilitate interactions with the Wasm modules (for web browser extensions or other web-related apps). +- [flutter_rust_bridge](https://github.com/fzyzcjy/flutter_rust_bridge) is used to generate bindings for Dart and Flutter. ## Pre-requisites Naturally, you will need the [Rust toolchain] installed. diff --git a/bindings/dart/CHANGELOG.md b/bindings/dart/CHANGELOG.md new file mode 100644 index 00000000..07613833 --- /dev/null +++ b/bindings/dart/CHANGELOG.md @@ -0,0 +1,2 @@ +## 0.0.1 +Initial Release \ No newline at end of file diff --git a/bindings/dart/LICENSE b/bindings/dart/LICENSE new file mode 100644 index 00000000..86933ccb --- /dev/null +++ b/bindings/dart/LICENSE @@ -0,0 +1,13 @@ +Copyright 2023-present, zk.link. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/bindings/dart/README.md b/bindings/dart/README.md new file mode 100644 index 00000000..147596f6 --- /dev/null +++ b/bindings/dart/README.md @@ -0,0 +1,4 @@ +[build status](https://github.com/zkLinkProtocol/zklink_sdk/actions?query=branch%3Amain) +[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +ZkLink SDK is an open-source cross-platform library that implements low-level cryptographic wallet functionality +for ZkLink and Ethereum-based blockchain networks. \ No newline at end of file diff --git a/bindings/dart/android/CMakeLists.txt b/bindings/dart/android/CMakeLists.txt new file mode 100644 index 00000000..4c73b3d5 --- /dev/null +++ b/bindings/dart/android/CMakeLists.txt @@ -0,0 +1,42 @@ +set(zklinkVersion "0.0.1") # generated; do not edit + +# Unlike the Windows & Linux CMakeLists.txt, this Android equivalent is just here +# to download the Android binaries into src/main/jniLibs/ and does not build anything. +# The binary download/extraction is difficult to do concisely in Groovy/Gradle, +# at least across host platforms, so we are just reusing our Linux/Windows logic. + +# The Flutter tooling requires that developers have CMake 3.10 or later +# installed. You should not increase this version, as doing so will cause +# the plugin to fail to compile for some customers of the plugin. +cmake_minimum_required(VERSION 3.10) + +# Download the binaries if they are not already present. +set(LIBROOT "${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs") +set(ARCHIVE "${CMAKE_CURRENT_SOURCE_DIR}/${zklinkVersion}.tar.xz") + + +# Extract the binaries, overriding any already present. +file(REMOVE_RECURSE ${LIBROOT}) +file(MAKE_DIRECTORY ${LIBROOT}) + +file(MAKE_DIRECTORY ${LIBROOT}/armeabi-v7a) +file(DOWNLOAD + "https://github.com/zkLinkProtocol/zklink_sdk/releases/download/dart_sdk_${zklinkVersion}/armv7-linux-androideabi.tar.xz" + ${ARCHIVE} + TLS_VERIFY ON +) +execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xvf ${ARCHIVE} -C armeabi-v7a + WORKING_DIRECTORY ${LIBROOT} +) + +file(MAKE_DIRECTORY ${LIBROOT}/arm64-v8a) +file(DOWNLOAD + "https://github.com/zkLinkProtocol/zklink_sdk/releases/download/dart_sdk_${zklinkVersion}/aarch64-linux-android.tar.xz" + ${ARCHIVE} + TLS_VERIFY ON +) +execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xvf ${ARCHIVE} -C arm64-v8a + WORKING_DIRECTORY ${LIBROOT} +) diff --git a/bindings/dart/android/build.gradle b/bindings/dart/android/build.gradle new file mode 100644 index 00000000..77fda85d --- /dev/null +++ b/bindings/dart/android/build.gradle @@ -0,0 +1,38 @@ +group 'com.zklink' +version '0.0.1' + +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + // The Android Gradle Plugin knows how to build native code with the NDK. + classpath 'com.android.tools.build:gradle:7.1.2' + } +} + +rootProject.allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 31 + + defaultConfig { + minSdkVersion 16 + } + + // Trigger the binary download/update over in CMakeLists.txt + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } +} diff --git a/bindings/dart/android/settings.gradle b/bindings/dart/android/settings.gradle new file mode 100644 index 00000000..022e41ff --- /dev/null +++ b/bindings/dart/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'zklink' diff --git a/bindings/dart/android/src/main/AndroidManifest.xml b/bindings/dart/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..1dcf6711 --- /dev/null +++ b/bindings/dart/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/bindings/dart/flutter_rust_bridge.yaml b/bindings/dart/flutter_rust_bridge.yaml new file mode 100644 index 00000000..3241904f --- /dev/null +++ b/bindings/dart/flutter_rust_bridge.yaml @@ -0,0 +1,4 @@ +rust_input: rust/src/api.rs +dart_output: lib +full_dep: true +web: false diff --git a/bindings/dart/ios/zklink.podspec b/bindings/dart/ios/zklink.podspec new file mode 100644 index 00000000..bdf14644 --- /dev/null +++ b/bindings/dart/ios/zklink.podspec @@ -0,0 +1,29 @@ +framework_name = 'zklink_sdk_dart' +url = "https://github.com/zkLinkProtocol/zklink_sdk/releases/download/dart_sdk_0.0.1/aarch64-apple-ios.tar.xz" +archive = "#{framework_name}.tar.xz" +` +mkdir -p Frameworks/#{framework_name} +cd Frameworks/#{framework_name} + +if [ ! -f #{archive} ] +then + curl -L #{url} -o #{archive} +fi + +tar xvf #{archive} +cd - +` + +Pod::Spec.new do |spec| + spec.name = 'zklink_sdk_dart' + spec.version = '0.0.1' + spec.license = { :file => '../LICENSE' } + spec.homepage = 'https://zk.link' + spec.summary = 'zkLink Dart SDK' + + spec.source = { :git => 'https://github.com/zkLinkProtocol/zklink_sdk.git' } + spec.vendored_frameworks = "Frameworks/#{framework_name}" + + spec.ios.deployment_target = '11.0' + spec.osx.deployment_target = '10.14' +end diff --git a/bindings/dart/lib/api.dart b/bindings/dart/lib/api.dart new file mode 100644 index 00000000..b2991115 --- /dev/null +++ b/bindings/dart/lib/api.dart @@ -0,0 +1,1059 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.32. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import 'frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// Rust type: RustOpaqueNom> +@sealed +class AutoDeleveraging extends RustOpaque { + AutoDeleveraging.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + AutoDeleveraging.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_AutoDeleveraging, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_AutoDeleveraging, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_AutoDeleveragingPtr, + ); + + factory AutoDeleveraging( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List contractPrices, + required List marginPrices, + required int adlAccountId, + required int pairId, + required String adlSize, + required String adlPrice, + required String fee, + required int feeToken, + dynamic hint}) => + RustLib.instance.api.autoDeleveragingNew( + accountId: accountId, + subAccountId: subAccountId, + subAccountNonce: subAccountNonce, + contractPrices: contractPrices, + marginPrices: marginPrices, + adlAccountId: adlAccountId, + pairId: pairId, + adlSize: adlSize, + adlPrice: adlPrice, + fee: fee, + feeToken: feeToken, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => RustLib + .instance.api + .autoDeleveragingSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.autoDeleveragingToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class ChangePubKey extends RustOpaque { + ChangePubKey.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + ChangePubKey.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_ChangePubKey, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_ChangePubKey, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_ChangePubKeyPtr, + ); + + String getEthSignMsg( + {required int nonce, required int accountId, dynamic hint}) => + RustLib.instance.api.changePubKeyGetEthSignMsg( + that: this, nonce: nonce, accountId: accountId, hint: hint); + + factory ChangePubKey( + {required int chainId, + required int accountId, + required int subAccountId, + required String newPubkeyHash, + required int feeToken, + required String fee, + required int nonce, + String? ethSignature, + int? ts, + dynamic hint}) => + RustLib.instance.api.changePubKeyNew( + chainId: chainId, + accountId: accountId, + subAccountId: subAccountId, + newPubkeyHash: newPubkeyHash, + feeToken: feeToken, + fee: fee, + nonce: nonce, + ethSignature: ethSignature, + ts: ts, + hint: hint); + + void setEthAuthData({required String sig, dynamic hint}) => + RustLib.instance.api + .changePubKeySetEthAuthData(that: this, sig: sig, hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => + RustLib.instance.api + .changePubKeySign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toEip712RequestPayload( + {required int chainId, required String address, dynamic hint}) => + RustLib.instance.api.changePubKeyToEip712RequestPayload( + that: this, chainId: chainId, address: address, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.changePubKeyToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Contract extends RustOpaque { + Contract.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Contract.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Contract, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Contract, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_ContractPtr, + ); + + factory Contract( + {required int accountId, + required int subAccountId, + required int slotId, + required int nonce, + required int pairId, + required String size, + required String price, + required bool direction, + required int makerFeeRate, + required int takerFeeRate, + required bool hasSubsidy, + dynamic hint}) => + RustLib.instance.api.contractNew( + accountId: accountId, + subAccountId: subAccountId, + slotId: slotId, + nonce: nonce, + pairId: pairId, + size: size, + price: price, + direction: direction, + makerFeeRate: makerFeeRate, + takerFeeRate: takerFeeRate, + hasSubsidy: hasSubsidy, + hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class ContractMatching extends RustOpaque { + ContractMatching.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + ContractMatching.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_ContractMatching, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_ContractMatching, + rustArcDecrementStrongCountPtr: RustLib + .instance.api.rust_arc_decrement_strong_count_ContractMatchingPtr, + ); + + factory ContractMatching( + {required int accountId, + required int subAccountId, + required Contract taker, + required List maker, + required String fee, + required int feeToken, + required List contractPrices, + required List marginPrices, + dynamic hint}) => + RustLib.instance.api.contractMatchingNew( + accountId: accountId, + subAccountId: subAccountId, + taker: taker, + maker: maker, + fee: fee, + feeToken: feeToken, + contractPrices: contractPrices, + marginPrices: marginPrices, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => RustLib + .instance.api + .contractMatchingSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.contractMatchingToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class ContractPrice extends RustOpaque { + ContractPrice.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + ContractPrice.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_ContractPrice, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_ContractPrice, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_ContractPricePtr, + ); + + factory ContractPrice( + {required int pairId, required String marketPrice, dynamic hint}) => + RustLib.instance.api.contractPriceNew( + pairId: pairId, marketPrice: marketPrice, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class EthTxOption extends RustOpaque { + EthTxOption.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + EthTxOption.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_EthTxOption, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_EthTxOption, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_EthTxOptionPtr, + ); + + factory EthTxOption( + {required bool isSupportEip1559, + required String to, + double? nonce, + String? value, + double? gas, + String? gasPrice, + dynamic hint}) => + RustLib.instance.api.ethTxOptionNew( + isSupportEip1559: isSupportEip1559, + to: to, + nonce: nonce, + value: value, + gas: gas, + gasPrice: gasPrice, + hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class ForcedExit extends RustOpaque { + ForcedExit.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + ForcedExit.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_ForcedExit, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_ForcedExit, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_ForcedExitPtr, + ); + + factory ForcedExit( + {required int toChainId, + required int initiatorAccountId, + required int initiatorSubAccountId, + required int targetSubAccountId, + required String target, + required int l2SourceToken, + required int l1TargetToken, + required String exitAmount, + required int initiatorNonce, + required bool withdrawToL1, + int? ts, + dynamic hint}) => + RustLib.instance.api.forcedExitNew( + toChainId: toChainId, + initiatorAccountId: initiatorAccountId, + initiatorSubAccountId: initiatorSubAccountId, + targetSubAccountId: targetSubAccountId, + target: target, + l2SourceToken: l2SourceToken, + l1TargetToken: l1TargetToken, + exitAmount: exitAmount, + initiatorNonce: initiatorNonce, + withdrawToL1: withdrawToL1, + ts: ts, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => + RustLib.instance.api + .forcedExitSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.forcedExitToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Funding extends RustOpaque { + Funding.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Funding.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Funding, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Funding, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_FundingPtr, + ); + + factory Funding( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List fundingAccountIds, + required String fee, + required int feeToken, + dynamic hint}) => + RustLib.instance.api.fundingNew( + accountId: accountId, + subAccountId: subAccountId, + subAccountNonce: subAccountNonce, + fundingAccountIds: fundingAccountIds, + fee: fee, + feeToken: feeToken, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => + RustLib.instance.api + .fundingSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.fundingToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class FundingInfo extends RustOpaque { + FundingInfo.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + FundingInfo.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_FundingInfo, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_FundingInfo, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_FundingInfoPtr, + ); + + factory FundingInfo( + {required int pairId, + required String price, + required int fundingRate, + dynamic hint}) => + RustLib.instance.api.fundingInfoNew( + pairId: pairId, price: price, fundingRate: fundingRate, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Liquidation extends RustOpaque { + Liquidation.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + Liquidation.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Liquidation, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Liquidation, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_LiquidationPtr, + ); + + factory Liquidation( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List contractPrices, + required List marginPrices, + required int liquidationAccountId, + required String fee, + required int feeToken, + dynamic hint}) => + RustLib.instance.api.liquidationNew( + accountId: accountId, + subAccountId: subAccountId, + subAccountNonce: subAccountNonce, + contractPrices: contractPrices, + marginPrices: marginPrices, + liquidationAccountId: liquidationAccountId, + fee: fee, + feeToken: feeToken, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => + RustLib.instance.api + .liquidationSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.liquidationToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Order extends RustOpaque { + Order.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Order.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Order, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Order, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_OrderPtr, + ); + + factory Order( + {required int accountId, + required int subAccountId, + required int slotId, + required int nonce, + required int baseTokenId, + required int quoteTokenId, + required String amount, + required String price, + required bool isSell, + required int makerFeeRate, + required int takerFeeRate, + required bool hasSubsidy, + dynamic hint}) => + RustLib.instance.api.orderNew( + accountId: accountId, + subAccountId: subAccountId, + slotId: slotId, + nonce: nonce, + baseTokenId: baseTokenId, + quoteTokenId: quoteTokenId, + amount: amount, + price: price, + isSell: isSell, + makerFeeRate: makerFeeRate, + takerFeeRate: takerFeeRate, + hasSubsidy: hasSubsidy, + hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class OrderMatching extends RustOpaque { + OrderMatching.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + OrderMatching.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_OrderMatching, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_OrderMatching, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_OrderMatchingPtr, + ); + + factory OrderMatching( + {required int accountId, + required int subAccountId, + required Order taker, + required Order maker, + required String fee, + required int feeToken, + required List contractPrices, + required List marginPrices, + required String expectBaseAmount, + required String expectQuoteAmount, + dynamic hint}) => + RustLib.instance.api.orderMatchingNew( + accountId: accountId, + subAccountId: subAccountId, + taker: taker, + maker: maker, + fee: fee, + feeToken: feeToken, + contractPrices: contractPrices, + marginPrices: marginPrices, + expectBaseAmount: expectBaseAmount, + expectQuoteAmount: expectQuoteAmount, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => RustLib + .instance.api + .orderMatchingSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.orderMatchingToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Parameter extends RustOpaque { + Parameter.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Parameter.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Parameter, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Parameter, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_ParameterPtr, + ); + + static Parameter contractInfo( + {required int pairId, + required String symbol, + required int initialMarginRate, + required int maintenanceMarginRate, + dynamic hint}) => + RustLib.instance.api.parameterContractInfo( + pairId: pairId, + symbol: symbol, + initialMarginRate: initialMarginRate, + maintenanceMarginRate: maintenanceMarginRate, + hint: hint); + + static Parameter feeAccount({required int accountId, dynamic hint}) => + RustLib.instance.api + .parameterFeeAccount(accountId: accountId, hint: hint); + + static Parameter fundingInfos( + {required List infos, dynamic hint}) => + RustLib.instance.api.parameterFundingInfos(infos: infos, hint: hint); + + static Parameter insuranceFundAccount( + {required int accountId, dynamic hint}) => + RustLib.instance.api + .parameterInsuranceFundAccount(accountId: accountId, hint: hint); + + static Parameter marginInfo( + {required int marginId, + String? symbol, + required int tokenId, + required int ratio, + dynamic hint}) => + RustLib.instance.api.parameterMarginInfo( + marginId: marginId, + symbol: symbol, + tokenId: tokenId, + ratio: ratio, + hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Signer extends RustOpaque { + Signer.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Signer.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Signer, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Signer, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_SignerPtr, + ); + + Contract createSignedContract({required Contract contract, dynamic hint}) => + RustLib.instance.api.signerCreateSignedContract( + that: this, contract: contract, hint: hint); + + Order createSignedOrder({required Order order, dynamic hint}) => + RustLib.instance.api + .signerCreateSignedOrder(that: this, order: order, hint: hint); + + static Signer ethSigner({required String ethPrivateKey, dynamic hint}) => + RustLib.instance.api + .signerEthSigner(ethPrivateKey: ethPrivateKey, hint: hint); + + String signAutoDeleveraging({required AutoDeleveraging tx, dynamic hint}) => + RustLib.instance.api + .signerSignAutoDeleveraging(that: this, tx: tx, hint: hint); + + String signChangePubkeyWithCreate2DataAuth( + {required ChangePubKey tx, + required String creatorAddress, + required String saltArg, + required String codeHash, + dynamic hint}) => + RustLib.instance.api.signerSignChangePubkeyWithCreate2DataAuth( + that: this, + tx: tx, + creatorAddress: creatorAddress, + saltArg: saltArg, + codeHash: codeHash, + hint: hint); + + String signChangePubkeyWithEthEcdsaAuth( + {required ChangePubKey tx, dynamic hint}) => + RustLib.instance.api.signerSignChangePubkeyWithEthEcdsaAuth( + that: this, tx: tx, hint: hint); + + String signChangePubkeyWithOnchain( + {required ChangePubKey tx, dynamic hint}) => + RustLib.instance.api + .signerSignChangePubkeyWithOnchain(that: this, tx: tx, hint: hint); + + String signContractMatching({required ContractMatching tx, dynamic hint}) => + RustLib.instance.api + .signerSignContractMatching(that: this, tx: tx, hint: hint); + + String signForcedExit({required ForcedExit tx, dynamic hint}) => + RustLib.instance.api.signerSignForcedExit(that: this, tx: tx, hint: hint); + + String signFunding({required Funding tx, dynamic hint}) => + RustLib.instance.api.signerSignFunding(that: this, tx: tx, hint: hint); + + String signLiquidation({required Liquidation tx, dynamic hint}) => + RustLib.instance.api + .signerSignLiquidation(that: this, tx: tx, hint: hint); + + String signOrderMatching({required OrderMatching tx, dynamic hint}) => + RustLib.instance.api + .signerSignOrderMatching(that: this, tx: tx, hint: hint); + + String signTransfer( + {required Transfer tx, + required String tokenSymbol, + String? chainId, + String? addr, + dynamic hint}) => + RustLib.instance.api.signerSignTransfer( + that: this, + tx: tx, + tokenSymbol: tokenSymbol, + chainId: chainId, + addr: addr, + hint: hint); + + String signWithdraw( + {required Withdraw tx, + required String tokenSymbol, + String? chainId, + String? addr, + dynamic hint}) => + RustLib.instance.api.signerSignWithdraw( + that: this, + tx: tx, + tokenSymbol: tokenSymbol, + chainId: chainId, + addr: addr, + hint: hint); + + static Signer starknetSigner( + {required String ethPrivateKey, + required String starknetChainId, + required String starknetAddr, + dynamic hint}) => + RustLib.instance.api.signerStarknetSigner( + ethPrivateKey: ethPrivateKey, + starknetChainId: starknetChainId, + starknetAddr: starknetAddr, + hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class SpotPriceInfo extends RustOpaque { + SpotPriceInfo.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + SpotPriceInfo.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_SpotPriceInfo, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_SpotPriceInfo, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_SpotPriceInfoPtr, + ); + + factory SpotPriceInfo( + {required int tokenId, required String price, dynamic hint}) => + RustLib.instance.api + .spotPriceInfoNew(tokenId: tokenId, price: price, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Transfer extends RustOpaque { + Transfer.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Transfer.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Transfer, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Transfer, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_TransferPtr, + ); + + String getEthSignMsg({required String tokenSymbol, dynamic hint}) => RustLib + .instance.api + .transferGetEthSignMsg(that: this, tokenSymbol: tokenSymbol, hint: hint); + + factory Transfer( + {required int accountId, + required String toAddress, + required int fromSubAccountId, + required int toSubAccountId, + required int token, + required String fee, + required String amount, + required int nonce, + int? ts, + dynamic hint}) => + RustLib.instance.api.transferNew( + accountId: accountId, + toAddress: toAddress, + fromSubAccountId: fromSubAccountId, + toSubAccountId: toSubAccountId, + token: token, + fee: fee, + amount: amount, + nonce: nonce, + ts: ts, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => + RustLib.instance.api + .transferSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.transferToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class UpdateGlobalVar extends RustOpaque { + UpdateGlobalVar.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + UpdateGlobalVar.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_UpdateGlobalVar, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_UpdateGlobalVar, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_UpdateGlobalVarPtr, + ); + + factory UpdateGlobalVar( + {required int fromChainId, + required int subAccountId, + required Parameter parameter, + required double serialId, + dynamic hint}) => + RustLib.instance.api.updateGlobalVarNew( + fromChainId: fromChainId, + subAccountId: subAccountId, + parameter: parameter, + serialId: serialId, + hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.updateGlobalVarToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Wallet extends RustOpaque { + Wallet.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Wallet.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Wallet, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Wallet, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_WalletPtr, + ); + + Future approveErc20( + {required String contract, + required String amount, + required EthTxOption ethParams, + dynamic hint}) => + RustLib.instance.api.walletApproveErc20( + that: this, + contract: contract, + amount: amount, + ethParams: ethParams, + hint: hint); + + Future depositErc20( + {required int subAccountId, + required String depositTo, + required String tokenAddr, + required String amount, + required bool mapping, + required EthTxOption ethParams, + required bool isGateway, + dynamic hint}) => + RustLib.instance.api.walletDepositErc20( + that: this, + subAccountId: subAccountId, + depositTo: depositTo, + tokenAddr: tokenAddr, + amount: amount, + mapping: mapping, + ethParams: ethParams, + isGateway: isGateway, + hint: hint); + + Future depositEth( + {required int subAccountId, + required String depositTo, + required EthTxOption ethParams, + required bool isGateway, + dynamic hint}) => + RustLib.instance.api.walletDepositEth( + that: this, + subAccountId: subAccountId, + depositTo: depositTo, + ethParams: ethParams, + isGateway: isGateway, + hint: hint); + + Future fullExit( + {required int accountId, + required int subAccountId, + required int tokenId, + required bool mapping, + required EthTxOption ethParams, + dynamic hint}) => + RustLib.instance.api.walletFullExit( + that: this, + accountId: accountId, + subAccountId: subAccountId, + tokenId: tokenId, + mapping: mapping, + ethParams: ethParams, + hint: hint); + + Future getBalance({dynamic hint}) => + RustLib.instance.api.walletGetBalance(that: this, hint: hint); + + Future getDepositFee( + {required EthTxOption ethParams, dynamic hint}) => + RustLib.instance.api + .walletGetDepositFee(that: this, ethParams: ethParams, hint: hint); + + Future getNonce({required String blockNumber, dynamic hint}) => + RustLib.instance.api + .walletGetNonce(that: this, blockNumber: blockNumber, hint: hint); + + factory Wallet( + {required String url, required String privateKey, dynamic hint}) => + RustLib.instance.api + .walletNew(url: url, privateKey: privateKey, hint: hint); + + Future setAuthPubkeyHash( + {required double nonce, + required String newPubkeyHash, + required EthTxOption ethParams, + dynamic hint}) => + RustLib.instance.api.walletSetAuthPubkeyHash( + that: this, + nonce: nonce, + newPubkeyHash: newPubkeyHash, + ethParams: ethParams, + hint: hint); + + Future waitForTransaction( + {required String txHash, int? timeout, dynamic hint}) => + RustLib.instance.api.walletWaitForTransaction( + that: this, txHash: txHash, timeout: timeout, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class Withdraw extends RustOpaque { + Withdraw.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); + + Withdraw.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_Withdraw, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_Withdraw, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_WithdrawPtr, + ); + + String getEthSignMsg({required String tokenSymbol, dynamic hint}) => RustLib + .instance.api + .withdrawGetEthSignMsg(that: this, tokenSymbol: tokenSymbol, hint: hint); + + factory Withdraw( + {required int accountId, + required int subAccountId, + required int toChainId, + required String toAddress, + required int l2SourceToken, + required int l1TargetToken, + required String amount, + String? callData, + required String fee, + required int nonce, + required bool withdrawToL1, + required int withdrawFeeRatio, + int? ts, + dynamic hint}) => + RustLib.instance.api.withdrawNew( + accountId: accountId, + subAccountId: subAccountId, + toChainId: toChainId, + toAddress: toAddress, + l2SourceToken: l2SourceToken, + l1TargetToken: l1TargetToken, + amount: amount, + callData: callData, + fee: fee, + nonce: nonce, + withdrawToL1: withdrawToL1, + withdrawFeeRatio: withdrawFeeRatio, + ts: ts, + hint: hint); + + void sign({required ZkLinkSigner zkLinkSigner, dynamic hint}) => + RustLib.instance.api + .withdrawSign(that: this, zkLinkSigner: zkLinkSigner, hint: hint); + + String toJson({dynamic hint}) => + RustLib.instance.api.withdrawToJson(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class ZkLinkSignature extends RustOpaque { + ZkLinkSignature.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + ZkLinkSignature.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_ZkLinkSignature, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_ZkLinkSignature, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_ZkLinkSignaturePtr, + ); + + String getPubkey({dynamic hint}) => + RustLib.instance.api.zkLinkSignatureGetPubkey(that: this, hint: hint); + + String getSignature({dynamic hint}) => + RustLib.instance.api.zkLinkSignatureGetSignature(that: this, hint: hint); +} + +// Rust type: RustOpaqueNom> +@sealed +class ZkLinkSigner extends RustOpaque { + ZkLinkSigner.dcoDecode(List wire) + : super.dcoDecode(wire, _kStaticData); + + ZkLinkSigner.sseDecode(int ptr, int externalSizeOnNative) + : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: + RustLib.instance.api.rust_arc_increment_strong_count_ZkLinkSigner, + rustArcDecrementStrongCount: + RustLib.instance.api.rust_arc_decrement_strong_count_ZkLinkSigner, + rustArcDecrementStrongCountPtr: + RustLib.instance.api.rust_arc_decrement_strong_count_ZkLinkSignerPtr, + ); + + static ZkLinkSigner ethSig({required String sig, dynamic hint}) => + RustLib.instance.api.zkLinkSignerEthSig(sig: sig, hint: hint); + + String getPubkey({dynamic hint}) => + RustLib.instance.api.zkLinkSignerGetPubkey(that: this, hint: hint); + + String getPubkeyHash({dynamic hint}) => + RustLib.instance.api.zkLinkSignerGetPubkeyHash(that: this, hint: hint); + + ZkLinkSignature signMusig({required List msg, dynamic hint}) => + RustLib.instance.api + .zkLinkSignerSignMusig(that: this, msg: msg, hint: hint); + + static ZkLinkSigner starknetSig({required String sig, dynamic hint}) => + RustLib.instance.api.zkLinkSignerStarknetSig(sig: sig, hint: hint); +} diff --git a/bindings/dart/lib/frb_generated.dart b/bindings/dart/lib/frb_generated.dart new file mode 100644 index 00000000..0970ab19 --- /dev/null +++ b/bindings/dart/lib/frb_generated.dart @@ -0,0 +1,6331 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.32. + +// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field + +import 'api.dart'; +import 'dart:async'; +import 'dart:convert'; +import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +/// Main entrypoint of the Rust API +class RustLib extends BaseEntrypoint { + @internal + static final instance = RustLib._(); + + RustLib._(); + + /// Initialize flutter_rust_bridge + static Future init({ + RustLibApi? api, + BaseHandler? handler, + ExternalLibrary? externalLibrary, + }) async { + await instance.initImpl( + api: api, + handler: handler, + externalLibrary: externalLibrary, + ); + } + + /// Dispose flutter_rust_bridge + /// + /// The call to this function is optional, since flutter_rust_bridge (and everything else) + /// is automatically disposed when the app stops. + static void dispose() => instance.disposeImpl(); + + @override + ApiImplConstructor get apiImplConstructor => + RustLibApiImpl.new; + + @override + WireConstructor get wireConstructor => + RustLibWire.fromExternalLibrary; + + @override + Future executeRustInitializers() async { + await api.initApp(); + } + + @override + ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig => + kDefaultExternalLibraryLoaderConfig; + + @override + String get codegenVersion => '2.0.0-dev.32'; + + @override + int get rustContentHash => 1188958908; + + static const kDefaultExternalLibraryLoaderConfig = + ExternalLibraryLoaderConfig( + stem: 'zklink_sdk_dart', + ioDirectory: 'rust/target/release/', + webPrefix: 'pkg/', + ); +} + +abstract class RustLibApi extends BaseApi { + AutoDeleveraging autoDeleveragingNew( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List contractPrices, + required List marginPrices, + required int adlAccountId, + required int pairId, + required String adlSize, + required String adlPrice, + required String fee, + required int feeToken, + dynamic hint}); + + void autoDeleveragingSign( + {required AutoDeleveraging that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String autoDeleveragingToJson({required AutoDeleveraging that, dynamic hint}); + + String changePubKeyGetEthSignMsg( + {required ChangePubKey that, + required int nonce, + required int accountId, + dynamic hint}); + + ChangePubKey changePubKeyNew( + {required int chainId, + required int accountId, + required int subAccountId, + required String newPubkeyHash, + required int feeToken, + required String fee, + required int nonce, + String? ethSignature, + int? ts, + dynamic hint}); + + void changePubKeySetEthAuthData( + {required ChangePubKey that, required String sig, dynamic hint}); + + void changePubKeySign( + {required ChangePubKey that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String changePubKeyToEip712RequestPayload( + {required ChangePubKey that, + required int chainId, + required String address, + dynamic hint}); + + String changePubKeyToJson({required ChangePubKey that, dynamic hint}); + + ContractMatching contractMatchingNew( + {required int accountId, + required int subAccountId, + required Contract taker, + required List maker, + required String fee, + required int feeToken, + required List contractPrices, + required List marginPrices, + dynamic hint}); + + void contractMatchingSign( + {required ContractMatching that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String contractMatchingToJson({required ContractMatching that, dynamic hint}); + + ContractPrice contractPriceNew( + {required int pairId, required String marketPrice, dynamic hint}); + + Contract contractNew( + {required int accountId, + required int subAccountId, + required int slotId, + required int nonce, + required int pairId, + required String size, + required String price, + required bool direction, + required int makerFeeRate, + required int takerFeeRate, + required bool hasSubsidy, + dynamic hint}); + + EthTxOption ethTxOptionNew( + {required bool isSupportEip1559, + required String to, + double? nonce, + String? value, + double? gas, + String? gasPrice, + dynamic hint}); + + ForcedExit forcedExitNew( + {required int toChainId, + required int initiatorAccountId, + required int initiatorSubAccountId, + required int targetSubAccountId, + required String target, + required int l2SourceToken, + required int l1TargetToken, + required String exitAmount, + required int initiatorNonce, + required bool withdrawToL1, + int? ts, + dynamic hint}); + + void forcedExitSign( + {required ForcedExit that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String forcedExitToJson({required ForcedExit that, dynamic hint}); + + FundingInfo fundingInfoNew( + {required int pairId, + required String price, + required int fundingRate, + dynamic hint}); + + Funding fundingNew( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List fundingAccountIds, + required String fee, + required int feeToken, + dynamic hint}); + + void fundingSign( + {required Funding that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String fundingToJson({required Funding that, dynamic hint}); + + Liquidation liquidationNew( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List contractPrices, + required List marginPrices, + required int liquidationAccountId, + required String fee, + required int feeToken, + dynamic hint}); + + void liquidationSign( + {required Liquidation that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String liquidationToJson({required Liquidation that, dynamic hint}); + + OrderMatching orderMatchingNew( + {required int accountId, + required int subAccountId, + required Order taker, + required Order maker, + required String fee, + required int feeToken, + required List contractPrices, + required List marginPrices, + required String expectBaseAmount, + required String expectQuoteAmount, + dynamic hint}); + + void orderMatchingSign( + {required OrderMatching that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String orderMatchingToJson({required OrderMatching that, dynamic hint}); + + Order orderNew( + {required int accountId, + required int subAccountId, + required int slotId, + required int nonce, + required int baseTokenId, + required int quoteTokenId, + required String amount, + required String price, + required bool isSell, + required int makerFeeRate, + required int takerFeeRate, + required bool hasSubsidy, + dynamic hint}); + + Parameter parameterContractInfo( + {required int pairId, + required String symbol, + required int initialMarginRate, + required int maintenanceMarginRate, + dynamic hint}); + + Parameter parameterFeeAccount({required int accountId, dynamic hint}); + + Parameter parameterFundingInfos( + {required List infos, dynamic hint}); + + Parameter parameterInsuranceFundAccount( + {required int accountId, dynamic hint}); + + Parameter parameterMarginInfo( + {required int marginId, + String? symbol, + required int tokenId, + required int ratio, + dynamic hint}); + + Contract signerCreateSignedContract( + {required Signer that, required Contract contract, dynamic hint}); + + Order signerCreateSignedOrder( + {required Signer that, required Order order, dynamic hint}); + + Signer signerEthSigner({required String ethPrivateKey, dynamic hint}); + + String signerSignAutoDeleveraging( + {required Signer that, required AutoDeleveraging tx, dynamic hint}); + + String signerSignChangePubkeyWithCreate2DataAuth( + {required Signer that, + required ChangePubKey tx, + required String creatorAddress, + required String saltArg, + required String codeHash, + dynamic hint}); + + String signerSignChangePubkeyWithEthEcdsaAuth( + {required Signer that, required ChangePubKey tx, dynamic hint}); + + String signerSignChangePubkeyWithOnchain( + {required Signer that, required ChangePubKey tx, dynamic hint}); + + String signerSignContractMatching( + {required Signer that, required ContractMatching tx, dynamic hint}); + + String signerSignForcedExit( + {required Signer that, required ForcedExit tx, dynamic hint}); + + String signerSignFunding( + {required Signer that, required Funding tx, dynamic hint}); + + String signerSignLiquidation( + {required Signer that, required Liquidation tx, dynamic hint}); + + String signerSignOrderMatching( + {required Signer that, required OrderMatching tx, dynamic hint}); + + String signerSignTransfer( + {required Signer that, + required Transfer tx, + required String tokenSymbol, + String? chainId, + String? addr, + dynamic hint}); + + String signerSignWithdraw( + {required Signer that, + required Withdraw tx, + required String tokenSymbol, + String? chainId, + String? addr, + dynamic hint}); + + Signer signerStarknetSigner( + {required String ethPrivateKey, + required String starknetChainId, + required String starknetAddr, + dynamic hint}); + + SpotPriceInfo spotPriceInfoNew( + {required int tokenId, required String price, dynamic hint}); + + String transferGetEthSignMsg( + {required Transfer that, required String tokenSymbol, dynamic hint}); + + Transfer transferNew( + {required int accountId, + required String toAddress, + required int fromSubAccountId, + required int toSubAccountId, + required int token, + required String fee, + required String amount, + required int nonce, + int? ts, + dynamic hint}); + + void transferSign( + {required Transfer that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String transferToJson({required Transfer that, dynamic hint}); + + UpdateGlobalVar updateGlobalVarNew( + {required int fromChainId, + required int subAccountId, + required Parameter parameter, + required double serialId, + dynamic hint}); + + String updateGlobalVarToJson({required UpdateGlobalVar that, dynamic hint}); + + Future walletApproveErc20( + {required Wallet that, + required String contract, + required String amount, + required EthTxOption ethParams, + dynamic hint}); + + Future walletDepositErc20( + {required Wallet that, + required int subAccountId, + required String depositTo, + required String tokenAddr, + required String amount, + required bool mapping, + required EthTxOption ethParams, + required bool isGateway, + dynamic hint}); + + Future walletDepositEth( + {required Wallet that, + required int subAccountId, + required String depositTo, + required EthTxOption ethParams, + required bool isGateway, + dynamic hint}); + + Future walletFullExit( + {required Wallet that, + required int accountId, + required int subAccountId, + required int tokenId, + required bool mapping, + required EthTxOption ethParams, + dynamic hint}); + + Future walletGetBalance({required Wallet that, dynamic hint}); + + Future walletGetDepositFee( + {required Wallet that, required EthTxOption ethParams, dynamic hint}); + + Future walletGetNonce( + {required Wallet that, required String blockNumber, dynamic hint}); + + Wallet walletNew( + {required String url, required String privateKey, dynamic hint}); + + Future walletSetAuthPubkeyHash( + {required Wallet that, + required double nonce, + required String newPubkeyHash, + required EthTxOption ethParams, + dynamic hint}); + + Future walletWaitForTransaction( + {required Wallet that, + required String txHash, + int? timeout, + dynamic hint}); + + String withdrawGetEthSignMsg( + {required Withdraw that, required String tokenSymbol, dynamic hint}); + + Withdraw withdrawNew( + {required int accountId, + required int subAccountId, + required int toChainId, + required String toAddress, + required int l2SourceToken, + required int l1TargetToken, + required String amount, + String? callData, + required String fee, + required int nonce, + required bool withdrawToL1, + required int withdrawFeeRatio, + int? ts, + dynamic hint}); + + void withdrawSign( + {required Withdraw that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}); + + String withdrawToJson({required Withdraw that, dynamic hint}); + + String zkLinkSignatureGetPubkey( + {required ZkLinkSignature that, dynamic hint}); + + String zkLinkSignatureGetSignature( + {required ZkLinkSignature that, dynamic hint}); + + ZkLinkSigner zkLinkSignerEthSig({required String sig, dynamic hint}); + + String zkLinkSignerGetPubkey({required ZkLinkSigner that, dynamic hint}); + + String zkLinkSignerGetPubkeyHash({required ZkLinkSigner that, dynamic hint}); + + ZkLinkSignature zkLinkSignerSignMusig( + {required ZkLinkSigner that, required List msg, dynamic hint}); + + ZkLinkSigner zkLinkSignerStarknetSig({required String sig, dynamic hint}); + + Future initApp({dynamic hint}); + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_AutoDeleveraging; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_AutoDeleveraging; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_AutoDeleveragingPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ChangePubKey; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ChangePubKey; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ChangePubKeyPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Contract; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Contract; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ContractPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ContractMatching; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ContractMatching; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ContractMatchingPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ContractPrice; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ContractPrice; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ContractPricePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_EthTxOption; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_EthTxOption; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_EthTxOptionPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ForcedExit; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ForcedExit; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ForcedExitPtr; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Funding; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Funding; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_FundingPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_FundingInfo; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_FundingInfo; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_FundingInfoPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Liquidation; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Liquidation; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_LiquidationPtr; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Order; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Order; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_OrderPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OrderMatching; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OrderMatching; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OrderMatchingPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Parameter; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Parameter; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ParameterPtr; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Signer; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Signer; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_SignerPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_SpotPriceInfo; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_SpotPriceInfo; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_SpotPriceInfoPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Transfer; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Transfer; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_TransferPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_UpdateGlobalVar; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_UpdateGlobalVar; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_UpdateGlobalVarPtr; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Wallet; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Wallet; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_WalletPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Withdraw; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Withdraw; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_WithdrawPtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ZkLinkSignature; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ZkLinkSignature; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ZkLinkSignaturePtr; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ZkLinkSigner; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ZkLinkSigner; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ZkLinkSignerPtr; +} + +class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { + RustLibApiImpl({ + required super.handler, + required super.wire, + required super.generalizedFrbRustBinding, + required super.portManager, + }); + + @override + AutoDeleveraging autoDeleveragingNew( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List contractPrices, + required List marginPrices, + required int adlAccountId, + required int pairId, + required String adlSize, + required String adlPrice, + required String fee, + required int feeToken, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_u_32(subAccountNonce); + var arg3 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + contractPrices); + var arg4 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + marginPrices); + var arg5 = cst_encode_u_32(adlAccountId); + var arg6 = cst_encode_u_16(pairId); + var arg7 = cst_encode_String(adlSize); + var arg8 = cst_encode_String(adlPrice); + var arg9 = cst_encode_String(fee); + var arg10 = cst_encode_u_16(feeToken); + return wire.wire_AutoDeleveraging_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kAutoDeleveragingNewConstMeta, + argValues: [ + accountId, + subAccountId, + subAccountNonce, + contractPrices, + marginPrices, + adlAccountId, + pairId, + adlSize, + adlPrice, + fee, + feeToken + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kAutoDeleveragingNewConstMeta => const TaskConstMeta( + debugName: "AutoDeleveraging_new", + argNames: [ + "accountId", + "subAccountId", + "subAccountNonce", + "contractPrices", + "marginPrices", + "adlAccountId", + "pairId", + "adlSize", + "adlPrice", + "fee", + "feeToken" + ], + ); + + @override + void autoDeleveragingSign( + {required AutoDeleveraging that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_AutoDeleveraging_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kAutoDeleveragingSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kAutoDeleveragingSignConstMeta => const TaskConstMeta( + debugName: "AutoDeleveraging_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String autoDeleveragingToJson( + {required AutoDeleveraging that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + that); + return wire.wire_AutoDeleveraging_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kAutoDeleveragingToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kAutoDeleveragingToJsonConstMeta => const TaskConstMeta( + debugName: "AutoDeleveraging_to_json", + argNames: ["that"], + ); + + @override + String changePubKeyGetEthSignMsg( + {required ChangePubKey that, + required int nonce, + required int accountId, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + that); + var arg1 = cst_encode_u_32(nonce); + var arg2 = cst_encode_u_32(accountId); + return wire.wire_ChangePubKey_get_eth_sign_msg(arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kChangePubKeyGetEthSignMsgConstMeta, + argValues: [that, nonce, accountId], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kChangePubKeyGetEthSignMsgConstMeta => const TaskConstMeta( + debugName: "ChangePubKey_get_eth_sign_msg", + argNames: ["that", "nonce", "accountId"], + ); + + @override + ChangePubKey changePubKeyNew( + {required int chainId, + required int accountId, + required int subAccountId, + required String newPubkeyHash, + required int feeToken, + required String fee, + required int nonce, + String? ethSignature, + int? ts, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_8(chainId); + var arg1 = cst_encode_u_32(accountId); + var arg2 = cst_encode_u_8(subAccountId); + var arg3 = cst_encode_String(newPubkeyHash); + var arg4 = cst_encode_u_32(feeToken); + var arg5 = cst_encode_String(fee); + var arg6 = cst_encode_u_32(nonce); + var arg7 = cst_encode_opt_String(ethSignature); + var arg8 = cst_encode_opt_box_autoadd_u_32(ts); + return wire.wire_ChangePubKey_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kChangePubKeyNewConstMeta, + argValues: [ + chainId, + accountId, + subAccountId, + newPubkeyHash, + feeToken, + fee, + nonce, + ethSignature, + ts + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kChangePubKeyNewConstMeta => const TaskConstMeta( + debugName: "ChangePubKey_new", + argNames: [ + "chainId", + "accountId", + "subAccountId", + "newPubkeyHash", + "feeToken", + "fee", + "nonce", + "ethSignature", + "ts" + ], + ); + + @override + void changePubKeySetEthAuthData( + {required ChangePubKey that, required String sig, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + that); + var arg1 = cst_encode_String(sig); + return wire.wire_ChangePubKey_set_eth_auth_data(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kChangePubKeySetEthAuthDataConstMeta, + argValues: [that, sig], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kChangePubKeySetEthAuthDataConstMeta => const TaskConstMeta( + debugName: "ChangePubKey_set_eth_auth_data", + argNames: ["that", "sig"], + ); + + @override + void changePubKeySign( + {required ChangePubKey that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_ChangePubKey_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kChangePubKeySignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kChangePubKeySignConstMeta => const TaskConstMeta( + debugName: "ChangePubKey_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String changePubKeyToEip712RequestPayload( + {required ChangePubKey that, + required int chainId, + required String address, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + that); + var arg1 = cst_encode_u_32(chainId); + var arg2 = cst_encode_String(address); + return wire.wire_ChangePubKey_to_eip712_request_payload( + arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kChangePubKeyToEip712RequestPayloadConstMeta, + argValues: [that, chainId, address], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kChangePubKeyToEip712RequestPayloadConstMeta => + const TaskConstMeta( + debugName: "ChangePubKey_to_eip712_request_payload", + argNames: ["that", "chainId", "address"], + ); + + @override + String changePubKeyToJson({required ChangePubKey that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + that); + return wire.wire_ChangePubKey_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kChangePubKeyToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kChangePubKeyToJsonConstMeta => const TaskConstMeta( + debugName: "ChangePubKey_to_json", + argNames: ["that"], + ); + + @override + ContractMatching contractMatchingNew( + {required int accountId, + required int subAccountId, + required Contract taker, + required List maker, + required String fee, + required int feeToken, + required List contractPrices, + required List marginPrices, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + taker); + var arg3 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + maker); + var arg4 = cst_encode_String(fee); + var arg5 = cst_encode_u_16(feeToken); + var arg6 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + contractPrices); + var arg7 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + marginPrices); + return wire.wire_ContractMatching_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kContractMatchingNewConstMeta, + argValues: [ + accountId, + subAccountId, + taker, + maker, + fee, + feeToken, + contractPrices, + marginPrices + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kContractMatchingNewConstMeta => const TaskConstMeta( + debugName: "ContractMatching_new", + argNames: [ + "accountId", + "subAccountId", + "taker", + "maker", + "fee", + "feeToken", + "contractPrices", + "marginPrices" + ], + ); + + @override + void contractMatchingSign( + {required ContractMatching that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_ContractMatching_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kContractMatchingSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kContractMatchingSignConstMeta => const TaskConstMeta( + debugName: "ContractMatching_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String contractMatchingToJson( + {required ContractMatching that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + that); + return wire.wire_ContractMatching_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kContractMatchingToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kContractMatchingToJsonConstMeta => const TaskConstMeta( + debugName: "ContractMatching_to_json", + argNames: ["that"], + ); + + @override + ContractPrice contractPriceNew( + {required int pairId, required String marketPrice, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_16(pairId); + var arg1 = cst_encode_String(marketPrice); + return wire.wire_ContractPrice_new(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kContractPriceNewConstMeta, + argValues: [pairId, marketPrice], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kContractPriceNewConstMeta => const TaskConstMeta( + debugName: "ContractPrice_new", + argNames: ["pairId", "marketPrice"], + ); + + @override + Contract contractNew( + {required int accountId, + required int subAccountId, + required int slotId, + required int nonce, + required int pairId, + required String size, + required String price, + required bool direction, + required int makerFeeRate, + required int takerFeeRate, + required bool hasSubsidy, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_u_32(slotId); + var arg3 = cst_encode_u_32(nonce); + var arg4 = cst_encode_u_16(pairId); + var arg5 = cst_encode_String(size); + var arg6 = cst_encode_String(price); + var arg7 = cst_encode_bool(direction); + var arg8 = cst_encode_u_8(makerFeeRate); + var arg9 = cst_encode_u_8(takerFeeRate); + var arg10 = cst_encode_bool(hasSubsidy); + return wire.wire_Contract_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kContractNewConstMeta, + argValues: [ + accountId, + subAccountId, + slotId, + nonce, + pairId, + size, + price, + direction, + makerFeeRate, + takerFeeRate, + hasSubsidy + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kContractNewConstMeta => const TaskConstMeta( + debugName: "Contract_new", + argNames: [ + "accountId", + "subAccountId", + "slotId", + "nonce", + "pairId", + "size", + "price", + "direction", + "makerFeeRate", + "takerFeeRate", + "hasSubsidy" + ], + ); + + @override + EthTxOption ethTxOptionNew( + {required bool isSupportEip1559, + required String to, + double? nonce, + String? value, + double? gas, + String? gasPrice, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_bool(isSupportEip1559); + var arg1 = cst_encode_String(to); + var arg2 = cst_encode_opt_box_autoadd_f_64(nonce); + var arg3 = cst_encode_opt_String(value); + var arg4 = cst_encode_opt_box_autoadd_f_64(gas); + var arg5 = cst_encode_opt_String(gasPrice); + return wire.wire_EthTxOption_new(arg0, arg1, arg2, arg3, arg4, arg5); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kEthTxOptionNewConstMeta, + argValues: [isSupportEip1559, to, nonce, value, gas, gasPrice], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kEthTxOptionNewConstMeta => const TaskConstMeta( + debugName: "EthTxOption_new", + argNames: [ + "isSupportEip1559", + "to", + "nonce", + "value", + "gas", + "gasPrice" + ], + ); + + @override + ForcedExit forcedExitNew( + {required int toChainId, + required int initiatorAccountId, + required int initiatorSubAccountId, + required int targetSubAccountId, + required String target, + required int l2SourceToken, + required int l1TargetToken, + required String exitAmount, + required int initiatorNonce, + required bool withdrawToL1, + int? ts, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_8(toChainId); + var arg1 = cst_encode_u_32(initiatorAccountId); + var arg2 = cst_encode_u_8(initiatorSubAccountId); + var arg3 = cst_encode_u_8(targetSubAccountId); + var arg4 = cst_encode_String(target); + var arg5 = cst_encode_u_32(l2SourceToken); + var arg6 = cst_encode_u_32(l1TargetToken); + var arg7 = cst_encode_String(exitAmount); + var arg8 = cst_encode_u_32(initiatorNonce); + var arg9 = cst_encode_bool(withdrawToL1); + var arg10 = cst_encode_opt_box_autoadd_u_32(ts); + return wire.wire_ForcedExit_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kForcedExitNewConstMeta, + argValues: [ + toChainId, + initiatorAccountId, + initiatorSubAccountId, + targetSubAccountId, + target, + l2SourceToken, + l1TargetToken, + exitAmount, + initiatorNonce, + withdrawToL1, + ts + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kForcedExitNewConstMeta => const TaskConstMeta( + debugName: "ForcedExit_new", + argNames: [ + "toChainId", + "initiatorAccountId", + "initiatorSubAccountId", + "targetSubAccountId", + "target", + "l2SourceToken", + "l1TargetToken", + "exitAmount", + "initiatorNonce", + "withdrawToL1", + "ts" + ], + ); + + @override + void forcedExitSign( + {required ForcedExit that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_ForcedExit_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kForcedExitSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kForcedExitSignConstMeta => const TaskConstMeta( + debugName: "ForcedExit_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String forcedExitToJson({required ForcedExit that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + that); + return wire.wire_ForcedExit_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kForcedExitToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kForcedExitToJsonConstMeta => const TaskConstMeta( + debugName: "ForcedExit_to_json", + argNames: ["that"], + ); + + @override + FundingInfo fundingInfoNew( + {required int pairId, + required String price, + required int fundingRate, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_16(pairId); + var arg1 = cst_encode_String(price); + var arg2 = cst_encode_i_16(fundingRate); + return wire.wire_FundingInfo_new(arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kFundingInfoNewConstMeta, + argValues: [pairId, price, fundingRate], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kFundingInfoNewConstMeta => const TaskConstMeta( + debugName: "FundingInfo_new", + argNames: ["pairId", "price", "fundingRate"], + ); + + @override + Funding fundingNew( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List fundingAccountIds, + required String fee, + required int feeToken, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_u_32(subAccountNonce); + var arg3 = cst_encode_list_prim_u_32_loose(fundingAccountIds); + var arg4 = cst_encode_String(fee); + var arg5 = cst_encode_u_16(feeToken); + return wire.wire_Funding_new(arg0, arg1, arg2, arg3, arg4, arg5); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kFundingNewConstMeta, + argValues: [ + accountId, + subAccountId, + subAccountNonce, + fundingAccountIds, + fee, + feeToken + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kFundingNewConstMeta => const TaskConstMeta( + debugName: "Funding_new", + argNames: [ + "accountId", + "subAccountId", + "subAccountNonce", + "fundingAccountIds", + "fee", + "feeToken" + ], + ); + + @override + void fundingSign( + {required Funding that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_Funding_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kFundingSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kFundingSignConstMeta => const TaskConstMeta( + debugName: "Funding_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String fundingToJson({required Funding that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + that); + return wire.wire_Funding_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kFundingToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kFundingToJsonConstMeta => const TaskConstMeta( + debugName: "Funding_to_json", + argNames: ["that"], + ); + + @override + Liquidation liquidationNew( + {required int accountId, + required int subAccountId, + required int subAccountNonce, + required List contractPrices, + required List marginPrices, + required int liquidationAccountId, + required String fee, + required int feeToken, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_u_32(subAccountNonce); + var arg3 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + contractPrices); + var arg4 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + marginPrices); + var arg5 = cst_encode_u_32(liquidationAccountId); + var arg6 = cst_encode_String(fee); + var arg7 = cst_encode_u_16(feeToken); + return wire.wire_Liquidation_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kLiquidationNewConstMeta, + argValues: [ + accountId, + subAccountId, + subAccountNonce, + contractPrices, + marginPrices, + liquidationAccountId, + fee, + feeToken + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLiquidationNewConstMeta => const TaskConstMeta( + debugName: "Liquidation_new", + argNames: [ + "accountId", + "subAccountId", + "subAccountNonce", + "contractPrices", + "marginPrices", + "liquidationAccountId", + "fee", + "feeToken" + ], + ); + + @override + void liquidationSign( + {required Liquidation that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_Liquidation_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kLiquidationSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLiquidationSignConstMeta => const TaskConstMeta( + debugName: "Liquidation_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String liquidationToJson({required Liquidation that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + that); + return wire.wire_Liquidation_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kLiquidationToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kLiquidationToJsonConstMeta => const TaskConstMeta( + debugName: "Liquidation_to_json", + argNames: ["that"], + ); + + @override + OrderMatching orderMatchingNew( + {required int accountId, + required int subAccountId, + required Order taker, + required Order maker, + required String fee, + required int feeToken, + required List contractPrices, + required List marginPrices, + required String expectBaseAmount, + required String expectQuoteAmount, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + taker); + var arg3 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + maker); + var arg4 = cst_encode_String(fee); + var arg5 = cst_encode_u_32(feeToken); + var arg6 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + contractPrices); + var arg7 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + marginPrices); + var arg8 = cst_encode_String(expectBaseAmount); + var arg9 = cst_encode_String(expectQuoteAmount); + return wire.wire_OrderMatching_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kOrderMatchingNewConstMeta, + argValues: [ + accountId, + subAccountId, + taker, + maker, + fee, + feeToken, + contractPrices, + marginPrices, + expectBaseAmount, + expectQuoteAmount + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kOrderMatchingNewConstMeta => const TaskConstMeta( + debugName: "OrderMatching_new", + argNames: [ + "accountId", + "subAccountId", + "taker", + "maker", + "fee", + "feeToken", + "contractPrices", + "marginPrices", + "expectBaseAmount", + "expectQuoteAmount" + ], + ); + + @override + void orderMatchingSign( + {required OrderMatching that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_OrderMatching_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kOrderMatchingSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kOrderMatchingSignConstMeta => const TaskConstMeta( + debugName: "OrderMatching_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String orderMatchingToJson({required OrderMatching that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + that); + return wire.wire_OrderMatching_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kOrderMatchingToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kOrderMatchingToJsonConstMeta => const TaskConstMeta( + debugName: "OrderMatching_to_json", + argNames: ["that"], + ); + + @override + Order orderNew( + {required int accountId, + required int subAccountId, + required int slotId, + required int nonce, + required int baseTokenId, + required int quoteTokenId, + required String amount, + required String price, + required bool isSell, + required int makerFeeRate, + required int takerFeeRate, + required bool hasSubsidy, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_u_32(slotId); + var arg3 = cst_encode_u_32(nonce); + var arg4 = cst_encode_u_32(baseTokenId); + var arg5 = cst_encode_u_32(quoteTokenId); + var arg6 = cst_encode_String(amount); + var arg7 = cst_encode_String(price); + var arg8 = cst_encode_bool(isSell); + var arg9 = cst_encode_u_8(makerFeeRate); + var arg10 = cst_encode_u_8(takerFeeRate); + var arg11 = cst_encode_bool(hasSubsidy); + return wire.wire_Order_new(arg0, arg1, arg2, arg3, arg4, arg5, arg6, + arg7, arg8, arg9, arg10, arg11); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kOrderNewConstMeta, + argValues: [ + accountId, + subAccountId, + slotId, + nonce, + baseTokenId, + quoteTokenId, + amount, + price, + isSell, + makerFeeRate, + takerFeeRate, + hasSubsidy + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kOrderNewConstMeta => const TaskConstMeta( + debugName: "Order_new", + argNames: [ + "accountId", + "subAccountId", + "slotId", + "nonce", + "baseTokenId", + "quoteTokenId", + "amount", + "price", + "isSell", + "makerFeeRate", + "takerFeeRate", + "hasSubsidy" + ], + ); + + @override + Parameter parameterContractInfo( + {required int pairId, + required String symbol, + required int initialMarginRate, + required int maintenanceMarginRate, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_16(pairId); + var arg1 = cst_encode_String(symbol); + var arg2 = cst_encode_u_16(initialMarginRate); + var arg3 = cst_encode_u_16(maintenanceMarginRate); + return wire.wire_Parameter_contract_info(arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kParameterContractInfoConstMeta, + argValues: [pairId, symbol, initialMarginRate, maintenanceMarginRate], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kParameterContractInfoConstMeta => const TaskConstMeta( + debugName: "Parameter_contract_info", + argNames: [ + "pairId", + "symbol", + "initialMarginRate", + "maintenanceMarginRate" + ], + ); + + @override + Parameter parameterFeeAccount({required int accountId, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + return wire.wire_Parameter_fee_account(arg0); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kParameterFeeAccountConstMeta, + argValues: [accountId], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kParameterFeeAccountConstMeta => const TaskConstMeta( + debugName: "Parameter_fee_account", + argNames: ["accountId"], + ); + + @override + Parameter parameterFundingInfos( + {required List infos, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + infos); + return wire.wire_Parameter_funding_infos(arg0); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kParameterFundingInfosConstMeta, + argValues: [infos], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kParameterFundingInfosConstMeta => const TaskConstMeta( + debugName: "Parameter_funding_infos", + argNames: ["infos"], + ); + + @override + Parameter parameterInsuranceFundAccount( + {required int accountId, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + return wire.wire_Parameter_insurance_fund_account(arg0); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kParameterInsuranceFundAccountConstMeta, + argValues: [accountId], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kParameterInsuranceFundAccountConstMeta => + const TaskConstMeta( + debugName: "Parameter_insurance_fund_account", + argNames: ["accountId"], + ); + + @override + Parameter parameterMarginInfo( + {required int marginId, + String? symbol, + required int tokenId, + required int ratio, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_8(marginId); + var arg1 = cst_encode_opt_String(symbol); + var arg2 = cst_encode_u_32(tokenId); + var arg3 = cst_encode_u_8(ratio); + return wire.wire_Parameter_margin_info(arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kParameterMarginInfoConstMeta, + argValues: [marginId, symbol, tokenId, ratio], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kParameterMarginInfoConstMeta => const TaskConstMeta( + debugName: "Parameter_margin_info", + argNames: ["marginId", "symbol", "tokenId", "ratio"], + ); + + @override + Contract signerCreateSignedContract( + {required Signer that, required Contract contract, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + contract); + return wire.wire_Signer_create_signed_contract(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerCreateSignedContractConstMeta, + argValues: [that, contract], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerCreateSignedContractConstMeta => const TaskConstMeta( + debugName: "Signer_create_signed_contract", + argNames: ["that", "contract"], + ); + + @override + Order signerCreateSignedOrder( + {required Signer that, required Order order, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + order); + return wire.wire_Signer_create_signed_order(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerCreateSignedOrderConstMeta, + argValues: [that, order], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerCreateSignedOrderConstMeta => const TaskConstMeta( + debugName: "Signer_create_signed_order", + argNames: ["that", "order"], + ); + + @override + Signer signerEthSigner({required String ethPrivateKey, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_String(ethPrivateKey); + return wire.wire_Signer_eth_signer(arg0); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerEthSignerConstMeta, + argValues: [ethPrivateKey], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerEthSignerConstMeta => const TaskConstMeta( + debugName: "Signer_eth_signer", + argNames: ["ethPrivateKey"], + ); + + @override + String signerSignAutoDeleveraging( + {required Signer that, required AutoDeleveraging tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + tx); + return wire.wire_Signer_sign_auto_deleveraging(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignAutoDeleveragingConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignAutoDeleveragingConstMeta => const TaskConstMeta( + debugName: "Signer_sign_auto_deleveraging", + argNames: ["that", "tx"], + ); + + @override + String signerSignChangePubkeyWithCreate2DataAuth( + {required Signer that, + required ChangePubKey tx, + required String creatorAddress, + required String saltArg, + required String codeHash, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + tx); + var arg2 = cst_encode_String(creatorAddress); + var arg3 = cst_encode_String(saltArg); + var arg4 = cst_encode_String(codeHash); + return wire.wire_Signer_sign_change_pubkey_with_create2data_auth( + arg0, arg1, arg2, arg3, arg4); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignChangePubkeyWithCreate2DataAuthConstMeta, + argValues: [that, tx, creatorAddress, saltArg, codeHash], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignChangePubkeyWithCreate2DataAuthConstMeta => + const TaskConstMeta( + debugName: "Signer_sign_change_pubkey_with_create2data_auth", + argNames: ["that", "tx", "creatorAddress", "saltArg", "codeHash"], + ); + + @override + String signerSignChangePubkeyWithEthEcdsaAuth( + {required Signer that, required ChangePubKey tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + tx); + return wire.wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth( + arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignChangePubkeyWithEthEcdsaAuthConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignChangePubkeyWithEthEcdsaAuthConstMeta => + const TaskConstMeta( + debugName: "Signer_sign_change_pubkey_with_eth_ecdsa_auth", + argNames: ["that", "tx"], + ); + + @override + String signerSignChangePubkeyWithOnchain( + {required Signer that, required ChangePubKey tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + tx); + return wire.wire_Signer_sign_change_pubkey_with_onchain(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignChangePubkeyWithOnchainConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignChangePubkeyWithOnchainConstMeta => + const TaskConstMeta( + debugName: "Signer_sign_change_pubkey_with_onchain", + argNames: ["that", "tx"], + ); + + @override + String signerSignContractMatching( + {required Signer that, required ContractMatching tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + tx); + return wire.wire_Signer_sign_contract_matching(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignContractMatchingConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignContractMatchingConstMeta => const TaskConstMeta( + debugName: "Signer_sign_contract_matching", + argNames: ["that", "tx"], + ); + + @override + String signerSignForcedExit( + {required Signer that, required ForcedExit tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + tx); + return wire.wire_Signer_sign_forced_exit(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignForcedExitConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignForcedExitConstMeta => const TaskConstMeta( + debugName: "Signer_sign_forced_exit", + argNames: ["that", "tx"], + ); + + @override + String signerSignFunding( + {required Signer that, required Funding tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + tx); + return wire.wire_Signer_sign_funding(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignFundingConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignFundingConstMeta => const TaskConstMeta( + debugName: "Signer_sign_funding", + argNames: ["that", "tx"], + ); + + @override + String signerSignLiquidation( + {required Signer that, required Liquidation tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + tx); + return wire.wire_Signer_sign_liquidation(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignLiquidationConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignLiquidationConstMeta => const TaskConstMeta( + debugName: "Signer_sign_liquidation", + argNames: ["that", "tx"], + ); + + @override + String signerSignOrderMatching( + {required Signer that, required OrderMatching tx, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + tx); + return wire.wire_Signer_sign_order_matching(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignOrderMatchingConstMeta, + argValues: [that, tx], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignOrderMatchingConstMeta => const TaskConstMeta( + debugName: "Signer_sign_order_matching", + argNames: ["that", "tx"], + ); + + @override + String signerSignTransfer( + {required Signer that, + required Transfer tx, + required String tokenSymbol, + String? chainId, + String? addr, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + tx); + var arg2 = cst_encode_String(tokenSymbol); + var arg3 = cst_encode_opt_String(chainId); + var arg4 = cst_encode_opt_String(addr); + return wire.wire_Signer_sign_transfer(arg0, arg1, arg2, arg3, arg4); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignTransferConstMeta, + argValues: [that, tx, tokenSymbol, chainId, addr], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignTransferConstMeta => const TaskConstMeta( + debugName: "Signer_sign_transfer", + argNames: ["that", "tx", "tokenSymbol", "chainId", "addr"], + ); + + @override + String signerSignWithdraw( + {required Signer that, + required Withdraw tx, + required String tokenSymbol, + String? chainId, + String? addr, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + tx); + var arg2 = cst_encode_String(tokenSymbol); + var arg3 = cst_encode_opt_String(chainId); + var arg4 = cst_encode_opt_String(addr); + return wire.wire_Signer_sign_withdraw(arg0, arg1, arg2, arg3, arg4); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerSignWithdrawConstMeta, + argValues: [that, tx, tokenSymbol, chainId, addr], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerSignWithdrawConstMeta => const TaskConstMeta( + debugName: "Signer_sign_withdraw", + argNames: ["that", "tx", "tokenSymbol", "chainId", "addr"], + ); + + @override + Signer signerStarknetSigner( + {required String ethPrivateKey, + required String starknetChainId, + required String starknetAddr, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_String(ethPrivateKey); + var arg1 = cst_encode_String(starknetChainId); + var arg2 = cst_encode_String(starknetAddr); + return wire.wire_Signer_starknet_signer(arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSignerStarknetSignerConstMeta, + argValues: [ethPrivateKey, starknetChainId, starknetAddr], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSignerStarknetSignerConstMeta => const TaskConstMeta( + debugName: "Signer_starknet_signer", + argNames: ["ethPrivateKey", "starknetChainId", "starknetAddr"], + ); + + @override + SpotPriceInfo spotPriceInfoNew( + {required int tokenId, required String price, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(tokenId); + var arg1 = cst_encode_String(price); + return wire.wire_SpotPriceInfo_new(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kSpotPriceInfoNewConstMeta, + argValues: [tokenId, price], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kSpotPriceInfoNewConstMeta => const TaskConstMeta( + debugName: "SpotPriceInfo_new", + argNames: ["tokenId", "price"], + ); + + @override + String transferGetEthSignMsg( + {required Transfer that, required String tokenSymbol, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + that); + var arg1 = cst_encode_String(tokenSymbol); + return wire.wire_Transfer_get_eth_sign_msg(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kTransferGetEthSignMsgConstMeta, + argValues: [that, tokenSymbol], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kTransferGetEthSignMsgConstMeta => const TaskConstMeta( + debugName: "Transfer_get_eth_sign_msg", + argNames: ["that", "tokenSymbol"], + ); + + @override + Transfer transferNew( + {required int accountId, + required String toAddress, + required int fromSubAccountId, + required int toSubAccountId, + required int token, + required String fee, + required String amount, + required int nonce, + int? ts, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_String(toAddress); + var arg2 = cst_encode_u_8(fromSubAccountId); + var arg3 = cst_encode_u_8(toSubAccountId); + var arg4 = cst_encode_u_32(token); + var arg5 = cst_encode_String(fee); + var arg6 = cst_encode_String(amount); + var arg7 = cst_encode_u_32(nonce); + var arg8 = cst_encode_opt_box_autoadd_u_32(ts); + return wire.wire_Transfer_new( + arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kTransferNewConstMeta, + argValues: [ + accountId, + toAddress, + fromSubAccountId, + toSubAccountId, + token, + fee, + amount, + nonce, + ts + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kTransferNewConstMeta => const TaskConstMeta( + debugName: "Transfer_new", + argNames: [ + "accountId", + "toAddress", + "fromSubAccountId", + "toSubAccountId", + "token", + "fee", + "amount", + "nonce", + "ts" + ], + ); + + @override + void transferSign( + {required Transfer that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_Transfer_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kTransferSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kTransferSignConstMeta => const TaskConstMeta( + debugName: "Transfer_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String transferToJson({required Transfer that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + that); + return wire.wire_Transfer_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kTransferToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kTransferToJsonConstMeta => const TaskConstMeta( + debugName: "Transfer_to_json", + argNames: ["that"], + ); + + @override + UpdateGlobalVar updateGlobalVarNew( + {required int fromChainId, + required int subAccountId, + required Parameter parameter, + required double serialId, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_8(fromChainId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + parameter); + var arg3 = cst_encode_f_64(serialId); + return wire.wire_UpdateGlobalVar_new(arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kUpdateGlobalVarNewConstMeta, + argValues: [fromChainId, subAccountId, parameter, serialId], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kUpdateGlobalVarNewConstMeta => const TaskConstMeta( + debugName: "UpdateGlobalVar_new", + argNames: ["fromChainId", "subAccountId", "parameter", "serialId"], + ); + + @override + String updateGlobalVarToJson({required UpdateGlobalVar that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + that); + return wire.wire_UpdateGlobalVar_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kUpdateGlobalVarToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kUpdateGlobalVarToJsonConstMeta => const TaskConstMeta( + debugName: "UpdateGlobalVar_to_json", + argNames: ["that"], + ); + + @override + Future walletApproveErc20( + {required Wallet that, + required String contract, + required String amount, + required EthTxOption ethParams, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = cst_encode_String(contract); + var arg2 = cst_encode_String(amount); + var arg3 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ethParams); + return wire.wire_Wallet_approve_erc20(port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletApproveErc20ConstMeta, + argValues: [that, contract, amount, ethParams], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletApproveErc20ConstMeta => const TaskConstMeta( + debugName: "Wallet_approve_erc20", + argNames: ["that", "contract", "amount", "ethParams"], + ); + + @override + Future walletDepositErc20( + {required Wallet that, + required int subAccountId, + required String depositTo, + required String tokenAddr, + required String amount, + required bool mapping, + required EthTxOption ethParams, + required bool isGateway, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_String(depositTo); + var arg3 = cst_encode_String(tokenAddr); + var arg4 = cst_encode_String(amount); + var arg5 = cst_encode_bool(mapping); + var arg6 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ethParams); + var arg7 = cst_encode_bool(isGateway); + return wire.wire_Wallet_deposit_erc20( + port_, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletDepositErc20ConstMeta, + argValues: [ + that, + subAccountId, + depositTo, + tokenAddr, + amount, + mapping, + ethParams, + isGateway + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletDepositErc20ConstMeta => const TaskConstMeta( + debugName: "Wallet_deposit_erc20", + argNames: [ + "that", + "subAccountId", + "depositTo", + "tokenAddr", + "amount", + "mapping", + "ethParams", + "isGateway" + ], + ); + + @override + Future walletDepositEth( + {required Wallet that, + required int subAccountId, + required String depositTo, + required EthTxOption ethParams, + required bool isGateway, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_String(depositTo); + var arg3 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ethParams); + var arg4 = cst_encode_bool(isGateway); + return wire.wire_Wallet_deposit_eth( + port_, arg0, arg1, arg2, arg3, arg4); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletDepositEthConstMeta, + argValues: [that, subAccountId, depositTo, ethParams, isGateway], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletDepositEthConstMeta => const TaskConstMeta( + debugName: "Wallet_deposit_eth", + argNames: [ + "that", + "subAccountId", + "depositTo", + "ethParams", + "isGateway" + ], + ); + + @override + Future walletFullExit( + {required Wallet that, + required int accountId, + required int subAccountId, + required int tokenId, + required bool mapping, + required EthTxOption ethParams, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = cst_encode_u_32(accountId); + var arg2 = cst_encode_u_8(subAccountId); + var arg3 = cst_encode_u_16(tokenId); + var arg4 = cst_encode_bool(mapping); + var arg5 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ethParams); + return wire.wire_Wallet_full_exit( + port_, arg0, arg1, arg2, arg3, arg4, arg5); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletFullExitConstMeta, + argValues: [that, accountId, subAccountId, tokenId, mapping, ethParams], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletFullExitConstMeta => const TaskConstMeta( + debugName: "Wallet_full_exit", + argNames: [ + "that", + "accountId", + "subAccountId", + "tokenId", + "mapping", + "ethParams" + ], + ); + + @override + Future walletGetBalance({required Wallet that, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + return wire.wire_Wallet_get_balance(port_, arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletGetBalanceConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletGetBalanceConstMeta => const TaskConstMeta( + debugName: "Wallet_get_balance", + argNames: ["that"], + ); + + @override + Future walletGetDepositFee( + {required Wallet that, required EthTxOption ethParams, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ethParams); + return wire.wire_Wallet_get_deposit_fee(port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletGetDepositFeeConstMeta, + argValues: [that, ethParams], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletGetDepositFeeConstMeta => const TaskConstMeta( + debugName: "Wallet_get_deposit_fee", + argNames: ["that", "ethParams"], + ); + + @override + Future walletGetNonce( + {required Wallet that, required String blockNumber, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = cst_encode_String(blockNumber); + return wire.wire_Wallet_get_nonce(port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_f_64, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletGetNonceConstMeta, + argValues: [that, blockNumber], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletGetNonceConstMeta => const TaskConstMeta( + debugName: "Wallet_get_nonce", + argNames: ["that", "blockNumber"], + ); + + @override + Wallet walletNew( + {required String url, required String privateKey, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_String(url); + var arg1 = cst_encode_String(privateKey); + return wire.wire_Wallet_new(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletNewConstMeta, + argValues: [url, privateKey], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletNewConstMeta => const TaskConstMeta( + debugName: "Wallet_new", + argNames: ["url", "privateKey"], + ); + + @override + Future walletSetAuthPubkeyHash( + {required Wallet that, + required double nonce, + required String newPubkeyHash, + required EthTxOption ethParams, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = cst_encode_f_64(nonce); + var arg2 = cst_encode_String(newPubkeyHash); + var arg3 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ethParams); + return wire.wire_Wallet_set_auth_pubkey_hash( + port_, arg0, arg1, arg2, arg3); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletSetAuthPubkeyHashConstMeta, + argValues: [that, nonce, newPubkeyHash, ethParams], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletSetAuthPubkeyHashConstMeta => const TaskConstMeta( + debugName: "Wallet_set_auth_pubkey_hash", + argNames: ["that", "nonce", "newPubkeyHash", "ethParams"], + ); + + @override + Future walletWaitForTransaction( + {required Wallet that, + required String txHash, + int? timeout, + dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + that); + var arg1 = cst_encode_String(txHash); + var arg2 = cst_encode_opt_box_autoadd_u_32(timeout); + return wire.wire_Wallet_wait_for_transaction(port_, arg0, arg1, arg2); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_u_8, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWalletWaitForTransactionConstMeta, + argValues: [that, txHash, timeout], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWalletWaitForTransactionConstMeta => const TaskConstMeta( + debugName: "Wallet_wait_for_transaction", + argNames: ["that", "txHash", "timeout"], + ); + + @override + String withdrawGetEthSignMsg( + {required Withdraw that, required String tokenSymbol, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + that); + var arg1 = cst_encode_String(tokenSymbol); + return wire.wire_Withdraw_get_eth_sign_msg(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kWithdrawGetEthSignMsgConstMeta, + argValues: [that, tokenSymbol], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWithdrawGetEthSignMsgConstMeta => const TaskConstMeta( + debugName: "Withdraw_get_eth_sign_msg", + argNames: ["that", "tokenSymbol"], + ); + + @override + Withdraw withdrawNew( + {required int accountId, + required int subAccountId, + required int toChainId, + required String toAddress, + required int l2SourceToken, + required int l1TargetToken, + required String amount, + String? callData, + required String fee, + required int nonce, + required bool withdrawToL1, + required int withdrawFeeRatio, + int? ts, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_u_32(accountId); + var arg1 = cst_encode_u_8(subAccountId); + var arg2 = cst_encode_u_8(toChainId); + var arg3 = cst_encode_String(toAddress); + var arg4 = cst_encode_u_32(l2SourceToken); + var arg5 = cst_encode_u_32(l1TargetToken); + var arg6 = cst_encode_String(amount); + var arg7 = cst_encode_opt_String(callData); + var arg8 = cst_encode_String(fee); + var arg9 = cst_encode_u_32(nonce); + var arg10 = cst_encode_bool(withdrawToL1); + var arg11 = cst_encode_u_16(withdrawFeeRatio); + var arg12 = cst_encode_opt_box_autoadd_u_32(ts); + return wire.wire_Withdraw_new(arg0, arg1, arg2, arg3, arg4, arg5, arg6, + arg7, arg8, arg9, arg10, arg11, arg12); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWithdrawNewConstMeta, + argValues: [ + accountId, + subAccountId, + toChainId, + toAddress, + l2SourceToken, + l1TargetToken, + amount, + callData, + fee, + nonce, + withdrawToL1, + withdrawFeeRatio, + ts + ], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWithdrawNewConstMeta => const TaskConstMeta( + debugName: "Withdraw_new", + argNames: [ + "accountId", + "subAccountId", + "toChainId", + "toAddress", + "l2SourceToken", + "l1TargetToken", + "amount", + "callData", + "fee", + "nonce", + "withdrawToL1", + "withdrawFeeRatio", + "ts" + ], + ); + + @override + void withdrawSign( + {required Withdraw that, + required ZkLinkSigner zkLinkSigner, + dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + that); + var arg1 = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + zkLinkSigner); + return wire.wire_Withdraw_sign(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWithdrawSignConstMeta, + argValues: [that, zkLinkSigner], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWithdrawSignConstMeta => const TaskConstMeta( + debugName: "Withdraw_sign", + argNames: ["that", "zkLinkSigner"], + ); + + @override + String withdrawToJson({required Withdraw that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + that); + return wire.wire_Withdraw_to_json(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kWithdrawToJsonConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kWithdrawToJsonConstMeta => const TaskConstMeta( + debugName: "Withdraw_to_json", + argNames: ["that"], + ); + + @override + String zkLinkSignatureGetPubkey( + {required ZkLinkSignature that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + that); + return wire.wire_ZkLinkSignature_get_pubkey(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kZkLinkSignatureGetPubkeyConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kZkLinkSignatureGetPubkeyConstMeta => const TaskConstMeta( + debugName: "ZkLinkSignature_get_pubkey", + argNames: ["that"], + ); + + @override + String zkLinkSignatureGetSignature( + {required ZkLinkSignature that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + that); + return wire.wire_ZkLinkSignature_get_signature(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kZkLinkSignatureGetSignatureConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kZkLinkSignatureGetSignatureConstMeta => + const TaskConstMeta( + debugName: "ZkLinkSignature_get_signature", + argNames: ["that"], + ); + + @override + ZkLinkSigner zkLinkSignerEthSig({required String sig, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_String(sig); + return wire.wire_ZkLinkSigner_eth_sig(arg0); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kZkLinkSignerEthSigConstMeta, + argValues: [sig], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kZkLinkSignerEthSigConstMeta => const TaskConstMeta( + debugName: "ZkLinkSigner_eth_sig", + argNames: ["sig"], + ); + + @override + String zkLinkSignerGetPubkey({required ZkLinkSigner that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + that); + return wire.wire_ZkLinkSigner_get_pubkey(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kZkLinkSignerGetPubkeyConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kZkLinkSignerGetPubkeyConstMeta => const TaskConstMeta( + debugName: "ZkLinkSigner_get_pubkey", + argNames: ["that"], + ); + + @override + String zkLinkSignerGetPubkeyHash({required ZkLinkSigner that, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + that); + return wire.wire_ZkLinkSigner_get_pubkey_hash(arg0); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_String, + decodeErrorData: null, + ), + constMeta: kZkLinkSignerGetPubkeyHashConstMeta, + argValues: [that], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kZkLinkSignerGetPubkeyHashConstMeta => const TaskConstMeta( + debugName: "ZkLinkSigner_get_pubkey_hash", + argNames: ["that"], + ); + + @override + ZkLinkSignature zkLinkSignerSignMusig( + {required ZkLinkSigner that, required List msg, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = + cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + that); + var arg1 = cst_encode_list_prim_u_8_loose(msg); + return wire.wire_ZkLinkSigner_sign_musig(arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kZkLinkSignerSignMusigConstMeta, + argValues: [that, msg], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kZkLinkSignerSignMusigConstMeta => const TaskConstMeta( + debugName: "ZkLinkSigner_sign_musig", + argNames: ["that", "msg"], + ); + + @override + ZkLinkSigner zkLinkSignerStarknetSig({required String sig, dynamic hint}) { + return handler.executeSync(SyncTask( + callFfi: () { + var arg0 = cst_encode_String(sig); + return wire.wire_ZkLinkSigner_starknet_sig(arg0); + }, + codec: DcoCodec( + decodeSuccessData: + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner, + decodeErrorData: dco_decode_AnyhowException, + ), + constMeta: kZkLinkSignerStarknetSigConstMeta, + argValues: [sig], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kZkLinkSignerStarknetSigConstMeta => const TaskConstMeta( + debugName: "ZkLinkSigner_starknet_sig", + argNames: ["sig"], + ); + + @override + Future initApp({dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + return wire.wire_init_app(port_); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: null, + ), + constMeta: kInitAppConstMeta, + argValues: [], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kInitAppConstMeta => const TaskConstMeta( + debugName: "init_app", + argNames: [], + ); + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_AutoDeleveraging => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_AutoDeleveraging => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ChangePubKey => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ChangePubKey => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Contract => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Contract => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ContractMatching => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ContractMatching => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ContractPrice => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ContractPrice => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_EthTxOption => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_EthTxOption => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ForcedExit => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ForcedExit => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Funding => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Funding => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_FundingInfo => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_FundingInfo => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Liquidation => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Liquidation => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation; + + RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_Order => + wire.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder; + + RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_Order => + wire.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_OrderMatching => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_OrderMatching => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Parameter => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Parameter => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Signer => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Signer => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_SpotPriceInfo => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_SpotPriceInfo => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Transfer => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Transfer => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_UpdateGlobalVar => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_UpdateGlobalVar => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Wallet => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Wallet => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_Withdraw => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_Withdraw => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ZkLinkSignature => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ZkLinkSignature => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature; + + RustArcIncrementStrongCountFnType + get rust_arc_increment_strong_count_ZkLinkSigner => wire + .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner; + + RustArcDecrementStrongCountFnType + get rust_arc_decrement_strong_count_ZkLinkSigner => wire + .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner; + + @protected + AnyhowException dco_decode_AnyhowException(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return AnyhowException(raw as String); + } + + @protected + AutoDeleveraging + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return AutoDeleveraging.dcoDecode(raw as List); + } + + @protected + ChangePubKey + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ChangePubKey.dcoDecode(raw as List); + } + + @protected + Contract + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Contract.dcoDecode(raw as List); + } + + @protected + ContractMatching + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ContractMatching.dcoDecode(raw as List); + } + + @protected + ContractPrice + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ContractPrice.dcoDecode(raw as List); + } + + @protected + EthTxOption + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return EthTxOption.dcoDecode(raw as List); + } + + @protected + ForcedExit + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ForcedExit.dcoDecode(raw as List); + } + + @protected + Funding + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Funding.dcoDecode(raw as List); + } + + @protected + FundingInfo + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return FundingInfo.dcoDecode(raw as List); + } + + @protected + Liquidation + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Liquidation.dcoDecode(raw as List); + } + + @protected + Order + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Order.dcoDecode(raw as List); + } + + @protected + OrderMatching + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return OrderMatching.dcoDecode(raw as List); + } + + @protected + Parameter + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Parameter.dcoDecode(raw as List); + } + + @protected + Signer + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Signer.dcoDecode(raw as List); + } + + @protected + SpotPriceInfo + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return SpotPriceInfo.dcoDecode(raw as List); + } + + @protected + Transfer + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Transfer.dcoDecode(raw as List); + } + + @protected + UpdateGlobalVar + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return UpdateGlobalVar.dcoDecode(raw as List); + } + + @protected + Wallet + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Wallet.dcoDecode(raw as List); + } + + @protected + Withdraw + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Withdraw.dcoDecode(raw as List); + } + + @protected + ZkLinkSignature + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ZkLinkSignature.dcoDecode(raw as List); + } + + @protected + ZkLinkSigner + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ZkLinkSigner.dcoDecode(raw as List); + } + + @protected + AutoDeleveraging + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return AutoDeleveraging.dcoDecode(raw as List); + } + + @protected + ChangePubKey + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ChangePubKey.dcoDecode(raw as List); + } + + @protected + ContractMatching + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ContractMatching.dcoDecode(raw as List); + } + + @protected + ForcedExit + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ForcedExit.dcoDecode(raw as List); + } + + @protected + Funding + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Funding.dcoDecode(raw as List); + } + + @protected + Liquidation + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Liquidation.dcoDecode(raw as List); + } + + @protected + OrderMatching + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return OrderMatching.dcoDecode(raw as List); + } + + @protected + Transfer + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Transfer.dcoDecode(raw as List); + } + + @protected + Withdraw + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Withdraw.dcoDecode(raw as List); + } + + @protected + AutoDeleveraging + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return AutoDeleveraging.dcoDecode(raw as List); + } + + @protected + ChangePubKey + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ChangePubKey.dcoDecode(raw as List); + } + + @protected + ContractMatching + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ContractMatching.dcoDecode(raw as List); + } + + @protected + ForcedExit + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ForcedExit.dcoDecode(raw as List); + } + + @protected + Funding + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Funding.dcoDecode(raw as List); + } + + @protected + Liquidation + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Liquidation.dcoDecode(raw as List); + } + + @protected + OrderMatching + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return OrderMatching.dcoDecode(raw as List); + } + + @protected + Signer + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Signer.dcoDecode(raw as List); + } + + @protected + Transfer + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Transfer.dcoDecode(raw as List); + } + + @protected + UpdateGlobalVar + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return UpdateGlobalVar.dcoDecode(raw as List); + } + + @protected + Wallet + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Wallet.dcoDecode(raw as List); + } + + @protected + Withdraw + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Withdraw.dcoDecode(raw as List); + } + + @protected + ZkLinkSignature + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ZkLinkSignature.dcoDecode(raw as List); + } + + @protected + ZkLinkSigner + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ZkLinkSigner.dcoDecode(raw as List); + } + + @protected + AutoDeleveraging + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return AutoDeleveraging.dcoDecode(raw as List); + } + + @protected + ChangePubKey + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ChangePubKey.dcoDecode(raw as List); + } + + @protected + Contract + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Contract.dcoDecode(raw as List); + } + + @protected + ContractMatching + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ContractMatching.dcoDecode(raw as List); + } + + @protected + ContractPrice + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ContractPrice.dcoDecode(raw as List); + } + + @protected + EthTxOption + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return EthTxOption.dcoDecode(raw as List); + } + + @protected + ForcedExit + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ForcedExit.dcoDecode(raw as List); + } + + @protected + Funding + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Funding.dcoDecode(raw as List); + } + + @protected + FundingInfo + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return FundingInfo.dcoDecode(raw as List); + } + + @protected + Liquidation + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Liquidation.dcoDecode(raw as List); + } + + @protected + Order + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Order.dcoDecode(raw as List); + } + + @protected + OrderMatching + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return OrderMatching.dcoDecode(raw as List); + } + + @protected + Parameter + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Parameter.dcoDecode(raw as List); + } + + @protected + Signer + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Signer.dcoDecode(raw as List); + } + + @protected + SpotPriceInfo + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return SpotPriceInfo.dcoDecode(raw as List); + } + + @protected + Transfer + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Transfer.dcoDecode(raw as List); + } + + @protected + UpdateGlobalVar + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return UpdateGlobalVar.dcoDecode(raw as List); + } + + @protected + Wallet + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Wallet.dcoDecode(raw as List); + } + + @protected + Withdraw + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return Withdraw.dcoDecode(raw as List); + } + + @protected + ZkLinkSignature + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ZkLinkSignature.dcoDecode(raw as List); + } + + @protected + ZkLinkSigner + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return ZkLinkSigner.dcoDecode(raw as List); + } + + @protected + String dco_decode_String(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as String; + } + + @protected + bool dco_decode_bool(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as bool; + } + + @protected + double dco_decode_box_autoadd_f_64(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as double; + } + + @protected + int dco_decode_box_autoadd_u_32(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + double dco_decode_f_64(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as double; + } + + @protected + int dco_decode_i_16(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List) + .map( + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract) + .toList(); + } + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List) + .map( + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice) + .toList(); + } + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List) + .map( + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo) + .toList(); + } + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List) + .map( + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo) + .toList(); + } + + @protected + List dco_decode_list_prim_u_32_loose(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as List; + } + + @protected + Uint32List dco_decode_list_prim_u_32_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as Uint32List; + } + + @protected + List dco_decode_list_prim_u_8_loose(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as List; + } + + @protected + Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as Uint8List; + } + + @protected + String? dco_decode_opt_String(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_String(raw); + } + + @protected + double? dco_decode_opt_box_autoadd_f_64(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_f_64(raw); + } + + @protected + int? dco_decode_opt_box_autoadd_u_32(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_box_autoadd_u_32(raw); + } + + @protected + int dco_decode_u_16(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + int dco_decode_u_32(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + int dco_decode_u_8(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + void dco_decode_unit(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return; + } + + @protected + int dco_decode_usize(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dcoDecodeI64OrU64(raw); + } + + @protected + AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_String(deserializer); + return AnyhowException(inner); + } + + @protected + AutoDeleveraging + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return AutoDeleveraging.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ChangePubKey + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ChangePubKey.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Contract + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Contract.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ContractMatching + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ContractMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ContractPrice + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ContractPrice.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + EthTxOption + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return EthTxOption.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ForcedExit + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ForcedExit.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Funding + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Funding.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + FundingInfo + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return FundingInfo.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Liquidation + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Liquidation.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Order + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Order.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OrderMatching + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return OrderMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Parameter + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Parameter.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Signer + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Signer.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + SpotPriceInfo + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return SpotPriceInfo.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Transfer + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Transfer.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + UpdateGlobalVar + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return UpdateGlobalVar.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Wallet + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Wallet.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Withdraw + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Withdraw.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ZkLinkSignature + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ZkLinkSignature.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ZkLinkSigner + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ZkLinkSigner.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + AutoDeleveraging + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return AutoDeleveraging.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ChangePubKey + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ChangePubKey.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ContractMatching + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ContractMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ForcedExit + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ForcedExit.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Funding + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Funding.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Liquidation + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Liquidation.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OrderMatching + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return OrderMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Transfer + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Transfer.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Withdraw + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Withdraw.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + AutoDeleveraging + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return AutoDeleveraging.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ChangePubKey + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ChangePubKey.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ContractMatching + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ContractMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ForcedExit + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ForcedExit.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Funding + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Funding.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Liquidation + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Liquidation.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OrderMatching + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return OrderMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Signer + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Signer.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Transfer + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Transfer.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + UpdateGlobalVar + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return UpdateGlobalVar.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Wallet + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Wallet.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Withdraw + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Withdraw.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ZkLinkSignature + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ZkLinkSignature.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ZkLinkSigner + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ZkLinkSigner.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + AutoDeleveraging + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return AutoDeleveraging.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ChangePubKey + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ChangePubKey.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Contract + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Contract.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ContractMatching + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ContractMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ContractPrice + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ContractPrice.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + EthTxOption + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return EthTxOption.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ForcedExit + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ForcedExit.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Funding + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Funding.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + FundingInfo + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return FundingInfo.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Liquidation + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Liquidation.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Order + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Order.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + OrderMatching + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return OrderMatching.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Parameter + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Parameter.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Signer + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Signer.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + SpotPriceInfo + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return SpotPriceInfo.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Transfer + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Transfer.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + UpdateGlobalVar + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return UpdateGlobalVar.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Wallet + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Wallet.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + Withdraw + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return Withdraw.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ZkLinkSignature + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ZkLinkSignature.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + ZkLinkSigner + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return ZkLinkSigner.sseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + } + + @protected + String sse_decode_String(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_list_prim_u_8_strict(deserializer); + return utf8.decoder.convert(inner); + } + + @protected + bool sse_decode_bool(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint8() != 0; + } + + @protected + double sse_decode_box_autoadd_f_64(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_f_64(deserializer)); + } + + @protected + int sse_decode_box_autoadd_u_32(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_u_32(deserializer)); + } + + @protected + double sse_decode_f_64(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getFloat64(); + } + + @protected + int sse_decode_i_16(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getInt16(); + } + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add( + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + deserializer)); + } + return ans_; + } + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add( + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + deserializer)); + } + return ans_; + } + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add( + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + deserializer)); + } + return ans_; + } + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add( + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + deserializer)); + } + return ans_; + } + + @protected + List sse_decode_list_prim_u_32_loose(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint32List(len_); + } + + @protected + Uint32List sse_decode_list_prim_u_32_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint32List(len_); + } + + @protected + List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint8List(len_); + } + + @protected + Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint8List(len_); + } + + @protected + String? sse_decode_opt_String(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_String(deserializer)); + } else { + return null; + } + } + + @protected + double? sse_decode_opt_box_autoadd_f_64(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_f_64(deserializer)); + } else { + return null; + } + } + + @protected + int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_box_autoadd_u_32(deserializer)); + } else { + return null; + } + } + + @protected + int sse_decode_u_16(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint16(); + } + + @protected + int sse_decode_u_32(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint32(); + } + + @protected + int sse_decode_u_8(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint8(); + } + + @protected + void sse_decode_unit(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + } + + @protected + int sse_decode_usize(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint64(); + } + + @protected + int sse_decode_i_32(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getInt32(); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: true); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(move: false); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner raw) { + // Codec=Cst (C-struct based), see doc to use other codecs +// ignore: invalid_use_of_internal_member + return raw.cstEncode(); + } + + @protected + bool cst_encode_bool(bool raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + double cst_encode_f_64(double raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + int cst_encode_i_16(int raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + int cst_encode_u_16(int raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + int cst_encode_u_32(int raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + int cst_encode_u_8(int raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + void cst_encode_unit(void raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + int cst_encode_usize(int raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw; + } + + @protected + void sse_encode_AnyhowException( + AnyhowException self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + throw UnimplementedError('Unreachable ()'); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: true), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: false), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_usize(self.sseEncode(move: null), serializer); + } + + @protected + void sse_encode_String(String self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer); + } + + @protected + void sse_encode_bool(bool self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint8(self ? 1 : 0); + } + + @protected + void sse_encode_box_autoadd_f_64(double self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_f_64(self, serializer); + } + + @protected + void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_u_32(self, serializer); + } + + @protected + void sse_encode_f_64(double self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putFloat64(self); + } + + @protected + void sse_encode_i_16(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putInt16(self); + } + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + item, serializer); + } + } + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + item, serializer); + } + } + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + item, serializer); + } + } + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + item, serializer); + } + } + + @protected + void sse_encode_list_prim_u_32_loose( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer + .putUint32List(self is Uint32List ? self : Uint32List.fromList(self)); + } + + @protected + void sse_encode_list_prim_u_32_strict( + Uint32List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint32List(self); + } + + @protected + void sse_encode_list_prim_u_8_loose( + List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer + .putUint8List(self is Uint8List ? self : Uint8List.fromList(self)); + } + + @protected + void sse_encode_list_prim_u_8_strict( + Uint8List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint8List(self); + } + + @protected + void sse_encode_opt_String(String? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_String(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_f_64(double? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_box_autoadd_f_64(self, serializer); + } + } + + @protected + void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_box_autoadd_u_32(self, serializer); + } + } + + @protected + void sse_encode_u_16(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint16(self); + } + + @protected + void sse_encode_u_32(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint32(self); + } + + @protected + void sse_encode_u_8(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint8(self); + } + + @protected + void sse_encode_unit(void self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + } + + @protected + void sse_encode_usize(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint64(self); + } + + @protected + void sse_encode_i_32(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putInt32(self); + } +} diff --git a/bindings/dart/lib/frb_generated.io.dart b/bindings/dart/lib/frb_generated.io.dart new file mode 100644 index 00000000..7eb7e2dd --- /dev/null +++ b/bindings/dart/lib/frb_generated.io.dart @@ -0,0 +1,4662 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.32. + +// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field + +import 'api.dart'; +import 'dart:async'; +import 'dart:convert'; +import 'dart:ffi' as ffi; +import 'frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart'; + +abstract class RustLibApiImplPlatform extends BaseApiImpl { + RustLibApiImplPlatform({ + required super.handler, + required super.wire, + required super.generalizedFrbRustBinding, + required super.portManager, + }); + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_AutoDeleveragingPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveragingPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ChangePubKeyPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKeyPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ContractPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ContractMatchingPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatchingPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ContractPricePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPricePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_EthTxOptionPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOptionPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ForcedExitPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExitPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_FundingPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_FundingInfoPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfoPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_LiquidationPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidationPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_OrderPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_OrderMatchingPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatchingPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ParameterPtr => + wire._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameterPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_SignerPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSignerPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_SpotPriceInfoPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfoPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_TransferPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransferPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_UpdateGlobalVarPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVarPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_WalletPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWalletPtr; + + CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_WithdrawPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdrawPtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ZkLinkSignaturePtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignaturePtr; + + CrossPlatformFinalizerArg + get rust_arc_decrement_strong_count_ZkLinkSignerPtr => wire + ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignerPtr; + + @protected + AnyhowException dco_decode_AnyhowException(dynamic raw); + + @protected + AutoDeleveraging + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw); + + @protected + ChangePubKey + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw); + + @protected + Contract + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + dynamic raw); + + @protected + ContractMatching + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw); + + @protected + ContractPrice + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + dynamic raw); + + @protected + EthTxOption + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + dynamic raw); + + @protected + ForcedExit + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw); + + @protected + Funding + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw); + + @protected + FundingInfo + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + dynamic raw); + + @protected + Liquidation + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw); + + @protected + Order + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + dynamic raw); + + @protected + OrderMatching + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw); + + @protected + Parameter + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + dynamic raw); + + @protected + Signer + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + dynamic raw); + + @protected + SpotPriceInfo + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + dynamic raw); + + @protected + Transfer + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw); + + @protected + UpdateGlobalVar + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + dynamic raw); + + @protected + Wallet + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + dynamic raw); + + @protected + Withdraw + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw); + + @protected + ZkLinkSignature + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + dynamic raw); + + @protected + ZkLinkSigner + dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + dynamic raw); + + @protected + AutoDeleveraging + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw); + + @protected + ChangePubKey + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw); + + @protected + ContractMatching + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw); + + @protected + ForcedExit + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw); + + @protected + Funding + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw); + + @protected + Liquidation + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw); + + @protected + OrderMatching + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw); + + @protected + Transfer + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw); + + @protected + Withdraw + dco_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw); + + @protected + AutoDeleveraging + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw); + + @protected + ChangePubKey + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw); + + @protected + ContractMatching + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw); + + @protected + ForcedExit + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw); + + @protected + Funding + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw); + + @protected + Liquidation + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw); + + @protected + OrderMatching + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw); + + @protected + Signer + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + dynamic raw); + + @protected + Transfer + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw); + + @protected + UpdateGlobalVar + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + dynamic raw); + + @protected + Wallet + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + dynamic raw); + + @protected + Withdraw + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw); + + @protected + ZkLinkSignature + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + dynamic raw); + + @protected + ZkLinkSigner + dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + dynamic raw); + + @protected + AutoDeleveraging + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + dynamic raw); + + @protected + ChangePubKey + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + dynamic raw); + + @protected + Contract + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + dynamic raw); + + @protected + ContractMatching + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + dynamic raw); + + @protected + ContractPrice + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + dynamic raw); + + @protected + EthTxOption + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + dynamic raw); + + @protected + ForcedExit + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + dynamic raw); + + @protected + Funding + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + dynamic raw); + + @protected + FundingInfo + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + dynamic raw); + + @protected + Liquidation + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + dynamic raw); + + @protected + Order + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + dynamic raw); + + @protected + OrderMatching + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + dynamic raw); + + @protected + Parameter + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + dynamic raw); + + @protected + Signer + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + dynamic raw); + + @protected + SpotPriceInfo + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + dynamic raw); + + @protected + Transfer + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + dynamic raw); + + @protected + UpdateGlobalVar + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + dynamic raw); + + @protected + Wallet + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + dynamic raw); + + @protected + Withdraw + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + dynamic raw); + + @protected + ZkLinkSignature + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + dynamic raw); + + @protected + ZkLinkSigner + dco_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + dynamic raw); + + @protected + String dco_decode_String(dynamic raw); + + @protected + bool dco_decode_bool(dynamic raw); + + @protected + double dco_decode_box_autoadd_f_64(dynamic raw); + + @protected + int dco_decode_box_autoadd_u_32(dynamic raw); + + @protected + double dco_decode_f_64(dynamic raw); + + @protected + int dco_decode_i_16(dynamic raw); + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + dynamic raw); + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + dynamic raw); + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + dynamic raw); + + @protected + List + dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + dynamic raw); + + @protected + List dco_decode_list_prim_u_32_loose(dynamic raw); + + @protected + Uint32List dco_decode_list_prim_u_32_strict(dynamic raw); + + @protected + List dco_decode_list_prim_u_8_loose(dynamic raw); + + @protected + Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); + + @protected + String? dco_decode_opt_String(dynamic raw); + + @protected + double? dco_decode_opt_box_autoadd_f_64(dynamic raw); + + @protected + int? dco_decode_opt_box_autoadd_u_32(dynamic raw); + + @protected + int dco_decode_u_16(dynamic raw); + + @protected + int dco_decode_u_32(dynamic raw); + + @protected + int dco_decode_u_8(dynamic raw); + + @protected + void dco_decode_unit(dynamic raw); + + @protected + int dco_decode_usize(dynamic raw); + + @protected + AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer); + + @protected + AutoDeleveraging + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer); + + @protected + ChangePubKey + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer); + + @protected + Contract + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + SseDeserializer deserializer); + + @protected + ContractMatching + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer); + + @protected + ContractPrice + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + SseDeserializer deserializer); + + @protected + EthTxOption + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + SseDeserializer deserializer); + + @protected + ForcedExit + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer); + + @protected + Funding + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer); + + @protected + FundingInfo + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + SseDeserializer deserializer); + + @protected + Liquidation + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer); + + @protected + Order + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + SseDeserializer deserializer); + + @protected + OrderMatching + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer); + + @protected + Parameter + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + SseDeserializer deserializer); + + @protected + Signer + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + SseDeserializer deserializer); + + @protected + SpotPriceInfo + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SseDeserializer deserializer); + + @protected + Transfer + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer); + + @protected + UpdateGlobalVar + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + SseDeserializer deserializer); + + @protected + Wallet + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + SseDeserializer deserializer); + + @protected + Withdraw + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer); + + @protected + ZkLinkSignature + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + SseDeserializer deserializer); + + @protected + ZkLinkSigner + sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + SseDeserializer deserializer); + + @protected + AutoDeleveraging + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer); + + @protected + ChangePubKey + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer); + + @protected + ContractMatching + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer); + + @protected + ForcedExit + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer); + + @protected + Funding + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer); + + @protected + Liquidation + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer); + + @protected + OrderMatching + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer); + + @protected + Transfer + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer); + + @protected + Withdraw + sse_decode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer); + + @protected + AutoDeleveraging + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer); + + @protected + ChangePubKey + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer); + + @protected + ContractMatching + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer); + + @protected + ForcedExit + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer); + + @protected + Funding + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer); + + @protected + Liquidation + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer); + + @protected + OrderMatching + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer); + + @protected + Signer + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + SseDeserializer deserializer); + + @protected + Transfer + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer); + + @protected + UpdateGlobalVar + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + SseDeserializer deserializer); + + @protected + Wallet + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + SseDeserializer deserializer); + + @protected + Withdraw + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer); + + @protected + ZkLinkSignature + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + SseDeserializer deserializer); + + @protected + ZkLinkSigner + sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + SseDeserializer deserializer); + + @protected + AutoDeleveraging + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + SseDeserializer deserializer); + + @protected + ChangePubKey + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + SseDeserializer deserializer); + + @protected + Contract + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + SseDeserializer deserializer); + + @protected + ContractMatching + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + SseDeserializer deserializer); + + @protected + ContractPrice + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + SseDeserializer deserializer); + + @protected + EthTxOption + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + SseDeserializer deserializer); + + @protected + ForcedExit + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + SseDeserializer deserializer); + + @protected + Funding + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + SseDeserializer deserializer); + + @protected + FundingInfo + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + SseDeserializer deserializer); + + @protected + Liquidation + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + SseDeserializer deserializer); + + @protected + Order + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + SseDeserializer deserializer); + + @protected + OrderMatching + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + SseDeserializer deserializer); + + @protected + Parameter + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + SseDeserializer deserializer); + + @protected + Signer + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + SseDeserializer deserializer); + + @protected + SpotPriceInfo + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SseDeserializer deserializer); + + @protected + Transfer + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + SseDeserializer deserializer); + + @protected + UpdateGlobalVar + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + SseDeserializer deserializer); + + @protected + Wallet + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + SseDeserializer deserializer); + + @protected + Withdraw + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + SseDeserializer deserializer); + + @protected + ZkLinkSignature + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + SseDeserializer deserializer); + + @protected + ZkLinkSigner + sse_decode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + SseDeserializer deserializer); + + @protected + String sse_decode_String(SseDeserializer deserializer); + + @protected + bool sse_decode_bool(SseDeserializer deserializer); + + @protected + double sse_decode_box_autoadd_f_64(SseDeserializer deserializer); + + @protected + int sse_decode_box_autoadd_u_32(SseDeserializer deserializer); + + @protected + double sse_decode_f_64(SseDeserializer deserializer); + + @protected + int sse_decode_i_16(SseDeserializer deserializer); + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + SseDeserializer deserializer); + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + SseDeserializer deserializer); + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + SseDeserializer deserializer); + + @protected + List + sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SseDeserializer deserializer); + + @protected + List sse_decode_list_prim_u_32_loose(SseDeserializer deserializer); + + @protected + Uint32List sse_decode_list_prim_u_32_strict(SseDeserializer deserializer); + + @protected + List sse_decode_list_prim_u_8_loose(SseDeserializer deserializer); + + @protected + Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); + + @protected + String? sse_decode_opt_String(SseDeserializer deserializer); + + @protected + double? sse_decode_opt_box_autoadd_f_64(SseDeserializer deserializer); + + @protected + int? sse_decode_opt_box_autoadd_u_32(SseDeserializer deserializer); + + @protected + int sse_decode_u_16(SseDeserializer deserializer); + + @protected + int sse_decode_u_32(SseDeserializer deserializer); + + @protected + int sse_decode_u_8(SseDeserializer deserializer); + + @protected + void sse_decode_unit(SseDeserializer deserializer); + + @protected + int sse_decode_usize(SseDeserializer deserializer); + + @protected + int sse_decode_i_32(SseDeserializer deserializer); + + @protected + ffi.Pointer cst_encode_AnyhowException( + AnyhowException raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + throw UnimplementedError(); + } + + @protected + ffi.Pointer cst_encode_String(String raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return cst_encode_list_prim_u_8_strict(utf8.encoder.convert(raw)); + } + + @protected + ffi.Pointer cst_encode_box_autoadd_f_64(double raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return wire.cst_new_box_autoadd_f_64(cst_encode_f_64(raw)); + } + + @protected + ffi.Pointer cst_encode_box_autoadd_u_32(int raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return wire.cst_new_box_autoadd_u_32(cst_encode_u_32(raw)); + } + + @protected + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract> + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire + .cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + raw.length); + for (var i = 0; i < raw.length; ++i) { + ans.ref.ptr[i] = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + raw[i]); + } + return ans; + } + + @protected + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire + .cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + raw.length); + for (var i = 0; i < raw.length; ++i) { + ans.ref.ptr[i] = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + raw[i]); + } + return ans; + } + + @protected + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo> + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire + .cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + raw.length); + for (var i = 0; i < raw.length; ++i) { + ans.ref.ptr[i] = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + raw[i]); + } + return ans; + } + + @protected + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire + .cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + raw.length); + for (var i = 0; i < raw.length; ++i) { + ans.ref.ptr[i] = + cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + raw[i]); + } + return ans; + } + + @protected + ffi.Pointer cst_encode_list_prim_u_32_loose( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_32_loose(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); + return ans; + } + + @protected + ffi.Pointer cst_encode_list_prim_u_32_strict( + Uint32List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_32_strict(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); + return ans; + } + + @protected + ffi.Pointer cst_encode_list_prim_u_8_loose( + List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_8_loose(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); + return ans; + } + + @protected + ffi.Pointer cst_encode_list_prim_u_8_strict( + Uint8List raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ans = wire.cst_new_list_prim_u_8_strict(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); + return ans; + } + + @protected + ffi.Pointer cst_encode_opt_String( + String? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_String(raw); + } + + @protected + ffi.Pointer cst_encode_opt_box_autoadd_f_64(double? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_f_64(raw); + } + + @protected + ffi.Pointer cst_encode_opt_box_autoadd_u_32(int? raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_32(raw); + } + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature raw); + + @protected + int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw); + + @protected + int cst_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature raw); + + @protected + int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature raw); + + @protected + int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner raw); + + @protected + bool cst_encode_bool(bool raw); + + @protected + double cst_encode_f_64(double raw); + + @protected + int cst_encode_i_16(int raw); + + @protected + int cst_encode_u_16(int raw); + + @protected + int cst_encode_u_32(int raw); + + @protected + int cst_encode_u_8(int raw); + + @protected + void cst_encode_unit(void raw); + + @protected + int cst_encode_usize(int raw); + + @protected + void sse_encode_AnyhowException( + AnyhowException self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_RefMut_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature self, SseSerializer serializer); + + @protected + void + sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + AutoDeleveraging self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ChangePubKey self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + Contract self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ContractMatching self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ContractPrice self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + EthTxOption self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ForcedExit self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + Funding self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + FundingInfo self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + Liquidation self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + Order self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + OrderMatching self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + Parameter self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + Signer self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + SpotPriceInfo self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + Transfer self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + UpdateGlobalVar self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + Wallet self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + Withdraw self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ZkLinkSignature self, SseSerializer serializer); + + @protected + void + sse_encode_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ZkLinkSigner self, SseSerializer serializer); + + @protected + void sse_encode_String(String self, SseSerializer serializer); + + @protected + void sse_encode_bool(bool self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_f_64(double self, SseSerializer serializer); + + @protected + void sse_encode_box_autoadd_u_32(int self, SseSerializer serializer); + + @protected + void sse_encode_f_64(double self, SseSerializer serializer); + + @protected + void sse_encode_i_16(int self, SseSerializer serializer); + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + List self, SseSerializer serializer); + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + List self, SseSerializer serializer); + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + List self, SseSerializer serializer); + + @protected + void + sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_32_loose( + List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_32_strict( + Uint32List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_loose(List self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_strict( + Uint8List self, SseSerializer serializer); + + @protected + void sse_encode_opt_String(String? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_f_64(double? self, SseSerializer serializer); + + @protected + void sse_encode_opt_box_autoadd_u_32(int? self, SseSerializer serializer); + + @protected + void sse_encode_u_16(int self, SseSerializer serializer); + + @protected + void sse_encode_u_32(int self, SseSerializer serializer); + + @protected + void sse_encode_u_8(int self, SseSerializer serializer); + + @protected + void sse_encode_unit(void self, SseSerializer serializer); + + @protected + void sse_encode_usize(int self, SseSerializer serializer); + + @protected + void sse_encode_i_32(int self, SseSerializer serializer); +} + +// Section: wire_class + +// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +// ignore_for_file: type=lint + +/// generated by flutter_rust_bridge +class RustLibWire implements BaseWire { + factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) => + RustLibWire(lib.ffiDynamicLibrary); + + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + RustLibWire(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + RustLibWire.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void store_dart_post_cobject( + DartPostCObjectFnType ptr, + ) { + return _store_dart_post_cobject( + ptr, + ); + } + + late final _store_dart_post_cobjectPtr = + _lookup>( + 'store_dart_post_cobject'); + late final _store_dart_post_cobject = _store_dart_post_cobjectPtr + .asFunction(); + + WireSyncRust2DartDco wire_AutoDeleveraging_new( + int account_id, + int sub_account_id, + int sub_account_nonce, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + contract_prices, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + margin_prices, + int adl_account_id, + int pair_id, + ffi.Pointer adl_size, + ffi.Pointer adl_price, + ffi.Pointer fee, + int fee_token, + ) { + return _wire_AutoDeleveraging_new( + account_id, + sub_account_id, + sub_account_nonce, + contract_prices, + margin_prices, + adl_account_id, + pair_id, + adl_size, + adl_price, + fee, + fee_token, + ); + } + + late final _wire_AutoDeleveraging_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.Uint32, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>, + ffi.Uint32, + ffi.Uint16, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint16)>>('frbgen_zklink_wire_AutoDeleveraging_new'); + late final _wire_AutoDeleveraging_new = _wire_AutoDeleveraging_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>, + int, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + + WireSyncRust2DartDco wire_AutoDeleveraging_sign( + int that, + int zk_link_signer, + ) { + return _wire_AutoDeleveraging_sign( + that, + zk_link_signer, + ); + } + + late final _wire_AutoDeleveraging_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_AutoDeleveraging_sign'); + late final _wire_AutoDeleveraging_sign = _wire_AutoDeleveraging_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_AutoDeleveraging_to_json( + int that, + ) { + return _wire_AutoDeleveraging_to_json( + that, + ); + } + + late final _wire_AutoDeleveraging_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_AutoDeleveraging_to_json'); + late final _wire_AutoDeleveraging_to_json = _wire_AutoDeleveraging_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_ChangePubKey_get_eth_sign_msg( + int that, + int nonce, + int account_id, + ) { + return _wire_ChangePubKey_get_eth_sign_msg( + that, + nonce, + account_id, + ); + } + + late final _wire_ChangePubKey_get_eth_sign_msgPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.Uint32, + ffi.Uint32)>>('frbgen_zklink_wire_ChangePubKey_get_eth_sign_msg'); + late final _wire_ChangePubKey_get_eth_sign_msg = + _wire_ChangePubKey_get_eth_sign_msgPtr + .asFunction(); + + WireSyncRust2DartDco wire_ChangePubKey_new( + int chain_id, + int account_id, + int sub_account_id, + ffi.Pointer new_pubkey_hash, + int fee_token, + ffi.Pointer fee, + int nonce, + ffi.Pointer eth_signature, + ffi.Pointer ts, + ) { + return _wire_ChangePubKey_new( + chain_id, + account_id, + sub_account_id, + new_pubkey_hash, + fee_token, + fee, + nonce, + eth_signature, + ts, + ); + } + + late final _wire_ChangePubKey_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint8, + ffi.Uint32, + ffi.Uint8, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer)>>('frbgen_zklink_wire_ChangePubKey_new'); + late final _wire_ChangePubKey_new = _wire_ChangePubKey_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_ChangePubKey_set_eth_auth_data( + int that, + ffi.Pointer sig, + ) { + return _wire_ChangePubKey_set_eth_auth_data( + that, + sig, + ); + } + + late final _wire_ChangePubKey_set_eth_auth_dataPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.Pointer)>>( + 'frbgen_zklink_wire_ChangePubKey_set_eth_auth_data'); + late final _wire_ChangePubKey_set_eth_auth_data = + _wire_ChangePubKey_set_eth_auth_dataPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_ChangePubKey_sign( + int that, + int zk_link_signer, + ) { + return _wire_ChangePubKey_sign( + that, + zk_link_signer, + ); + } + + late final _wire_ChangePubKey_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_ChangePubKey_sign'); + late final _wire_ChangePubKey_sign = _wire_ChangePubKey_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_ChangePubKey_to_eip712_request_payload( + int that, + int chain_id, + ffi.Pointer address, + ) { + return _wire_ChangePubKey_to_eip712_request_payload( + that, + chain_id, + address, + ); + } + + late final _wire_ChangePubKey_to_eip712_request_payloadPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.Uint32, + ffi.Pointer)>>( + 'frbgen_zklink_wire_ChangePubKey_to_eip712_request_payload'); + late final _wire_ChangePubKey_to_eip712_request_payload = + _wire_ChangePubKey_to_eip712_request_payloadPtr.asFunction< + WireSyncRust2DartDco Function( + int, int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_ChangePubKey_to_json( + int that, + ) { + return _wire_ChangePubKey_to_json( + that, + ); + } + + late final _wire_ChangePubKey_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_ChangePubKey_to_json'); + late final _wire_ChangePubKey_to_json = _wire_ChangePubKey_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_ContractMatching_new( + int account_id, + int sub_account_id, + int taker, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract> + maker, + ffi.Pointer fee, + int fee_token, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + contract_prices, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + margin_prices, + ) { + return _wire_ContractMatching_new( + account_id, + sub_account_id, + taker, + maker, + fee, + fee_token, + contract_prices, + margin_prices, + ); + } + + late final _wire_ContractMatching_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.UintPtr, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract>, + ffi.Pointer, + ffi.Uint16, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>)>>( + 'frbgen_zklink_wire_ContractMatching_new'); + late final _wire_ContractMatching_new = _wire_ContractMatching_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract>, + ffi.Pointer, + int, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>)>(); + + WireSyncRust2DartDco wire_ContractMatching_sign( + int that, + int zk_link_signer, + ) { + return _wire_ContractMatching_sign( + that, + zk_link_signer, + ); + } + + late final _wire_ContractMatching_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_ContractMatching_sign'); + late final _wire_ContractMatching_sign = _wire_ContractMatching_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_ContractMatching_to_json( + int that, + ) { + return _wire_ContractMatching_to_json( + that, + ); + } + + late final _wire_ContractMatching_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_ContractMatching_to_json'); + late final _wire_ContractMatching_to_json = _wire_ContractMatching_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_ContractPrice_new( + int pair_id, + ffi.Pointer market_price, + ) { + return _wire_ContractPrice_new( + pair_id, + market_price, + ); + } + + late final _wire_ContractPrice_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint16, ffi.Pointer)>>( + 'frbgen_zklink_wire_ContractPrice_new'); + late final _wire_ContractPrice_new = _wire_ContractPrice_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Contract_new( + int account_id, + int sub_account_id, + int slot_id, + int nonce, + int pair_id, + ffi.Pointer size, + ffi.Pointer price, + bool direction, + int maker_fee_rate, + int taker_fee_rate, + bool has_subsidy, + ) { + return _wire_Contract_new( + account_id, + sub_account_id, + slot_id, + nonce, + pair_id, + size, + price, + direction, + maker_fee_rate, + taker_fee_rate, + has_subsidy, + ); + } + + late final _wire_Contract_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.Uint32, + ffi.Uint32, + ffi.Uint16, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Uint8, + ffi.Uint8, + ffi.Bool)>>('frbgen_zklink_wire_Contract_new'); + late final _wire_Contract_new = _wire_Contract_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + int, + int, + ffi.Pointer, + ffi.Pointer, + bool, + int, + int, + bool)>(); + + WireSyncRust2DartDco wire_EthTxOption_new( + bool is_support_eip1559, + ffi.Pointer to, + ffi.Pointer nonce, + ffi.Pointer value, + ffi.Pointer gas, + ffi.Pointer gas_price, + ) { + return _wire_EthTxOption_new( + is_support_eip1559, + to, + nonce, + value, + gas, + gas_price, + ); + } + + late final _wire_EthTxOption_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_EthTxOption_new'); + late final _wire_EthTxOption_new = _wire_EthTxOption_newPtr.asFunction< + WireSyncRust2DartDco Function( + bool, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_ForcedExit_new( + int to_chain_id, + int initiator_account_id, + int initiator_sub_account_id, + int target_sub_account_id, + ffi.Pointer target, + int l2_source_token, + int l1_target_token, + ffi.Pointer exit_amount, + int initiator_nonce, + bool withdraw_to_l1, + ffi.Pointer ts, + ) { + return _wire_ForcedExit_new( + to_chain_id, + initiator_account_id, + initiator_sub_account_id, + target_sub_account_id, + target, + l2_source_token, + l1_target_token, + exit_amount, + initiator_nonce, + withdraw_to_l1, + ts, + ); + } + + late final _wire_ForcedExit_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint8, + ffi.Uint32, + ffi.Uint8, + ffi.Uint8, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32, + ffi.Bool, + ffi.Pointer)>>('frbgen_zklink_wire_ForcedExit_new'); + late final _wire_ForcedExit_new = _wire_ForcedExit_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + int, + ffi.Pointer, + int, + int, + ffi.Pointer, + int, + bool, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_ForcedExit_sign( + int that, + int zk_link_signer, + ) { + return _wire_ForcedExit_sign( + that, + zk_link_signer, + ); + } + + late final _wire_ForcedExit_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.UintPtr)>>('frbgen_zklink_wire_ForcedExit_sign'); + late final _wire_ForcedExit_sign = _wire_ForcedExit_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_ForcedExit_to_json( + int that, + ) { + return _wire_ForcedExit_to_json( + that, + ); + } + + late final _wire_ForcedExit_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_ForcedExit_to_json'); + late final _wire_ForcedExit_to_json = _wire_ForcedExit_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_FundingInfo_new( + int pair_id, + ffi.Pointer price, + int funding_rate, + ) { + return _wire_FundingInfo_new( + pair_id, + price, + funding_rate, + ); + } + + late final _wire_FundingInfo_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint16, + ffi.Pointer, + ffi.Int16)>>('frbgen_zklink_wire_FundingInfo_new'); + late final _wire_FundingInfo_new = _wire_FundingInfo_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer, int)>(); + + WireSyncRust2DartDco wire_Funding_new( + int account_id, + int sub_account_id, + int sub_account_nonce, + ffi.Pointer funding_account_ids, + ffi.Pointer fee, + int fee_token, + ) { + return _wire_Funding_new( + account_id, + sub_account_id, + sub_account_nonce, + funding_account_ids, + fee, + fee_token, + ); + } + + late final _wire_Funding_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer, + ffi.Uint16)>>('frbgen_zklink_wire_Funding_new'); + late final _wire_Funding_new = _wire_Funding_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + ffi.Pointer, + ffi.Pointer, + int)>(); + + WireSyncRust2DartDco wire_Funding_sign( + int that, + int zk_link_signer, + ) { + return _wire_Funding_sign( + that, + zk_link_signer, + ); + } + + late final _wire_Funding_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.UintPtr)>>('frbgen_zklink_wire_Funding_sign'); + late final _wire_Funding_sign = _wire_Funding_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_Funding_to_json( + int that, + ) { + return _wire_Funding_to_json( + that, + ); + } + + late final _wire_Funding_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_Funding_to_json'); + late final _wire_Funding_to_json = + _wire_Funding_to_jsonPtr.asFunction(); + + WireSyncRust2DartDco wire_Liquidation_new( + int account_id, + int sub_account_id, + int sub_account_nonce, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + contract_prices, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + margin_prices, + int liquidation_account_id, + ffi.Pointer fee, + int fee_token, + ) { + return _wire_Liquidation_new( + account_id, + sub_account_id, + sub_account_nonce, + contract_prices, + margin_prices, + liquidation_account_id, + fee, + fee_token, + ); + } + + late final _wire_Liquidation_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.Uint32, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>, + ffi.Uint32, + ffi.Pointer, + ffi.Uint16)>>('frbgen_zklink_wire_Liquidation_new'); + late final _wire_Liquidation_new = _wire_Liquidation_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>, + int, + ffi.Pointer, + int)>(); + + WireSyncRust2DartDco wire_Liquidation_sign( + int that, + int zk_link_signer, + ) { + return _wire_Liquidation_sign( + that, + zk_link_signer, + ); + } + + late final _wire_Liquidation_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_Liquidation_sign'); + late final _wire_Liquidation_sign = _wire_Liquidation_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_Liquidation_to_json( + int that, + ) { + return _wire_Liquidation_to_json( + that, + ); + } + + late final _wire_Liquidation_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_Liquidation_to_json'); + late final _wire_Liquidation_to_json = _wire_Liquidation_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_OrderMatching_new( + int account_id, + int sub_account_id, + int taker, + int maker, + ffi.Pointer fee, + int fee_token, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + contract_prices, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + margin_prices, + ffi.Pointer expect_base_amount, + ffi.Pointer expect_quote_amount, + ) { + return _wire_OrderMatching_new( + account_id, + sub_account_id, + taker, + maker, + fee, + fee_token, + contract_prices, + margin_prices, + expect_base_amount, + expect_quote_amount, + ); + } + + late final _wire_OrderMatching_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.UintPtr, + ffi.UintPtr, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_OrderMatching_new'); + late final _wire_OrderMatching_new = _wire_OrderMatching_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + int, + ffi.Pointer, + int, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice>, + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo>, + ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_OrderMatching_sign( + int that, + int zk_link_signer, + ) { + return _wire_OrderMatching_sign( + that, + zk_link_signer, + ); + } + + late final _wire_OrderMatching_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_OrderMatching_sign'); + late final _wire_OrderMatching_sign = _wire_OrderMatching_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_OrderMatching_to_json( + int that, + ) { + return _wire_OrderMatching_to_json( + that, + ); + } + + late final _wire_OrderMatching_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_OrderMatching_to_json'); + late final _wire_OrderMatching_to_json = _wire_OrderMatching_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_Order_new( + int account_id, + int sub_account_id, + int slot_id, + int nonce, + int base_token_id, + int quote_token_id, + ffi.Pointer amount, + ffi.Pointer price, + bool is_sell, + int maker_fee_rate, + int taker_fee_rate, + bool has_subsidy, + ) { + return _wire_Order_new( + account_id, + sub_account_id, + slot_id, + nonce, + base_token_id, + quote_token_id, + amount, + price, + is_sell, + maker_fee_rate, + taker_fee_rate, + has_subsidy, + ); + } + + late final _wire_Order_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.Uint32, + ffi.Uint32, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Uint8, + ffi.Uint8, + ffi.Bool)>>('frbgen_zklink_wire_Order_new'); + late final _wire_Order_new = _wire_Order_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + int, + int, + int, + ffi.Pointer, + ffi.Pointer, + bool, + int, + int, + bool)>(); + + WireSyncRust2DartDco wire_Parameter_contract_info( + int pair_id, + ffi.Pointer symbol, + int initial_margin_rate, + int maintenance_margin_rate, + ) { + return _wire_Parameter_contract_info( + pair_id, + symbol, + initial_margin_rate, + maintenance_margin_rate, + ); + } + + late final _wire_Parameter_contract_infoPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint16, + ffi.Pointer, + ffi.Uint16, + ffi.Uint16)>>('frbgen_zklink_wire_Parameter_contract_info'); + late final _wire_Parameter_contract_info = + _wire_Parameter_contract_infoPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer, int, int)>(); + + WireSyncRust2DartDco wire_Parameter_fee_account( + int account_id, + ) { + return _wire_Parameter_fee_account( + account_id, + ); + } + + late final _wire_Parameter_fee_accountPtr = + _lookup>( + 'frbgen_zklink_wire_Parameter_fee_account'); + late final _wire_Parameter_fee_account = _wire_Parameter_fee_accountPtr + .asFunction(); + + WireSyncRust2DartDco wire_Parameter_funding_infos( + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo> + infos, + ) { + return _wire_Parameter_funding_infos( + infos, + ); + } + + late final _wire_Parameter_funding_infosPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo>)>>( + 'frbgen_zklink_wire_Parameter_funding_infos'); + late final _wire_Parameter_funding_infos = + _wire_Parameter_funding_infosPtr.asFunction< + WireSyncRust2DartDco Function( + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo>)>(); + + WireSyncRust2DartDco wire_Parameter_insurance_fund_account( + int account_id, + ) { + return _wire_Parameter_insurance_fund_account( + account_id, + ); + } + + late final _wire_Parameter_insurance_fund_accountPtr = + _lookup>( + 'frbgen_zklink_wire_Parameter_insurance_fund_account'); + late final _wire_Parameter_insurance_fund_account = + _wire_Parameter_insurance_fund_accountPtr + .asFunction(); + + WireSyncRust2DartDco wire_Parameter_margin_info( + int margin_id, + ffi.Pointer symbol, + int token_id, + int ratio, + ) { + return _wire_Parameter_margin_info( + margin_id, + symbol, + token_id, + ratio, + ); + } + + late final _wire_Parameter_margin_infoPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint8, + ffi.Pointer, + ffi.Uint32, + ffi.Uint8)>>('frbgen_zklink_wire_Parameter_margin_info'); + late final _wire_Parameter_margin_info = + _wire_Parameter_margin_infoPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer, int, int)>(); + + WireSyncRust2DartDco wire_Signer_create_signed_contract( + int that, + int contract, + ) { + return _wire_Signer_create_signed_contract( + that, + contract, + ); + } + + late final _wire_Signer_create_signed_contractPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_zklink_wire_Signer_create_signed_contract'); + late final _wire_Signer_create_signed_contract = + _wire_Signer_create_signed_contractPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_create_signed_order( + int that, + int order, + ) { + return _wire_Signer_create_signed_order( + that, + order, + ); + } + + late final _wire_Signer_create_signed_orderPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_Signer_create_signed_order'); + late final _wire_Signer_create_signed_order = + _wire_Signer_create_signed_orderPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_eth_signer( + ffi.Pointer eth_private_key, + ) { + return _wire_Signer_eth_signer( + eth_private_key, + ); + } + + late final _wire_Signer_eth_signerPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Pointer)>>( + 'frbgen_zklink_wire_Signer_eth_signer'); + late final _wire_Signer_eth_signer = _wire_Signer_eth_signerPtr.asFunction< + WireSyncRust2DartDco Function( + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Signer_sign_auto_deleveraging( + int that, + int tx, + ) { + return _wire_Signer_sign_auto_deleveraging( + that, + tx, + ); + } + + late final _wire_Signer_sign_auto_deleveragingPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_zklink_wire_Signer_sign_auto_deleveraging'); + late final _wire_Signer_sign_auto_deleveraging = + _wire_Signer_sign_auto_deleveragingPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_change_pubkey_with_create2data_auth( + int that, + int tx, + ffi.Pointer creator_address, + ffi.Pointer salt_arg, + ffi.Pointer code_hash, + ) { + return _wire_Signer_sign_change_pubkey_with_create2data_auth( + that, + tx, + creator_address, + salt_arg, + code_hash, + ); + } + + late final _wire_Signer_sign_change_pubkey_with_create2data_authPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, + ffi.UintPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_Signer_sign_change_pubkey_with_create2data_auth'); + late final _wire_Signer_sign_change_pubkey_with_create2data_auth = + _wire_Signer_sign_change_pubkey_with_create2data_authPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth( + int that, + int tx, + ) { + return _wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth( + that, + tx, + ); + } + + late final _wire_Signer_sign_change_pubkey_with_eth_ecdsa_authPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_zklink_wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth'); + late final _wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth = + _wire_Signer_sign_change_pubkey_with_eth_ecdsa_authPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_change_pubkey_with_onchain( + int that, + int tx, + ) { + return _wire_Signer_sign_change_pubkey_with_onchain( + that, + tx, + ); + } + + late final _wire_Signer_sign_change_pubkey_with_onchainPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_zklink_wire_Signer_sign_change_pubkey_with_onchain'); + late final _wire_Signer_sign_change_pubkey_with_onchain = + _wire_Signer_sign_change_pubkey_with_onchainPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_contract_matching( + int that, + int tx, + ) { + return _wire_Signer_sign_contract_matching( + that, + tx, + ); + } + + late final _wire_Signer_sign_contract_matchingPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, ffi.UintPtr)>>( + 'frbgen_zklink_wire_Signer_sign_contract_matching'); + late final _wire_Signer_sign_contract_matching = + _wire_Signer_sign_contract_matchingPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_forced_exit( + int that, + int tx, + ) { + return _wire_Signer_sign_forced_exit( + that, + tx, + ); + } + + late final _wire_Signer_sign_forced_exitPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_Signer_sign_forced_exit'); + late final _wire_Signer_sign_forced_exit = _wire_Signer_sign_forced_exitPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_funding( + int that, + int tx, + ) { + return _wire_Signer_sign_funding( + that, + tx, + ); + } + + late final _wire_Signer_sign_fundingPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_Signer_sign_funding'); + late final _wire_Signer_sign_funding = _wire_Signer_sign_fundingPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_liquidation( + int that, + int tx, + ) { + return _wire_Signer_sign_liquidation( + that, + tx, + ); + } + + late final _wire_Signer_sign_liquidationPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_Signer_sign_liquidation'); + late final _wire_Signer_sign_liquidation = _wire_Signer_sign_liquidationPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_order_matching( + int that, + int tx, + ) { + return _wire_Signer_sign_order_matching( + that, + tx, + ); + } + + late final _wire_Signer_sign_order_matchingPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_Signer_sign_order_matching'); + late final _wire_Signer_sign_order_matching = + _wire_Signer_sign_order_matchingPtr + .asFunction(); + + WireSyncRust2DartDco wire_Signer_sign_transfer( + int that, + int tx, + ffi.Pointer token_symbol, + ffi.Pointer chain_id, + ffi.Pointer addr, + ) { + return _wire_Signer_sign_transfer( + that, + tx, + token_symbol, + chain_id, + addr, + ); + } + + late final _wire_Signer_sign_transferPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, + ffi.UintPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_Signer_sign_transfer'); + late final _wire_Signer_sign_transfer = + _wire_Signer_sign_transferPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Signer_sign_withdraw( + int that, + int tx, + ffi.Pointer token_symbol, + ffi.Pointer chain_id, + ffi.Pointer addr, + ) { + return _wire_Signer_sign_withdraw( + that, + tx, + token_symbol, + chain_id, + addr, + ); + } + + late final _wire_Signer_sign_withdrawPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, + ffi.UintPtr, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_Signer_sign_withdraw'); + late final _wire_Signer_sign_withdraw = + _wire_Signer_sign_withdrawPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Signer_starknet_signer( + ffi.Pointer eth_private_key, + ffi.Pointer starknet_chain_id, + ffi.Pointer starknet_addr, + ) { + return _wire_Signer_starknet_signer( + eth_private_key, + starknet_chain_id, + starknet_addr, + ); + } + + late final _wire_Signer_starknet_signerPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_Signer_starknet_signer'); + late final _wire_Signer_starknet_signer = + _wire_Signer_starknet_signerPtr.asFunction< + WireSyncRust2DartDco Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_SpotPriceInfo_new( + int token_id, + ffi.Pointer price, + ) { + return _wire_SpotPriceInfo_new( + token_id, + price, + ); + } + + late final _wire_SpotPriceInfo_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, ffi.Pointer)>>( + 'frbgen_zklink_wire_SpotPriceInfo_new'); + late final _wire_SpotPriceInfo_new = _wire_SpotPriceInfo_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Transfer_get_eth_sign_msg( + int that, + ffi.Pointer token_symbol, + ) { + return _wire_Transfer_get_eth_sign_msg( + that, + token_symbol, + ); + } + + late final _wire_Transfer_get_eth_sign_msgPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.Pointer)>>( + 'frbgen_zklink_wire_Transfer_get_eth_sign_msg'); + late final _wire_Transfer_get_eth_sign_msg = + _wire_Transfer_get_eth_sign_msgPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Transfer_new( + int account_id, + ffi.Pointer to_address, + int from_sub_account_id, + int to_sub_account_id, + int token, + ffi.Pointer fee, + ffi.Pointer amount, + int nonce, + ffi.Pointer ts, + ) { + return _wire_Transfer_new( + account_id, + to_address, + from_sub_account_id, + to_sub_account_id, + token, + fee, + amount, + nonce, + ts, + ); + } + + late final _wire_Transfer_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Pointer, + ffi.Uint8, + ffi.Uint8, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>('frbgen_zklink_wire_Transfer_new'); + late final _wire_Transfer_new = _wire_Transfer_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + ffi.Pointer, + int, + int, + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Transfer_sign( + int that, + int zk_link_signer, + ) { + return _wire_Transfer_sign( + that, + zk_link_signer, + ); + } + + late final _wire_Transfer_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.UintPtr)>>('frbgen_zklink_wire_Transfer_sign'); + late final _wire_Transfer_sign = _wire_Transfer_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_Transfer_to_json( + int that, + ) { + return _wire_Transfer_to_json( + that, + ); + } + + late final _wire_Transfer_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_Transfer_to_json'); + late final _wire_Transfer_to_json = _wire_Transfer_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_UpdateGlobalVar_new( + int from_chain_id, + int sub_account_id, + int parameter, + double serial_id, + ) { + return _wire_UpdateGlobalVar_new( + from_chain_id, + sub_account_id, + parameter, + serial_id, + ); + } + + late final _wire_UpdateGlobalVar_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function(ffi.Uint8, ffi.Uint8, ffi.UintPtr, + ffi.Double)>>('frbgen_zklink_wire_UpdateGlobalVar_new'); + late final _wire_UpdateGlobalVar_new = _wire_UpdateGlobalVar_newPtr + .asFunction(); + + WireSyncRust2DartDco wire_UpdateGlobalVar_to_json( + int that, + ) { + return _wire_UpdateGlobalVar_to_json( + that, + ); + } + + late final _wire_UpdateGlobalVar_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_UpdateGlobalVar_to_json'); + late final _wire_UpdateGlobalVar_to_json = _wire_UpdateGlobalVar_to_jsonPtr + .asFunction(); + + void wire_Wallet_approve_erc20( + int port_, + int that, + ffi.Pointer contract, + ffi.Pointer amount, + int eth_params, + ) { + return _wire_Wallet_approve_erc20( + port_, + that, + contract, + amount, + eth_params, + ); + } + + late final _wire_Wallet_approve_erc20Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.UintPtr, + ffi.Pointer, + ffi.Pointer, + ffi.UintPtr)>>('frbgen_zklink_wire_Wallet_approve_erc20'); + late final _wire_Wallet_approve_erc20 = + _wire_Wallet_approve_erc20Ptr.asFunction< + void Function(int, int, ffi.Pointer, + ffi.Pointer, int)>(); + + void wire_Wallet_deposit_erc20( + int port_, + int that, + int sub_account_id, + ffi.Pointer deposit_to, + ffi.Pointer token_addr, + ffi.Pointer amount, + bool mapping, + int eth_params, + bool is_gateway, + ) { + return _wire_Wallet_deposit_erc20( + port_, + that, + sub_account_id, + deposit_to, + token_addr, + amount, + mapping, + eth_params, + is_gateway, + ); + } + + late final _wire_Wallet_deposit_erc20Ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.UintPtr, + ffi.Uint8, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.UintPtr, + ffi.Bool)>>('frbgen_zklink_wire_Wallet_deposit_erc20'); + late final _wire_Wallet_deposit_erc20 = + _wire_Wallet_deposit_erc20Ptr.asFunction< + void Function( + int, + int, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool, + int, + bool)>(); + + void wire_Wallet_deposit_eth( + int port_, + int that, + int sub_account_id, + ffi.Pointer deposit_to, + int eth_params, + bool is_gateway, + ) { + return _wire_Wallet_deposit_eth( + port_, + that, + sub_account_id, + deposit_to, + eth_params, + is_gateway, + ); + } + + late final _wire_Wallet_deposit_ethPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.UintPtr, + ffi.Uint8, + ffi.Pointer, + ffi.UintPtr, + ffi.Bool)>>('frbgen_zklink_wire_Wallet_deposit_eth'); + late final _wire_Wallet_deposit_eth = _wire_Wallet_deposit_ethPtr.asFunction< + void Function(int, int, int, ffi.Pointer, + int, bool)>(); + + void wire_Wallet_full_exit( + int port_, + int that, + int account_id, + int sub_account_id, + int token_id, + bool mapping, + int eth_params, + ) { + return _wire_Wallet_full_exit( + port_, + that, + account_id, + sub_account_id, + token_id, + mapping, + eth_params, + ); + } + + late final _wire_Wallet_full_exitPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.UintPtr, + ffi.Uint32, + ffi.Uint8, + ffi.Uint16, + ffi.Bool, + ffi.UintPtr)>>('frbgen_zklink_wire_Wallet_full_exit'); + late final _wire_Wallet_full_exit = _wire_Wallet_full_exitPtr + .asFunction(); + + void wire_Wallet_get_balance( + int port_, + int that, + ) { + return _wire_Wallet_get_balance( + port_, + that, + ); + } + + late final _wire_Wallet_get_balancePtr = + _lookup>( + 'frbgen_zklink_wire_Wallet_get_balance'); + late final _wire_Wallet_get_balance = + _wire_Wallet_get_balancePtr.asFunction(); + + void wire_Wallet_get_deposit_fee( + int port_, + int that, + int eth_params, + ) { + return _wire_Wallet_get_deposit_fee( + port_, + that, + eth_params, + ); + } + + late final _wire_Wallet_get_deposit_feePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.UintPtr, + ffi.UintPtr)>>('frbgen_zklink_wire_Wallet_get_deposit_fee'); + late final _wire_Wallet_get_deposit_fee = _wire_Wallet_get_deposit_feePtr + .asFunction(); + + void wire_Wallet_get_nonce( + int port_, + int that, + ffi.Pointer block_number, + ) { + return _wire_Wallet_get_nonce( + port_, + that, + block_number, + ); + } + + late final _wire_Wallet_get_noncePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.UintPtr, + ffi.Pointer)>>( + 'frbgen_zklink_wire_Wallet_get_nonce'); + late final _wire_Wallet_get_nonce = _wire_Wallet_get_noncePtr.asFunction< + void Function(int, int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Wallet_new( + ffi.Pointer url, + ffi.Pointer private_key, + ) { + return _wire_Wallet_new( + url, + private_key, + ); + } + + late final _wire_Wallet_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_Wallet_new'); + late final _wire_Wallet_new = _wire_Wallet_newPtr.asFunction< + WireSyncRust2DartDco Function(ffi.Pointer, + ffi.Pointer)>(); + + void wire_Wallet_set_auth_pubkey_hash( + int port_, + int that, + double nonce, + ffi.Pointer new_pubkey_hash, + int eth_params, + ) { + return _wire_Wallet_set_auth_pubkey_hash( + port_, + that, + nonce, + new_pubkey_hash, + eth_params, + ); + } + + late final _wire_Wallet_set_auth_pubkey_hashPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.UintPtr, + ffi.Double, + ffi.Pointer, + ffi.UintPtr)>>('frbgen_zklink_wire_Wallet_set_auth_pubkey_hash'); + late final _wire_Wallet_set_auth_pubkey_hash = + _wire_Wallet_set_auth_pubkey_hashPtr.asFunction< + void Function(int, int, double, + ffi.Pointer, int)>(); + + void wire_Wallet_wait_for_transaction( + int port_, + int that, + ffi.Pointer tx_hash, + ffi.Pointer timeout, + ) { + return _wire_Wallet_wait_for_transaction( + port_, + that, + tx_hash, + timeout, + ); + } + + late final _wire_Wallet_wait_for_transactionPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int64, + ffi.UintPtr, + ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_zklink_wire_Wallet_wait_for_transaction'); + late final _wire_Wallet_wait_for_transaction = + _wire_Wallet_wait_for_transactionPtr.asFunction< + void Function(int, int, ffi.Pointer, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Withdraw_get_eth_sign_msg( + int that, + ffi.Pointer token_symbol, + ) { + return _wire_Withdraw_get_eth_sign_msg( + that, + token_symbol, + ); + } + + late final _wire_Withdraw_get_eth_sign_msgPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.Pointer)>>( + 'frbgen_zklink_wire_Withdraw_get_eth_sign_msg'); + late final _wire_Withdraw_get_eth_sign_msg = + _wire_Withdraw_get_eth_sign_msgPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Withdraw_new( + int account_id, + int sub_account_id, + int to_chain_id, + ffi.Pointer to_address, + int l2_source_token, + int l1_target_token, + ffi.Pointer amount, + ffi.Pointer call_data, + ffi.Pointer fee, + int nonce, + bool withdraw_to_l1, + int withdraw_fee_ratio, + ffi.Pointer ts, + ) { + return _wire_Withdraw_new( + account_id, + sub_account_id, + to_chain_id, + to_address, + l2_source_token, + l1_target_token, + amount, + call_data, + fee, + nonce, + withdraw_to_l1, + withdraw_fee_ratio, + ts, + ); + } + + late final _wire_Withdraw_newPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Uint32, + ffi.Uint8, + ffi.Uint8, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Bool, + ffi.Uint16, + ffi.Pointer)>>('frbgen_zklink_wire_Withdraw_new'); + late final _wire_Withdraw_new = _wire_Withdraw_newPtr.asFunction< + WireSyncRust2DartDco Function( + int, + int, + int, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + bool, + int, + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_Withdraw_sign( + int that, + int zk_link_signer, + ) { + return _wire_Withdraw_sign( + that, + zk_link_signer, + ); + } + + late final _wire_Withdraw_signPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.UintPtr)>>('frbgen_zklink_wire_Withdraw_sign'); + late final _wire_Withdraw_sign = _wire_Withdraw_signPtr + .asFunction(); + + WireSyncRust2DartDco wire_Withdraw_to_json( + int that, + ) { + return _wire_Withdraw_to_json( + that, + ); + } + + late final _wire_Withdraw_to_jsonPtr = + _lookup>( + 'frbgen_zklink_wire_Withdraw_to_json'); + late final _wire_Withdraw_to_json = _wire_Withdraw_to_jsonPtr + .asFunction(); + + WireSyncRust2DartDco wire_ZkLinkSignature_get_pubkey( + int that, + ) { + return _wire_ZkLinkSignature_get_pubkey( + that, + ); + } + + late final _wire_ZkLinkSignature_get_pubkeyPtr = + _lookup>( + 'frbgen_zklink_wire_ZkLinkSignature_get_pubkey'); + late final _wire_ZkLinkSignature_get_pubkey = + _wire_ZkLinkSignature_get_pubkeyPtr + .asFunction(); + + WireSyncRust2DartDco wire_ZkLinkSignature_get_signature( + int that, + ) { + return _wire_ZkLinkSignature_get_signature( + that, + ); + } + + late final _wire_ZkLinkSignature_get_signaturePtr = + _lookup>( + 'frbgen_zklink_wire_ZkLinkSignature_get_signature'); + late final _wire_ZkLinkSignature_get_signature = + _wire_ZkLinkSignature_get_signaturePtr + .asFunction(); + + WireSyncRust2DartDco wire_ZkLinkSigner_eth_sig( + ffi.Pointer sig, + ) { + return _wire_ZkLinkSigner_eth_sig( + sig, + ); + } + + late final _wire_ZkLinkSigner_eth_sigPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Pointer)>>( + 'frbgen_zklink_wire_ZkLinkSigner_eth_sig'); + late final _wire_ZkLinkSigner_eth_sig = + _wire_ZkLinkSigner_eth_sigPtr.asFunction< + WireSyncRust2DartDco Function( + ffi.Pointer)>(); + + WireSyncRust2DartDco wire_ZkLinkSigner_get_pubkey( + int that, + ) { + return _wire_ZkLinkSigner_get_pubkey( + that, + ); + } + + late final _wire_ZkLinkSigner_get_pubkeyPtr = + _lookup>( + 'frbgen_zklink_wire_ZkLinkSigner_get_pubkey'); + late final _wire_ZkLinkSigner_get_pubkey = _wire_ZkLinkSigner_get_pubkeyPtr + .asFunction(); + + WireSyncRust2DartDco wire_ZkLinkSigner_get_pubkey_hash( + int that, + ) { + return _wire_ZkLinkSigner_get_pubkey_hash( + that, + ); + } + + late final _wire_ZkLinkSigner_get_pubkey_hashPtr = + _lookup>( + 'frbgen_zklink_wire_ZkLinkSigner_get_pubkey_hash'); + late final _wire_ZkLinkSigner_get_pubkey_hash = + _wire_ZkLinkSigner_get_pubkey_hashPtr + .asFunction(); + + WireSyncRust2DartDco wire_ZkLinkSigner_sign_musig( + int that, + ffi.Pointer msg, + ) { + return _wire_ZkLinkSigner_sign_musig( + that, + msg, + ); + } + + late final _wire_ZkLinkSigner_sign_musigPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.UintPtr, ffi.Pointer)>>( + 'frbgen_zklink_wire_ZkLinkSigner_sign_musig'); + late final _wire_ZkLinkSigner_sign_musig = + _wire_ZkLinkSigner_sign_musigPtr.asFunction< + WireSyncRust2DartDco Function( + int, ffi.Pointer)>(); + + WireSyncRust2DartDco wire_ZkLinkSigner_starknet_sig( + ffi.Pointer sig, + ) { + return _wire_ZkLinkSigner_starknet_sig( + sig, + ); + } + + late final _wire_ZkLinkSigner_starknet_sigPtr = _lookup< + ffi.NativeFunction< + WireSyncRust2DartDco Function( + ffi.Pointer)>>( + 'frbgen_zklink_wire_ZkLinkSigner_starknet_sig'); + late final _wire_ZkLinkSigner_starknet_sig = + _wire_ZkLinkSigner_starknet_sigPtr.asFunction< + WireSyncRust2DartDco Function( + ffi.Pointer)>(); + + void wire_init_app( + int port_, + ) { + return _wire_init_app( + port_, + ); + } + + late final _wire_init_appPtr = + _lookup>( + 'frbgen_zklink_wire_init_app'); + late final _wire_init_app = + _wire_init_appPtr.asFunction(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveragingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveragingPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveragingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveragingPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKeyPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKeyPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKeyPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKeyPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatchingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatchingPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatchingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatchingPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPricePtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPricePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPricePtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPricePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOptionPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOptionPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOptionPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOptionPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExitPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExitPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExitPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExitPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfoPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfoPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfoPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfoPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidationPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidationPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidationPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidationPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatchingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatchingPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatchingPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatchingPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameterPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameterPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameterPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameterPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSignerPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSignerPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSignerPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSignerPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfoPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfoPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfoPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfoPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransferPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransferPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransferPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransferPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVarPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVarPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVarPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVarPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWalletPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWalletPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWalletPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWalletPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdrawPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdrawPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdrawPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdrawPtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignaturePtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignaturePtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignaturePtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignaturePtr + .asFunction)>(); + + void + rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ffi.Pointer ptr, + ) { + return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ptr, + ); + } + + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignerPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner'); + late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner = + _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignerPtr + .asFunction)>(); + + void + rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ffi.Pointer ptr, + ) { + return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ptr, + ); + } + + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignerPtr = + _lookup)>>( + 'frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner'); + late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner = + _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignerPtr + .asFunction)>(); + + ffi.Pointer cst_new_box_autoadd_f_64( + double value, + ) { + return _cst_new_box_autoadd_f_64( + value, + ); + } + + late final _cst_new_box_autoadd_f_64Ptr = + _lookup Function(ffi.Double)>>( + 'frbgen_zklink_cst_new_box_autoadd_f_64'); + late final _cst_new_box_autoadd_f_64 = _cst_new_box_autoadd_f_64Ptr + .asFunction Function(double)>(); + + ffi.Pointer cst_new_box_autoadd_u_32( + int value, + ) { + return _cst_new_box_autoadd_u_32( + value, + ); + } + + late final _cst_new_box_autoadd_u_32Ptr = + _lookup Function(ffi.Uint32)>>( + 'frbgen_zklink_cst_new_box_autoadd_u_32'); + late final _cst_new_box_autoadd_u_32 = _cst_new_box_autoadd_u_32Ptr + .asFunction Function(int)>(); + + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract> + cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + int len, + ) { + return _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + len, + ); + } + + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPtr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract> + Function(ffi.Int32)>>( + 'frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract'); + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract = + _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPtr + .asFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract> + Function(int)>(); + + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + int len, + ) { + return _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + len, + ); + } + + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPricePtr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + Function(ffi.Int32)>>( + 'frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice'); + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice = + _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPricePtr + .asFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice> + Function(int)>(); + + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo> + cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + int len, + ) { + return _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + len, + ); + } + + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfoPtr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo> + Function(ffi.Int32)>>( + 'frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo'); + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo = + _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfoPtr + .asFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo> + Function(int)>(); + + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + int len, + ) { + return _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + len, + ); + } + + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfoPtr = + _lookup< + ffi.NativeFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + Function(ffi.Int32)>>( + 'frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo'); + late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo = + _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfoPtr + .asFunction< + ffi.Pointer< + wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo> + Function(int)>(); + + ffi.Pointer cst_new_list_prim_u_32_loose( + int len, + ) { + return _cst_new_list_prim_u_32_loose( + len, + ); + } + + late final _cst_new_list_prim_u_32_loosePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_zklink_cst_new_list_prim_u_32_loose'); + late final _cst_new_list_prim_u_32_loose = _cst_new_list_prim_u_32_loosePtr + .asFunction Function(int)>(); + + ffi.Pointer cst_new_list_prim_u_32_strict( + int len, + ) { + return _cst_new_list_prim_u_32_strict( + len, + ); + } + + late final _cst_new_list_prim_u_32_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_zklink_cst_new_list_prim_u_32_strict'); + late final _cst_new_list_prim_u_32_strict = _cst_new_list_prim_u_32_strictPtr + .asFunction Function(int)>(); + + ffi.Pointer cst_new_list_prim_u_8_loose( + int len, + ) { + return _cst_new_list_prim_u_8_loose( + len, + ); + } + + late final _cst_new_list_prim_u_8_loosePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_zklink_cst_new_list_prim_u_8_loose'); + late final _cst_new_list_prim_u_8_loose = _cst_new_list_prim_u_8_loosePtr + .asFunction Function(int)>(); + + ffi.Pointer cst_new_list_prim_u_8_strict( + int len, + ) { + return _cst_new_list_prim_u_8_strict( + len, + ); + } + + late final _cst_new_list_prim_u_8_strictPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('frbgen_zklink_cst_new_list_prim_u_8_strict'); + late final _cst_new_list_prim_u_8_strict = _cst_new_list_prim_u_8_strictPtr + .asFunction Function(int)>(); + + int dummy_method_to_enforce_bundling() { + return _dummy_method_to_enforce_bundling(); + } + + late final _dummy_method_to_enforce_bundlingPtr = + _lookup>( + 'dummy_method_to_enforce_bundling'); + late final _dummy_method_to_enforce_bundling = + _dummy_method_to_enforce_bundlingPtr.asFunction(); +} + +typedef DartPostCObjectFnType + = ffi.Pointer>; +typedef DartPostCObjectFnTypeFunction = ffi.Bool Function( + DartPort port_id, ffi.Pointer message); +typedef DartDartPostCObjectFnTypeFunction = bool Function( + DartDartPort port_id, ffi.Pointer message); +typedef DartPort = ffi.Int64; +typedef DartDartPort = int; + +final class wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice + extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo + extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_prim_u_8_strict extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract + extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_prim_u_32_loose extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo + extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_prim_u_8_loose extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +final class wire_cst_list_prim_u_32_strict extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} diff --git a/bindings/dart/linux/CMakeLists.txt b/bindings/dart/linux/CMakeLists.txt new file mode 100644 index 00000000..e0a17f5d --- /dev/null +++ b/bindings/dart/linux/CMakeLists.txt @@ -0,0 +1,36 @@ +set(zklinkVersion "0.0.1") # generated; do not edit + +# The Flutter tooling requires that developers have CMake 3.10 or later +# installed. You should not increase this version, as doing so will cause +# the plugin to fail to compile for some customers of the plugin. +cmake_minimum_required(VERSION 3.10) + +# Project-level configuration. +set(PROJECT_NAME "zklink") + +# Download the binaries if they are not already present. +set(LIBROOT "${CMAKE_CURRENT_SOURCE_DIR}/${zklinkVersion}") +set(ARCHIVE "${LIBROOT}.tar.gz") +if(NOT EXISTS ${ARCHIVE}) + file(DOWNLOAD + "https://github.com/zkLinkProtocol/zklink_sdk/releases/download/dart_sdk_${zklinkVersion}/x86_64-unknown-linux-gnu.tar.xz" + ${ARCHIVE} + TLS_VERIFY ON + ) +endif() + +# Extract the binaries, overriding any already present. +file(REMOVE_RECURSE ${LIBROOT}) +file(MAKE_DIRECTORY ${LIBROOT}) +execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xvf ${ARCHIVE} + WORKING_DIRECTORY ${LIBROOT} +) + +# List of absolute paths to libraries that should be bundled with the plugin. +# This list could contain prebuilt libraries, or libraries created by an +# external build triggered from this build file. +set(zklink_bundled_libraries + "${LIBROOT}/libzklink_sdk_dart.so" + PARENT_SCOPE +) \ No newline at end of file diff --git a/bindings/dart/macos/zklink.podspec b/bindings/dart/macos/zklink.podspec new file mode 100644 index 00000000..96951a8f --- /dev/null +++ b/bindings/dart/macos/zklink.podspec @@ -0,0 +1,29 @@ +framework_name = 'zklink_sdk_dart' +url = "https://github.com/zkLinkProtocol/zklink_sdk/releases/download/dart_sdk_0.0.1/aarch64-apple-darwin.tar.xz" +archive = "#{framework_name}.tar.xz" +` +mkdir -p Frameworks/#{framework_name} +cd Frameworks/#{framework_name} + +if [ ! -f #{archive} ] +then + curl -L #{url} -o #{archive} +fi + +tar xvf #{archive} +cd - +` + +Pod::Spec.new do |spec| + spec.name = 'zklink_sdk_dart' + spec.version = '0.0.1' + spec.license = { :file => '../LICENSE' } + spec.homepage = 'https://zk.link' + spec.summary = 'zkLink Dart SDK' + + spec.source = { :git => 'https://github.com/zkLinkProtocol/zklink_sdk.git' } + spec.vendored_frameworks = "Frameworks/#{framework_name}" + + spec.ios.deployment_target = '11.0' + spec.osx.deployment_target = '10.14' +end diff --git a/bindings/dart/pubspec.yaml b/bindings/dart/pubspec.yaml new file mode 100644 index 00000000..0c139661 --- /dev/null +++ b/bindings/dart/pubspec.yaml @@ -0,0 +1,34 @@ +name: zklink +description: "zkLink Dart SDK" +homepage: "https://zk.link" + +version: 0.0.1 + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: '>=3.0.0' + +dependencies: + flutter: + sdk: flutter + ffi: ^2.1.2 + flutter_rust_bridge: 2.0.0-dev.32 + +dev_dependencies: + flutter_test: + sdk: flutter + ffigen: ^11.0.0 + +flutter: + plugin: + platforms: + ios: + ffiPlugin: true + macos: + ffiPlugin: true + android: + ffiPlugin: true + linux: + ffiPlugin: true + windows: + ffiPlugin: true diff --git a/bindings/dart/rust/Cargo.toml b/bindings/dart/rust/Cargo.toml new file mode 100644 index 00000000..ba894fa4 --- /dev/null +++ b/bindings/dart/rust/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "zklink_sdk_dart" +version = "0.0.1" +edition = "2021" + +[lib] +crate-type = ["cdylib", "staticlib"] + +[dependencies] +flutter_rust_bridge = "=2.0.0-dev.32" +serde_json = { workspace = true } +anyhow = { workspace = true } +hex = { workspace = true } +zklink_sdk_types = { path = "../../../types" } +zklink_sdk_signers = { path = "../../../signers" } +zklink_sdk_interface = { path = "../../../interface" } +zklink_sdk_wallet = { path = "../../../wallet" } diff --git a/bindings/dart/rust/src/api.rs b/bindings/dart/rust/src/api.rs new file mode 100644 index 00000000..ab97e32e --- /dev/null +++ b/bindings/dart/rust/src/api.rs @@ -0,0 +1,1083 @@ +use anyhow::Result; +use flutter_rust_bridge::frb; +use serde_json::to_string; +use std::str::FromStr; +use std::time::UNIX_EPOCH; +use zklink_sdk_interface::signer::{L1SignerType, Signer as InnerSigner}; +use zklink_sdk_signers::eth_signer::{PackedEthSignature, H256}; +use zklink_sdk_signers::starknet_signer::StarkEcdsaSignature; +use zklink_sdk_signers::zklink_signer::{ + signature::ZkLinkSignature as InnerZkLinkSignature, PubKeyHash, + ZkLinkSigner as InnerZkLinkSigner, +}; +use zklink_sdk_types::basic_types::{BigUint, GetBytes, ZkLinkAddress}; +use zklink_sdk_types::tx_builder::*; +use zklink_sdk_types::tx_type::change_pubkey::{ + ChangePubKey as InnerChangePubKey, ChangePubKeyAuthData, Create2Data, +}; +use zklink_sdk_types::tx_type::contract::{ + AutoDeleveraging as InnerAutoDeleveraging, Contract as InnerContract, + ContractMatching as InnerContractMatching, ContractPrice as InnerContractPrice, + Funding as InnerFunding, FundingInfo as InnerFundingInfo, Liquidation as InnerLiquidation, + Parameter as InnerParameter, SpotPriceInfo as InnerSpotPriceInfo, + UpdateGlobalVar as InnerUpdateGlobalVar, +}; +use zklink_sdk_types::tx_type::forced_exit::ForcedExit as InnerForcedExit; +use zklink_sdk_types::tx_type::order_matching::{ + Order as InnerOrder, OrderMatching as InnerOrderMatching, +}; +use zklink_sdk_types::tx_type::transfer::Transfer as InnerTransfer; +use zklink_sdk_types::tx_type::withdraw::Withdraw as InnerWithdraw; +use zklink_sdk_wallet::eth::EthTxOption as InnerEthTxOption; +use zklink_sdk_wallet::wallet::Wallet as InnerWallet; + +macro_rules! tx_default { + () => { + #[frb(sync)] + pub fn sign(&mut self, zk_link_signer: ZkLinkSigner) -> Result<()> { + self.inner.signature = zk_link_signer.inner.sign_musig(&self.inner.get_bytes())?; + Ok(()) + } + + #[frb(sync)] + pub fn to_json(&self) -> Result { + Ok(to_string(&self.inner)?) + } + }; +} + +#[frb(opaque)] +pub struct ZkLinkSignature { + pub inner: InnerZkLinkSignature, +} + +impl ZkLinkSignature { + #[frb(sync)] + pub fn get_pubkey(&self) -> String { + self.inner.pub_key.as_hex() + } + + #[frb(sync)] + pub fn get_signature(&self) -> String { + self.inner.signature.as_hex() + } +} + +#[frb(opaque)] +pub struct ZkLinkSigner { + pub inner: InnerZkLinkSigner, +} + +impl ZkLinkSigner { + #[frb(sync)] + pub fn eth_sig(sig: String) -> Result { + let signature = PackedEthSignature::from_hex(&sig)?; + let seed = signature.serialize_packed(); + Ok(Self { + inner: InnerZkLinkSigner::new_from_seed(&seed)?, + }) + } + + #[frb(sync)] + pub fn starknet_sig(sig: String) -> Result { + let signature = StarkEcdsaSignature::from_hex(&sig)?; + let seed = signature.to_bytes_be(); + Ok(Self { + inner: InnerZkLinkSigner::new_from_seed(&seed)?, + }) + } + + #[frb(sync)] + pub fn get_pubkey(&self) -> String { + self.inner.public_key().as_hex() + } + + #[frb(sync)] + pub fn get_pubkey_hash(&self) -> String { + self.inner.public_key().public_key_hash().as_hex() + } + + #[frb(sync)] + pub fn sign_musig(&self, msg: Vec) -> Result { + Ok(ZkLinkSignature { + inner: self.inner.sign_musig(&msg)?, + }) + } +} + +#[frb(opaque)] +pub struct Signer { + pub inner: InnerSigner, +} + +impl Signer { + #[frb(sync)] + pub fn eth_signer(eth_private_key: String) -> Result { + Ok(Self { + inner: InnerSigner::new(ð_private_key, L1SignerType::Eth)?, + }) + } + + #[frb(sync)] + pub fn starknet_signer( + eth_private_key: String, + starknet_chain_id: String, + starknet_addr: String, + ) -> Result { + let signer_type = L1SignerType::Starknet { + chain_id: starknet_chain_id, + address: starknet_addr, + }; + Ok(Self { + inner: InnerSigner::new(ð_private_key, signer_type)?, + }) + } + + #[frb(sync)] + pub fn sign_change_pubkey_with_onchain(&self, tx: ChangePubKey) -> Result { + let sig = self + .inner + .sign_change_pubkey_with_onchain_auth_data(tx.inner)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_change_pubkey_with_eth_ecdsa_auth(&self, tx: ChangePubKey) -> Result { + let sig = self + .inner + .sign_change_pubkey_with_eth_ecdsa_auth(tx.inner)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_change_pubkey_with_create2data_auth( + &self, + tx: ChangePubKey, + creator_address: String, + salt_arg: String, + code_hash: String, + ) -> Result { + let create2_data = Create2Data { + creator_address: ZkLinkAddress::from_hex(&creator_address)?, + code_hash: H256::from_str(&code_hash)?, + salt_arg: H256::from_str(&salt_arg)?, + }; + let sig = self + .inner + .sign_change_pubkey_with_create2data_auth(tx.inner, create2_data)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_transfer( + &self, + tx: Transfer, + token_symbol: String, + chain_id: Option, + addr: Option, + ) -> Result { + let sig = self + .inner + .sign_transfer(tx.inner, &token_symbol, chain_id, addr)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_withdraw( + &self, + tx: Withdraw, + token_symbol: String, + chain_id: Option, + addr: Option, + ) -> Result { + let sig = self + .inner + .sign_withdraw(tx.inner, &token_symbol, chain_id, addr)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_forced_exit(&self, tx: ForcedExit) -> Result { + let sig = self.inner.sign_forced_exit(tx.inner)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn create_signed_order(&self, order: Order) -> Result { + Ok(Order { + inner: self.inner.create_signed_order(&order.inner)?, + }) + } + + #[frb(sync)] + pub fn sign_order_matching(&self, tx: OrderMatching) -> Result { + let sig = self.inner.sign_order_matching(tx.inner)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn create_signed_contract(&self, contract: Contract) -> Result { + Ok(Contract { + inner: self.inner.create_signed_contract(&contract.inner)?, + }) + } + + #[frb(sync)] + pub fn sign_contract_matching(&self, tx: ContractMatching) -> Result { + let sig = self.inner.sign_contract_matching(tx.inner)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_auto_deleveraging(&self, tx: AutoDeleveraging) -> Result { + let sig = self.inner.sign_auto_deleveraging(tx.inner)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_funding(&self, tx: Funding) -> Result { + let sig = self.inner.sign_funding(tx.inner)?; + Ok(to_string(&sig.tx)?) + } + + #[frb(sync)] + pub fn sign_liquidation(&self, tx: Liquidation) -> Result { + let sig = self.inner.sign_liquidation(tx.inner)?; + Ok(to_string(&sig.tx)?) + } +} + +#[frb(opaque)] +pub struct ChangePubKey { + pub inner: InnerChangePubKey, +} + +impl ChangePubKey { + #[frb(sync)] + pub fn new( + chain_id: u8, + account_id: u32, + sub_account_id: u8, + new_pubkey_hash: String, + fee_token: u32, + fee: String, + nonce: u32, + eth_signature: Option, + ts: Option, + ) -> Result { + let ts = if let Some(time_stamp) = ts { + time_stamp + } else { + UNIX_EPOCH.elapsed().unwrap().as_secs() as u32 + }; + let eth_signature = if let Some(s) = eth_signature { + Some(PackedEthSignature::from_hex(&s)?) + } else { + None + }; + Ok(Self { + inner: ChangePubKeyBuilder { + chain_id: chain_id.into(), + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + new_pubkey_hash: PubKeyHash::from_hex(&new_pubkey_hash)?, + fee_token: fee_token.into(), + fee: BigUint::from_str(&fee)?, + nonce: nonce.into(), + eth_signature, + timestamp: ts.into(), + } + .build(), + }) + } + + #[frb(sync)] + pub fn to_eip712_request_payload(&self, chain_id: u32, address: String) -> Result { + let eth_data = self + .inner + .to_eip712_request_payload(chain_id, &ZkLinkAddress::from_hex(&address)?)?; + Ok(to_string(ð_data)?) + } + + #[frb(sync)] + pub fn get_eth_sign_msg(&self, nonce: u32, account_id: u32) -> String { + format!( + "ChangePubKey\nPubKeyHash: {}\nNonce: {}\nAccountId: {}", + self.inner.new_pk_hash.as_hex(), + nonce, + account_id + ) + } + + #[frb(sync)] + pub fn set_eth_auth_data(&mut self, sig: String) -> Result<()> { + let eth_signature = PackedEthSignature::from_hex(&sig)?; + let eth_authdata = ChangePubKeyAuthData::EthECDSA { eth_signature }; + self.inner.eth_auth_data = eth_authdata; + Ok(()) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct Transfer { + pub inner: InnerTransfer, +} + +impl Transfer { + #[frb(sync)] + pub fn new( + account_id: u32, + to_address: String, + from_sub_account_id: u8, + to_sub_account_id: u8, + token: u32, + fee: String, + amount: String, + nonce: u32, + ts: Option, + ) -> Result { + let ts = if let Some(time_stamp) = ts { + time_stamp + } else { + UNIX_EPOCH.elapsed().unwrap().as_secs() as u32 + }; + Ok(Self { + inner: TransferBuilder { + account_id: account_id.into(), + to_address: ZkLinkAddress::from_hex(&to_address)?, + from_sub_account_id: from_sub_account_id.into(), + to_sub_account_id: to_sub_account_id.into(), + token: token.into(), + fee: BigUint::from_str(&fee)?, + nonce: nonce.into(), + timestamp: ts.into(), + amount: BigUint::from_str(&amount)?, + } + .build(), + }) + } + + #[frb(sync)] + pub fn get_eth_sign_msg(&self, token_symbol: String) -> String { + self.inner.get_eth_sign_msg(&token_symbol) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct Withdraw { + pub inner: InnerWithdraw, +} + +impl Withdraw { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + to_chain_id: u8, + to_address: String, + l2_source_token: u32, + l1_target_token: u32, + amount: String, + call_data: Option, + fee: String, + nonce: u32, + withdraw_to_l1: bool, + withdraw_fee_ratio: u16, + ts: Option, + ) -> Result { + let ts = if let Some(time_stamp) = ts { + time_stamp + } else { + UNIX_EPOCH.elapsed().unwrap().as_secs() as u32 + }; + let call_data = if let Some(call_data) = call_data { + Some(hex::decode(call_data.trim_start_matches("0x"))?) + } else { + None + }; + Ok(Self { + inner: WithdrawBuilder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + to_chain_id: to_chain_id.into(), + to_address: ZkLinkAddress::from_hex(&to_address)?, + l2_source_token: l2_source_token.into(), + l1_target_token: l1_target_token.into(), + amount: BigUint::from_str(&amount)?, + call_data, + fee: BigUint::from_str(&fee)?, + nonce: nonce.into(), + withdraw_to_l1, + withdraw_fee_ratio, + timestamp: ts.into(), + } + .build(), + }) + } + + #[frb(sync)] + pub fn get_eth_sign_msg(&self, token_symbol: String) -> String { + self.inner.get_eth_sign_msg(&token_symbol) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct ForcedExit { + pub inner: InnerForcedExit, +} + +impl ForcedExit { + #[frb(sync)] + pub fn new( + to_chain_id: u8, + initiator_account_id: u32, + initiator_sub_account_id: u8, + target_sub_account_id: u8, + target: String, + l2_source_token: u32, + l1_target_token: u32, + exit_amount: String, + initiator_nonce: u32, + withdraw_to_l1: bool, + ts: Option, + ) -> Result { + let ts = if let Some(time_stamp) = ts { + time_stamp + } else { + UNIX_EPOCH.elapsed().unwrap().as_secs() as u32 + }; + Ok(Self { + inner: ForcedExitBuilder { + to_chain_id: to_chain_id.into(), + initiator_account_id: initiator_account_id.into(), + initiator_sub_account_id: initiator_sub_account_id.into(), + target: ZkLinkAddress::from_hex(&target)?, + l2_source_token: l2_source_token.into(), + timestamp: ts.into(), + l1_target_token: l1_target_token.into(), + initiator_nonce: initiator_nonce.into(), + target_sub_account_id: target_sub_account_id.into(), + withdraw_to_l1, + exit_amount: BigUint::from_str(&exit_amount)?, + } + .build(), + }) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct ContractPrice { + pub inner: InnerContractPrice, +} + +impl ContractPrice { + #[frb(sync)] + pub fn new(pair_id: u16, market_price: String) -> Result { + Ok(Self { + inner: InnerContractPrice { + pair_id: pair_id.into(), + market_price: BigUint::from_str(&market_price)?, + }, + }) + } +} + +#[frb(opaque)] +pub struct SpotPriceInfo { + pub inner: InnerSpotPriceInfo, +} + +impl SpotPriceInfo { + #[frb(sync)] + pub fn new(token_id: u32, price: String) -> Result { + Ok(Self { + inner: InnerSpotPriceInfo { + token_id: token_id.into(), + price: BigUint::from_str(&price)?, + }, + }) + } +} + +#[frb(opaque)] +pub struct Order { + pub inner: InnerOrder, +} + +impl Order { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + slot_id: u32, + nonce: u32, + base_token_id: u32, + quote_token_id: u32, + amount: String, + price: String, + is_sell: bool, + maker_fee_rate: u8, + taker_fee_rate: u8, + has_subsidy: bool, + ) -> Result { + Ok(Self { + inner: InnerOrder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + slot_id: slot_id.into(), + nonce: nonce.into(), + base_token_id: base_token_id.into(), + quote_token_id: quote_token_id.into(), + amount: BigUint::from_str(&amount)?, + price: BigUint::from_str(&price)?, + is_sell: is_sell as u8, + fee_rates: [maker_fee_rate, taker_fee_rate], + has_subsidy: has_subsidy as u8, + signature: Default::default(), + }, + }) + } +} + +#[frb(opaque)] +pub struct OrderMatching { + pub inner: InnerOrderMatching, +} + +impl OrderMatching { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + taker: Order, + maker: Order, + fee: String, + fee_token: u32, + contract_prices: Vec, + margin_prices: Vec, + expect_base_amount: String, + expect_quote_amount: String, + ) -> Result { + let contract_prices = contract_prices.iter().map(|e| e.inner.clone()).collect(); + let margin_prices = margin_prices.iter().map(|e| e.inner.clone()).collect(); + Ok(Self { + inner: OrderMatchingBuilder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + taker: taker.inner, + fee: BigUint::from_str(&fee)?, + fee_token: fee_token.into(), + expect_base_amount: BigUint::from_str(&expect_base_amount)?, + maker: maker.inner, + expect_quote_amount: BigUint::from_str(&expect_quote_amount)?, + contract_prices, + margin_prices, + } + .build(), + }) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct Contract { + pub inner: InnerContract, +} + +impl Contract { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + slot_id: u32, + nonce: u32, + pair_id: u16, + size: String, + price: String, + direction: bool, + maker_fee_rate: u8, + taker_fee_rate: u8, + has_subsidy: bool, + ) -> Result { + Ok(Self { + inner: ContractBuilder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + slot_id: slot_id.into(), + nonce: nonce.into(), + pair_id: pair_id.into(), + size: BigUint::from_str(&size)?, + price: BigUint::from_str(&price)?, + direction, + maker_fee_rate, + taker_fee_rate, + has_subsidy, + } + .build(), + }) + } +} + +#[frb(opaque)] +pub struct ContractMatching { + pub inner: InnerContractMatching, +} + +impl ContractMatching { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + taker: Contract, + maker: Vec, + fee: String, + fee_token: u16, + contract_prices: Vec, + margin_prices: Vec, + ) -> Result { + let maker = maker.iter().map(|e| e.inner.clone()).collect(); + let contract_prices = contract_prices.iter().map(|e| e.inner.clone()).collect(); + let margin_prices = margin_prices.iter().map(|e| e.inner.clone()).collect(); + Ok(Self { + inner: ContractMatchingBuilder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + taker: taker.inner, + maker, + fee: BigUint::from_str(&fee)?, + fee_token: fee_token.into(), + contract_prices, + margin_prices, + } + .build(), + }) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct AutoDeleveraging { + pub inner: InnerAutoDeleveraging, +} + +impl AutoDeleveraging { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + sub_account_nonce: u32, + contract_prices: Vec, + margin_prices: Vec, + adl_account_id: u32, + pair_id: u16, + adl_size: String, + adl_price: String, + fee: String, + fee_token: u16, + ) -> Result { + let contract_prices = contract_prices.iter().map(|e| e.inner.clone()).collect(); + let margin_prices = margin_prices.iter().map(|e| e.inner.clone()).collect(); + Ok(Self { + inner: AutoDeleveragingBuilder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + sub_account_nonce: sub_account_nonce.into(), + contract_prices, + margin_prices, + adl_account_id: adl_account_id.into(), + pair_id: pair_id.into(), + adl_size: BigUint::from_str(&adl_size)?, + adl_price: BigUint::from_str(&adl_price)?, + fee: BigUint::from_str(&fee)?, + fee_token: fee_token.into(), + } + .build(), + }) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct Funding { + pub inner: InnerFunding, +} + +impl Funding { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + sub_account_nonce: u32, + funding_account_ids: Vec, + fee: String, + fee_token: u16, + ) -> Result { + let funding_account_ids = funding_account_ids + .iter() + .map(|id| (*id).into()) + .collect::>(); + Ok(Self { + inner: FundingBuilder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + sub_account_nonce: sub_account_nonce.into(), + fee: BigUint::from_str(&fee)?, + fee_token: fee_token.into(), + funding_account_ids, + } + .build(), + }) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct Liquidation { + pub inner: InnerLiquidation, +} + +impl Liquidation { + #[frb(sync)] + pub fn new( + account_id: u32, + sub_account_id: u8, + sub_account_nonce: u32, + contract_prices: Vec, + margin_prices: Vec, + liquidation_account_id: u32, + fee: String, + fee_token: u16, + ) -> Result { + let contract_prices = contract_prices.iter().map(|e| e.inner.clone()).collect(); + let margin_prices = margin_prices.iter().map(|e| e.inner.clone()).collect(); + Ok(Self { + inner: LiquidationBuilder { + account_id: account_id.into(), + sub_account_id: sub_account_id.into(), + sub_account_nonce: sub_account_nonce.into(), + contract_prices, + margin_prices, + liquidation_account_id: liquidation_account_id.into(), + fee: BigUint::from_str(&fee)?, + fee_token: fee_token.into(), + } + .build(), + }) + } + + tx_default!(); +} + +#[frb(opaque)] +pub struct FundingInfo { + pub inner: InnerFundingInfo, +} + +impl FundingInfo { + #[frb(sync)] + pub fn new(pair_id: u16, price: String, funding_rate: i16) -> Result { + Ok(Self { + inner: InnerFundingInfo { + pair_id: pair_id.into(), + price: BigUint::from_str(&price)?, + funding_rate, + }, + }) + } +} + +#[frb(opaque)] +pub struct Parameter { + pub inner: InnerParameter, +} + +impl Parameter { + #[frb(sync)] + pub fn fee_account(account_id: u32) -> Result { + Ok(Self { + inner: InnerParameter::FeeAccount { + account_id: account_id.into(), + }, + }) + } + + #[frb(sync)] + pub fn insurance_fund_account(account_id: u32) -> Result { + Ok(Self { + inner: InnerParameter::InsuranceFundAccount { + account_id: account_id.into(), + }, + }) + } + + #[allow(unused_variables)] + #[frb(sync)] + pub fn margin_info( + margin_id: u8, + symbol: Option, + token_id: u32, + ratio: u8, + ) -> Result { + Ok(Self { + inner: InnerParameter::MarginInfo { + margin_id: margin_id.into(), + token_id: token_id.into(), + ratio, + }, + }) + } + + #[frb(sync)] + pub fn funding_infos(infos: Vec) -> Result { + let infos = infos.iter().map(|e| e.inner.clone()).collect(); + Ok(Self { + inner: InnerParameter::FundingInfos { infos }, + }) + } + + #[frb(sync)] + pub fn contract_info( + pair_id: u16, + symbol: String, + initial_margin_rate: u16, + maintenance_margin_rate: u16, + ) -> Result { + Ok(Self { + inner: InnerParameter::ContractInfo { + pair_id: pair_id.into(), + symbol, + initial_margin_rate, + maintenance_margin_rate, + }, + }) + } +} + +#[frb(opaque)] +pub struct UpdateGlobalVar { + pub inner: InnerUpdateGlobalVar, +} + +impl UpdateGlobalVar { + #[frb(sync)] + pub fn new( + from_chain_id: u8, + sub_account_id: u8, + parameter: Parameter, + serial_id: f64, + ) -> Result { + Ok(Self { + inner: UpdateGlobalVarBuilder { + from_chain_id: from_chain_id.into(), + sub_account_id: sub_account_id.into(), + parameter: parameter.inner, + serial_id: serial_id as u64, + } + .build(), + }) + } + + #[frb(sync)] + pub fn to_json(&self) -> Result { + Ok(to_string(&self.inner)?) + } +} + +#[frb(opaque)] +pub struct EthTxOption { + pub inner: InnerEthTxOption, +} + +impl EthTxOption { + #[frb(sync)] + pub fn new( + is_support_eip1559: bool, + to: String, + nonce: Option, + value: Option, + gas: Option, + gas_price: Option, + ) -> Result { + let value = if let Some(v) = value { + Some(BigUint::from_str(&v)?) + } else { + None + }; + let gas_price = if let Some(g) = gas_price { + Some(BigUint::from_str(&g)?) + } else { + None + }; + Ok(Self { + inner: InnerEthTxOption { + is_support_eip1559, + to: ZkLinkAddress::from_hex(&to)?, + nonce: nonce.map(|n| n as u64), + value, + gas: gas.map(|g| g as u64), + gas_price, + }, + }) + } +} + +#[frb(opaque)] +pub struct Wallet { + pub inner: InnerWallet, +} + +impl Wallet { + #[frb(sync)] + pub fn new(url: String, private_key: String) -> Result { + Ok(Self { + inner: InnerWallet::new(&url, &private_key), + }) + } + + pub async fn get_balance(&self) -> Result { + let balance = self.inner.get_balance().await?; + Ok(balance.to_string()) + } + + pub async fn get_nonce(&self, block_number: String) -> Result { + let nonce = self.inner.get_nonce(block_number).await?; + Ok(nonce.as_u64() as f64) + } + + pub async fn get_deposit_fee(&self, eth_params: EthTxOption) -> Result { + let fee = self.inner.get_fee(eth_params.inner).await?; + Ok(fee.to_string()) + } + + pub async fn wait_for_transaction(&self, tx_hash: String, timeout: Option) -> Result { + let tx_hash = H256::from_str(&tx_hash)?; + let status = self.inner.wait_for_transaction(tx_hash, timeout).await?; + Ok(status as u8) + } + + pub async fn approve_erc20( + &self, + contract: String, + amount: String, + eth_params: EthTxOption, + ) -> Result { + let contract = ZkLinkAddress::from_hex(&contract)?; + let amount = BigUint::from_str(&amount)?; + let tx_hash = self + .inner + .approve_erc20(contract, amount, eth_params.inner) + .await?; + Ok(hex::encode(tx_hash.as_bytes())) + } + + pub async fn deposit_erc20( + &self, + sub_account_id: u8, + deposit_to: String, + token_addr: String, + amount: String, + mapping: bool, + eth_params: EthTxOption, + is_gateway: bool, + ) -> Result { + let deposit_to = ZkLinkAddress::from_hex(&deposit_to)?; + let token_addr = ZkLinkAddress::from_hex(&token_addr)?; + let amount = BigUint::from_str(&amount)?; + let tx_hash = if !is_gateway { + self.inner + .deposit_erc20_to_layer1( + sub_account_id, + deposit_to, + token_addr, + amount, + mapping, + eth_params.inner, + ) + .await? + } else { + self.inner + .deposit_erc20_to_gateway( + sub_account_id, + deposit_to, + token_addr, + amount, + mapping, + eth_params.inner, + ) + .await? + }; + Ok(hex::encode(tx_hash.as_bytes())) + } + + pub async fn deposit_eth( + &self, + sub_account_id: u8, + deposit_to: String, + eth_params: EthTxOption, + is_gateway: bool, + ) -> Result { + let deposit_to = ZkLinkAddress::from_hex(&deposit_to)?; + let tx_hash = if !is_gateway { + self.inner + .deposit_eth_to_layer1(sub_account_id, deposit_to, eth_params.inner) + .await? + } else { + self.inner + .deposit_eth_to_gateway(sub_account_id, deposit_to, eth_params.inner) + .await? + }; + Ok(hex::encode(tx_hash.as_bytes())) + } + + pub async fn set_auth_pubkey_hash( + &self, + nonce: f64, + new_pubkey_hash: String, + eth_params: EthTxOption, + ) -> Result { + let new_pubkey_hash = PubKeyHash::from_hex(&new_pubkey_hash)?; + let tx_hash = self + .inner + .set_auth_pubkey_hash(nonce as u64, new_pubkey_hash, eth_params.inner) + .await?; + Ok(hex::encode(tx_hash.as_bytes())) + } + + pub async fn full_exit( + &self, + account_id: u32, + sub_account_id: u8, + token_id: u16, + mapping: bool, + eth_params: EthTxOption, + ) -> Result { + let tx_hash = self + .inner + .full_exit( + account_id, + sub_account_id, + token_id, + mapping, + eth_params.inner, + ) + .await?; + Ok(hex::encode(tx_hash.as_bytes())) + } +} + +#[frb(init)] +pub fn init_app() { + flutter_rust_bridge::setup_default_user_utils(); +} diff --git a/bindings/dart/rust/src/frb_generated.io.rs b/bindings/dart/rust/src/frb_generated.io.rs new file mode 100644 index 00000000..b760e893 --- /dev/null +++ b/bindings/dart/rust/src/frb_generated.io.rs @@ -0,0 +1,1904 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.32. + +// Section: imports + +use super::*; +use crate::api::*; +use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; +use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::{Handler, IntoIntoDart}; + +// Section: boilerplate + +flutter_rust_bridge::frb_generated_boilerplate_io!(); + +// Section: dart2rust + +impl CstDecode + for *mut wire_cst_list_prim_u_8_strict +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> flutter_rust_bridge::for_generated::anyhow::Error { + unimplemented!() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> AutoDeleveraging { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> ChangePubKey { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Contract { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> ContractMatching { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> ContractPrice { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> EthTxOption { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> ForcedExit { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Funding { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> FundingInfo { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Liquidation { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Order { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> OrderMatching { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Parameter { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Signer { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> SpotPriceInfo { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Transfer { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> UpdateGlobalVar { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Wallet { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Withdraw { + CstDecode::>>::cst_decode(self).rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> ZkLinkSignature { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> ZkLinkSigner { + CstDecode::< + RustOpaqueNom>, + >::cst_decode(self) + .rust_auto_opaque_decode_owned() + } +} +impl + CstDecode< + RustOpaqueNom>, + > for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> + { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl + CstDecode< + RustOpaqueNom>, + > for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> + { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl + CstDecode< + RustOpaqueNom>, + > for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> + { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl + CstDecode< + RustOpaqueNom>, + > for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> + { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode>> + for usize +{ + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode( + self, + ) -> RustOpaqueNom> { + unsafe { decode_rust_opaque_nom(self as _) } + } +} +impl CstDecode for *mut wire_cst_list_prim_u_8_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> String { + let vec: Vec = self.cst_decode(); + String::from_utf8(vec).unwrap() + } +} +impl CstDecode for *mut f64 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> f64 { + unsafe { *flutter_rust_bridge::for_generated::box_from_leak_ptr(self) } + } +} +impl CstDecode for *mut u32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u32 { + unsafe { *flutter_rust_bridge::for_generated::box_from_leak_ptr(self) } + } +} +impl CstDecode> for *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } + } +impl CstDecode> for *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } + } +impl CstDecode> for *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } + } +impl CstDecode> for *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } + } +impl CstDecode> for *mut wire_cst_list_prim_u_32_loose { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + } + } +} +impl CstDecode> for *mut wire_cst_list_prim_u_32_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + } + } +} +impl CstDecode> for *mut wire_cst_list_prim_u_8_loose { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + } + } +} +impl CstDecode> for *mut wire_cst_list_prim_u_8_strict { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + } + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_AutoDeleveraging_new( + account_id: u32, + sub_account_id: u8, + sub_account_nonce: u32, + contract_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice, + margin_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo, + adl_account_id: u32, + pair_id: u16, + adl_size: *mut wire_cst_list_prim_u_8_strict, + adl_price: *mut wire_cst_list_prim_u_8_strict, + fee: *mut wire_cst_list_prim_u_8_strict, + fee_token: u16, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_AutoDeleveraging_new_impl( + account_id, + sub_account_id, + sub_account_nonce, + contract_prices, + margin_prices, + adl_account_id, + pair_id, + adl_size, + adl_price, + fee, + fee_token, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_AutoDeleveraging_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_AutoDeleveraging_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_AutoDeleveraging_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_AutoDeleveraging_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ChangePubKey_get_eth_sign_msg( + that: usize, + nonce: u32, + account_id: u32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ChangePubKey_get_eth_sign_msg_impl(that, nonce, account_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ChangePubKey_new( + chain_id: u8, + account_id: u32, + sub_account_id: u8, + new_pubkey_hash: *mut wire_cst_list_prim_u_8_strict, + fee_token: u32, + fee: *mut wire_cst_list_prim_u_8_strict, + nonce: u32, + eth_signature: *mut wire_cst_list_prim_u_8_strict, + ts: *mut u32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ChangePubKey_new_impl( + chain_id, + account_id, + sub_account_id, + new_pubkey_hash, + fee_token, + fee, + nonce, + eth_signature, + ts, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ChangePubKey_set_eth_auth_data( + that: usize, + sig: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ChangePubKey_set_eth_auth_data_impl(that, sig) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ChangePubKey_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ChangePubKey_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ChangePubKey_to_eip712_request_payload( + that: usize, + chain_id: u32, + address: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ChangePubKey_to_eip712_request_payload_impl(that, chain_id, address) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ChangePubKey_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ChangePubKey_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ContractMatching_new( + account_id: u32, + sub_account_id: u8, + taker: usize, + maker: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract, + fee: *mut wire_cst_list_prim_u_8_strict, + fee_token: u16, + contract_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice, + margin_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ContractMatching_new_impl( + account_id, + sub_account_id, + taker, + maker, + fee, + fee_token, + contract_prices, + margin_prices, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ContractMatching_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ContractMatching_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ContractMatching_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ContractMatching_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ContractPrice_new( + pair_id: u16, + market_price: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ContractPrice_new_impl(pair_id, market_price) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Contract_new( + account_id: u32, + sub_account_id: u8, + slot_id: u32, + nonce: u32, + pair_id: u16, + size: *mut wire_cst_list_prim_u_8_strict, + price: *mut wire_cst_list_prim_u_8_strict, + direction: bool, + maker_fee_rate: u8, + taker_fee_rate: u8, + has_subsidy: bool, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Contract_new_impl( + account_id, + sub_account_id, + slot_id, + nonce, + pair_id, + size, + price, + direction, + maker_fee_rate, + taker_fee_rate, + has_subsidy, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_EthTxOption_new( + is_support_eip1559: bool, + to: *mut wire_cst_list_prim_u_8_strict, + nonce: *mut f64, + value: *mut wire_cst_list_prim_u_8_strict, + gas: *mut f64, + gas_price: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_EthTxOption_new_impl(is_support_eip1559, to, nonce, value, gas, gas_price) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ForcedExit_new( + to_chain_id: u8, + initiator_account_id: u32, + initiator_sub_account_id: u8, + target_sub_account_id: u8, + target: *mut wire_cst_list_prim_u_8_strict, + l2_source_token: u32, + l1_target_token: u32, + exit_amount: *mut wire_cst_list_prim_u_8_strict, + initiator_nonce: u32, + withdraw_to_l1: bool, + ts: *mut u32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ForcedExit_new_impl( + to_chain_id, + initiator_account_id, + initiator_sub_account_id, + target_sub_account_id, + target, + l2_source_token, + l1_target_token, + exit_amount, + initiator_nonce, + withdraw_to_l1, + ts, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ForcedExit_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ForcedExit_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ForcedExit_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ForcedExit_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_FundingInfo_new( + pair_id: u16, + price: *mut wire_cst_list_prim_u_8_strict, + funding_rate: i16, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_FundingInfo_new_impl(pair_id, price, funding_rate) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Funding_new( + account_id: u32, + sub_account_id: u8, + sub_account_nonce: u32, + funding_account_ids: *mut wire_cst_list_prim_u_32_loose, + fee: *mut wire_cst_list_prim_u_8_strict, + fee_token: u16, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Funding_new_impl( + account_id, + sub_account_id, + sub_account_nonce, + funding_account_ids, + fee, + fee_token, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Funding_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Funding_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Funding_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Funding_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Liquidation_new( + account_id: u32, + sub_account_id: u8, + sub_account_nonce: u32, + contract_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice, + margin_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo, + liquidation_account_id: u32, + fee: *mut wire_cst_list_prim_u_8_strict, + fee_token: u16, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Liquidation_new_impl( + account_id, + sub_account_id, + sub_account_nonce, + contract_prices, + margin_prices, + liquidation_account_id, + fee, + fee_token, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Liquidation_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Liquidation_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Liquidation_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Liquidation_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_OrderMatching_new( + account_id: u32, + sub_account_id: u8, + taker: usize, + maker: usize, + fee: *mut wire_cst_list_prim_u_8_strict, + fee_token: u32, + contract_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice, + margin_prices: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo, + expect_base_amount: *mut wire_cst_list_prim_u_8_strict, + expect_quote_amount: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_OrderMatching_new_impl( + account_id, + sub_account_id, + taker, + maker, + fee, + fee_token, + contract_prices, + margin_prices, + expect_base_amount, + expect_quote_amount, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_OrderMatching_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_OrderMatching_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_OrderMatching_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_OrderMatching_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Order_new( + account_id: u32, + sub_account_id: u8, + slot_id: u32, + nonce: u32, + base_token_id: u32, + quote_token_id: u32, + amount: *mut wire_cst_list_prim_u_8_strict, + price: *mut wire_cst_list_prim_u_8_strict, + is_sell: bool, + maker_fee_rate: u8, + taker_fee_rate: u8, + has_subsidy: bool, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Order_new_impl( + account_id, + sub_account_id, + slot_id, + nonce, + base_token_id, + quote_token_id, + amount, + price, + is_sell, + maker_fee_rate, + taker_fee_rate, + has_subsidy, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Parameter_contract_info( + pair_id: u16, + symbol: *mut wire_cst_list_prim_u_8_strict, + initial_margin_rate: u16, + maintenance_margin_rate: u16, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Parameter_contract_info_impl( + pair_id, + symbol, + initial_margin_rate, + maintenance_margin_rate, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Parameter_fee_account( + account_id: u32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Parameter_fee_account_impl(account_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Parameter_funding_infos( + infos: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Parameter_funding_infos_impl(infos) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Parameter_insurance_fund_account( + account_id: u32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Parameter_insurance_fund_account_impl(account_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Parameter_margin_info( + margin_id: u8, + symbol: *mut wire_cst_list_prim_u_8_strict, + token_id: u32, + ratio: u8, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Parameter_margin_info_impl(margin_id, symbol, token_id, ratio) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_create_signed_contract( + that: usize, + contract: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_create_signed_contract_impl(that, contract) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_create_signed_order( + that: usize, + order: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_create_signed_order_impl(that, order) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_eth_signer( + eth_private_key: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_eth_signer_impl(eth_private_key) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_auto_deleveraging( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_auto_deleveraging_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_change_pubkey_with_create2data_auth( + that: usize, + tx: usize, + creator_address: *mut wire_cst_list_prim_u_8_strict, + salt_arg: *mut wire_cst_list_prim_u_8_strict, + code_hash: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_change_pubkey_with_create2data_auth_impl( + that, + tx, + creator_address, + salt_arg, + code_hash, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_change_pubkey_with_onchain( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_change_pubkey_with_onchain_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_contract_matching( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_contract_matching_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_forced_exit( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_forced_exit_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_funding( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_funding_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_liquidation( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_liquidation_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_order_matching( + that: usize, + tx: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_order_matching_impl(that, tx) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_transfer( + that: usize, + tx: usize, + token_symbol: *mut wire_cst_list_prim_u_8_strict, + chain_id: *mut wire_cst_list_prim_u_8_strict, + addr: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_transfer_impl(that, tx, token_symbol, chain_id, addr) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_sign_withdraw( + that: usize, + tx: usize, + token_symbol: *mut wire_cst_list_prim_u_8_strict, + chain_id: *mut wire_cst_list_prim_u_8_strict, + addr: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_sign_withdraw_impl(that, tx, token_symbol, chain_id, addr) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Signer_starknet_signer( + eth_private_key: *mut wire_cst_list_prim_u_8_strict, + starknet_chain_id: *mut wire_cst_list_prim_u_8_strict, + starknet_addr: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Signer_starknet_signer_impl(eth_private_key, starknet_chain_id, starknet_addr) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_SpotPriceInfo_new( + token_id: u32, + price: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_SpotPriceInfo_new_impl(token_id, price) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Transfer_get_eth_sign_msg( + that: usize, + token_symbol: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Transfer_get_eth_sign_msg_impl(that, token_symbol) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Transfer_new( + account_id: u32, + to_address: *mut wire_cst_list_prim_u_8_strict, + from_sub_account_id: u8, + to_sub_account_id: u8, + token: u32, + fee: *mut wire_cst_list_prim_u_8_strict, + amount: *mut wire_cst_list_prim_u_8_strict, + nonce: u32, + ts: *mut u32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Transfer_new_impl( + account_id, + to_address, + from_sub_account_id, + to_sub_account_id, + token, + fee, + amount, + nonce, + ts, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Transfer_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Transfer_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Transfer_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Transfer_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_UpdateGlobalVar_new( + from_chain_id: u8, + sub_account_id: u8, + parameter: usize, + serial_id: f64, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_UpdateGlobalVar_new_impl(from_chain_id, sub_account_id, parameter, serial_id) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_UpdateGlobalVar_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_UpdateGlobalVar_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_approve_erc20( + port_: i64, + that: usize, + contract: *mut wire_cst_list_prim_u_8_strict, + amount: *mut wire_cst_list_prim_u_8_strict, + eth_params: usize, +) { + wire_Wallet_approve_erc20_impl(port_, that, contract, amount, eth_params) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_deposit_erc20( + port_: i64, + that: usize, + sub_account_id: u8, + deposit_to: *mut wire_cst_list_prim_u_8_strict, + token_addr: *mut wire_cst_list_prim_u_8_strict, + amount: *mut wire_cst_list_prim_u_8_strict, + mapping: bool, + eth_params: usize, + is_gateway: bool, +) { + wire_Wallet_deposit_erc20_impl( + port_, + that, + sub_account_id, + deposit_to, + token_addr, + amount, + mapping, + eth_params, + is_gateway, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_deposit_eth( + port_: i64, + that: usize, + sub_account_id: u8, + deposit_to: *mut wire_cst_list_prim_u_8_strict, + eth_params: usize, + is_gateway: bool, +) { + wire_Wallet_deposit_eth_impl( + port_, + that, + sub_account_id, + deposit_to, + eth_params, + is_gateway, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_full_exit( + port_: i64, + that: usize, + account_id: u32, + sub_account_id: u8, + token_id: u16, + mapping: bool, + eth_params: usize, +) { + wire_Wallet_full_exit_impl( + port_, + that, + account_id, + sub_account_id, + token_id, + mapping, + eth_params, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_get_balance(port_: i64, that: usize) { + wire_Wallet_get_balance_impl(port_, that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_get_deposit_fee( + port_: i64, + that: usize, + eth_params: usize, +) { + wire_Wallet_get_deposit_fee_impl(port_, that, eth_params) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_get_nonce( + port_: i64, + that: usize, + block_number: *mut wire_cst_list_prim_u_8_strict, +) { + wire_Wallet_get_nonce_impl(port_, that, block_number) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_new( + url: *mut wire_cst_list_prim_u_8_strict, + private_key: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Wallet_new_impl(url, private_key) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_set_auth_pubkey_hash( + port_: i64, + that: usize, + nonce: f64, + new_pubkey_hash: *mut wire_cst_list_prim_u_8_strict, + eth_params: usize, +) { + wire_Wallet_set_auth_pubkey_hash_impl(port_, that, nonce, new_pubkey_hash, eth_params) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Wallet_wait_for_transaction( + port_: i64, + that: usize, + tx_hash: *mut wire_cst_list_prim_u_8_strict, + timeout: *mut u32, +) { + wire_Wallet_wait_for_transaction_impl(port_, that, tx_hash, timeout) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Withdraw_get_eth_sign_msg( + that: usize, + token_symbol: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Withdraw_get_eth_sign_msg_impl(that, token_symbol) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Withdraw_new( + account_id: u32, + sub_account_id: u8, + to_chain_id: u8, + to_address: *mut wire_cst_list_prim_u_8_strict, + l2_source_token: u32, + l1_target_token: u32, + amount: *mut wire_cst_list_prim_u_8_strict, + call_data: *mut wire_cst_list_prim_u_8_strict, + fee: *mut wire_cst_list_prim_u_8_strict, + nonce: u32, + withdraw_to_l1: bool, + withdraw_fee_ratio: u16, + ts: *mut u32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Withdraw_new_impl( + account_id, + sub_account_id, + to_chain_id, + to_address, + l2_source_token, + l1_target_token, + amount, + call_data, + fee, + nonce, + withdraw_to_l1, + withdraw_fee_ratio, + ts, + ) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Withdraw_sign( + that: usize, + zk_link_signer: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Withdraw_sign_impl(that, zk_link_signer) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_Withdraw_to_json( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_Withdraw_to_json_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ZkLinkSignature_get_pubkey( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ZkLinkSignature_get_pubkey_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ZkLinkSignature_get_signature( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ZkLinkSignature_get_signature_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ZkLinkSigner_eth_sig( + sig: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ZkLinkSigner_eth_sig_impl(sig) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ZkLinkSigner_get_pubkey( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ZkLinkSigner_get_pubkey_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ZkLinkSigner_get_pubkey_hash( + that: usize, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ZkLinkSigner_get_pubkey_hash_impl(that) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ZkLinkSigner_sign_musig( + that: usize, + msg: *mut wire_cst_list_prim_u_8_loose, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ZkLinkSigner_sign_musig_impl(that, msg) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_ZkLinkSigner_starknet_sig( + sig: *mut wire_cst_list_prim_u_8_strict, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + wire_ZkLinkSigner_starknet_sig_impl(sig) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_wire_init_app(port_: i64) { + wire_init_app_impl(port_) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockAutoDeleveraging( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockChangePubKey( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractMatching( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockEthTxOption( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockForcedExit( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFunding( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockLiquidation( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrder( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockOrderMatching( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockParameter( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSigner( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockTransfer( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockUpdateGlobalVar( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWallet( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockWithdraw( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSignature( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::increment_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockZkLinkSigner( + ptr: *const std::ffi::c_void, +) { + unsafe { + StdArc::>::decrement_strong_count(ptr as _); + } +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_box_autoadd_f_64(value: f64) -> *mut f64 { + flutter_rust_bridge::for_generated::new_leak_box_ptr(value) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_box_autoadd_u_32(value: u32) -> *mut u32 { + flutter_rust_bridge::for_generated::new_leak_box_ptr(value) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract( + len: i32, +) -> *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract +{ + let wrap = wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract { ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), len }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice(len: i32) -> *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice{ + let wrap = wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice { ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), len }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo(len: i32) -> *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo{ + let wrap = wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo { ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), len }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo(len: i32) -> *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo{ + let wrap = wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo { ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), len }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_prim_u_32_loose( + len: i32, +) -> *mut wire_cst_list_prim_u_32_loose { + let ans = wire_cst_list_prim_u_32_loose { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_prim_u_32_strict( + len: i32, +) -> *mut wire_cst_list_prim_u_32_strict { + let ans = wire_cst_list_prim_u_32_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_prim_u_8_loose( + len: i32, +) -> *mut wire_cst_list_prim_u_8_loose { + let ans = wire_cst_list_prim_u_8_loose { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + +#[no_mangle] +pub extern "C" fn frbgen_zklink_cst_new_list_prim_u_8_strict( + len: i32, +) -> *mut wire_cst_list_prim_u_8_strict { + let ans = wire_cst_list_prim_u_8_strict { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(ans) +} + +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContract +{ + ptr: *mut usize, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockContractPrice +{ + ptr: *mut usize, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockFundingInfo +{ + ptr: *mut usize, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedrust_asyncRwLockSpotPriceInfo +{ + ptr: *mut usize, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_prim_u_32_loose { + ptr: *mut u32, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_prim_u_32_strict { + ptr: *mut u32, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_prim_u_8_loose { + ptr: *mut u8, + len: i32, +} +#[repr(C)] +#[derive(Clone, Copy)] +pub struct wire_cst_list_prim_u_8_strict { + ptr: *mut u8, + len: i32, +} diff --git a/bindings/dart/rust/src/frb_generated.rs b/bindings/dart/rust/src/frb_generated.rs new file mode 100644 index 00000000..abe08149 --- /dev/null +++ b/bindings/dart/rust/src/frb_generated.rs @@ -0,0 +1,3619 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.32. + +#![allow( + non_camel_case_types, + unused, + non_snake_case, + clippy::needless_return, + clippy::redundant_closure_call, + clippy::redundant_closure, + clippy::useless_conversion, + clippy::unit_arg, + clippy::unused_unit, + clippy::double_parens, + clippy::let_and_return, + clippy::too_many_arguments, + clippy::match_single_binding +)] + +// Section: imports + +use crate::api::*; +use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; +use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::{Handler, IntoIntoDart}; + +// Section: boilerplate + +flutter_rust_bridge::frb_generated_boilerplate!( + default_stream_sink_codec = DcoCodec, + default_rust_opaque = RustOpaqueNom, + default_rust_auto_opaque = RustAutoOpaqueNom, +); +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.32"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1188958908; + +// Section: executor + +flutter_rust_bridge::frb_generated_default_handler!(); + +// Section: wire_funcs + +fn wire_AutoDeleveraging_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + sub_account_nonce: impl CstDecode, + contract_prices: impl CstDecode>, + margin_prices: impl CstDecode>, + adl_account_id: impl CstDecode, + pair_id: impl CstDecode, + adl_size: impl CstDecode, + adl_price: impl CstDecode, + fee: impl CstDecode, + fee_token: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "AutoDeleveraging_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_sub_account_nonce = sub_account_nonce.cst_decode(); + let api_contract_prices = contract_prices.cst_decode(); + let api_margin_prices = margin_prices.cst_decode(); + let api_adl_account_id = adl_account_id.cst_decode(); + let api_pair_id = pair_id.cst_decode(); + let api_adl_size = adl_size.cst_decode(); + let api_adl_price = adl_price.cst_decode(); + let api_fee = fee.cst_decode(); + let api_fee_token = fee_token.cst_decode(); + transform_result_dco((move || { + crate::api::AutoDeleveraging::new( + api_account_id, + api_sub_account_id, + api_sub_account_nonce, + api_contract_prices, + api_margin_prices, + api_adl_account_id, + api_pair_id, + api_adl_size, + api_adl_price, + api_fee, + api_fee_token, + ) + })()) + }, + ) +} +fn wire_AutoDeleveraging_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "AutoDeleveraging_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::AutoDeleveraging::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_AutoDeleveraging_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "AutoDeleveraging_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::AutoDeleveraging::to_json(&api_that) + })()) + }, + ) +} +fn wire_ChangePubKey_get_eth_sign_msg_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + nonce: impl CstDecode, + account_id: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ChangePubKey_get_eth_sign_msg", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_account_id = account_id.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + Result::<_, ()>::Ok(crate::api::ChangePubKey::get_eth_sign_msg( + &api_that, + api_nonce, + api_account_id, + )) + })()) + }, + ) +} +fn wire_ChangePubKey_new_impl( + chain_id: impl CstDecode, + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + new_pubkey_hash: impl CstDecode, + fee_token: impl CstDecode, + fee: impl CstDecode, + nonce: impl CstDecode, + eth_signature: impl CstDecode>, + ts: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ChangePubKey_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_chain_id = chain_id.cst_decode(); + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_new_pubkey_hash = new_pubkey_hash.cst_decode(); + let api_fee_token = fee_token.cst_decode(); + let api_fee = fee.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_eth_signature = eth_signature.cst_decode(); + let api_ts = ts.cst_decode(); + transform_result_dco((move || { + crate::api::ChangePubKey::new( + api_chain_id, + api_account_id, + api_sub_account_id, + api_new_pubkey_hash, + api_fee_token, + api_fee, + api_nonce, + api_eth_signature, + api_ts, + ) + })()) + }, + ) +} +fn wire_ChangePubKey_set_eth_auth_data_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + sig: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ChangePubKey_set_eth_auth_data", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_sig = sig.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::ChangePubKey::set_eth_auth_data(&mut api_that, api_sig) + })()) + }, + ) +} +fn wire_ChangePubKey_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ChangePubKey_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::ChangePubKey::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_ChangePubKey_to_eip712_request_payload_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + chain_id: impl CstDecode, + address: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ChangePubKey_to_eip712_request_payload", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_chain_id = chain_id.cst_decode(); + let api_address = address.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::ChangePubKey::to_eip712_request_payload( + &api_that, + api_chain_id, + api_address, + ) + })()) + }, + ) +} +fn wire_ChangePubKey_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ChangePubKey_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::ChangePubKey::to_json(&api_that) + })()) + }, + ) +} +fn wire_ContractMatching_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + taker: impl CstDecode, + maker: impl CstDecode>, + fee: impl CstDecode, + fee_token: impl CstDecode, + contract_prices: impl CstDecode>, + margin_prices: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ContractMatching_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_taker = taker.cst_decode(); + let api_maker = maker.cst_decode(); + let api_fee = fee.cst_decode(); + let api_fee_token = fee_token.cst_decode(); + let api_contract_prices = contract_prices.cst_decode(); + let api_margin_prices = margin_prices.cst_decode(); + transform_result_dco((move || { + crate::api::ContractMatching::new( + api_account_id, + api_sub_account_id, + api_taker, + api_maker, + api_fee, + api_fee_token, + api_contract_prices, + api_margin_prices, + ) + })()) + }, + ) +} +fn wire_ContractMatching_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ContractMatching_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::ContractMatching::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_ContractMatching_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ContractMatching_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::ContractMatching::to_json(&api_that) + })()) + }, + ) +} +fn wire_ContractPrice_new_impl( + pair_id: impl CstDecode, + market_price: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ContractPrice_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_pair_id = pair_id.cst_decode(); + let api_market_price = market_price.cst_decode(); + transform_result_dco((move || { + crate::api::ContractPrice::new(api_pair_id, api_market_price) + })()) + }, + ) +} +fn wire_Contract_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + slot_id: impl CstDecode, + nonce: impl CstDecode, + pair_id: impl CstDecode, + size: impl CstDecode, + price: impl CstDecode, + direction: impl CstDecode, + maker_fee_rate: impl CstDecode, + taker_fee_rate: impl CstDecode, + has_subsidy: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Contract_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_slot_id = slot_id.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_pair_id = pair_id.cst_decode(); + let api_size = size.cst_decode(); + let api_price = price.cst_decode(); + let api_direction = direction.cst_decode(); + let api_maker_fee_rate = maker_fee_rate.cst_decode(); + let api_taker_fee_rate = taker_fee_rate.cst_decode(); + let api_has_subsidy = has_subsidy.cst_decode(); + transform_result_dco((move || { + crate::api::Contract::new( + api_account_id, + api_sub_account_id, + api_slot_id, + api_nonce, + api_pair_id, + api_size, + api_price, + api_direction, + api_maker_fee_rate, + api_taker_fee_rate, + api_has_subsidy, + ) + })()) + }, + ) +} +fn wire_EthTxOption_new_impl( + is_support_eip1559: impl CstDecode, + to: impl CstDecode, + nonce: impl CstDecode>, + value: impl CstDecode>, + gas: impl CstDecode>, + gas_price: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "EthTxOption_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_is_support_eip1559 = is_support_eip1559.cst_decode(); + let api_to = to.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_value = value.cst_decode(); + let api_gas = gas.cst_decode(); + let api_gas_price = gas_price.cst_decode(); + transform_result_dco((move || { + crate::api::EthTxOption::new( + api_is_support_eip1559, + api_to, + api_nonce, + api_value, + api_gas, + api_gas_price, + ) + })()) + }, + ) +} +fn wire_ForcedExit_new_impl( + to_chain_id: impl CstDecode, + initiator_account_id: impl CstDecode, + initiator_sub_account_id: impl CstDecode, + target_sub_account_id: impl CstDecode, + target: impl CstDecode, + l2_source_token: impl CstDecode, + l1_target_token: impl CstDecode, + exit_amount: impl CstDecode, + initiator_nonce: impl CstDecode, + withdraw_to_l1: impl CstDecode, + ts: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ForcedExit_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_to_chain_id = to_chain_id.cst_decode(); + let api_initiator_account_id = initiator_account_id.cst_decode(); + let api_initiator_sub_account_id = initiator_sub_account_id.cst_decode(); + let api_target_sub_account_id = target_sub_account_id.cst_decode(); + let api_target = target.cst_decode(); + let api_l2_source_token = l2_source_token.cst_decode(); + let api_l1_target_token = l1_target_token.cst_decode(); + let api_exit_amount = exit_amount.cst_decode(); + let api_initiator_nonce = initiator_nonce.cst_decode(); + let api_withdraw_to_l1 = withdraw_to_l1.cst_decode(); + let api_ts = ts.cst_decode(); + transform_result_dco((move || { + crate::api::ForcedExit::new( + api_to_chain_id, + api_initiator_account_id, + api_initiator_sub_account_id, + api_target_sub_account_id, + api_target, + api_l2_source_token, + api_l1_target_token, + api_exit_amount, + api_initiator_nonce, + api_withdraw_to_l1, + api_ts, + ) + })()) + }, + ) +} +fn wire_ForcedExit_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ForcedExit_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::ForcedExit::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_ForcedExit_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ForcedExit_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::ForcedExit::to_json(&api_that) + })()) + }, + ) +} +fn wire_FundingInfo_new_impl( + pair_id: impl CstDecode, + price: impl CstDecode, + funding_rate: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "FundingInfo_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_pair_id = pair_id.cst_decode(); + let api_price = price.cst_decode(); + let api_funding_rate = funding_rate.cst_decode(); + transform_result_dco((move || { + crate::api::FundingInfo::new(api_pair_id, api_price, api_funding_rate) + })()) + }, + ) +} +fn wire_Funding_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + sub_account_nonce: impl CstDecode, + funding_account_ids: impl CstDecode>, + fee: impl CstDecode, + fee_token: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Funding_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_sub_account_nonce = sub_account_nonce.cst_decode(); + let api_funding_account_ids = funding_account_ids.cst_decode(); + let api_fee = fee.cst_decode(); + let api_fee_token = fee_token.cst_decode(); + transform_result_dco((move || { + crate::api::Funding::new( + api_account_id, + api_sub_account_id, + api_sub_account_nonce, + api_funding_account_ids, + api_fee, + api_fee_token, + ) + })()) + }, + ) +} +fn wire_Funding_sign_impl( + that: impl CstDecode>>, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Funding_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::Funding::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_Funding_to_json_impl( + that: impl CstDecode>>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Funding_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Funding::to_json(&api_that) + })()) + }, + ) +} +fn wire_Liquidation_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + sub_account_nonce: impl CstDecode, + contract_prices: impl CstDecode>, + margin_prices: impl CstDecode>, + liquidation_account_id: impl CstDecode, + fee: impl CstDecode, + fee_token: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Liquidation_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_sub_account_nonce = sub_account_nonce.cst_decode(); + let api_contract_prices = contract_prices.cst_decode(); + let api_margin_prices = margin_prices.cst_decode(); + let api_liquidation_account_id = liquidation_account_id.cst_decode(); + let api_fee = fee.cst_decode(); + let api_fee_token = fee_token.cst_decode(); + transform_result_dco((move || { + crate::api::Liquidation::new( + api_account_id, + api_sub_account_id, + api_sub_account_nonce, + api_contract_prices, + api_margin_prices, + api_liquidation_account_id, + api_fee, + api_fee_token, + ) + })()) + }, + ) +} +fn wire_Liquidation_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Liquidation_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::Liquidation::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_Liquidation_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Liquidation_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Liquidation::to_json(&api_that) + })()) + }, + ) +} +fn wire_OrderMatching_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + taker: impl CstDecode, + maker: impl CstDecode, + fee: impl CstDecode, + fee_token: impl CstDecode, + contract_prices: impl CstDecode>, + margin_prices: impl CstDecode>, + expect_base_amount: impl CstDecode, + expect_quote_amount: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "OrderMatching_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_taker = taker.cst_decode(); + let api_maker = maker.cst_decode(); + let api_fee = fee.cst_decode(); + let api_fee_token = fee_token.cst_decode(); + let api_contract_prices = contract_prices.cst_decode(); + let api_margin_prices = margin_prices.cst_decode(); + let api_expect_base_amount = expect_base_amount.cst_decode(); + let api_expect_quote_amount = expect_quote_amount.cst_decode(); + transform_result_dco((move || { + crate::api::OrderMatching::new( + api_account_id, + api_sub_account_id, + api_taker, + api_maker, + api_fee, + api_fee_token, + api_contract_prices, + api_margin_prices, + api_expect_base_amount, + api_expect_quote_amount, + ) + })()) + }, + ) +} +fn wire_OrderMatching_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "OrderMatching_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::OrderMatching::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_OrderMatching_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "OrderMatching_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::OrderMatching::to_json(&api_that) + })()) + }, + ) +} +fn wire_Order_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + slot_id: impl CstDecode, + nonce: impl CstDecode, + base_token_id: impl CstDecode, + quote_token_id: impl CstDecode, + amount: impl CstDecode, + price: impl CstDecode, + is_sell: impl CstDecode, + maker_fee_rate: impl CstDecode, + taker_fee_rate: impl CstDecode, + has_subsidy: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Order_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_slot_id = slot_id.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_base_token_id = base_token_id.cst_decode(); + let api_quote_token_id = quote_token_id.cst_decode(); + let api_amount = amount.cst_decode(); + let api_price = price.cst_decode(); + let api_is_sell = is_sell.cst_decode(); + let api_maker_fee_rate = maker_fee_rate.cst_decode(); + let api_taker_fee_rate = taker_fee_rate.cst_decode(); + let api_has_subsidy = has_subsidy.cst_decode(); + transform_result_dco((move || { + crate::api::Order::new( + api_account_id, + api_sub_account_id, + api_slot_id, + api_nonce, + api_base_token_id, + api_quote_token_id, + api_amount, + api_price, + api_is_sell, + api_maker_fee_rate, + api_taker_fee_rate, + api_has_subsidy, + ) + })()) + }, + ) +} +fn wire_Parameter_contract_info_impl( + pair_id: impl CstDecode, + symbol: impl CstDecode, + initial_margin_rate: impl CstDecode, + maintenance_margin_rate: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Parameter_contract_info", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_pair_id = pair_id.cst_decode(); + let api_symbol = symbol.cst_decode(); + let api_initial_margin_rate = initial_margin_rate.cst_decode(); + let api_maintenance_margin_rate = maintenance_margin_rate.cst_decode(); + transform_result_dco((move || { + crate::api::Parameter::contract_info( + api_pair_id, + api_symbol, + api_initial_margin_rate, + api_maintenance_margin_rate, + ) + })()) + }, + ) +} +fn wire_Parameter_fee_account_impl( + account_id: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Parameter_fee_account", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + transform_result_dco((move || crate::api::Parameter::fee_account(api_account_id))()) + }, + ) +} +fn wire_Parameter_funding_infos_impl( + infos: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Parameter_funding_infos", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_infos = infos.cst_decode(); + transform_result_dco((move || crate::api::Parameter::funding_infos(api_infos))()) + }, + ) +} +fn wire_Parameter_insurance_fund_account_impl( + account_id: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Parameter_insurance_fund_account", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + transform_result_dco((move || { + crate::api::Parameter::insurance_fund_account(api_account_id) + })()) + }, + ) +} +fn wire_Parameter_margin_info_impl( + margin_id: impl CstDecode, + symbol: impl CstDecode>, + token_id: impl CstDecode, + ratio: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Parameter_margin_info", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_margin_id = margin_id.cst_decode(); + let api_symbol = symbol.cst_decode(); + let api_token_id = token_id.cst_decode(); + let api_ratio = ratio.cst_decode(); + transform_result_dco((move || { + crate::api::Parameter::margin_info( + api_margin_id, + api_symbol, + api_token_id, + api_ratio, + ) + })()) + }, + ) +} +fn wire_Signer_create_signed_contract_impl( + that: impl CstDecode>>, + contract: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_create_signed_contract", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_contract = contract.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::create_signed_contract(&api_that, api_contract) + })()) + }, + ) +} +fn wire_Signer_create_signed_order_impl( + that: impl CstDecode>>, + order: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_create_signed_order", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_order = order.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::create_signed_order(&api_that, api_order) + })()) + }, + ) +} +fn wire_Signer_eth_signer_impl( + eth_private_key: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_eth_signer", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_eth_private_key = eth_private_key.cst_decode(); + transform_result_dco((move || { + crate::api::Signer::eth_signer(api_eth_private_key) + })()) + }, + ) +} +fn wire_Signer_sign_auto_deleveraging_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_auto_deleveraging", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_auto_deleveraging(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_change_pubkey_with_create2data_auth_impl( + that: impl CstDecode>>, + tx: impl CstDecode, + creator_address: impl CstDecode, + salt_arg: impl CstDecode, + code_hash: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_change_pubkey_with_create2data_auth", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + let api_creator_address = creator_address.cst_decode(); + let api_salt_arg = salt_arg.cst_decode(); + let api_code_hash = code_hash.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_change_pubkey_with_create2data_auth( + &api_that, + api_tx, + api_creator_address, + api_salt_arg, + api_code_hash, + ) + })()) + }, + ) +} +fn wire_Signer_sign_change_pubkey_with_eth_ecdsa_auth_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_change_pubkey_with_eth_ecdsa_auth", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_change_pubkey_with_eth_ecdsa_auth(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_change_pubkey_with_onchain_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_change_pubkey_with_onchain", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_change_pubkey_with_onchain(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_contract_matching_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_contract_matching", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_contract_matching(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_forced_exit_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_forced_exit", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_forced_exit(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_funding_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_funding", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_funding(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_liquidation_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_liquidation", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_liquidation(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_order_matching_impl( + that: impl CstDecode>>, + tx: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_order_matching", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_order_matching(&api_that, api_tx) + })()) + }, + ) +} +fn wire_Signer_sign_transfer_impl( + that: impl CstDecode>>, + tx: impl CstDecode, + token_symbol: impl CstDecode, + chain_id: impl CstDecode>, + addr: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_transfer", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + let api_token_symbol = token_symbol.cst_decode(); + let api_chain_id = chain_id.cst_decode(); + let api_addr = addr.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_transfer( + &api_that, + api_tx, + api_token_symbol, + api_chain_id, + api_addr, + ) + })()) + }, + ) +} +fn wire_Signer_sign_withdraw_impl( + that: impl CstDecode>>, + tx: impl CstDecode, + token_symbol: impl CstDecode, + chain_id: impl CstDecode>, + addr: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_sign_withdraw", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_tx = tx.cst_decode(); + let api_token_symbol = token_symbol.cst_decode(); + let api_chain_id = chain_id.cst_decode(); + let api_addr = addr.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Signer::sign_withdraw( + &api_that, + api_tx, + api_token_symbol, + api_chain_id, + api_addr, + ) + })()) + }, + ) +} +fn wire_Signer_starknet_signer_impl( + eth_private_key: impl CstDecode, + starknet_chain_id: impl CstDecode, + starknet_addr: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Signer_starknet_signer", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_eth_private_key = eth_private_key.cst_decode(); + let api_starknet_chain_id = starknet_chain_id.cst_decode(); + let api_starknet_addr = starknet_addr.cst_decode(); + transform_result_dco((move || { + crate::api::Signer::starknet_signer( + api_eth_private_key, + api_starknet_chain_id, + api_starknet_addr, + ) + })()) + }, + ) +} +fn wire_SpotPriceInfo_new_impl( + token_id: impl CstDecode, + price: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "SpotPriceInfo_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_token_id = token_id.cst_decode(); + let api_price = price.cst_decode(); + transform_result_dco((move || { + crate::api::SpotPriceInfo::new(api_token_id, api_price) + })()) + }, + ) +} +fn wire_Transfer_get_eth_sign_msg_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + token_symbol: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Transfer_get_eth_sign_msg", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_token_symbol = token_symbol.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + Result::<_, ()>::Ok(crate::api::Transfer::get_eth_sign_msg( + &api_that, + api_token_symbol, + )) + })()) + }, + ) +} +fn wire_Transfer_new_impl( + account_id: impl CstDecode, + to_address: impl CstDecode, + from_sub_account_id: impl CstDecode, + to_sub_account_id: impl CstDecode, + token: impl CstDecode, + fee: impl CstDecode, + amount: impl CstDecode, + nonce: impl CstDecode, + ts: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Transfer_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_to_address = to_address.cst_decode(); + let api_from_sub_account_id = from_sub_account_id.cst_decode(); + let api_to_sub_account_id = to_sub_account_id.cst_decode(); + let api_token = token.cst_decode(); + let api_fee = fee.cst_decode(); + let api_amount = amount.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_ts = ts.cst_decode(); + transform_result_dco((move || { + crate::api::Transfer::new( + api_account_id, + api_to_address, + api_from_sub_account_id, + api_to_sub_account_id, + api_token, + api_fee, + api_amount, + api_nonce, + api_ts, + ) + })()) + }, + ) +} +fn wire_Transfer_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Transfer_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::Transfer::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_Transfer_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Transfer_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Transfer::to_json(&api_that) + })()) + }, + ) +} +fn wire_UpdateGlobalVar_new_impl( + from_chain_id: impl CstDecode, + sub_account_id: impl CstDecode, + parameter: impl CstDecode, + serial_id: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "UpdateGlobalVar_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_from_chain_id = from_chain_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_parameter = parameter.cst_decode(); + let api_serial_id = serial_id.cst_decode(); + transform_result_dco((move || { + crate::api::UpdateGlobalVar::new( + api_from_chain_id, + api_sub_account_id, + api_parameter, + api_serial_id, + ) + })()) + }, + ) +} +fn wire_UpdateGlobalVar_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "UpdateGlobalVar_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::UpdateGlobalVar::to_json(&api_that) + })()) + }, + ) +} +fn wire_Wallet_approve_erc20_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + contract: impl CstDecode, + amount: impl CstDecode, + eth_params: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_approve_erc20", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_contract = contract.cst_decode(); + let api_amount = amount.cst_decode(); + let api_eth_params = eth_params.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::approve_erc20( + &api_that, + api_contract, + api_amount, + api_eth_params, + ) + .await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_deposit_erc20_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + sub_account_id: impl CstDecode, + deposit_to: impl CstDecode, + token_addr: impl CstDecode, + amount: impl CstDecode, + mapping: impl CstDecode, + eth_params: impl CstDecode, + is_gateway: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_deposit_erc20", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_deposit_to = deposit_to.cst_decode(); + let api_token_addr = token_addr.cst_decode(); + let api_amount = amount.cst_decode(); + let api_mapping = mapping.cst_decode(); + let api_eth_params = eth_params.cst_decode(); + let api_is_gateway = is_gateway.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::deposit_erc20( + &api_that, + api_sub_account_id, + api_deposit_to, + api_token_addr, + api_amount, + api_mapping, + api_eth_params, + api_is_gateway, + ) + .await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_deposit_eth_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + sub_account_id: impl CstDecode, + deposit_to: impl CstDecode, + eth_params: impl CstDecode, + is_gateway: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_deposit_eth", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_deposit_to = deposit_to.cst_decode(); + let api_eth_params = eth_params.cst_decode(); + let api_is_gateway = is_gateway.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::deposit_eth( + &api_that, + api_sub_account_id, + api_deposit_to, + api_eth_params, + api_is_gateway, + ) + .await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_full_exit_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + token_id: impl CstDecode, + mapping: impl CstDecode, + eth_params: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_full_exit", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_token_id = token_id.cst_decode(); + let api_mapping = mapping.cst_decode(); + let api_eth_params = eth_params.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::full_exit( + &api_that, + api_account_id, + api_sub_account_id, + api_token_id, + api_mapping, + api_eth_params, + ) + .await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_get_balance_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_get_balance", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::get_balance(&api_that).await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_get_deposit_fee_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + eth_params: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_get_deposit_fee", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_eth_params = eth_params.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::get_deposit_fee(&api_that, api_eth_params).await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_get_nonce_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + block_number: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_get_nonce", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_block_number = block_number.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::get_nonce(&api_that, api_block_number).await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_new_impl( + url: impl CstDecode, + private_key: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_url = url.cst_decode(); + let api_private_key = private_key.cst_decode(); + transform_result_dco((move || crate::api::Wallet::new(api_url, api_private_key))()) + }, + ) +} +fn wire_Wallet_set_auth_pubkey_hash_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + nonce: impl CstDecode, + new_pubkey_hash: impl CstDecode, + eth_params: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_set_auth_pubkey_hash", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_new_pubkey_hash = new_pubkey_hash.cst_decode(); + let api_eth_params = eth_params.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::set_auth_pubkey_hash( + &api_that, + api_nonce, + api_new_pubkey_hash, + api_eth_params, + ) + .await + })() + .await, + ) + } + }, + ) +} +fn wire_Wallet_wait_for_transaction_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode>>, + tx_hash: impl CstDecode, + timeout: impl CstDecode>, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Wallet_wait_for_transaction", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_tx_hash = tx_hash.cst_decode(); + let api_timeout = timeout.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Wallet::wait_for_transaction( + &api_that, + api_tx_hash, + api_timeout, + ) + .await + })() + .await, + ) + } + }, + ) +} +fn wire_Withdraw_get_eth_sign_msg_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + token_symbol: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Withdraw_get_eth_sign_msg", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_token_symbol = token_symbol.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + Result::<_, ()>::Ok(crate::api::Withdraw::get_eth_sign_msg( + &api_that, + api_token_symbol, + )) + })()) + }, + ) +} +fn wire_Withdraw_new_impl( + account_id: impl CstDecode, + sub_account_id: impl CstDecode, + to_chain_id: impl CstDecode, + to_address: impl CstDecode, + l2_source_token: impl CstDecode, + l1_target_token: impl CstDecode, + amount: impl CstDecode, + call_data: impl CstDecode>, + fee: impl CstDecode, + nonce: impl CstDecode, + withdraw_to_l1: impl CstDecode, + withdraw_fee_ratio: impl CstDecode, + ts: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Withdraw_new", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_account_id = account_id.cst_decode(); + let api_sub_account_id = sub_account_id.cst_decode(); + let api_to_chain_id = to_chain_id.cst_decode(); + let api_to_address = to_address.cst_decode(); + let api_l2_source_token = l2_source_token.cst_decode(); + let api_l1_target_token = l1_target_token.cst_decode(); + let api_amount = amount.cst_decode(); + let api_call_data = call_data.cst_decode(); + let api_fee = fee.cst_decode(); + let api_nonce = nonce.cst_decode(); + let api_withdraw_to_l1 = withdraw_to_l1.cst_decode(); + let api_withdraw_fee_ratio = withdraw_fee_ratio.cst_decode(); + let api_ts = ts.cst_decode(); + transform_result_dco((move || { + crate::api::Withdraw::new( + api_account_id, + api_sub_account_id, + api_to_chain_id, + api_to_address, + api_l2_source_token, + api_l1_target_token, + api_amount, + api_call_data, + api_fee, + api_nonce, + api_withdraw_to_l1, + api_withdraw_fee_ratio, + api_ts, + ) + })()) + }, + ) +} +fn wire_Withdraw_sign_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + zk_link_signer: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Withdraw_sign", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_zk_link_signer = zk_link_signer.cst_decode(); + transform_result_dco((move || { + let mut api_that = api_that.rust_auto_opaque_decode_ref_mut(); + crate::api::Withdraw::sign(&mut api_that, api_zk_link_signer) + })()) + }, + ) +} +fn wire_Withdraw_to_json_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "Withdraw_to_json", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::Withdraw::to_json(&api_that) + })()) + }, + ) +} +fn wire_ZkLinkSignature_get_pubkey_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ZkLinkSignature_get_pubkey", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + Result::<_, ()>::Ok(crate::api::ZkLinkSignature::get_pubkey(&api_that)) + })()) + }, + ) +} +fn wire_ZkLinkSignature_get_signature_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ZkLinkSignature_get_signature", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + Result::<_, ()>::Ok(crate::api::ZkLinkSignature::get_signature(&api_that)) + })()) + }, + ) +} +fn wire_ZkLinkSigner_eth_sig_impl( + sig: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ZkLinkSigner_eth_sig", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_sig = sig.cst_decode(); + transform_result_dco((move || crate::api::ZkLinkSigner::eth_sig(api_sig))()) + }, + ) +} +fn wire_ZkLinkSigner_get_pubkey_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ZkLinkSigner_get_pubkey", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + Result::<_, ()>::Ok(crate::api::ZkLinkSigner::get_pubkey(&api_that)) + })()) + }, + ) +} +fn wire_ZkLinkSigner_get_pubkey_hash_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ZkLinkSigner_get_pubkey_hash", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + Result::<_, ()>::Ok(crate::api::ZkLinkSigner::get_pubkey_hash(&api_that)) + })()) + }, + ) +} +fn wire_ZkLinkSigner_sign_musig_impl( + that: impl CstDecode< + RustOpaqueNom>, + >, + msg: impl CstDecode>, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ZkLinkSigner_sign_musig", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_that = that.cst_decode(); + let api_msg = msg.cst_decode(); + transform_result_dco((move || { + let api_that = api_that.rust_auto_opaque_decode_ref(); + crate::api::ZkLinkSigner::sign_musig(&api_that, api_msg) + })()) + }, + ) +} +fn wire_ZkLinkSigner_starknet_sig_impl( + sig: impl CstDecode, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_sync::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "ZkLinkSigner_starknet_sig", + port: None, + mode: flutter_rust_bridge::for_generated::FfiCallMode::Sync, + }, + move || { + let api_sig = sig.cst_decode(); + transform_result_dco((move || crate::api::ZkLinkSigner::starknet_sig(api_sig))()) + }, + ) +} +fn wire_init_app_impl(port_: flutter_rust_bridge::for_generated::MessagePort) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "init_app", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + move |context| { + transform_result_dco((move || Result::<_, ()>::Ok(crate::api::init_app()))()) + } + }, + ) +} + +// Section: dart2rust + +impl CstDecode for bool { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> bool { + self + } +} +impl CstDecode for f64 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> f64 { + self + } +} +impl CstDecode for i16 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> i16 { + self + } +} +impl CstDecode for u16 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u16 { + self + } +} +impl CstDecode for u32 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u32 { + self + } +} +impl CstDecode for u8 { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> u8 { + self + } +} +impl CstDecode for usize { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> usize { + self + } +} +impl SseDecode for flutter_rust_bridge::for_generated::anyhow::Error { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + unreachable!(""); + } +} + +impl SseDecode for AutoDeleveraging { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for ChangePubKey { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Contract { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for ContractMatching { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for ContractPrice { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for EthTxOption { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for ForcedExit { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Funding { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for FundingInfo { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Liquidation { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Order { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for OrderMatching { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Parameter { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Signer { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for SpotPriceInfo { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Transfer { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for UpdateGlobalVar { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Wallet { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for Withdraw { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for ZkLinkSignature { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode for ZkLinkSigner { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = , + >>::sse_decode(deserializer); + return inner.rust_auto_opaque_decode_owned(); + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return unsafe { decode_rust_opaque_nom(inner) }; + } +} + +impl SseDecode for String { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = >::sse_decode(deserializer); + return String::from_utf8(inner).unwrap(); + } +} + +impl SseDecode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() != 0 + } +} + +impl SseDecode for f64 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_f64::().unwrap() + } +} + +impl SseDecode for i16 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_i16::().unwrap() + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + if (::sse_decode(deserializer)) { + return Some(::sse_decode(deserializer)); + } else { + return None; + } + } +} + +impl SseDecode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + if (::sse_decode(deserializer)) { + return Some(::sse_decode(deserializer)); + } else { + return None; + } + } +} + +impl SseDecode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + if (::sse_decode(deserializer)) { + return Some(::sse_decode(deserializer)); + } else { + return None; + } + } +} + +impl SseDecode for u16 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u16::().unwrap() + } +} + +impl SseDecode for u32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u32::().unwrap() + } +} + +impl SseDecode for u8 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() + } +} + +impl SseDecode for () { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} +} + +impl SseDecode for usize { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u64::().unwrap() as _ + } +} + +impl SseDecode for i32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_i32::().unwrap() + } +} + +fn pde_ffi_dispatcher_primary_impl( + func_id: i32, + port: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + _ => unreachable!(), + } +} + +fn pde_ffi_dispatcher_sync_impl( + func_id: i32, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + _ => unreachable!(), + } +} + +// Section: rust2dart + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for AutoDeleveraging { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for ChangePubKey { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Contract { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for ContractMatching { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for ContractPrice { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for EthTxOption { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for ForcedExit { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Funding { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for FundingInfo { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Liquidation { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Order { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for OrderMatching { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Parameter { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Signer { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for SpotPriceInfo { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Transfer { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for UpdateGlobalVar { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Wallet { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for Withdraw { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for ZkLinkSignature { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper {} + +impl flutter_rust_bridge::IntoIntoDart> for ZkLinkSigner { + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} + +impl SseEncode for flutter_rust_bridge::for_generated::anyhow::Error { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(format!("{:?}", self), serializer); + } +} + +impl SseEncode for AutoDeleveraging { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for ChangePubKey { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Contract { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for ContractMatching { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for ContractPrice { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for EthTxOption { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for ForcedExit { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Funding { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for FundingInfo { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Liquidation { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Order { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode( + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), + serializer, + ); + } +} + +impl SseEncode for OrderMatching { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Parameter { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Signer { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode( + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), + serializer, + ); + } +} + +impl SseEncode for SpotPriceInfo { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Transfer { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for UpdateGlobalVar { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for Wallet { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode( + flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), + serializer, + ); + } +} + +impl SseEncode for Withdraw { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for ZkLinkSignature { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode for ZkLinkSigner { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for RustOpaqueNom> { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode + for RustOpaqueNom> +{ + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + let (ptr, size) = self.sse_encode_raw(); + ::sse_encode(ptr, serializer); + ::sse_encode(size, serializer); + } +} + +impl SseEncode for String { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >::sse_encode(self.into_bytes(), serializer); + } +} + +impl SseEncode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u8(self as _).unwrap(); + } +} + +impl SseEncode for f64 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_f64::(self).unwrap(); + } +} + +impl SseEncode for i16 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_i16::(self).unwrap(); + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.is_some(), serializer); + if let Some(value) = self { + ::sse_encode(value, serializer); + } + } +} + +impl SseEncode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.is_some(), serializer); + if let Some(value) = self { + ::sse_encode(value, serializer); + } + } +} + +impl SseEncode for Option { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.is_some(), serializer); + if let Some(value) = self { + ::sse_encode(value, serializer); + } + } +} + +impl SseEncode for u16 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u16::(self).unwrap(); + } +} + +impl SseEncode for u32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u32::(self).unwrap(); + } +} + +impl SseEncode for u8 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u8(self).unwrap(); + } +} + +impl SseEncode for () { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {} +} + +impl SseEncode for usize { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer + .cursor + .write_u64::(self as _) + .unwrap(); + } +} + +impl SseEncode for i32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_i32::(self).unwrap(); + } +} + +#[cfg(not(target_family = "wasm"))] +#[path = "frb_generated.io.rs"] +mod io; +#[cfg(not(target_family = "wasm"))] +pub use io::*; diff --git a/bindings/dart/rust/src/lib.rs b/bindings/dart/rust/src/lib.rs new file mode 100644 index 00000000..93606027 --- /dev/null +++ b/bindings/dart/rust/src/lib.rs @@ -0,0 +1,2 @@ +pub mod api; +mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ diff --git a/bindings/dart/test/main.dart b/bindings/dart/test/main.dart new file mode 100644 index 00000000..3c9e2059 --- /dev/null +++ b/bindings/dart/test/main.dart @@ -0,0 +1,67 @@ +import 'package:test/test.dart'; +import 'dart:convert'; +import '../lib/api.dart'; +import '../lib/frb_generated.dart'; + +Future main() async { + await RustLib.init(); + test('Order Matching', () { + var signer = Signer.ethSigner(ethPrivateKey: "0xbe725250b123a39dab5b7579334d5888987c72a58f4508062545fe6e08ca94f4"); + var maker = signer.createSignedOrder(order: Order( + accountId: 5, + subAccountId: 1, + slotId: 1, + nonce: 1, + baseTokenId: 18, + quoteTokenId: 17, + amount: "10000000000000", + price: "10000000000", + isSell: true, + makerFeeRate: 5, + takerFeeRate: 3, + hasSubsidy: false, + )); + var taker = signer.createSignedOrder(order: Order( + accountId: 6, + subAccountId: 1, + slotId: 1, + nonce: 1, + baseTokenId: 18, + quoteTokenId: 17, + amount: "10000000000000", + price: "10000000000", + isSell: false, + makerFeeRate: 5, + takerFeeRate: 3, + hasSubsidy: false, + )); + var contractPrices = [ + ContractPrice(pairId: 1, marketPrice: "100"), + ContractPrice(pairId: 2, marketPrice: "200"), + ContractPrice(pairId: 3, marketPrice: "300"), + ContractPrice(pairId: 4, marketPrice: "400"), + ]; + var marginPrices = [ + SpotPriceInfo(tokenId: 11, price: "100"), + SpotPriceInfo(tokenId: 12, price: "200"), + SpotPriceInfo(tokenId: 13, price: "300"), + ]; + var tx = OrderMatching( + accountId: 10, + subAccountId: 1, + taker: taker, + maker: maker, + fee: "1000000000", + feeToken: 18, + contractPrices: contractPrices, + marginPrices: marginPrices, + expectBaseAmount: "10000000000000000", + expectQuoteAmount: "10000000000000000", + ); + var txStr = signer.signOrderMatching(tx: tx); + print(txStr); + var txJson = jsonDecode(txStr); + expect(txJson["signature"]["pubKey"], "0x7b173e25e484eed3461091430f81b2a5bd7ae792f69701dcb073cb903f812510"); + expect(txJson["signature"]["signature"], "a4d48b291495bdb2505dc14c4f04931f854662c9333d7bae13bc953e852ad428b132148c47418b92c216cb555a5a5e8caaba200d204b9ef7f2fefe52e848a003"); + }); +} \ No newline at end of file diff --git a/bindings/dart/windows/CMakeLists.txt b/bindings/dart/windows/CMakeLists.txt new file mode 100644 index 00000000..11805c54 --- /dev/null +++ b/bindings/dart/windows/CMakeLists.txt @@ -0,0 +1,40 @@ +set(zklinkVersion "0.0.1") # generated; do not edit + +# TODO Remove this workaround once Flutter supports Windows ARM. +# https://github.com/flutter/flutter/issues/116196 +set(FLUTTER_TARGET_PLATFORM windows-x64) + +# The Flutter tooling requires that developers have CMake 3.10 or later +# installed. You should not increase this version, as doing so will cause +# the plugin to fail to compile for some customers of the plugin. +cmake_minimum_required(VERSION 3.10) + +# Project-level configuration. +set(PROJECT_NAME "zklink") + +# Download the binaries if they are not already present. +set(LIBROOT "${CMAKE_CURRENT_SOURCE_DIR}/${zklinkVersion}") +set(ARCHIVE "${LIBROOT}.7z") +if(NOT EXISTS ${ARCHIVE}) + file(DOWNLOAD + "https://github.com/zkLinkProtocol/zklink_sdk/releases/download/dart_sdk_${zklinkVersion}/x86_64-pc-windows-msvc.7z" + ${ARCHIVE} + TLS_VERIFY ON + ) +endif() + +# Extract the binaries, overriding any already present. +file(REMOVE_RECURSE ${LIBROOT}) +file(MAKE_DIRECTORY ${LIBROOT}) +execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xvf ${ARCHIVE} + WORKING_DIRECTORY ${LIBROOT} +) + +# List of absolute paths to libraries that should be bundled with the plugin. +# This list could contain prebuilt libraries, or libraries created by an +# external build triggered from this build file. +set(zklink_bundled_libraries + "${LIBROOT}/zklink_sdk_dart.dll" + PARENT_SCOPE +) \ No newline at end of file