From 361e56b72e6d401adaef23eb0a325e1a05b2d8a4 Mon Sep 17 00:00:00 2001 From: Collin Jackson Date: Fri, 21 Jun 2024 13:18:50 -0700 Subject: [PATCH] Big bang --- .github/workflows/main.yaml | 151 + .gitignore | 10 + .metadata | 10 + CHANGELOG.md | 3 + CLA.md | 31 + CONTRIBUTING.md | 30 + LICENSE | 178 + README.md | 23 + TERMS-OF-USE.md | 133 + analysis_options.yaml | 21 + android/.gitignore | 8 + android/build.gradle | 41 + android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 6 + android/settings.gradle | 1 + android/src/main/AndroidManifest.xml | 3 + .../mobilecoin/mobilecoin_flutter/Ffi.java | 24 + .../mobilecoin_flutter/FfiAccountKey.java | 36 + .../mobilecoin_flutter/FfiClientConfig.java | 60 + .../mobilecoin_flutter/FfiCryptoBox.java | 27 + .../mobilecoin_flutter/FfiMnemonic.java | 29 + .../FfiMobileCoinClient.java | 464 ++ .../mobilecoin_flutter/FfiOnetimeKeys.java | 27 + .../mobilecoin_flutter/FfiPaymentRequest.java | 51 + .../FfiPrintableWrapper.java | 97 + .../mobilecoin_flutter/FfiPublicAddress.java | 31 + .../FfiRistrettoPrivate.java | 26 + .../FfiRistrettoPublic.java | 26 + .../FfiTransferPayload.java | 33 + .../MobileCoinFlutterPlugin.java | 1036 +++ .../mobilecoin_flutter/ObjectStorage.java | 19 + .../mobilecoin_flutter/PicoMob.java | 26 + .../mistyswap/AttestedMistySwapClient.java | 279 + .../GRPCMistySwapCommonClientService.java | 40 + .../GRPCMistySwapOfframpClientService.java | 68 + .../GRPCMistySwapOnrampClientService.java | 68 + .../main/java/mistyswap/MistySwapScheme.java | 33 + .../src/main/java/mistyswap/MistySwapUri.java | 22 + .../main/java/mistyswap/MistyswapCommon.java | 3534 +++++++++ .../mistyswap/MistyswapCommonApiGrpc.java | 270 + .../main/java/mistyswap/MistyswapOfframp.java | 7032 +++++++++++++++++ .../mistyswap/MistyswapOfframpApiGrpc.java | 541 ++ .../main/java/mistyswap/MistyswapOnramp.java | 6608 ++++++++++++++++ .../mistyswap/MistyswapOnrampApiGrpc.java | 541 ++ bin/protobuf_update.sh | 61 + buf.gen.yaml | 5 + example/.gitignore | 46 + example/.metadata | 10 + example/README.md | 3 + example/analysis_options.yaml | 29 + example/android/.gitignore | 13 + example/android/app/build.gradle | 58 + .../android/app/src/debug/AndroidManifest.xml | 8 + .../android/app/src/main/AndroidManifest.xml | 34 + .../MainActivity.java | 6 + .../app/FlutterMultiDexApplication.java | 25 + .../res/drawable-v21/launch_background.xml | 12 + .../main/res/drawable/launch_background.xml | 12 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 + .../app/src/main/res/values/styles.xml | 18 + .../app/src/profile/AndroidManifest.xml | 7 + example/android/build.gradle | 27 + example/android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 6 + example/android/settings.gradle | 11 + example/ios/.gitignore | 33 + example/ios/Flutter/AppFrameworkInfo.plist | 26 + example/ios/Flutter/Debug.xcconfig | 2 + example/ios/Flutter/Release.xcconfig | 2 + example/ios/Gemfile | 4 + example/ios/Podfile | 41 + example/ios/Podfile.lock | 224 + example/ios/Runner.xcodeproj/project.pbxproj | 553 ++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcshareddata/xcschemes/Runner.xcscheme | 91 + .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + example/ios/Runner/AppDelegate.swift | 13 + .../AppIcon.appiconset/Contents.json | 122 + .../Icon-App-1024x1024@1x.png | Bin 0 -> 10932 bytes .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 0 -> 564 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 0 -> 1283 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 0 -> 1588 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 0 -> 1025 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 0 -> 1716 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 0 -> 1920 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 0 -> 1283 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 0 -> 1895 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 0 -> 2665 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 0 -> 2665 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 0 -> 3831 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 0 -> 1888 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 0 -> 3294 bytes .../Icon-App-83.5x83.5@2x.png | Bin 0 -> 3612 bytes .../LaunchImage.imageset/Contents.json | 23 + .../LaunchImage.imageset/LaunchImage.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@2x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@3x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/README.md | 5 + .../Runner/Base.lproj/LaunchScreen.storyboard | 37 + example/ios/Runner/Base.lproj/Main.storyboard | 26 + example/ios/Runner/Info.plist | 49 + example/ios/Runner/Runner-Bridging-Header.h | 1 + example/lib/main.dart | 59 + example/pubspec.lock | 332 + example/pubspec.yaml | 86 + ios/.gitignore | 38 + ios/Assets/.gitkeep | 0 ios/Classes/FFiClientConfig.swift | 192 + ios/Classes/FFiMobileCoinClient.swift | 657 ++ ios/Classes/FfiAccountKey.swift | 39 + ios/Classes/FfiCryptoBox.swift | 47 + ios/Classes/FfiMistySwap.swift | 112 + ios/Classes/FfiMnemonic.swift | 40 + ios/Classes/FfiPaymentRequest.swift | 70 + ios/Classes/FfiPrintableWrapper.swift | 154 + ios/Classes/FfiTransferPayload.swift | 38 + ios/Classes/MobileCoinFlutterPlugin.h | 6 + ios/Classes/MobileCoinFlutterPlugin.m | 17 + ios/Classes/PublicAddress.swift | 41 + ios/Classes/RistrettoPrivate.swift | 32 + ios/Classes/RistrettoPublic.swift | 32 + ios/Classes/SwiftMobileCoinPlugin.swift | 169 + ios/mobilecoin_flutter.podspec | 27 + lib/mobilecoin_flutter.dart | 41 + lib/src/account_key.dart | 54 + lib/src/attestation/client_config.dart | 23 + lib/src/attestation/service_config.dart | 70 + lib/src/crypto_box.dart | 32 + lib/src/mobilecoin_client.dart | 202 + ...mobilecoin_flutter_plugin_channel_api.dart | 776 ++ lib/src/onetime_keys.dart | 22 + lib/src/payment_request.dart | 46 + lib/src/picomob.dart | 85 + lib/src/platform_object.dart | 10 + lib/src/printable_wrapper.dart | 83 + lib/src/protobufs/generated/attest.pb.dart | 133 + .../protobufs/generated/attest.pbenum.dart | 7 + .../protobufs/generated/attest.pbgrpc.dart | 53 + .../protobufs/generated/attest.pbjson.dart | 32 + .../generated/google/protobuf/empty.pb.dart | 40 + .../google/protobuf/empty.pbenum.dart | 7 + .../google/protobuf/empty.pbjson.dart | 17 + .../generated/mistyswap_common.pb.dart | 306 + .../generated/mistyswap_common.pbenum.dart | 7 + .../generated/mistyswap_common.pbgrpc.dart | 54 + .../generated/mistyswap_common.pbjson.dart | 46 + .../generated/mistyswap_offramp.pb.dart | 810 ++ .../generated/mistyswap_offramp.pbenum.dart | 79 + .../generated/mistyswap_offramp.pbgrpc.dart | 123 + .../generated/mistyswap_offramp.pbjson.dart | 191 + .../generated/mistyswap_onramp.pb.dart | 762 ++ .../generated/mistyswap_onramp.pbenum.dart | 71 + .../generated/mistyswap_onramp.pbgrpc.dart | 123 + .../generated/mistyswap_onramp.pbjson.dart | 195 + lib/src/protobufs/google/protobuf/empty.proto | 51 + lib/src/public_address.dart | 26 + lib/src/ristretto_private.dart | 21 + lib/src/ristretto_public.dart | 21 + lib/src/transfer_payload.dart | 27 + pubspec.lock | 317 + pubspec.yaml | 70 + test/attestation_config_test.dart | 42 + test/mobilecoin_flutter_test.dart | 20 + 172 files changed, 30696 insertions(+) create mode 100644 .github/workflows/main.yaml create mode 100644 .gitignore create mode 100644 .metadata create mode 100644 CHANGELOG.md create mode 100644 CLA.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 TERMS-OF-USE.md create mode 100644 analysis_options.yaml create mode 100644 android/.gitignore create mode 100644 android/build.gradle create mode 100644 android/gradle.properties create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100644 android/settings.gradle create mode 100644 android/src/main/AndroidManifest.xml create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/Ffi.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiAccountKey.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiClientConfig.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiCryptoBox.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMnemonic.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMobileCoinClient.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiOnetimeKeys.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPaymentRequest.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPrintableWrapper.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPublicAddress.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPrivate.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPublic.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiTransferPayload.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/MobileCoinFlutterPlugin.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/ObjectStorage.java create mode 100644 android/src/main/java/com/mobilecoin/mobilecoin_flutter/PicoMob.java create mode 100644 android/src/main/java/mistyswap/AttestedMistySwapClient.java create mode 100644 android/src/main/java/mistyswap/GRPCMistySwapCommonClientService.java create mode 100644 android/src/main/java/mistyswap/GRPCMistySwapOfframpClientService.java create mode 100644 android/src/main/java/mistyswap/GRPCMistySwapOnrampClientService.java create mode 100644 android/src/main/java/mistyswap/MistySwapScheme.java create mode 100644 android/src/main/java/mistyswap/MistySwapUri.java create mode 100644 android/src/main/java/mistyswap/MistyswapCommon.java create mode 100644 android/src/main/java/mistyswap/MistyswapCommonApiGrpc.java create mode 100644 android/src/main/java/mistyswap/MistyswapOfframp.java create mode 100644 android/src/main/java/mistyswap/MistyswapOfframpApiGrpc.java create mode 100644 android/src/main/java/mistyswap/MistyswapOnramp.java create mode 100644 android/src/main/java/mistyswap/MistyswapOnrampApiGrpc.java create mode 100755 bin/protobuf_update.sh create mode 100644 buf.gen.yaml create mode 100644 example/.gitignore create mode 100644 example/.metadata create mode 100644 example/README.md create mode 100644 example/analysis_options.yaml create mode 100644 example/android/.gitignore create mode 100644 example/android/app/build.gradle create mode 100644 example/android/app/src/debug/AndroidManifest.xml create mode 100644 example/android/app/src/main/AndroidManifest.xml create mode 100644 example/android/app/src/main/java/com/mobilecoin/mobilecoin_flutter_example/MainActivity.java create mode 100644 example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java create mode 100644 example/android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 example/android/app/src/main/res/drawable/launch_background.xml create mode 100644 example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 example/android/app/src/main/res/values-night/styles.xml create mode 100644 example/android/app/src/main/res/values/styles.xml create mode 100644 example/android/app/src/profile/AndroidManifest.xml create mode 100644 example/android/build.gradle create mode 100644 example/android/gradle.properties create mode 100644 example/android/gradle/wrapper/gradle-wrapper.properties create mode 100644 example/android/settings.gradle create mode 100644 example/ios/.gitignore create mode 100644 example/ios/Flutter/AppFrameworkInfo.plist create mode 100644 example/ios/Flutter/Debug.xcconfig create mode 100644 example/ios/Flutter/Release.xcconfig create mode 100644 example/ios/Gemfile create mode 100644 example/ios/Podfile create mode 100644 example/ios/Podfile.lock create mode 100644 example/ios/Runner.xcodeproj/project.pbxproj create mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme create mode 100644 example/ios/Runner.xcworkspace/contents.xcworkspacedata create mode 100644 example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 example/ios/Runner/AppDelegate.swift create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png create mode 100644 example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png create mode 100644 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json create mode 100644 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png create mode 100644 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png create mode 100644 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png create mode 100644 example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md create mode 100644 example/ios/Runner/Base.lproj/LaunchScreen.storyboard create mode 100644 example/ios/Runner/Base.lproj/Main.storyboard create mode 100644 example/ios/Runner/Info.plist create mode 100644 example/ios/Runner/Runner-Bridging-Header.h create mode 100644 example/lib/main.dart create mode 100644 example/pubspec.lock create mode 100644 example/pubspec.yaml create mode 100644 ios/.gitignore create mode 100644 ios/Assets/.gitkeep create mode 100644 ios/Classes/FFiClientConfig.swift create mode 100644 ios/Classes/FFiMobileCoinClient.swift create mode 100644 ios/Classes/FfiAccountKey.swift create mode 100644 ios/Classes/FfiCryptoBox.swift create mode 100644 ios/Classes/FfiMistySwap.swift create mode 100644 ios/Classes/FfiMnemonic.swift create mode 100644 ios/Classes/FfiPaymentRequest.swift create mode 100644 ios/Classes/FfiPrintableWrapper.swift create mode 100644 ios/Classes/FfiTransferPayload.swift create mode 100644 ios/Classes/MobileCoinFlutterPlugin.h create mode 100644 ios/Classes/MobileCoinFlutterPlugin.m create mode 100644 ios/Classes/PublicAddress.swift create mode 100644 ios/Classes/RistrettoPrivate.swift create mode 100644 ios/Classes/RistrettoPublic.swift create mode 100644 ios/Classes/SwiftMobileCoinPlugin.swift create mode 100644 ios/mobilecoin_flutter.podspec create mode 100644 lib/mobilecoin_flutter.dart create mode 100644 lib/src/account_key.dart create mode 100644 lib/src/attestation/client_config.dart create mode 100644 lib/src/attestation/service_config.dart create mode 100644 lib/src/crypto_box.dart create mode 100644 lib/src/mobilecoin_client.dart create mode 100644 lib/src/mobilecoin_flutter_plugin_channel_api.dart create mode 100644 lib/src/onetime_keys.dart create mode 100644 lib/src/payment_request.dart create mode 100644 lib/src/picomob.dart create mode 100644 lib/src/platform_object.dart create mode 100644 lib/src/printable_wrapper.dart create mode 100644 lib/src/protobufs/generated/attest.pb.dart create mode 100644 lib/src/protobufs/generated/attest.pbenum.dart create mode 100644 lib/src/protobufs/generated/attest.pbgrpc.dart create mode 100644 lib/src/protobufs/generated/attest.pbjson.dart create mode 100644 lib/src/protobufs/generated/google/protobuf/empty.pb.dart create mode 100644 lib/src/protobufs/generated/google/protobuf/empty.pbenum.dart create mode 100644 lib/src/protobufs/generated/google/protobuf/empty.pbjson.dart create mode 100644 lib/src/protobufs/generated/mistyswap_common.pb.dart create mode 100644 lib/src/protobufs/generated/mistyswap_common.pbenum.dart create mode 100644 lib/src/protobufs/generated/mistyswap_common.pbgrpc.dart create mode 100644 lib/src/protobufs/generated/mistyswap_common.pbjson.dart create mode 100644 lib/src/protobufs/generated/mistyswap_offramp.pb.dart create mode 100644 lib/src/protobufs/generated/mistyswap_offramp.pbenum.dart create mode 100644 lib/src/protobufs/generated/mistyswap_offramp.pbgrpc.dart create mode 100644 lib/src/protobufs/generated/mistyswap_offramp.pbjson.dart create mode 100644 lib/src/protobufs/generated/mistyswap_onramp.pb.dart create mode 100644 lib/src/protobufs/generated/mistyswap_onramp.pbenum.dart create mode 100644 lib/src/protobufs/generated/mistyswap_onramp.pbgrpc.dart create mode 100644 lib/src/protobufs/generated/mistyswap_onramp.pbjson.dart create mode 100644 lib/src/protobufs/google/protobuf/empty.proto create mode 100644 lib/src/public_address.dart create mode 100644 lib/src/ristretto_private.dart create mode 100644 lib/src/ristretto_public.dart create mode 100644 lib/src/transfer_payload.dart create mode 100644 pubspec.lock create mode 100644 pubspec.yaml create mode 100644 test/attestation_config_test.dart create mode 100644 test/mobilecoin_flutter_test.dart diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..41e1c92 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,151 @@ +name: build + +on: + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +env: + FLUTTER_VERSION: 3.10.3 + +jobs: + android: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + with: + fetch-depth: 0 # to get all branches and tags + + - name: 'Set Java version' + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '12' + cache: 'gradle' + + - name: 'Cache Flutter' + id: flutter-cache + uses: actions/cache@v2 + with: + key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} + path: /opt/hostedtoolcache/flutter + + - name: 'Cache Flutter dependencies' + id: pub-cache + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + path: | + ${{ env.FLUTTER_HOME }}/.pub-cache + **/.packages + **/.flutter-plugins + **/.flutter-plugin-dependencies + **/.dart_tool/package_config.json + + - name: 'Set Flutter version' + if: steps.flutter-cache.cache.outputs.cache-hit != 'true' + uses: subosito/flutter-action@v1 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + + - name: 'Install Dart dependencies' + if: steps.pub-cache.cache.outputs.cache-hit != 'true' + run: flutter pub get; + + - name: 'Format' + run: dart format $(find . -name "*.dart" -not -wholename "*/generated/*") --set-exit-if-changed + + - uses: invertase/github-action-dart-analyzer@v1 + with: + fatal-infos: true + fatal-warnings: true + annotate: true + working-directory: ./lib + + - name: 'Run unit tests' + run: flutter test --no-pub --coverage --test-randomize-ordering-seed random + + - name: 'Build example' + run: | + cd ${{ github.workspace }}/example; + flutter build apk; + + ios: + runs-on: macos-11 + timeout-minutes: 25 + steps: + - name: 'Checkout Repo' + uses: actions/checkout@v2 + with: + fetch-depth: 0 # to get all branches and tags + + - name: 'Cache Flutter' + id: flutter-cache + uses: actions/cache@v2 + with: + key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} + path: /Users/runner/hostedtoolcache/flutter + + - name: 'Cache Flutter dependencies' + id: pub-cache + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} + path: | + ${{ env.FLUTTER_HOME }}/.pub-cache + **/.packages + **/.flutter-plugins + **/.flutter-plugin-dependencies + **/.dart_tool/package_config.json + + - name: 'Cache Ruby dependencies' + id: ruby-cache + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} + path: ${{ github.workspace }}/vendor/bundle + + - name: 'Cache Pods' + id: pod-cache + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + path: ${{ github.workspace }}/example/ios/Pods + + - name: 'Set Flutter version' + if: steps.flutter-cache.cache.outputs.cache-hit != 'true' + uses: subosito/flutter-action@v1 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + + - name: 'Set Ruby version' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7.2' + + - name: 'Set Xcode version' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '13.1' + + - name: 'Install Dart dependencies' + if: steps.pub-cache.cache.outputs.cache-hit != 'true' + run: flutter pub get + + - name: 'Install Ruby dependencies' + if: steps.ruby-cache.cache.outputs.cache-hit != 'true' + run: | + bundle config path ${{ github.workspace }}/vendor/bundle; + cd ${{ github.workspace }}/example/ios; + bundle install; + + - name: 'Build example' + run: | + cd ${{ github.workspace }}/example; + flutter build ios --simulator; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b1787e --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +.dart_tool/ +.idea +.vscode + +.packages +.pub/ + +build/ +example/ios/Gemfile.lock diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..5e30052 --- /dev/null +++ b/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: f18b9281c2280c2646aa3d4348715ed5bb9446c8 + channel: beta + +project_type: plugin diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..cbdbf72 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* Initial open source release. diff --git a/CLA.md b/CLA.md new file mode 100644 index 0000000..358bed8 --- /dev/null +++ b/CLA.md @@ -0,0 +1,31 @@ +## Contributor License Agreement + +Thank you for your contribution to the MobileCoin project from MoblieCoin Inc. (“MobileCoin”). + +This contributor license agreement documents the rights granted by contributors to MobileCoin. This license is for your protection as a Contributor as well as the protection of MobileCoin, its users, and its licensees; you may still license your own Contributions under other terms. + +In exchange for the ability to participate in the MobileCoin community and for other good consideration, the receipt of which is hereby acknowledged, you accept and agree to the following terms and conditions for Your present and future Contributions submitted to MobileCoin. Except for the license granted herein to MobileCoin and recipients of software distributed by MobileCoin, You reserve all right, title, and interest in and to Your Contributions. + +1. Definitions. + + “You” (or “Your”) shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with MobileCoin. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + “Contribution” shall mean any original work of authorship or invention, including any modifications or additions to an existing work, that is intentionally submitted by You to MobileCoin for inclusion in, or documentation of, any of the products owned or managed by MobileCoin (the “Work”). For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to MobileCoin or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, MobileCoin for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as “Not a Contribution.” + +1. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to MobileCoin and to recipients of software distributed by MobileCoin a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute Your Contributions and such derivative works, as well as the right to sublicense and have sublicensed all of the foregoing rights, through multiple tiers of sublicensees, provided that in all cases, MobileCoin will make Your Contributions available under an open source license. + + a. Moral Rights. If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against MobileCoin or its successors in interest, or any of MobileCoin’s licensees, either direct or indirect. + + +1. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to MobileCoin and to recipients of software distributed by MobileCoin a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. + +1. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your contributions to MobileCoin, or that your employer has executed with MobileCoin a separate contributor license agreement substantially similar to this Agreement. + +1. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. + +1. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of title, non-infringement, merchantability, or fitness for a particular purpose. + +1. Should You wish to submit work that is not Your original creation, You may submit it to MobileCoin separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as “Not a Contribution”. Third-party materials licensed pursuant to: [license name(s) here]” (substituting the bracketed text with the appropriate license name(s)). + +1. You agree to notify MobileCoin of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..da0dbbd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +## Contributing Bug Reports + +The MobileCoin Flutter plugin is a prototype that is being actively developed. + +Please report issues to https://github.com/mobilecoinofficial/mobilecoin_flutter_plugin/issues. + +1. Search both open and closed tickets to make sure your bug report is not a duplicate. +1. Do not use GitHub issues as a forum. To participate in community discussions, please use the community forum at [community.mobilecoin.foundation](https://community.mobilecoin.foundation). + +## Pull Requests (PRs) + +We are happy to review and consider PRs submitted against the public mobilecoin_flutter_plugin repository. Your changes will be taken as suggestions and may be rolled in with other changes. + +Generally follow the [Dart Code Style Guidelines](https://dart.dev/effective-dart/style) unless there is a reason not to. + +### Sign the Contributor License Agreement (CLA) + +You will need to sign [our CLA](./CLA.md) before your pull request can be merged. Please email [cla@mobilecoin.com](mailto://cla@mobilecoin.com) and we will send you a copy. + +## Participating in TestNet + +MobileCoin is maintaining a test network. Help us try it out. + +Let's build a community around private payments. + +If you would like to participate in TestNet, please [apply here](https://forms.gle/ULNjA6cMxCD5XNyT7). + +## Get in Touch + +We're friendly. Feel free to [ping us](mailto://support@mobilecoin.com)! diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f2ac309 --- /dev/null +++ b/LICENSE @@ -0,0 +1,178 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: +cjackson@MC-MAC-LT10 repos % cat ~/.ssh/id_rsa_2.pub +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC46B4sVVS1g+XB5YHmD9dgVRvNKcqaotbVTdO4ib5/CGADljeeqFhX9rfwGR+E0cYnv2JSQ1sI5ScPhEoRuBQvRY88s0JW9dGOfkusj655AdmqmIC2X9P2Ljse3k/1JbBlAyCQpEUEcWtkJMk5fSjbVSjeJErUofQnyECLhRD1PNKBz2gsZVt+eAf+u/BWtlemu/bz2stXyS7nHyWQpAnKaEdmF3erbPKnTkVeYZouzkHhTl0fUXASUt3D9PMOQ8XpKj4j4+vl4lUgK4Zrpy3TJiNIeJ5uo5OAo9wxtaiZXTq6jyrZVIGDkZk5nDFuNMz0jlESOHFtB9S6IA51aojZw0L23nEnfg+6tJqwP9ZvW2z2/IxzV/v5WoAg7ilQyDfVZZ5HnXoECfGOLoZmYdgQ+6z+c7J7q2ZIq46VbLnZrkWoo0gY83jv/swf/UNIEMia2VxTGQDVXvsauWyhzSHaTd0wJWXKajNEtR1NgkeZbw++vplJgDRfu5R8mPsL/Fk= cjackson@MC-MAC-LT10.local + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + diff --git a/README.md b/README.md new file mode 100644 index 0000000..3367c61 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# mobilecoin_flutter + +[![build_status][]][builds] + +The mobilecoin_flutter plugin makes the iOS and Android MobileCoin SDKs available to Flutter apps. + +[build_status]: https://github.com/mobilecoinofficial/mobilecoin_flutter_plugin/actions/workflows/main.yaml/badge.svg +[builds]: https://github.com/mobilecoinofficial/mobilecoin_flutter_plugin/actions/workflows/main.yaml + +Please see [CONTRIBUTING.md](CONTRIBUTING.md) for notes on contributing bug reports and code, and [TERMS-OF-USE.md](TERMS-OF-USE.md) for terms of use. + +## Build iOS + +```bash +$ cd example; flutter build ios-framework +``` + +## Generating Protobufs + +```bash +$ ./bin/update_protobufs.sh +``` + diff --git a/TERMS-OF-USE.md b/TERMS-OF-USE.md new file mode 100644 index 0000000..995360c --- /dev/null +++ b/TERMS-OF-USE.md @@ -0,0 +1,133 @@ +# **TERMS OF USE** **FOR MOBILECOINS AND MOBILECOIN WALLETS** + +The MobileCoin Network uses an open source software protocol commonly known as the MobileCoin protocol. The MobileCoin protocol is designed to enable holders of digital tokens known as MobileCoins to send and receive peer-to-peer payments securely and privately through a digital wallet that can send and receive MobileCoins (MobileCoin Wallets). MobileCoins and MobileCoin Wallets enable a simple, secure, and private medium of exchange for consumers in countries of operation to manage and move their money using a currency of equivalent value across countries. + +These Terms of Use for MobileCoins and MobileCoin Wallets (Terms) govern: + +- MobileCoins and their use and transfer; and +- MobileCoin Wallets and their access and use. + +Please read these Terms carefully before you start to use any MobileCoins and any MobileCoin Wallet. By acquiring or otherwise obtaining MobileCoins, using or transferring MobileCoins or obtaining, accessing or using a MobileCoin Wallet, you acknowledge that you have read, understand, and completely agree to be bound by these Terms. You also agree to require any transferee of your MobileCoins and any holder of a MobileCoin Wallet facilitated by you to be subject to these Terms. These Terms may be enforced against you by MobileCoin TS Ltd., MobileCoin U.S., LLC or other authorized entities (which are collectively referred to in these Terms as the Compliance Entities). These Terms may be amended, changed, or updated by the Compliance Entities at any time and without prior notice to you by posting at [www.buymobilecoin.us](https://www.buymobilecoin.us/). Your continued use of any MobileCoins and any MobileCoin Wallets following the posting of any amendment, change, or update means that you accept and agree to the amended, changed, or updated Terms. These Terms are first effective as of August 17, 2021 and supersede any previous versions. + +Access or use of any MobileCoin Wallets or use or transfer of any MobileCoins is void where such access, use or transfer is prohibited by, would constitute a violation of, or would be subject to penalties under applicable laws. Such access or use of MobileCoin Wallets or use or transfer of any MobileCoins which is void will not be the basis for the assertion or recognition of any interest, right, remedy, power, or privilege. \[Please also consult the applicable Terms of Sale and Access and Use of the Site, available at the MobileCoin U.S. LLC website at [www.buymobilecoin.us](https://www.buymobilecoin.us/) or the MobileCoin TS Ltd. website at [www.buymobilecoin.com](https://www.buymobilecoin.com). Information on the way personal information is handled is included in the appropriate Privacy Policy, available at [www.buymobilecoin.us](https://www.buymobilecoin.us/) or [www.buymobilecoin.com](https://www.buymobilecoin.com/).\] + +## **Limitations on Access or Use of MobileCoin Wallets and Use and Transfer of MobileCoins** + +The right to access or use MobileCoin Wallets and use or transfer MobileCoins is a personal, restricted, non-exclusive, non-sublicensable, revocable, limited license, and it is subject to the limitations and obligations in these Terms. Every Prohibited Person is strictly prohibited from directly or indirectly transacting, transferring, holding, owning, accessing or using any MobileCoins and any MobileCoin Wallets in any way. + +You are a Prohibited Person if you are: + +1. an individual or entity present in or subject to the jurisdiction of any jurisdiction in which the distribution or offer of or transaction in MobileCoins is unlawful or who is restricted or prohibited by applicable law, including without limitation, anti-money laundering laws, counter-terrorist financing laws, anti-corruption laws, and economic sanctions laws, from purchasing or otherwise obtaining MobileCoins or transacting in MobileCoins; +2. an individual or entity present in or subject to the jurisdiction of Cuba, Democratic People's Republic of Korea (North Korea), Iran, Syria or Crimea (a region of Ukraine annexed by the Russian Federation) (a Prohibited Jurisdiction); +3. a government or government official of any Prohibited Jurisdiction or of Venezuela or any subdivision thereof; +4. an individual or entity subject to asset freezing or blocking sanctions imposed by the United Nations, British Virgin Islands, United Kingdom, European Union, or United States or any entity owned 50 percent or more by one or more such persons (a Sanctioned Person); +5. a person under 18 years of age; or +6. any other individual or entity whose dealings in MobileCoins or use of a MobileCoin Wallet could expose the Compliance Entities to civil or criminal liability or cause the Compliance Entities to engage in sanctionable conduct. + +## **MobileCoin Wallets** + +No MobileCoin Wallet may be operated for and no order or transaction in a MobileCoin Wallet may be used for the financial or other benefit of or on behalf of a Prohibited Person. Persons, whether or not Prohibited Persons, are prohibited from operating a MobileCoin Wallet in any way or otherwise transacting on or using any MobileCoins and any MobileCoin Wallets while they or any individual (including any fiduciary, dealer, trustee, executor or administrator), agency or branch operating their MobileCoin Wallet on their behalf is present in any jurisdiction in which MobileCoins are unlawful. + +Certain software comprising MobileCoin Wallets is available to the public without charge on an open source basis. This software is provided "as is" without warranty of any kind. However, MobileCoin Wallets linked to a mobile messaging application may integrate software from a third party. MobileCoin Wallets must be accessed through a telephone, computer or other equipment as well as a network connection through telecommunication lines or other utility. None of these components of the MobileCoin Wallet is provided or controlled by the Compliance Entities. The Compliance Entities are not responsible for the accuracy or reliability of any open-source software or of any software, hardware, information, or advice provided by third parties or for their privacy and security policies and procedures. + +Access to and use of your MobileCoin Wallet may from time to time be unavailable, delayed, limited or slowed due to failures of hardware, software, utility services or other causes outside the control of the Compliance Entities. You may suffer losses as a result of these delays and limitations. You assume all risks associated with the operation, performance and security of a MobileCoin Wallet. You are responsible for maintaining the security of your MobileCoin Wallet and any password or other security designed to limit access. + +In addition to these Terms, you may be bound by any additional terms required by your third-party providers. These third parties' terms may apply to your use of the MobileCoin Wallets. Please be aware that these Terms do not govern third parties' relationships with you. These third parties, and not any Compliance Entity, are responsible for any product or service warranties, whether express or implied by law, provided to you. + +## **Nature of MobileCoins and Transactions in MobileCoins** + +MobileCoins are digital tokens. Digital tokens such as MobileCoins are not legal tender, are not backed by any government, and are not insured. MobileCoins do not provide you with any ownership of any physical asset or ownership or other interest or rights of any form with respect to the Compliance Entities or any affiliate or its revenue or assets, including any voting, distribution, redemption, liquidation, proprietary (including all forms of intellectual property), or other financial or legal rights. MobileCoins are distributed and offered on an as-is, and, are offered without any representation as to merchantability or fitness for any particular purpose. + +You accept that the Compliance Entities may be required to share your user information with other contractual third parties, including financial institutions, or as required under applicable laws or demanded upon a lawful request by any government. When information includes personal data under European Union law and/or California law, the terms of the Privacy Policy will apply. Please consult the appropriate Privacy Policy available at [www.buymobilecoin.us](https://www.buymobilecoin.us/) and [www.buymobilecoin.com](https://www.buymobilecoin.com/). + +You accept all consequences of sending MobileCoins. MobileCoin transactions are not reversible or refundable. Once you send MobileCoins to an address, whether intentionally or by a fraudulent or accidental transaction, you accept the risk that you may lose access to, and any claim on, those MobileCoins indefinitely or permanently. + +## **Prohibited Uses and Transfers of MobileCoins and Uses of MobileCoin Wallets** + +You may not: + +- use or transfer MobileCoins or access or use a MobileCoin Wallet for any illegal purposes; +- use or transfer MobileCoins or access or use a MobileCoin Wallet in order to disguise the origin or nature of illicit proceeds of, or to further, any breach of applicable laws, or to transact or deal in any contraband funds, property, or proceeds; +- use or transfer MobileCoins or access or use a MobileCoin Wallet if such conduct is prohibited, penalized, or otherwise sanctionable under any applicable laws, including without limitation anti-money laundering laws, counter-terrorist financing laws, anti-corruption laws, and economic sanctions laws or would expose the Compliance Entities or their affiliates to liability under any applicable laws; +- use or transfer MobileCoins or access or use a MobileCoin Wallet or any third party services to facilitate, approve, evade, avoid, or circumvent any applicable laws, including anti-money laundering laws, counterterrorist financing laws, anti-corruption laws, and economic sanctions laws; +- use, or transfer MobileCoins with a Prohibited Person or any individual or entity prohibited from using, transacting, transferring, trading, or receiving MobileCoins by these Terms or applicable laws; +- use or transfer MobileCoins or access or use a MobileCoin Wallet to evade taxes under applicable laws; +- use or transfer MobileCoins or access or use a MobileCoin Wallet to interfere with or subvert the rights or obligations of the Compliance Entities or the rights or obligations of any other individual or entity; +- use or transfer MobileCoins or access or use a MobileCoin Wallet by using misleading or inaccurate information or to take advantage of any technical glitch, malfunction, failure, delay, default, or security breach; +- use or transfer MobileCoins or access or use a MobileCoin Wallet to engage in conduct that is detrimental to the Compliance Entities or to any other individual or entity; +- falsify or materially omit any information provided to or provide misleading or inaccurate information requested by the Compliance Entities or impersonate another individual or entity or misrepresent your affiliation with an individual or entity; +- cause injury to, or attempt to harm, the Compliance Entities or any other individual or entity through your access to or use of any MobileCoins and any MobileCoin Wallets; or +- violate, promote, or cause a violation of, or conspire or attempt to violate these Terms or applicable laws. + +Any of these uses may be described in these Terms as a Prohibited Use. Should your actions or inaction result in Loss being suffered by the Compliance Entities or any Associates, you will pay an amount to the Compliance Entities or the Associates so as to render the Compliance Entities or the Associates whole, including the amount of taxes or penalties that might be imposed on the Compliance Entities or the Associates. + +In these Terms, Associates of the Compliance Entities means the successors, assignees and affiliates of MobileCoin TS Ltd., MobileCoin U.S., LLC and their respective shareholders, directors, officers, affiliates, employees, contractors, agents, partners, insurers, attorneys, and any licensors of technology to the Compliance Entities. + +In these Terms, Losses means any claim, application, loss, injury, delay, accident, cost, business interruption costs, or any other expenses (including attorneys' fees or the costs of any claim or suit), including any incidental, direct, indirect, general, special, punitive, exemplary, or consequential damages, loss of goodwill or business profits, work stoppage, data loss, computer failure or malfunction, or any and all other commercial losses; + +## **Intellectual Property** + +The MobileCoin name and logo are protected trademarks. You agree not to copy, modify, display, or use these trademarks without written permission from the Compliance Entities. All rights not expressly granted to you in these Terms are reserved. + +## **Your Representations and Warranties** + +You represent and warrant to the Compliance Entities on the date of your acceptance of these Terms and each day on which you use or transfer MobileCoins or use a MobileCoin Wallet, in each case with reference to the facts and circumstances existing at such date, as follows: + +- that, if you are an individual, you are 18 years of age or older and that you have the capacity to contract under applicable laws; +- that, if you are acting on behalf of a legal entity, (i) such legal entity is duly organized and validly existing under the applicable laws of the jurisdiction of its organization; and (ii) you are duly authorized by such legal entity to act on its behalf; +- that neither you nor any individual or entity acting on your behalf is a Prohibited Person or otherwise prohibited or restricted from purchasing or otherwise obtaining MobileCoins, using or transferring MobileCoins or accessing or using MobileCoin Wallets; +- that you will not engage in any Prohibited Uses or transfers, as described above; +- that you comply with the laws of your country of establishment, incorporation, residence, or location and, as applicable, the country from which you use any MobileCoins and any MobileCoin Wallets; +- that you understand and acknowledge that the Compliance Entities are not registered with or licensed by any financial regulatory authority in the British Virgin Islands, United States or elsewhere; and that accordingly, no British Virgin Islands, United States or other financial regulatory authority has passed upon the contents of these Terms or the merits of purchasing or using MobileCoins, nor have these Terms been filed with, or reviewed by any British Virgin Islands, United States or other financial regulatory authority; +- that you have had the opportunity to seek legal, accounting, taxation and other professional advice regarding these Terms, any MobileCoins and any MobileCoin Wallets; +- that you are currently in compliance with, and must, at your own cost and expense, comply with all laws that relate to or affect these Terms, including anti-money laundering laws, counter-terrorist financing laws, anti-corruption laws, economic sanctions laws, Tax Information Exchange Laws or other tax laws; +- that you will not utilize any virtual private network, proxy service, or any other third-party service, or network for the purpose of disguising or misrepresenting your IP address or location in order to download or use the MobileCoin Wallet in a manner prohibited in these Terms; +- that you consent to any and all tax and information reporting under anti-money laundering laws, counter-terrorist financing laws, anti-corruption laws, economic sanctions laws, Tax Information Exchange Laws or other tax laws as the Compliance Entities may reasonably determine and to extent permitted by law; +- that neither you nor any of your affiliates are acting directly or indirectly (i) on behalf of or for the benefit of a Prohibited Person; (ii) in violation of or as prohibited, restricted, or penalized under applicable economic sanctions laws; or (iii) in any way that would violate, be inconsistent with, penalized under, or cause the omission of filing of any report required under applicable anti-money laundering laws, counter-terrorist financing laws, or economic sanctions laws; +- that neither you nor any of your affiliates is: (i) itself or owned (beneficially or of record) or controlled by a Prohibited Person; (ii) involved in any transaction, transfer, or conduct that is likely to result in you or your affiliates becoming a Prohibited Person; (iii) residing or domiciled in a Prohibited Jurisdiction; (iv) transferring any funds, where denominated in MobileCoin or another cryptocurrency or fiat currency, to, from, or through a Prohibited Jurisdiction in connection to any dealings or conduct with or involving the Compliance Entities; (v) a government or government official of a Prohibited Jurisdiction; or (vi) otherwise a Prohibited Person; +- that you will fairly and promptly report all income associated with your use, transaction, transfer, or trade of MobileCoins and access and use MobileCoin Wallets, as applicable, pursuant to applicable laws and pay any and all taxes thereon; +- that you will accurately and promptly inform the Compliance Entities if you know or have reason to know whether any of the foregoing representations or warranties no longer is correct or becomes incorrect; and +- you will use, transact, transfer, and trade MobileCoins and access and use your MobileCoin Wallet for consumptive, and not for investment, purposes. + +In these Terms, Tax Information Exchange Laws means laws relating to the exchange of information relating to taxes between governments, including United States Foreign Account Tax Compliance Act, as enacted by Title V, Subtitle A of the Hiring Incentives to Restore Employment Act, P.L 111-147 (2010), as amended; and common reporting standard or the Standard for Automatic Exchange of Financial Account Information. + +## **No Representations or Advice by the Compliance Entities** + +The Compliance Entities make no warranties, or guarantees to you of any kind and, to the extent permitted by applicable laws, the Compliance Entities expressly disclaim all representations, warranties, covenants or guarantees, express, implied or statutory, with respect to MobileCoins and any MobileCoin Wallet. The MobileCoins and the MobileCoin Wallet are distributed and offered strictly on an as-is, and, without limiting the generality of the foregoing, are distributed and offered without any representation as to merchantability or fitness for any particular purpose. The Compliance Entities do not provide any investment, legal, accounting, tax or other advice. + +## **Limitation of Liability, Release, and Indemnity** + +Important: Except as may be provided for in these Terms, the Compliance Entities assume no liability or responsibility for and will have no liability or responsibility for any Losses directly or indirectly arising out of or related to: + +- these Terms, +- MobileCoins and their use and transfer, +- your MobileCoin Wallet, and your access and use of it, +- to the extent permitted by law, any stolen, lost, or unauthorized use of your personal information, any breach of security or data breach related to your personal information, or any criminal or other third-party act affecting the Compliance Entities, or +- any unauthorized representation, suggestion, statement, or claim made about MobileCoins or the MobileCoin Wallet. + +You agree to release the Compliance Entities and its Associates from liability for any and all Losses, and you will indemnify and save and hold the Compliance Entities and its Associates harmless from and against all Losses. The foregoing limitations of liability will apply, to the extent permitted by law, whether the alleged liability or losses are based on contract, negligence, tort, unjust enrichment, strict liability, violation of law or regulation, or any other basis, even if the Compliance Entities and its Associates have been advised of or should have known of the possibility of such losses and damages, and without regard to the success or effectiveness of any other remedies. + +## **Electronic Communications** + +You agree and consent to receive electronically all communications, agreements, receipts and disclosures that the Compliance Entities may provide in connection with these Terms. Information in relation to how we may communicate with you and your rights in that respect can be found in the appropriate Privacy Policy at [www.buymobilecoin.us](https://www.buymobilecoin.us/) or [www.buymobilecoin.com](https://www.buymobilecoin.com/). + +## **Miscellaneous** + +Any right or remedy of the Compliance Entities set forth in these Terms is in addition to, and not in lieu of, any other right or remedy whether described in these Terms, at law or in equity. The Compliance Entities' failure or delay in exercising any right, power, or privilege under these Terms will not operate as a waiver thereof. If any portion of these Terms is found to be invalid or unenforceable for any reason, the invalid or unenforceable provision shall be severed from these Terms. Severance of invalid or unenforceable provisions of any of these Terms will not affect the validity or enforceability of any other of these Terms, all of which will remain in full force and effect. The Compliance Entities will have no responsibility or liability for any failure or delay in performance, or any loss or damage that you may incur, due to any Force Majeure or circumstance or event beyond its control. You may not assign or transfer any of your rights or obligations under these Terms, without the Compliance Entities' prior written consent, including by operation of law or in connection with any change of control, and any such assignment or transfer by you without the Compliance Entities' prior written consent shall be null and void and of no effect. The Compliance Entities may assign or transfer any or all of its rights or obligations under these Terms, without notice or your consent. If there is a conflict between these Terms and any other agreement with the Compliance Entities, these Terms will control unless the other agreement specifically identifies these Terms and declares that the other agreement supersedes these Terms. These Terms do not create any third-party beneficiary rights in any person, save that any Compliance Entity or any of its respective Associates may rely on these Terms in any action, suit, proceeding or other dispute brought against it by you, to exercise any right or to benefit from any limitation expressly provided to it hereunder and to enforce such provisions of these Terms as if party hereto. + +## **Governing Law and Resolution of Disputes** + +Any dispute, claim, controversy or action arising out of or related to (a) these Terms or the existence, breach, termination, enforcement, interpretation or validity thereof or (b) your MobileCoins or MobileCoin Wallet, will be subject to the exclusive jurisdiction of the courts of the British Virgin Islands. This provision expressly applies to any claim, whether in tort, contract or otherwise, against the Compliance Entities. + +You irrevocably and unconditionally agree and consent to the jurisdiction and venue of the courts of the British Virgin Islands, and you waive any objections. The foregoing shall be without prejudice to any applicable provisions of mandatory consumer protection law under the laws of your country of residence, to the extent that these offer you more protection. + +Any complaint or dispute is personal to you and you agree that it will not be brought as a class action, class arbitration or any other type of representative proceeding. There will be no class action in which you attempt to resolve a complaint or dispute as a representative of another individual or group of individuals, save with the express agreement in writing of the relevant Compliance Entity. + +JURY TRIAL WAIVER: TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, THE PARTIES HEREBY IRREVOCABLY AND UNCONDITIONALLY WAIVE ALL RIGHT TO TRIAL BY JURY IN ANY LEGAL ACTION OR PROCEEDING OF ANY KIND WHATSOVER ARISING OUT OF OR RELATING TO THESE TERMS OR ANY BREACH THEREOF, ANY USE OR ATTEMPTED USE OR TRANSFER OF MOBILECOINS OR USE OR ATTEMPED USE OF A MOBILECOIN WALLET BY YOU, AND/OR ANY OTHER MATTER INVOLVING THE PARTIES. + +## **Language and Contact** + +These Terms and any information or notifications that are provided under these Terms shall be in English. + +If you have any questions relating to these Terms, your rights and obligations arising from these Terms and/or your use of any MobileCoins and any MobileCoin Wallets, please use the question form at [www.buymobilecoin.us](https://www.buymobilecoin.us/) or the MobileCoin TS Ltd. website at [www.buymobilecoin.com](https://www.buymobilecoin.com/). + diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..ea28272 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,21 @@ +include: package:very_good_analysis/analysis_options.2.3.0.yaml +analyzer: + exclude: [lib/src/protobufs/generated/*, analysis_options.yaml] +linter: + rules: + avoid_final_parameters: true + avoid_multiple_declarations_per_line: true + close_sinks: true + no_leading_underscores_for_library_prefixes: true + no_leading_underscores_for_local_identifiers: true + no_runtimeType_toString: true + prefer_if_elements_to_conditional_expressions: false + prefer_null_aware_operators: true + public_member_api_docs: false + require_trailing_commas: true + sized_box_shrink_expand: true + super_goes_last: true + use_enums: true + use_if_null_to_convert_nulls_to_bools: true + use_setters_to_change_properties: false + always_use_package_imports: true diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..c6cbe56 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..55a0ba4 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,41 @@ +group 'com.mobilecoin.mobilecoin_flutter' +version '1.0' + +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.2.2' + } +} +rootProject.allprojects { + repositories { + google() + mavenCentral() + maven { + url "https://dl.cloudsmith.io/qxAgwaeEE1vN8aLU/mobilecoin/mobilecoin/maven/" + } + } +} + +apply plugin: 'com.android.library' + +dependencies { + implementation 'com.mobilecoin:android-sdk:6.0.0' +} + +android { + compileSdkVersion 30 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + defaultConfig { + minSdkVersion 19 + } +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..7e43e85 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Oct 03 13:26:15 PDT 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..4db8076 --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'mobilecoin_flutter' diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..087a981 --- /dev/null +++ b/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/Ffi.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/Ffi.java new file mode 100644 index 0000000..41030ec --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/Ffi.java @@ -0,0 +1,24 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import android.os.Handler; +import android.os.Looper; + +import io.flutter.plugin.common.MethodChannel.Result; + +class Ffi { + + private Ffi() { + } + + static void processSuccess(final Result result, final Object value) { + final Handler handler = new Handler(Looper.getMainLooper()); + handler.post(() -> result.success(value)); + } + + static void processError(final Result result, final String message, final Object details) { + final Handler handler = new Handler(Looper.getMainLooper()); + handler.post(() -> result.error("NATIVE", message, details)); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiAccountKey.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiAccountKey.java new file mode 100644 index 0000000..db8ed09 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiAccountKey.java @@ -0,0 +1,36 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import android.net.Uri; + +import androidx.annotation.Keep; + +import com.mobilecoin.lib.AccountKey; +import com.mobilecoin.lib.PublicAddress; +import com.mobilecoin.lib.exceptions.InvalidUriException; +import com.mobilecoin.lib.exceptions.BadEntropyException; + +@Keep +public class FfiAccountKey { + + private FfiAccountKey() { + } + + public static int fromBip39Entropy(byte[] entropy, String fogReportUri, String reportId, byte[] fogAuthoritySpki) + throws InvalidUriException, BadEntropyException { + AccountKey accountKey = AccountKey.fromBip39Entropy(entropy, 0, Uri.parse(fogReportUri), reportId, + fogAuthoritySpki); + final int hashCode = accountKey.hashCode(); + ObjectStorage.addObject(hashCode, accountKey); + return hashCode; + } + + public static int getPublicAddress(int addressId) { + AccountKey accountKey = (AccountKey) ObjectStorage.objectForKey(addressId); + PublicAddress publicAddress = accountKey.getPublicAddress(); + final int hashCode = publicAddress.hashCode(); + ObjectStorage.addObject(hashCode, publicAddress); + return hashCode; + } +} \ No newline at end of file diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiClientConfig.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiClientConfig.java new file mode 100644 index 0000000..3f9141f --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiClientConfig.java @@ -0,0 +1,60 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import com.mobilecoin.lib.exceptions.AttestationException; +import com.mobilecoin.lib.ClientConfig; +import com.mobilecoin.lib.TrustedIdentities; +import com.mobilecoin.lib.util.Hex; + +public class FfiClientConfig { + private FfiClientConfig() {} + + public static int create() { + ClientConfig config = new ClientConfig(); + final int hashCode = config.hashCode(); + ObjectStorage.addObject(hashCode, config); + return hashCode; + } + + public static void addServiceConfig(Integer clientConfigId, String fogViewMrEnclave, + String fogLedgerMrEnclave, String fogReportMrEnclave, String consensusMrEnclave, + String[] hardeningAdvisories) throws AttestationException { + ClientConfig clientConfig = (ClientConfig) ObjectStorage.objectForKey(clientConfigId); + ClientConfig.Service fogViewService = clientConfig.fogView; + ClientConfig.Service fogLedgerService = clientConfig.fogLedger; + ClientConfig.Service fogReportService = clientConfig.report; + ClientConfig.Service consensusService = clientConfig.consensus; + if (fogViewService == null) { + fogViewService = new ClientConfig.Service().withTrustedIdentities(new TrustedIdentities()); + } + if (fogLedgerService == null) { + fogLedgerService = new ClientConfig.Service().withTrustedIdentities(new TrustedIdentities()); + } + if (fogReportService == null) { + fogReportService = new ClientConfig.Service().withTrustedIdentities(new TrustedIdentities()); + } + if (consensusService == null) { + consensusService = new ClientConfig.Service().withTrustedIdentities(new TrustedIdentities()); + } + TrustedIdentities fogViewIdentities = fogViewService.getTrustedIdentities(); + fogViewIdentities.addMrEnclaveIdentity(Hex.toByteArray(fogViewMrEnclave), null, hardeningAdvisories); + + TrustedIdentities fogLedgerIdentities = fogLedgerService.getTrustedIdentities(); + fogLedgerIdentities.addMrEnclaveIdentity(Hex.toByteArray(fogLedgerMrEnclave), null, + hardeningAdvisories); + + TrustedIdentities fogReportIdentities = fogReportService.getTrustedIdentities(); + fogReportIdentities.addMrEnclaveIdentity(Hex.toByteArray(fogReportMrEnclave), null, + hardeningAdvisories); + + TrustedIdentities consensusIdentities = consensusService.getTrustedIdentities(); + consensusIdentities.addMrEnclaveIdentity(Hex.toByteArray(consensusMrEnclave), null, + hardeningAdvisories); + + clientConfig.fogView = fogViewService; + clientConfig.fogLedger = fogLedgerService; + clientConfig.report = fogReportService; + clientConfig.consensus = consensusService; + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiCryptoBox.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiCryptoBox.java new file mode 100644 index 0000000..363489d --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiCryptoBox.java @@ -0,0 +1,27 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import androidx.annotation.Keep; + +import com.mobilecoin.lib.DefaultVersionedCryptoBox; +import com.mobilecoin.lib.RistrettoPrivate; +import com.mobilecoin.lib.RistrettoPublic; + +@Keep +public class FfiCryptoBox { + + private FfiCryptoBox() { } + + public static byte[] encrypt(byte[] data, int ristrettoPublicId) { + RistrettoPublic ristrettoPublic = (RistrettoPublic) ObjectStorage.objectForKey(ristrettoPublicId); + final DefaultVersionedCryptoBox cryptoBox = new DefaultVersionedCryptoBox(); + return cryptoBox.versionedCryptoBoxEncrypt(ristrettoPublic, data); + } + + public static byte[] decrypt(byte[] encrypted, int ristrettoPrivateId) throws Exception { + RistrettoPrivate ristrettoPrivate = (RistrettoPrivate) ObjectStorage.objectForKey(ristrettoPrivateId); + final DefaultVersionedCryptoBox cryptoBox = new DefaultVersionedCryptoBox(); + return cryptoBox.versionedCryptoBoxDecrypt(ristrettoPrivate, encrypted); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMnemonic.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMnemonic.java new file mode 100644 index 0000000..b86278e --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMnemonic.java @@ -0,0 +1,29 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import android.text.TextUtils; + +import androidx.annotation.Keep; +import com.mobilecoin.lib.Mnemonics; +import com.mobilecoin.lib.exceptions.BadEntropyException; +import com.mobilecoin.lib.exceptions.BadMnemonicException;; + +@Keep +public class FfiMnemonic { + + private FfiMnemonic() { + } + + public static String fromBip39Entropy(byte[] entropy) throws BadEntropyException { + return Mnemonics.bip39EntropyToMnemonic(entropy); + } + + public static byte[] toBip39Entropy(String mnemonicPhrase) throws BadMnemonicException { + return Mnemonics.bip39EntropyFromMnemonic(mnemonicPhrase); + } + + public static String allWords() throws BadMnemonicException { + return TextUtils.join(",", Mnemonics.wordsByPrefix("")); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMobileCoinClient.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMobileCoinClient.java new file mode 100644 index 0000000..f50a899 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiMobileCoinClient.java @@ -0,0 +1,464 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import android.net.Uri; +import android.util.Base64; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.mobilecoin.lib.AccountActivity; +import com.mobilecoin.lib.AccountKey; +import com.mobilecoin.lib.AccountSnapshot; +import com.mobilecoin.lib.AddressHash; +import com.mobilecoin.lib.Amount; +import com.mobilecoin.lib.Balance; +import com.mobilecoin.lib.ChaCha20Rng; +import com.mobilecoin.lib.ClientConfig; +import com.mobilecoin.lib.DefaultRng; +import com.mobilecoin.lib.DefragmentationDelegate; +import com.mobilecoin.lib.DestinationMemo; +import com.mobilecoin.lib.DestinationMemoData; +import com.mobilecoin.lib.DestinationWithPaymentIntentMemo; +import com.mobilecoin.lib.DestinationWithPaymentIntentMemoData; +import com.mobilecoin.lib.DestinationWithPaymentRequestMemo; +import com.mobilecoin.lib.DestinationWithPaymentRequestMemoData; +import com.mobilecoin.lib.MobileCoinClient; +import com.mobilecoin.lib.OwnedTxOut; +import com.mobilecoin.lib.PendingTransaction; +import com.mobilecoin.lib.PublicAddress; +import com.mobilecoin.lib.RandomLoadBalancer; +import com.mobilecoin.lib.RistrettoPublic; +import com.mobilecoin.lib.SenderMemo; +import com.mobilecoin.lib.SenderWithPaymentIntentMemo; +import com.mobilecoin.lib.SenderWithPaymentRequestMemo; +import com.mobilecoin.lib.TokenId; +import com.mobilecoin.lib.Transaction; +import com.mobilecoin.lib.TxOutMemo; +import com.mobilecoin.lib.TxOutMemoBuilder; +import com.mobilecoin.lib.TxOutMemoType; +import com.mobilecoin.lib.UnsignedLong; +import com.mobilecoin.lib.TrustedIdentities; +import com.mobilecoin.lib.exceptions.AttestationException; +import com.mobilecoin.lib.exceptions.FeeRejectedException; +import com.mobilecoin.lib.exceptions.FogReportException; +import com.mobilecoin.lib.exceptions.FogSyncException; +import com.mobilecoin.lib.exceptions.FragmentedAccountException; +import com.mobilecoin.lib.exceptions.InsufficientFundsException; +import com.mobilecoin.lib.exceptions.InvalidFogResponse; +import com.mobilecoin.lib.exceptions.InvalidTransactionException; +import com.mobilecoin.lib.exceptions.InvalidTxOutMemoException; +import com.mobilecoin.lib.exceptions.InvalidUriException; +import com.mobilecoin.lib.exceptions.NetworkException; +import com.mobilecoin.lib.exceptions.SerializationException; +import com.mobilecoin.lib.exceptions.TransactionBuilderException; +import com.mobilecoin.lib.network.TransportProtocol; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.math.BigInteger; + +import consensus_common.ConsensusCommon; +import mistyswap.AttestedMistySwapClient; +import mistyswap.MistySwapUri; + +@Keep +public class FfiMobileCoinClient { + + private FfiMobileCoinClient() {} + + public static int create(int accountKeyId, String fogUrl, String consensusUrl, + @Nullable String mistySwapUrl, boolean useTestNet, Integer clientConfigId) throws InvalidUriException, AttestationException { + AccountKey accountKey = (AccountKey) ObjectStorage.objectForKey(accountKeyId); + ClientConfig clientConfig = (ClientConfig) ObjectStorage.objectForKey(clientConfigId); + MobileCoinClient mobileCoinClient = new MobileCoinClient(accountKey, Uri.parse(fogUrl), + Uri.parse(consensusUrl), clientConfig, TransportProtocol.forGRPC()); + + final int mobileCoinClientHashCode = mobileCoinClient.hashCode(); + ObjectStorage.addObject(mobileCoinClientHashCode, mobileCoinClient); + + if (!useTestNet && mistySwapUrl != null && !mistySwapUrl.isEmpty()) { + AttestedMistySwapClient mistySwapClient = new AttestedMistySwapClient( + RandomLoadBalancer.create(new MistySwapUri(mistySwapUrl)), + new ClientConfig.Service().withTrustedIdentities((new TrustedIdentities())), + TransportProtocol.forGRPC()); + ObjectStorage.addObject(mistySwapClientHashCode(mobileCoinClientHashCode), mistySwapClient); + } + return mobileCoinClientHashCode; + } + + static int mistySwapClientHashCode(int mobileCoinClientHashCode) { + // TODO: will this work? + return mobileCoinClientHashCode + 1; + } + + public static String getBalance(int mobileClientId) throws InvalidFogResponse, NetworkException, + AttestationException, FogSyncException, JSONException { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + Map balances = mobileCoinClient.getBalances(); + JSONObject result = new JSONObject(); + for (TokenId tokenId : balances.keySet()) { + String balance = balances.get(tokenId).getValue().toString(); + result.put(tokenId.getId().toString(), balance); + } + return result.toString(); + } + + public static String getAccountActivity(int mobileClientId) + throws NetworkException, InvalidFogResponse, AttestationException, JSONException, + FogSyncException, TransactionBuilderException { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + AccountSnapshot snapshot = mobileCoinClient.getAccountSnapshot(); + Map balances = snapshot.getBalances(); + JSONObject result = new JSONObject(); + for (TokenId tokenId : balances.keySet()) { + JSONObject activity = new JSONObject(); + Amount minFee = mobileCoinClient.getOrFetchMinimumTxFee(tokenId); + Amount transferableAmount = snapshot.getTransferableAmount(minFee); + String balance = snapshot.getBalance(tokenId).getValue().toString(); + AccountActivity accountActivity = snapshot.getAccountActivity(); + AccountKey accountKey = mobileCoinClient.getAccountKey(); + activity.put("balance", balance); + activity.put("transferableAmount", transferableAmount.getValue().toString()); + activity.put("blockCount", accountActivity.getBlockCount()); + Set ownedTxOuts = accountActivity.getAllTokenTxOuts(tokenId); + JSONArray txOuts = new JSONArray(); + for (OwnedTxOut txOut : ownedTxOuts) { + JSONObject jsonTxOut = new JSONObject(); + jsonTxOut.put("value", txOut.getAmount().getValue().toString()); + + if (txOut.getReceivedBlockTimestamp() != null) { + jsonTxOut.put("receivedDate", txOut.getReceivedBlockTimestamp().getTime()); + } + + jsonTxOut.put("receivedBlock", txOut.getReceivedBlockIndex().toString()); + jsonTxOut.put("publicKey", + Base64.encodeToString(txOut.getPublicKey().getKeyBytes(), Base64.NO_WRAP)); + jsonTxOut.put("keyImage", + Base64.encodeToString(txOut.getKeyImage().getData(), Base64.NO_WRAP)); + jsonTxOut.put("sharedSecret", Base64.encodeToString( + txOut.getSharedSecret(accountKey).getKeyBytes(), Base64.NO_WRAP)); + + TxOutMemo txOutMemo = txOut.getTxOutMemo(); + try { + JSONObject jsonMemo = memoToJson(txOutMemo); + if (null != jsonMemo) { + jsonTxOut.put("memo", jsonMemo); + } + } catch (Exception ignored) { /* skip unknown memos */ } + + if (txOut.getSpentBlockIndex() != null) { + jsonTxOut.put("spentBlock", txOut.getSpentBlockIndex().toString()); + + // spentBlockTimestamp is null when checking a spent TxOut before Fog Ledger + // knows it is spent + if (txOut.getSpentBlockTimestamp() != null) { + jsonTxOut.put("spentDate", txOut.getSpentBlockTimestamp().getTime()); + } + } + txOuts.put(jsonTxOut); + } + activity.put("txOuts", txOuts); + result.put(tokenId.getId().toString(), activity); + } + return result.toString(); + } + + + @Nullable + static JSONObject memoToJson(@NonNull TxOutMemo txOutMemo) throws JSONException, InvalidTxOutMemoException { + JSONObject jsonMemoData = new JSONObject(); + final String memoTypeBytes; + final String memoTypeName; + final AddressHash addressHash; + + TxOutMemoType memoType = txOutMemo.getTxOutMemoType(); + switch (memoType) { + case NOT_SET: + case UNUSED: + case UNKNOWN: + return null; + case SENDER: + memoTypeBytes = "0100"; + memoTypeName = "SenderMemo"; + addressHash = ((SenderMemo)txOutMemo).getUnvalidatedAddressHash(); + break; + case SENDER_WITH_PAYMENT_REQUEST: + memoTypeBytes = "0101"; + memoTypeName = "SenderWithPaymentRequestIdMemo"; + SenderWithPaymentRequestMemo senderWithPaymentRequestMemo = (SenderWithPaymentRequestMemo)txOutMemo; + UnsignedLong paymentRequestId = senderWithPaymentRequestMemo + .getUnvalidatedSenderWithPaymentRequestMemoData().getPaymentRequestId(); + addressHash = senderWithPaymentRequestMemo.getUnvalidatedAddressHash(); + jsonMemoData.put("paymentRequestId", paymentRequestId.toString()); + break; + case SENDER_WITH_PAYMENT_INTENT: + memoTypeBytes = "0102"; + memoTypeName = "SenderWithPaymentIntentIdMemo"; + addressHash = ((SenderWithPaymentIntentMemo)txOutMemo).getUnvalidatedAddressHash(); + SenderWithPaymentIntentMemo senderWithPaymentIntentMemo = (SenderWithPaymentIntentMemo)txOutMemo; + UnsignedLong paymentIntentId = senderWithPaymentIntentMemo + .getUnvalidatedSenderWithPaymentIntentMemoData().getPaymentIntentId(); + jsonMemoData.put("paymentIntentId", paymentIntentId.toString()); + break; + case DESTINATION: + memoTypeBytes = "0200"; + memoTypeName = "DestinationMemo"; + DestinationMemoData destinationMemoData = ((DestinationMemo) txOutMemo).getDestinationMemoData(); + addressHash = destinationMemoData.getAddressHash(); + jsonMemoData.put("fee", destinationMemoData.getFee().toString()); + jsonMemoData.put("totalOutlay", destinationMemoData.getTotalOutlay().toString()); + jsonMemoData.put("numberOfRecipients", String.valueOf(destinationMemoData.getNumberOfRecipients())); + break; + case DESTINATION_WITH_PAYMENT_REQUEST: + memoTypeBytes = "0203"; + memoTypeName = "DestinationWithPaymentRequestIdMemo"; + DestinationWithPaymentRequestMemoData destinationWithPaymentRequestMemoData = ((DestinationWithPaymentRequestMemo)txOutMemo).getDestinationWithPaymentRequestMemoData(); + addressHash = destinationWithPaymentRequestMemoData.getAddressHash(); + jsonMemoData.put("fee", destinationWithPaymentRequestMemoData.getFee().toString()); + jsonMemoData.put("totalOutlay", destinationWithPaymentRequestMemoData.getTotalOutlay().toString()); + jsonMemoData.put("numberOfRecipients", String.valueOf(destinationWithPaymentRequestMemoData.getNumberOfRecipients())); + jsonMemoData.put("paymentRequestId", destinationWithPaymentRequestMemoData.getPaymentRequestId().toString()); + break; + case DESTINATION_WITH_PAYMENT_INTENT: + memoTypeBytes = "0204"; + memoTypeName = "DestinationWithPaymentIntentIdMemo"; + DestinationWithPaymentIntentMemoData destinationWithPaymentIntentMemoData = ((DestinationWithPaymentIntentMemo)txOutMemo).getDestinationWithPaymentIntentMemoData(); + addressHash = destinationWithPaymentIntentMemoData.getAddressHash(); + jsonMemoData.put("fee", destinationWithPaymentIntentMemoData.getFee().toString()); + jsonMemoData.put("totalOutlay", destinationWithPaymentIntentMemoData.getTotalOutlay().toString()); + jsonMemoData.put("numberOfRecipients", String.valueOf(destinationWithPaymentIntentMemoData.getNumberOfRecipients())); + jsonMemoData.put("paymentIntentId", destinationWithPaymentIntentMemoData.getPaymentIntentId().toString()); + break; + default: + // skip unknown memo + return null; + } + String addressHashHex = bytesToHex(addressHash.getHashData()); + jsonMemoData.put("addressHashHex", addressHashHex); + + JSONObject jsonMemo = new JSONObject(); + jsonMemo.put("typeBytes", memoTypeBytes); + jsonMemo.put("typeName", memoTypeName); + jsonMemo.put("data", jsonMemoData); + return jsonMemo; + } + + private static final byte[] HEX_ARRAY = "0123456789abcdef".getBytes(StandardCharsets.US_ASCII); + + private static String bytesToHex(byte[] bytes) { + byte[] hexChars = new byte[bytes.length * 2]; + for (int j = 0; j < bytes.length; j++) { + int v = bytes[j] & 0xFF; + hexChars[j * 2] = HEX_ARRAY[v >>> 4]; + hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F]; + } + return new String(hexChars, StandardCharsets.UTF_8); + } + + public static void setAuthorization(int mobileClientId, @NonNull String username, + @NonNull String password) { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + mobileCoinClient.setFogBasicAuthorization(username, password); + } + + public static int checkTransactionStatus(int mobileClientId, int receiptId) + throws AttestationException, InvalidFogResponse, NetworkException, FogSyncException { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + Transaction transaction = (Transaction) ObjectStorage.objectForKey(receiptId); + + // more race condition testing will need to be done before changing this to + // `getTransactionStatusQuick` + Transaction.Status status = mobileCoinClient.getTransactionStatus(transaction); + switch (status) { + case ACCEPTED: + return 1; + case FAILED: + return 2; + case UNKNOWN: + default: + return 0; + } + } + + @Nullable + static UnsignedLong tryParseLong(String value) { + try { + return UnsignedLong.fromBigInteger(new BigInteger(value)); + } catch (Exception e) { + return null; + } + } + + public static HashMap createPendingTransaction(int mobileClientId, + int recipientId, @NonNull PicoMob fee, @NonNull PicoMob amount, + @NonNull TokenId tokenId, byte[] rngSeed, String paymentRequestIdString) throws InvalidFogResponse, + AttestationException, FeeRejectedException, InsufficientFundsException, + FragmentedAccountException, NetworkException, TransactionBuilderException, + FogReportException, FogSyncException, SerializationException { + PublicAddress recipient = (PublicAddress) ObjectStorage.objectForKey(recipientId); + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + final UnsignedLong paymentRequestId = tryParseLong(paymentRequestIdString); + TxOutMemoBuilder txOutMemoBuilder = paymentRequestId == null ? + TxOutMemoBuilder + .createSenderAndDestinationRTHMemoBuilder(mobileCoinClient.getAccountKey()) : + TxOutMemoBuilder + .createSenderPaymentRequestAndDestinationRTHMemoBuilder(mobileCoinClient.getAccountKey(), paymentRequestId); + + // Reusing an rngSeed makes it so the public key is always the same, ensuring + // idempotence + ChaCha20Rng rng = ChaCha20Rng.fromSeed(rngSeed); + + final PendingTransaction pendingTransaction = mobileCoinClient.prepareTransaction(recipient, + new Amount(amount.getPicoCountAsBigInt(), tokenId), + new Amount(fee.getPicoCountAsBigInt(), tokenId), txOutMemoBuilder, rng); + + HashMap returnPayload = new HashMap<>(); + returnPayload.put("transaction", pendingTransaction.getTransaction().toByteArray()); + + final RistrettoPublic payloadTxOutPublicKey = + pendingTransaction.getPayloadTxOutContext().getTxOutPublicKey(); + final RistrettoPublic payloadTxOutSharedSecret = + pendingTransaction.getPayloadTxOutContext().getSharedSecret(); + final RistrettoPublic changeTxOutPublicKey = + pendingTransaction.getChangeTxOutContext().getTxOutPublicKey(); + final RistrettoPublic changeTxOutSharedSecret = + pendingTransaction.getChangeTxOutContext().getSharedSecret(); + + returnPayload.put("payloadTxOutPublicKey", + Base64.encodeToString(payloadTxOutPublicKey.getKeyBytes(), Base64.NO_WRAP)); + returnPayload.put("payloadTxOutSharedSecret", + Base64.encodeToString(payloadTxOutSharedSecret.getKeyBytes(), Base64.NO_WRAP)); + returnPayload.put("changeTxOutPublicKey", + Base64.encodeToString(changeTxOutPublicKey.getKeyBytes(), Base64.NO_WRAP)); + returnPayload.put("changeTxOutSharedSecret", + Base64.encodeToString(changeTxOutSharedSecret.getKeyBytes(), Base64.NO_WRAP)); + + return returnPayload; + } + + public static String sendFunds(int mobileClientId, byte[] serializedTransaction) + throws SerializationException, JSONException { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + Transaction transaction = Transaction.fromBytes(serializedTransaction); + int receiptId = transaction.hashCode(); + + ObjectStorage.addObject(receiptId, transaction); + + JSONObject resultObject = new JSONObject(); + + try { + final long blockIndex = mobileCoinClient.submitTransaction(transaction); + + resultObject.put("status", "OK"); + resultObject.put("blockIndex", blockIndex); + resultObject.put("receiptId", receiptId); + } catch (InvalidTransactionException e) { + final ConsensusCommon.ProposeTxResult result = + e.getResult() == null ? ConsensusCommon.ProposeTxResult.UNRECOGNIZED + : e.getResult(); + + resultObject.put("blockIndex", e.getBlockIndex()); + + switch (result) { + case ContainsSpentKeyImage: + case ContainsExistingOutputPublicKey: + resultObject.put("status", "INPUT_ALREADY_SPENT"); + case TxFeeError: + resultObject.put("status", "FEE_ERROR"); + case MissingMemo: + resultObject.put("status", "MISSING_MEMO"); + case TombstoneBlockTooFar: + resultObject.put("status", "TOMBSTONE_BLOCK_TOO_FAR"); + default: + resultObject.put("status", "INVALID_TRANSACTION"); + } + } catch (NetworkException e) { + resultObject.put("status", "NETWORK_ERROR"); + } catch (AttestationException e) { + resultObject.put("status", "ATTESTATION_EXCEPTION"); + } + + return resultObject.toString(); + } + + public static boolean requiresDefragmentation(int mobileClientId, + @NonNull BigInteger amount, @NonNull TokenId tokenId) throws Exception { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + return mobileCoinClient.requiresDefragmentation( + new Amount(amount, tokenId) + ); + } + + public static void defragmentAccount(int mobileClientId, + @NonNull BigInteger amount, @NonNull TokenId tokenId, + boolean shouldWriteRTHMemos, @Nullable byte[] rngSeed + ) throws Exception { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + + DefragmentationDelegate defragDelegate = new DefragmentationDelegate() { + @Override + public void onStart() { } + + @Override + public boolean onStepReady(@NonNull PendingTransaction defragStepTx, + @NonNull BigInteger fee) throws NetworkException, + InvalidTransactionException, AttestationException { + mobileCoinClient.submitTransaction(defragStepTx.getTransaction()); + return true; + } + + @Override + public void onComplete() { } + + @Override + public void onCancel() { } + }; + + Amount tokenAmount = new Amount(amount, tokenId); + if (null == rngSeed || rngSeed.length < 32) { + mobileCoinClient.defragmentAccount(tokenAmount, defragDelegate, shouldWriteRTHMemos, DefaultRng.createInstance()); + } else { + ChaCha20Rng rng = ChaCha20Rng.fromSeed(rngSeed); + mobileCoinClient.defragmentAccount(tokenAmount, defragDelegate, shouldWriteRTHMemos, rng); + } + } + + public static String estimateTotalFee(int mobileClientId, + @NonNull BigInteger amount, @NonNull TokenId tokenId + ) throws Exception { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + + Amount tokenAmount = new Amount(amount, tokenId); + Amount fee = mobileCoinClient.estimateTotalFee(tokenAmount); + return fee.getValue().toString(); + } + + public static String getTransferableAmount( + int mobileClientId, + @NonNull TokenId tokenId + ) throws Exception { + MobileCoinClient mobileCoinClient = + (MobileCoinClient) ObjectStorage.objectForKey(mobileClientId); + + Amount amount = mobileCoinClient.getTransferableAmount(tokenId); + return amount.getValue().toString(); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiOnetimeKeys.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiOnetimeKeys.java new file mode 100644 index 0000000..35a1b76 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiOnetimeKeys.java @@ -0,0 +1,27 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import androidx.annotation.Keep; + +import com.mobilecoin.lib.OnetimeKeys; +import com.mobilecoin.lib.RistrettoPublic; +import com.mobilecoin.lib.RistrettoPrivate; + + +@Keep +public class FfiOnetimeKeys { + + private FfiOnetimeKeys() { + } + + public static int createTxOutPublicKey(final int txOutPrivateKeyId, final int recipientSpendPublicKeyId) { + final RistrettoPrivate privateKey = (RistrettoPrivate) ObjectStorage.objectForKey(txOutPrivateKeyId); + final RistrettoPublic publicKey = (RistrettoPublic) ObjectStorage.objectForKey(recipientSpendPublicKeyId); + final RistrettoPublic txOutPublicKey = OnetimeKeys.createTxOutPublicKey(privateKey, publicKey); + final int hashCode = txOutPublicKey.hashCode(); + ObjectStorage.addObject(hashCode, txOutPublicKey); + return hashCode; + } + +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPaymentRequest.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPaymentRequest.java new file mode 100644 index 0000000..44fb1f3 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPaymentRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import com.mobilecoin.lib.PaymentRequest; +import com.mobilecoin.lib.PublicAddress; +import com.mobilecoin.lib.TokenId; +import com.mobilecoin.lib.UnsignedLong; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +@Keep +public class FfiPaymentRequest { + + public static int create(int publicAddressId, @Nullable UnsignedLong amount, + @Nullable String memo, @NonNull TokenId tokenId) { + PublicAddress publicAddress = (PublicAddress) ObjectStorage.objectForKey(publicAddressId); + if (memo == null) memo = ""; + if (amount == null) amount = UnsignedLong.ZERO; + PaymentRequest paymentRequest = new PaymentRequest(publicAddress, amount, memo, tokenId); + final int hashCode = paymentRequest.hashCode(); + ObjectStorage.addObject(hashCode, paymentRequest); + return hashCode; + } + + public static String getValue(int requestId) { + PaymentRequest paymentRequest = (PaymentRequest) ObjectStorage.objectForKey(requestId); + UnsignedLong value = paymentRequest.getValue(); + return value.toString(); + } + + public static String getMemo(int requestId) { + PaymentRequest paymentRequest = (PaymentRequest) ObjectStorage.objectForKey(requestId); + return paymentRequest.getMemo(); + } + + public static String getTokenId(int requestId) { + PaymentRequest paymentRequest = (PaymentRequest) ObjectStorage.objectForKey(requestId); + return paymentRequest.getTokenId().getId().toString(); + } + + public static int getPublicAddress(int requestId) { + PaymentRequest paymentRequest = (PaymentRequest) ObjectStorage.objectForKey(requestId); + PublicAddress publicAddress = paymentRequest.getPublicAddress(); + final int hashCode = publicAddress.hashCode(); + ObjectStorage.addObject(hashCode, publicAddress); + return hashCode; + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPrintableWrapper.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPrintableWrapper.java new file mode 100644 index 0000000..808ecf8 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPrintableWrapper.java @@ -0,0 +1,97 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import com.mobilecoin.lib.PaymentRequest; +import com.mobilecoin.lib.PrintableWrapper; +import com.mobilecoin.lib.TransferPayload; +import com.mobilecoin.lib.PublicAddress; +import com.mobilecoin.lib.exceptions.SerializationException; + +import androidx.annotation.Keep; + +import java.util.Objects; + +@Keep +public class FfiPrintableWrapper { + + private FfiPrintableWrapper() { + } + + public static int fromB58String(String b58String) throws SerializationException { + PrintableWrapper printableWrapper = PrintableWrapper.fromB58String(b58String); + final int hashCode = printableWrapper.hashCode(); + ObjectStorage.addObject(hashCode, printableWrapper); + return hashCode; + } + + public static String toB58String(int wrapperId) throws SerializationException { + PrintableWrapper printableWrapper = (PrintableWrapper) ObjectStorage.objectForKey(wrapperId); + return printableWrapper.toB58String(); + } + + public static int fromPublicAddress(int publicAddressId) throws SerializationException { + PublicAddress publicAddress = (PublicAddress) ObjectStorage.objectForKey(publicAddressId); + PrintableWrapper printableWrapper = PrintableWrapper.fromPublicAddress(publicAddress); + final int hashCode = printableWrapper.hashCode(); + ObjectStorage.addObject(hashCode, printableWrapper); + return hashCode; + } + + public static boolean hasPublicAddress(int wrapperId) { + PrintableWrapper printableWrapper = (PrintableWrapper) ObjectStorage.objectForKey(wrapperId); + return printableWrapper.hasPublicAddress(); + } + + public static int getPublicAddress(int wrapperId) { + PrintableWrapper printableWrapper = (PrintableWrapper) ObjectStorage.objectForKey(wrapperId); + PublicAddress publicAddress = printableWrapper.getPublicAddress(); + Objects.requireNonNull(publicAddress); + final int hashCode = publicAddress.hashCode(); + ObjectStorage.addObject(hashCode, publicAddress); + return hashCode; + } + + public static int fromTransferPayload(int payloadId) throws SerializationException { + TransferPayload transferPayload = (TransferPayload) ObjectStorage.objectForKey(payloadId); + PrintableWrapper printableWrapper = PrintableWrapper.fromTransferPayload(transferPayload); + final int hashCode = printableWrapper.hashCode(); + ObjectStorage.addObject(hashCode, printableWrapper); + return hashCode; + } + + public static boolean hasTransferPayload(int wrapperId) { + PrintableWrapper printableWrapper = (PrintableWrapper) ObjectStorage.objectForKey(wrapperId); + return printableWrapper.hasTransferPayload(); + } + + public static int getTransferPayload(int wrapperId) { + PrintableWrapper printableWrapper = (PrintableWrapper) ObjectStorage.objectForKey(wrapperId); + TransferPayload transferPayload = printableWrapper.getTransferPayload(); + Objects.requireNonNull(transferPayload); + final int hashCode = transferPayload.hashCode(); + ObjectStorage.addObject(hashCode, transferPayload); + return hashCode; + } + + public static int fromPaymentRequest(int paymentRequestId) throws SerializationException { + PaymentRequest paymentRequest = (PaymentRequest) ObjectStorage.objectForKey(paymentRequestId); + PrintableWrapper printableWrapper = PrintableWrapper.fromPaymentRequest(paymentRequest); + final int hashCode = printableWrapper.hashCode(); + ObjectStorage.addObject(hashCode, printableWrapper); + return hashCode; + } + public static boolean hasPaymentRequest(int wrapperId) { + PrintableWrapper printableWrapper = (PrintableWrapper) ObjectStorage.objectForKey(wrapperId); + return printableWrapper.hasPaymentRequest(); + } + + public static int getPaymentRequest(int wrapperId) { + PrintableWrapper printableWrapper = (PrintableWrapper) ObjectStorage.objectForKey(wrapperId); + PaymentRequest paymentRequest = printableWrapper.getPaymentRequest(); + Objects.requireNonNull(paymentRequest); + final int hashCode = paymentRequest.hashCode(); + ObjectStorage.addObject(hashCode, paymentRequest); + return hashCode; + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPublicAddress.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPublicAddress.java new file mode 100644 index 0000000..0d06225 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiPublicAddress.java @@ -0,0 +1,31 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import androidx.annotation.Keep; + +import com.mobilecoin.lib.PublicAddress; +import com.mobilecoin.lib.exceptions.SerializationException; + +@Keep +public class FfiPublicAddress { + + private FfiPublicAddress() {} + + public static int fromBytes(byte[] serializedBytes) throws SerializationException { + PublicAddress publicAddress = PublicAddress.fromBytes(serializedBytes); + final int hashCode = publicAddress.hashCode(); + ObjectStorage.addObject(hashCode, publicAddress); + return hashCode; + } + + public static byte[] toByteArray(int addressId) { + PublicAddress publicAddress = (PublicAddress)ObjectStorage.objectForKey(addressId); + return publicAddress.toByteArray(); + } + + public static byte[] getAddressHash(int addressId) { + PublicAddress publicAddress = (PublicAddress)ObjectStorage.objectForKey(addressId); + return publicAddress.calculateAddressHash().getHashData(); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPrivate.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPrivate.java new file mode 100644 index 0000000..7eed6af --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPrivate.java @@ -0,0 +1,26 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import androidx.annotation.Keep; + +import com.mobilecoin.lib.RistrettoPrivate; +import com.mobilecoin.lib.exceptions.SerializationException; + +@Keep +public class FfiRistrettoPrivate { + + private FfiRistrettoPrivate() {} + + public static int fromBytes(byte[] serializedBytes) throws SerializationException { + RistrettoPrivate ristrettoPrivate = RistrettoPrivate.fromBytes(serializedBytes); + final int hashCode = ristrettoPrivate.hashCode(); + ObjectStorage.addObject(hashCode, ristrettoPrivate); + return hashCode; + } + + public static byte[] toByteArray(int ristrettoPrivateId) { + RistrettoPrivate ristrettoPrivate = (RistrettoPrivate)ObjectStorage.objectForKey(ristrettoPrivateId); + return ristrettoPrivate.getKeyBytes(); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPublic.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPublic.java new file mode 100644 index 0000000..924834d --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiRistrettoPublic.java @@ -0,0 +1,26 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import androidx.annotation.Keep; + +import com.mobilecoin.lib.RistrettoPublic; +import com.mobilecoin.lib.exceptions.SerializationException; + +@Keep +public class FfiRistrettoPublic { + + private FfiRistrettoPublic() {} + + public static int fromBytes(byte[] serializedBytes) throws SerializationException { + RistrettoPublic ristrettoPublic = RistrettoPublic.fromBytes(serializedBytes); + final int hashCode = ristrettoPublic.hashCode(); + ObjectStorage.addObject(hashCode, ristrettoPublic); + return hashCode; + } + + public static byte[] toByteArray(int ristrettoPublicId) { + RistrettoPublic ristrettoPublic = (RistrettoPublic)ObjectStorage.objectForKey(ristrettoPublicId); + return ristrettoPublic.getKeyBytes(); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiTransferPayload.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiTransferPayload.java new file mode 100644 index 0000000..c65238a --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/FfiTransferPayload.java @@ -0,0 +1,33 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import com.mobilecoin.lib.RistrettoPublic; +import com.mobilecoin.lib.TransferPayload; + +import androidx.annotation.Keep; + +@Keep +public class FfiTransferPayload { + + private FfiTransferPayload() { + } + + public static byte[] getBip39Entropy(int payloadId) { + TransferPayload transferPayload = (TransferPayload) ObjectStorage.objectForKey(payloadId); + return transferPayload.getBip39Entropy(); + } + + public static String getMemo(int payloadId) { + TransferPayload transferPayload = (TransferPayload) ObjectStorage.objectForKey(payloadId); + return transferPayload.getMemo(); + } + + public static int getPublicKey(int payloadId) { + TransferPayload transferPayload = (TransferPayload) ObjectStorage.objectForKey(payloadId); + RistrettoPublic publicKey = transferPayload.getPublicKey(); + final int hashCode = publicKey.hashCode(); + ObjectStorage.addObject(hashCode, publicKey); + return hashCode; + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/MobileCoinFlutterPlugin.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/MobileCoinFlutterPlugin.java new file mode 100644 index 0000000..3bff714 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/MobileCoinFlutterPlugin.java @@ -0,0 +1,1036 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; + +import com.mobilecoin.lib.TokenId; +import com.mobilecoin.lib.UnsignedLong; +import com.mobilecoin.lib.exceptions.AttestationException; +import com.mobilecoin.lib.exceptions.BadEntropyException; +import com.mobilecoin.lib.exceptions.BadMnemonicException; +import com.mobilecoin.lib.exceptions.FeeRejectedException; +import com.mobilecoin.lib.exceptions.FogReportException; +import com.mobilecoin.lib.exceptions.FogSyncException; +import com.mobilecoin.lib.exceptions.FragmentedAccountException; +import com.mobilecoin.lib.exceptions.InsufficientFundsException; +import com.mobilecoin.lib.exceptions.InvalidFogResponse; +import com.mobilecoin.lib.exceptions.InvalidTransactionException; +import com.mobilecoin.lib.exceptions.InvalidUriException; +import com.mobilecoin.lib.exceptions.NetworkException; +import com.mobilecoin.lib.exceptions.SerializationException; +import com.mobilecoin.lib.exceptions.TransactionBuilderException; + +import org.json.JSONException; + +import java.math.BigInteger; +import java.util.Arrays; +import java.util.HashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import io.flutter.embedding.engine.plugins.FlutterPlugin; +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import io.flutter.plugin.common.MethodChannel.MethodCallHandler; +import io.flutter.plugin.common.MethodChannel.Result; +import mistyswap.AttestedMistySwapClient; + +/** + * MobileCoinFlutterPlugin + */ +public class MobileCoinFlutterPlugin implements FlutterPlugin, MethodCallHandler { + private static final int EXECUTOR_THREAD_POOL_SIZE = 4; + /// The MethodChannel that will the communication between Flutter and native + /// Android + /// + /// This local reference serves to register the plugin with the Flutter Engine + /// and unregister it + /// when the Flutter Engine is detached from the Activity + private MethodChannel channel; + private final ExecutorService executorService = + Executors.newFixedThreadPool(EXECUTOR_THREAD_POOL_SIZE); + + private final ChannelMessageDispatcher dispatcher; + + // Needed for code generation in the app's plugin registrant. + public MobileCoinFlutterPlugin() { + this(new DefaultMobileCoinFlutterPluginChannelApi()); + } + + @VisibleForTesting + MobileCoinFlutterPlugin(MobileCoinFlutterPluginChannelApi api) { + dispatcher = new ChannelMessageDispatcher(api); + } + + @Override + public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { + channel = + new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "mobilecoin_flutter"); + channel.setMethodCallHandler(this); + } + + @Override + public void onMethodCall(@NonNull final MethodCall call, @NonNull final Result result) { + // Do all message handling on background thread because all messages + // require long-running work, which would otherwise block Flutter's + // platform thread. + executorService.submit(() -> { + // WIP: eventually the dispatcher will support all messages, + // but for now it only handles some of them, so we try + // the dispatcher first and then fallback to reflection + // handling. + try { + Object resultValue = dispatcher.onMethodCall(call); + Ffi.processSuccess(result, resultValue); + } catch (Exception exception) { + exception.printStackTrace(); + Ffi.processError(result, exception.getLocalizedMessage(), exception); + } + }); + } + + @Override + public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { + channel.setMethodCallHandler(null); + } + + /** + * Interprets an incoming plugin channel message and then invokes the appropriate + * MobileCoinFlutterPluginChannelApi. + *

+ * The dispatching of channel messages is handled by a dedicated object so that we can test this + * object without worrying about threading concerns. The channel's onMethodCall + * method includes a post() to a background thread to do work, followed by another + * post() to get back to Flutter's platform thread to send the response. + */ + static class ChannelMessageDispatcher { + private final MobileCoinFlutterPluginChannelApi api; + + ChannelMessageDispatcher(MobileCoinFlutterPluginChannelApi api) { + this.api = api; + } + + @NonNull + private T getCallArgument(@NonNull MethodCall call, @NonNull String key) { + T argument = call.argument(key); + if (null == argument) { + throw new IllegalArgumentException(); + } + return argument; + } + + public Object onMethodCall(@NonNull final MethodCall call) throws Exception { + String message = call.method; + switch (message) { + case "MobileCoinClient#create": + return api.createMobileCoinClient(getCallArgument(call, "accountKey"), + getCallArgument(call, "fogUrl"), + getCallArgument(call, "consensusUrl"), + call.argument("mistyswapUrl"), // can be null + getCallArgument(call, "useTestNet"), + getCallArgument(call, "clientConfigId")); + case "MobileCoinClient#getAccountActivity": + return api.getAccountActivity(getCallArgument(call, "id")); + + case "MobileCoinClient#getBalance": + return api.getBalance(getCallArgument(call, "id")); + case "MobileCoinClient#setAuthorization": + return api.setAuthorization(getCallArgument(call, "id"), getCallArgument(call, "username"), + getCallArgument(call, "password")); + case "MobileCoinClient#createPendingTransaction": { + String tokenIdString = getCallArgument(call, "tokenId"); + TokenId tokenId = TokenId.from(UnsignedLong.fromBigInteger(new BigInteger(tokenIdString))); + return api.createPendingTransaction(getCallArgument(call, "id"), getCallArgument(call, "recipient"), + PicoMob.parsePico(getCallArgument(call, "fee")), + PicoMob.parsePico(getCallArgument(call, "amount")), + tokenId, + getCallArgument(call, "rngSeed"), + call.argument("paymentRequestId")); // can be null + } + case "MobileCoinClient#sendFunds": + return api.sendFunds(getCallArgument(call, "id"), getCallArgument(call, "transaction")); + case "MobileCoinClient#checkTransactionStatus": + return api.checkTransactionStatus(getCallArgument(call, "id"), getCallArgument(call, "receiptId")); + case "AccountKey#fromBip39Entropy": + return api.getAccountKeyFromBip39Entropy(getCallArgument(call, "bip39Entropy"), + call.argument("fogReportUri"), getCallArgument(call, "reportId"), + call.argument("fogAuthoritySpki")); + + case "MobileCoinClient#requiresDefragmentation": { + BigInteger bigTokenId = new BigInteger((String) getCallArgument(call, "tokenId")); + TokenId tokenId = TokenId.from(UnsignedLong.fromBigInteger(bigTokenId)); + return api.accountRequiresDefragmentation( + getCallArgument(call, "id"), + new BigInteger((String)getCallArgument(call, "amount")), + tokenId + ); + } + case "MobileCoinClient#defragmentAccount": { + BigInteger bigTokenId = new BigInteger((String) getCallArgument(call, "tokenId")); + TokenId tokenId = TokenId.from(UnsignedLong.fromBigInteger(bigTokenId)); + api.defragmentAccount( + getCallArgument(call, "id"), + new BigInteger((String)getCallArgument(call, "amount")), + tokenId, + getCallArgument(call, "shouldWriteRTHMemos"), + getCallArgument(call, "rngSeed") + ); + return null; + } + case "MobileCoinClient#estimateTotalFee": { + BigInteger bigTokenId = new BigInteger((String) getCallArgument(call, "tokenId")); + TokenId tokenId = TokenId.from(UnsignedLong.fromBigInteger(bigTokenId)); + return api.estimateTotalFee( + getCallArgument(call, "id"), + new BigInteger((String)getCallArgument(call, "amount")), + tokenId + ); + } + case "MobileCoinClient#getTransferableAmount": { + BigInteger bigTokenId = new BigInteger((String) getCallArgument(call, "tokenId")); + TokenId tokenId = TokenId.from(UnsignedLong.fromBigInteger(bigTokenId)); + return api.getTransferableAmount( + getCallArgument(call, "id"), + tokenId + ); + } + case "AccountKey#getPublicAddress": + return api.getAccountKeyPublicAddress(getCallArgument(call, "id")); + case "PrintableWrapper#fromB58String": + return api.printableWrapperFromB58String(getCallArgument(call, "b58String")); + case "PrintableWrapper#toB58String": + return api.printableWrapperToB58String(getCallArgument(call, "id")); + case "PrintableWrapper#hasPublicAddress": + return api.printableWrapperHasPublicAddress(getCallArgument(call, "id")); + case "PrintableWrapper#getPublicAddress": + return api.printableWrapperGetPublicAddress(getCallArgument(call, "id")); + case "PrintableWrapper#fromPublicAddress": + return api.printableWrapperFromPublicAddress(getCallArgument(call, "id")); + case "PrintableWrapper#fromPaymentRequest": + return api.printableWrapperFromPaymentRequest(getCallArgument(call, "id")); + case "PrintableWrapper#hasTransferPayload": + return api.printableWrapperHasTransferPayload(getCallArgument(call, "id")); + case "PrintableWrapper#getTransferPayload": + return api.printableWrapperGetTransferPayload(getCallArgument(call, "id")); + case "PrintableWrapper#hasPaymentRequest": + return api.printableWrapperHasPaymentRequest(getCallArgument(call, "id")); + case "PrintableWrapper#getPaymentRequest": + return api.printableWrapperGetPaymentRequest(getCallArgument(call, "id")); + case "PrintableWrapper#fromTransferPayload": + return api.printableWrapperFromTransferPayload(getCallArgument(call, "id")); + case "PublicAddress#fromBytes": + return api.publicAddressFromBytes(getCallArgument(call, "serializedBytes")); + case "PublicAddress#toByteArray": + return api.publicAddressToByteArray(getCallArgument(call, "id")); + case "PublicAddress#getAddressHash": + return api.publicAddressGetAddressHash(getCallArgument(call, "id")); + case "TransferPayload#getBip39Entropy": + return api.transferPayloadGetBip39Entropy(getCallArgument(call, "id")); + case "TransferPayload#getMemo": + return api.transferPayloadGetMemo(getCallArgument(call, "id")); + case "TransferPayload#getPublicKey": + return api.transferPayloadGetPublicKey(getCallArgument(call, "id")); + case "PaymentRequest#create": { + BigInteger bigTokenId = new BigInteger((String) getCallArgument(call, "tokenId")); + TokenId tokenId = TokenId.from(UnsignedLong.fromBigInteger(bigTokenId)); + return api.paymentRequestCreate(getCallArgument(call, "publicAddressId"), + getCallArgument(call, "amount"), getCallArgument(call, "memo"), tokenId); + } + case "PaymentRequest#getMemo": + return api.paymentRequestGetMemo(getCallArgument(call, "id")); + case "PaymentRequest#getPublicAddress": + return api.paymentRequestGetPublicAddress(getCallArgument(call, "id")); + case "PaymentRequest#getTokenId": + return api.paymentRequestGetTokenId(getCallArgument(call, "id")); + case "PaymentRequest#getValue": + return api.paymentRequestGetValue(getCallArgument(call, "id")); + case "Mnemonic#fromBip39Entropy": + return api.mnemonicFromBip39Entropy(getCallArgument(call, "bip39Entropy")); + case "Mnemonic#toBip39Entropy": + return api.mnemonicToBip39Entropy(getCallArgument(call, "mnemonicPhrase")); + case "Mnemonic#allWords": + return api.mnemonicAllWords(); + case "CryptoBox#encrypt": + return api.cryptoBoxEncrypt(getCallArgument(call, "data"), + getCallArgument(call, "publicKeyId")); + case "CryptoBox#decrypt": + return api.cryptoBoxDecrypt(getCallArgument(call, "data"), + getCallArgument(call, "privateKeyId")); + case "ClientConfig#create": + return api.clientConfigCreate(); + case "ClientConfig#addServiceConfig": + String hardeningAdvisories = getCallArgument(call, "hardeningAdvisories"); + api.clientConfigAddServiceConfig(getCallArgument(call, "clientConfigId"), + getCallArgument(call, "fogViewMrEnclave"), + getCallArgument(call, "fogLedgerMrEnclave"), + getCallArgument(call, "fogReportMrEnclave"), + getCallArgument(call, "consensusMrEnclave"), + hardeningAdvisories.split(",", 0)); + return ""; + case "RistrettoPublic#fromBytes": + return api.ristrettoPublicFromBytes(getCallArgument(call, "serializedBytes")); + case "RistrettoPublic#toByteArray": + return api.ristrettoPublicToByteArray(getCallArgument(call, "id")); + case "RistrettoPrivate#fromBytes": + return api.ristrettoPrivateFromBytes(getCallArgument(call, "serializedBytes")); + case "RistrettoPrivate#toByteArray": + return api.ristrettoPrivateToByteArray(getCallArgument(call, "id")); + case "OnetimeKeys#createTxOutPublicKey": + return api.createTxOutPublicKey(getCallArgument(call, "txOutPrivateKeyId"), getCallArgument(call, "recipientSpendPublicKeyId")); + case "AttestedMistySwapClient#initiateOfframp": + return api.attestedMistySwapClientInitiateOfframp( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "initiateOfframpRequestBytes")); + case "AttestedMistySwapClient#forgetOfframpRequestId": + return api.attestedMistySwapClientForgetOfframp( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "forgetOfframpRequestBytes")); + case "AttestedMistySwapClient#getOfframpStatus": + return api.attestedMistySwapClientGetOfframpStatus( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "getOfframpStatusRequestBytes")); + case "AttestedMistySwapClient#getOfframpDebugStatus": + return api.attestedMistySwapClientGetOfframpDebugInfo( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "getOfframpDebugInfoRequestBytes")); + case "AttestedMistySwapClient#setupOnramp": + return api.attestedMistySwapClientSetupOnramp( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "setupOnrampRequestBytes")); + case "AttestedMistySwapClient#forgetOnramp": + return api.attestedMistySwapClientForgetOnramp( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "forgetOnrampRequestBytes")); + case "AttestedMistySwapClient#getOnrampStatus": + return api.attestedMistySwapClientGetOnrampStatus( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "getOnrampStatusRequestBytes")); + case "AttestedMistySwapClient#getOnrampDebugInfo": + return api.attestedMistySwapClientGetOnrampDebugInfo( + getCallArgument(call, "mobileCoinClientId"), + getCallArgument(call, "getOnrampDebugInfoRequestBytes")); + case "AttestedMistySwapClient#getInfo": + return api.attestedMistySwapClientGetInfo( + getCallArgument(call, "mobileCoinClientId")); + default: + throw new UnsupportedOperationException(); + } + } + } + + interface MobileCoinFlutterPluginChannelApi { + /** + * Creates a new FftMobileCoinClient and returns the hashCode of the new + * instance. + */ + Integer createMobileCoinClient(Integer accountKey, String fogUrl, String consensusUrl, + @Nullable String mistySwapUrl, boolean useTestNet, Integer clientConfigId) throws InvalidUriException, AttestationException; + + /** + * Retrieves and returns the current balance of all coins of the given + * FftMobileCoinClient. The returned result is JSON encoded in format {tokenId: + * balance} + */ + String getBalance(Integer mobileCoinClientId) throws InvalidFogResponse, NetworkException, + AttestationException, FogSyncException, JSONException; + + String getAccountActivity(Integer mobileCoinClientId) + throws InvalidFogResponse, NetworkException, AttestationException, JSONException, + FogSyncException, TransactionBuilderException; + + /** + * Set the basic HTTP authorization username and password for future requests + */ + Void setAuthorization(int mobileClientId, @NonNull String username, + @NonNull String password); + + /** + * Creates a PendingTransaction object from the given FftMobileCoinClient to + * the given recipient and then returns pending transaction ID, along with the + * payloadPublicKey, changePublicKey, payloadSharedSecret, and changeSharedSecret + */ + HashMap createPendingTransaction(int mobileClientId, int recipientId, + @NonNull PicoMob fee, @NonNull PicoMob amount, @NonNull TokenId tokenId, + @NonNull byte[] rngSeed, String paymentRequestId) + throws InvalidFogResponse, InterruptedException, InvalidTransactionException, + AttestationException, FeeRejectedException, InsufficientFundsException, + FragmentedAccountException, NetworkException, TransactionBuilderException, + FogReportException, FogSyncException, SerializationException; + + /** + * Sends from the given FftMobileCoinClient based on the + * pendingTransactionId and then returns the receipt ID. + */ + String sendFunds(int mobileClientId, byte[] serializedTransaction) + throws SerializationException, JSONException; + + /** + * Checks to see if a transaction has gone through, given a transactionId returns an integer + * representing the results. + */ + Integer checkTransactionStatus(int mobileClientId, int receiptId) + throws AttestationException, InvalidFogResponse, NetworkException, FogSyncException; + + /** + * + */ + int getAccountKeyFromBip39Entropy(byte[] bip39Entropy, String fogReportUri, String reportId, + byte[] fogAuthoritySpki) throws InvalidUriException, BadEntropyException; + + /** + * Retrieves the public address for the given AccountKey, stores the address is + * local object storage, and returns its hash code. + */ + int getAccountKeyPublicAddress(int publicAddressId); + + /** + * Creates a PrintableWrapper from the given b58String, stores it + * in local object storage, and returns its hash code. + */ + int printableWrapperFromB58String(String b58String) throws Exception; + + /** + * Converts the PrintableWrapper associated with the given + * printableWrapperId into a b58string and returns it. + */ + String printableWrapperToB58String(int printableWrapperId) throws SerializationException; + + /** + * Returns true if the given PrintableWrapper has a public address. + */ + boolean printableWrapperHasPublicAddress(int printableWrapperId); + + /** + * Retrieves the PublicAddress associated with the given + * PrintableWrapper, stores the public address in local object storage, and + * returns its hash code. + */ + int printableWrapperGetPublicAddress(int printableWrapperId); + + /** + * Returns the PrintableWrapper associated with the given + * publicAddressId. + */ + int printableWrapperFromPublicAddress(int publicAddressId) throws SerializationException; + + /** + * Returns true if the given PrintableWrapper has a transfer payload. + */ + boolean printableWrapperHasTransferPayload(int printableWrapperId); + + /** + * Retrieves the TransferPayload associated with the given + * PrintableWrapper, stores the transfer payload in local object storage, and + * returns its hash code. + */ + int printableWrapperGetTransferPayload(int printableWrapperId); + + /** + * Returns the PrintableWrapper associated with the given + * paymentRequestId. + */ + int printableWrapperFromPaymentRequest(int paymentRequestId) throws SerializationException; + + /** + * Returns true if the given PrintableWrapper has a paymentRequest payload. + */ + boolean printableWrapperHasPaymentRequest(int printableWrapperId); + + /** + * Retrieves the PaymentRequest associated with the given + * PrintableWrapper, stores the payment request in local object storage, and + * returns its hash code. + */ + int printableWrapperGetPaymentRequest(int printableWrapperId); + + /** + * Returns the PrintableWrapper associated with the given + * transferPayloadId. + */ + int printableWrapperFromTransferPayload(int transferPayloadId) + throws SerializationException; + + /** + * Deserializes the given byte[] into a PublicAddress, stores the + * address in local object storage, and returns its hash code. + */ + int publicAddressFromBytes(byte[] publicAddress) throws Exception; + + /** + * Looks up the given PublicAddress in local object storage, then returns a + * serialized version as a byte[]. + */ + byte[] publicAddressToByteArray(int publicAddressId); + + /** + * Looks up the given PublicAddress in local object storage, then returns an + * address hash. + */ + byte[] publicAddressGetAddressHash(int publicAddressId); + + /** + * Looks up the given TransferPayload in local object storage, then returns its + * root entropy as a byte[]. + */ + byte[] transferPayloadGetBip39Entropy(int transferPayloadId); + + /** + * Looks up the given TransferPayload in local object storage, then returns its + * memo. + */ + String transferPayloadGetMemo(int transferPayloadId); + + /** + * Looks up the given TransferPayload in local object storage, retrieves its + * public key, stores the public key in local object storage, and then returns the public + * key's hash code. + */ + int transferPayloadGetPublicKey(int transferPayloadId); + + /** + * Creates a new PaymentRequest in local object storage, then returns its id. + */ + int paymentRequestCreate(int publicAddressId, @Nullable String amount, + @Nullable String memo, @NonNull TokenId tokenId); + + /** + * Looks up the given PaymentRequest in local object storage, then returns its + * amount value as a String. + */ + String paymentRequestGetValue(int paymentRequestId); + + /** + * Looks up the given PaymentRequest in local object storage, then returns its + * memo. + */ + String paymentRequestGetMemo(int paymentRequestId); + + /** + * Looks up the given PaymentRequest in local object storage, then returns its + * token id 64bit value represented as String. + */ + String paymentRequestGetTokenId(int paymentRequestId); + + /** + * Looks up the given PaymentRequest in local object storage, then retrieves + * its public address, stores that public address in local object storage, and then returns + * the public address' hash code. + */ + int paymentRequestGetPublicAddress(int paymentRequestId); + + /** + * Convert the given b39 entropy into the mnemonic phrase The mnemonic phrase is a string of + * 24 words delimited by a space + */ + String mnemonicFromBip39Entropy(byte[] entropy) throws BadEntropyException; + + /** + * Convert mnemonic phrase into the b39 entropy The mnemonic phrase is a string of 24 words + * delimited by a space + */ + byte[] mnemonicToBip39Entropy(String mnemonicPhrase) throws BadMnemonicException; + + /** + * Returns a list of all allowed words for mnemonic phrases as a String + */ + String mnemonicAllWords() throws BadMnemonicException; + + int clientConfigCreate(); + + void clientConfigAddServiceConfig(Integer clientConfigId, String fogViewMrEnclave, + String fogLedgerMrEnclave, String forReportMrEnclave, String consensusMrEnclave, + String[] hardeningAdvisories) throws AttestationException; + + /** + * Encrypt data using recipient's public key + * Note: only recipient's account key can decrypt it + */ + byte[] cryptoBoxEncrypt(byte[] data, int publicAddressId) throws Exception; + + /** + * Decrypt data using recipient's account key + * Note: only recipient's account key can decrypt it + */ + byte[] cryptoBoxDecrypt(byte[] data, int accountKeyId) throws Exception; + /** + * Returns whether or not MobileCoin client can send a specified amount + * without account defragmentation + */ + + boolean accountRequiresDefragmentation( + int mobileClientId, + @NonNull BigInteger amount, + @NonNull TokenId tokenId + ) throws Exception; + + /** Defragments the user's account. + *

+ * An account needs to be defragmented when an account balance consists + * of multiple coins and there are no big enough coins to successfully + * send the transaction. + * If the account is too fragmented, it might be necessary to defragment + * the account more than once. However, wallet fragmentation is a + * rare occurrence since there is an internal mechanism to defragment + * the account during other operations. + *

+ * `shouldWriteRTHMemos` writes sender and destination memos for a defrag + * transactions if true. + */ + void defragmentAccount( + int mobileClientId, + @NonNull BigInteger amount, + @NonNull TokenId tokenId, + boolean shouldWriteRTHMemos, + @Nullable byte[] rngSeed + ) throws Exception; + + /** + * Estimates the minimum fee required to send a transaction with the specified amount. The account + * balance consists of multiple coins, if there are no big enough coins to successfully send the + * transaction {@link FragmentedAccountException} will be thrown. The account needs to be + * defragmented in order to send the specified amount. See {MobileCoinAccountClient#defragmentAccount}. + * + * @param amount amount to send + */ + String estimateTotalFee( + int mobileClientId, + @NonNull BigInteger amount, + @NonNull TokenId tokenId + ) throws Exception; + + /** + * Calculate the total transferable amount excluding all the required fees for such transfer. + */ + String getTransferableAmount( + int mobileClientId, + @NonNull TokenId tokenId + ) throws Exception; + + /** + * Deserializes the given byte[] into a RistrettoPublic, stores the + * address in local object storage, and returns its hash code. + */ + int ristrettoPublicFromBytes(byte[] serializedBytes) throws Exception; + + /** + * Looks up the given RistrettoPublic in local object storage, then returns a + * serialized version as a byte[]. + */ + byte[] ristrettoPublicToByteArray(int ristrettoPublicId); + + /** + * Deserializes the given byte[] into a RistrettoPrivate, stores the + * address in local object storage, and returns its hash code. + */ + int ristrettoPrivateFromBytes(byte[] serializedBytes) throws Exception; + + /** + * Looks up the given RistrettoPrivate in local object storage, then returns a + * serialized version as a byte[]. + */ + byte[] ristrettoPrivateToByteArray(int ristrettoPrivateId); + + /** + * Creates the TxOut public key from the TxOut private key and the recipient spend public key + */ + int createTxOutPublicKey(int txOutPrivateKeyId , int recipientSpendPublicKeyId) throws Exception; + + byte[] attestedMistySwapClientInitiateOfframp(int mobileCoinClientId, byte[] initiateOfframpRequestBytes) throws AttestationException, NetworkException; + + byte[] attestedMistySwapClientForgetOfframp(int mobileCoinClientId, byte[] forgetOfframpRequestBytes) throws AttestationException, NetworkException; + + byte[] attestedMistySwapClientGetOfframpStatus(int mobileCoinClientId, byte[] getOfframpStatusRequestBytes) throws AttestationException, NetworkException; + + byte[] attestedMistySwapClientGetOfframpDebugInfo(int mobileCoinClientId, byte[] getOfframpDebugInfoRequestBytes) throws AttestationException, NetworkException; + + byte[] attestedMistySwapClientSetupOnramp(int mobileCoinClientId, byte[] setupOnrampRequestBytes) throws AttestationException, NetworkException; + + byte[] attestedMistySwapClientForgetOnramp(int mobileCoinClientId, byte[] forgetOnrampRequestBytes) throws AttestationException, NetworkException; + + byte[] attestedMistySwapClientGetOnrampStatus(int mobileCoinClientId, byte[] getOnrampStatusRequestBytes) throws AttestationException, NetworkException; + + byte[] attestedMistySwapClientGetOnrampDebugInfo(int mobileCoinClientId, byte[] getOnrampDebugInfoRequestBytes) throws AttestationException, NetworkException; + + int attestedMistySwapClientGetInfo(int mobileCoinClientId) throws AttestationException, NetworkException; + + } + + static class DefaultMobileCoinFlutterPluginChannelApi + implements MobileCoinFlutterPluginChannelApi { + + @Override + public Integer createMobileCoinClient(Integer accountKey, String fogUrl, + String consensusUrl, @Nullable String mistySwapUrl, boolean useTestNet, Integer clientConfigId) + throws InvalidUriException, AttestationException { + return FfiMobileCoinClient.create(accountKey, fogUrl, consensusUrl, mistySwapUrl, useTestNet, + clientConfigId); + } + + @Override + public String getBalance(Integer mobileCoinClientId) throws InvalidFogResponse, + NetworkException, AttestationException, FogSyncException, JSONException { + return FfiMobileCoinClient.getBalance(mobileCoinClientId); + } + + @Override + public String getAccountActivity(Integer mobileCoinClientId) + throws InvalidFogResponse, NetworkException, AttestationException, JSONException, + FogSyncException, TransactionBuilderException { + return FfiMobileCoinClient.getAccountActivity(mobileCoinClientId); + } + + @Override + public Void setAuthorization(int mobileClientId, @NonNull String username, + @NonNull String password) { + FfiMobileCoinClient.setAuthorization(mobileClientId, username, password); + return null; + } + + @Override + public HashMap createPendingTransaction(int mobileClientId, int recipientId, + @NonNull PicoMob fee, @NonNull PicoMob amount, @NonNull TokenId tokenId, + @NonNull byte[] rngSeed, String paymentRequestIdString) throws InvalidFogResponse, AttestationException, + FeeRejectedException, InsufficientFundsException, FragmentedAccountException, + NetworkException, TransactionBuilderException, FogReportException, FogSyncException, + SerializationException { + return FfiMobileCoinClient.createPendingTransaction(mobileClientId, recipientId, fee, + amount, tokenId, rngSeed, paymentRequestIdString); + } + + @Override + public String sendFunds(int mobileClientId, byte[] serializedTransaction) + throws SerializationException, JSONException { + return FfiMobileCoinClient.sendFunds(mobileClientId, serializedTransaction); + } + + @Override + public Integer checkTransactionStatus(int mobileClientId, int receiptId) + throws AttestationException, InvalidFogResponse, NetworkException, + FogSyncException { + return FfiMobileCoinClient.checkTransactionStatus(mobileClientId, receiptId); + } + + @Override + public int getAccountKeyFromBip39Entropy(byte[] entropy, String fogReportUri, + String reportId, byte[] fogAuthoritySpki) + throws InvalidUriException, BadEntropyException { + return FfiAccountKey.fromBip39Entropy(entropy, fogReportUri, reportId, + fogAuthoritySpki); + } + + @Override + public int getAccountKeyPublicAddress(int publicAddressId) { + return FfiAccountKey.getPublicAddress(publicAddressId); + } + + @Override + public int printableWrapperFromB58String(String b58String) throws Exception { + return FfiPrintableWrapper.fromB58String(b58String); + } + + @Override + public String printableWrapperToB58String(int printableWrapperId) + throws SerializationException { + return FfiPrintableWrapper.toB58String(printableWrapperId); + } + + @Override + public boolean printableWrapperHasPublicAddress(int printableWrapperId) { + return FfiPrintableWrapper.hasPublicAddress(printableWrapperId); + } + + @Override + public int printableWrapperGetPublicAddress(int printableWrapperId) { + return FfiPrintableWrapper.getPublicAddress(printableWrapperId); + } + + @Override + public int printableWrapperFromPublicAddress(int publicAddressId) + throws SerializationException { + return FfiPrintableWrapper.fromPublicAddress(publicAddressId); + } + + @Override + public boolean printableWrapperHasTransferPayload(int printableWrapperId) { + return FfiPrintableWrapper.hasTransferPayload(printableWrapperId); + } + + @Override + public int printableWrapperGetTransferPayload(int printableWrapperId) { + return FfiPrintableWrapper.getTransferPayload(printableWrapperId); + } + + @Override + public int printableWrapperFromPaymentRequest(int paymentRequestId) + throws SerializationException { + return FfiPrintableWrapper.fromPaymentRequest(paymentRequestId); + } + + @Override + public boolean printableWrapperHasPaymentRequest(int printableWrapperId) { + return FfiPrintableWrapper.hasPaymentRequest(printableWrapperId); + } + + @Override + public int printableWrapperGetPaymentRequest(int printableWrapperId) { + return FfiPrintableWrapper.getPaymentRequest(printableWrapperId); + } + + @Override + public int printableWrapperFromTransferPayload(int transferPayloadId) + throws SerializationException { + return FfiPrintableWrapper.fromTransferPayload(transferPayloadId); + } + + @Override + public int publicAddressFromBytes(byte[] publicAddress) throws Exception { + return FfiPublicAddress.fromBytes(publicAddress); + } + + @Override + public byte[] publicAddressToByteArray(int publicAddressId) { + return FfiPublicAddress.toByteArray(publicAddressId); + } + + @Override + public byte[] publicAddressGetAddressHash(int publicAddressId) { + return FfiPublicAddress.getAddressHash(publicAddressId); + } + + @Override + public byte[] transferPayloadGetBip39Entropy(int transferPayloadId) { + return FfiTransferPayload.getBip39Entropy(transferPayloadId); + } + + @Override + public String transferPayloadGetMemo(int transferPayloadId) { + return FfiTransferPayload.getMemo(transferPayloadId); + } + + @Override + public int transferPayloadGetPublicKey(int transferPayloadId) { + return FfiTransferPayload.getPublicKey(transferPayloadId); + } + + @Override + public int paymentRequestCreate(int publicAddressId, @Nullable String amount, + @Nullable String memo, @NonNull TokenId tokenId) { + UnsignedLong unsignedAmount = + amount == null ? null : UnsignedLong.fromBigInteger(new BigInteger(amount)); + return FfiPaymentRequest.create(publicAddressId, unsignedAmount, memo, tokenId); + } + + @Override + public String paymentRequestGetValue(int paymentRequestId) { + return FfiPaymentRequest.getValue(paymentRequestId); + } + + @Override + public String paymentRequestGetMemo(int paymentRequestId) { + return FfiPaymentRequest.getMemo(paymentRequestId); + } + + @Override + public String paymentRequestGetTokenId(int paymentRequestId) { + return FfiPaymentRequest.getTokenId(paymentRequestId); + } + + @Override + public int paymentRequestGetPublicAddress(int paymentRequestId) { + return FfiPaymentRequest.getPublicAddress(paymentRequestId); + } + + @Override + public String mnemonicFromBip39Entropy(byte[] entropy) throws BadEntropyException { + return FfiMnemonic.fromBip39Entropy(entropy); + } + + @Override + public byte[] mnemonicToBip39Entropy(String mnemonicPhrase) throws BadMnemonicException { + return FfiMnemonic.toBip39Entropy(mnemonicPhrase); + } + + @Override + public String mnemonicAllWords() throws BadMnemonicException { + return FfiMnemonic.allWords(); + } + + @Override + public int clientConfigCreate() { + return FfiClientConfig.create(); + } + + @Override + public void clientConfigAddServiceConfig(Integer clientConfigId, String fogViewMrEnclave, + String fogLedgerMrEnclave, String forReportMrEnclave, String consensusMrEnclave, + String[] hardeningAdvisories) throws AttestationException { + FfiClientConfig.addServiceConfig(clientConfigId, fogViewMrEnclave, fogLedgerMrEnclave, + forReportMrEnclave, consensusMrEnclave, hardeningAdvisories); + } + + @Override + public byte[] cryptoBoxEncrypt(byte[] data, int publicAddressId) { + return FfiCryptoBox.encrypt(data, publicAddressId); + } + + @Override + public byte[] cryptoBoxDecrypt(byte[] data, int accountKeyId) throws Exception { + return FfiCryptoBox.decrypt(data, accountKeyId); + } + + public boolean accountRequiresDefragmentation( + int mobileClientId, + @NonNull BigInteger amount, + @NonNull TokenId tokenId + ) throws Exception { + return FfiMobileCoinClient.requiresDefragmentation( + mobileClientId, + amount, + tokenId + ); + } + + @Override + public void defragmentAccount(int mobileClientId, @NonNull BigInteger amount, + @NonNull TokenId tokenId, boolean shouldWriteRTHMemos, + @Nullable byte[] rngSeed + ) throws Exception { + FfiMobileCoinClient.defragmentAccount( + mobileClientId, + amount, + tokenId, + shouldWriteRTHMemos, + rngSeed + ); + } + + @Override + public String estimateTotalFee( + int mobileClientId, + @NonNull BigInteger amount, + @NonNull TokenId tokenId + ) throws Exception { + return FfiMobileCoinClient.estimateTotalFee( + mobileClientId, + amount, + tokenId + ); + } + + @Override + public String getTransferableAmount( + int mobileClientId, + @NonNull TokenId tokenId + ) throws Exception { + return FfiMobileCoinClient.getTransferableAmount( + mobileClientId, + tokenId + ); + } + + @Override + public int ristrettoPublicFromBytes(byte[] serializedBytes) throws Exception { + return FfiRistrettoPublic.fromBytes(serializedBytes); + } + + @Override + public byte[] ristrettoPublicToByteArray(int ristrettoPublicId) { + return FfiRistrettoPublic.toByteArray(ristrettoPublicId); + } + + @Override + public int ristrettoPrivateFromBytes(byte[] serializedBytes) throws Exception { + return FfiRistrettoPrivate.fromBytes(serializedBytes); + } + + @Override + public byte[] ristrettoPrivateToByteArray(int ristrettoPrivateId) { + return FfiRistrettoPrivate.toByteArray(ristrettoPrivateId); + } + + @Override + public int createTxOutPublicKey(int txOutPrivateKeyId, int recipientSpendPublicKeyId) { + return FfiOnetimeKeys.createTxOutPublicKey(txOutPrivateKeyId, recipientSpendPublicKeyId); + } + + @Override + public byte[] attestedMistySwapClientInitiateOfframp(int mobileCoinClientId, byte[] initiateOfframpRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.initiateOfframp(initiateOfframpRequestBytes); + } + + @Override + public byte[] attestedMistySwapClientForgetOfframp(int mobileCoinClientId, byte[] forgetOfframpRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.forgetOfframp(forgetOfframpRequestBytes); + } + + @Override + public byte[] attestedMistySwapClientGetOfframpStatus(int mobileCoinClientId, byte[] getOfframpStatusRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.getOfframpStatus(getOfframpStatusRequestBytes); + } + + @Override + public byte[] attestedMistySwapClientGetOfframpDebugInfo(int mobileCoinClientId, byte[] getOfframpDebugInfoRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.getOfframpDebugInfo(getOfframpDebugInfoRequestBytes); + } + + @Override + public byte[] attestedMistySwapClientSetupOnramp(int mobileCoinClientId, byte[] setupOnrampRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.setupOnramp(setupOnrampRequestBytes); + } + + @Override + public byte[] attestedMistySwapClientForgetOnramp(int mobileCoinClientId, byte[] forgetOnrampRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.forgetOnramp(forgetOnrampRequestBytes); + } + + @Override + public byte[] attestedMistySwapClientGetOnrampStatus(int mobileCoinClientId, byte[] getOnrampStatusRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.getOnrampStatus(getOnrampStatusRequestBytes); + } + + @Override + public byte[] attestedMistySwapClientGetOnrampDebugInfo(int mobileCoinClientId, byte[] getOnrampDebugInfoRequestBytes) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + return mistySwapClient.getOnrampDebugInfo(getOnrampDebugInfoRequestBytes); + } + + @Override + public int attestedMistySwapClientGetInfo(int mobileCoinClientId) throws AttestationException, NetworkException { + final int mistySwapClientHash = FfiMobileCoinClient.mistySwapClientHashCode(mobileCoinClientId); + final AttestedMistySwapClient mistySwapClient = + (AttestedMistySwapClient)ObjectStorage.objectForKey(mistySwapClientHash); + final byte[] getInfoResponseBytes = mistySwapClient.getInfo(); + final int hashCode = Arrays.hashCode(getInfoResponseBytes); + ObjectStorage.addObject(hashCode, getInfoResponseBytes); + return hashCode; + } + + } + +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/ObjectStorage.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/ObjectStorage.java new file mode 100644 index 0000000..91800c0 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/ObjectStorage.java @@ -0,0 +1,19 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import java.util.HashMap; + +class ObjectStorage { + private static final HashMap managedObjects = new HashMap<>(); + + private ObjectStorage() { } + + public static synchronized void addObject(final Integer key, final Object object) { + managedObjects.put(key, object); + } + + public static synchronized Object objectForKey(final Integer key) { + return managedObjects.get(key); + } +} diff --git a/android/src/main/java/com/mobilecoin/mobilecoin_flutter/PicoMob.java b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/PicoMob.java new file mode 100644 index 0000000..4cebb46 --- /dev/null +++ b/android/src/main/java/com/mobilecoin/mobilecoin_flutter/PicoMob.java @@ -0,0 +1,26 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package com.mobilecoin.mobilecoin_flutter; + +import java.math.BigDecimal; +import java.math.BigInteger; + +public class PicoMob { + static PicoMob parsePico(String picoCount) { + return new PicoMob(new BigInteger(picoCount)); + } + + private final BigInteger picoMob; + + PicoMob(BigInteger picoMob) { + this.picoMob = picoMob; + } + + BigInteger getPicoCountAsBigInt() { + return picoMob; + } + + BigDecimal getMobFractionAsBigDecimal() { + return new BigDecimal(picoMob).divide(new BigDecimal("1e12")); + } +} diff --git a/android/src/main/java/mistyswap/AttestedMistySwapClient.java b/android/src/main/java/mistyswap/AttestedMistySwapClient.java new file mode 100644 index 0000000..641e97c --- /dev/null +++ b/android/src/main/java/mistyswap/AttestedMistySwapClient.java @@ -0,0 +1,279 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; + +import com.google.protobuf.ByteString; +import com.mobilecoin.lib.AttestedClient; +import com.mobilecoin.lib.ClientConfig; +import com.mobilecoin.lib.exceptions.AttestationException; +import com.mobilecoin.lib.exceptions.NetworkException; +import com.mobilecoin.lib.LoadBalancer; +import com.mobilecoin.lib.network.NetworkResult; +import com.mobilecoin.lib.network.TransportProtocol; +import com.mobilecoin.lib.network.services.AttestedService; +import com.mobilecoin.lib.network.services.transport.Transport; +import com.mobilecoin.lib.network.services.transport.grpc.GRPCTransport; +import com.mobilecoin.lib.util.NetworkingCall; + +import attest.Attest; + +@Keep +public class AttestedMistySwapClient extends AttestedClient { + + public AttestedMistySwapClient(@NonNull LoadBalancer loadBalancer, @NonNull ClientConfig.Service serviceConfig, @NonNull TransportProtocol transportProtocol) { + super(loadBalancer, serviceConfig, transportProtocol); + } + + @Override + public synchronized void attest(@NonNull Transport transport) throws AttestationException, NetworkException { + try { + final byte[] requestBytes = attestStart(getCurrentServiceUri()); + final AttestedService attestedService = getAPIManager().getAttestedService(transport); + final ByteString bytes = ByteString.copyFrom(requestBytes); + final Attest.AuthMessage authMessage = Attest.AuthMessage.newBuilder().setData(bytes).build(); + final Attest.AuthMessage response = attestedService.auth(authMessage); + attestFinish(response.getData().toByteArray(), getServiceConfig().getTrustedIdentities()); + } catch(NetworkException e) { + attestReset(); + if(e.getResult().getResultCode() == NetworkResult.ResultCode.INTERNAL) { + throw new AttestationException(e.getResult().getDescription(), e); + } + throw e; + + } catch(Exception e) { + attestReset(); + throw new AttestationException("Unable to attest the Misty Swap connection", e); + } + } + + public synchronized byte[] initiateOfframp(@NonNull final byte[] initiateOfframpRequestBytes) + throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOfframp.InitiateOfframpRequest rq = + MistyswapOfframp.InitiateOfframpRequest.parseFrom(initiateOfframpRequestBytes); + final GRPCMistySwapOfframpClientService mistySwapClientService = + getMistySwapOfframpClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.initiateOfframp(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] forgetOfframp(@NonNull final byte[] forgetOfframpRequestBytes) throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOfframp.ForgetOfframpRequest rq = + MistyswapOfframp.ForgetOfframpRequest.parseFrom(forgetOfframpRequestBytes); + final GRPCMistySwapOfframpClientService mistySwapClientService = + getMistySwapOfframpClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.forgetOfframp(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] getOfframpStatus(@NonNull final byte[] getOfframpStatusRequestBytes) throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOfframp.GetOfframpStatusRequest rq = + MistyswapOfframp.GetOfframpStatusRequest.parseFrom(getOfframpStatusRequestBytes); + final GRPCMistySwapOfframpClientService mistySwapClientService = + getMistySwapOfframpClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.getOfframpStatus(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] getOfframpDebugInfo(@NonNull final byte[] getOfframpDebugInfoRequestBytes) throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOfframp.GetOfframpDebugInfoRequest rq = + MistyswapOfframp.GetOfframpDebugInfoRequest.parseFrom(getOfframpDebugInfoRequestBytes); + final GRPCMistySwapOfframpClientService mistySwapClientService = + getMistySwapOfframpClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.getOfframpDebugInfo(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] setupOnramp(@NonNull final byte[] setupOnrampRequestBytes) + throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOnramp.SetupOnrampRequest rq = + MistyswapOnramp.SetupOnrampRequest.parseFrom(setupOnrampRequestBytes); + final GRPCMistySwapOnrampClientService mistySwapClientService = + getMistySwapOnrampClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.setupOnramp(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] forgetOnramp(@NonNull final byte[] forgetOnrampRequestBytes) throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOnramp.ForgetOnrampRequest rq = + MistyswapOnramp.ForgetOnrampRequest.parseFrom(forgetOnrampRequestBytes); + final GRPCMistySwapOnrampClientService mistySwapClientService = + getMistySwapOnrampClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.forgetOnramp(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] getOnrampStatus(@NonNull final byte[] getOnrampStatusRequestBytes) throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOnramp.GetOnrampStatusRequest rq = + MistyswapOnramp.GetOnrampStatusRequest.parseFrom(getOnrampStatusRequestBytes); + final GRPCMistySwapOnrampClientService mistySwapClientService = + getMistySwapOnrampClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.getOnrampStatus(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] getOnrampDebugInfo(@NonNull final byte[] getOnrampDebugInfoRequestBytes) throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final MistyswapOnramp.GetOnrampDebugInfoRequest rq = + MistyswapOnramp.GetOnrampDebugInfoRequest.parseFrom(getOnrampDebugInfoRequestBytes); + final GRPCMistySwapOnrampClientService mistySwapClientService = + getMistySwapOnrampClientService((GRPCTransport)getNetworkTransport()); + final Attest.Message encryptedRequest = encryptMessage(rq); + final Attest.Message decryptedResponse = + decryptMessage(mistySwapClientService.getOnrampDebugInfo(encryptedRequest)); + return decryptedResponse.getData().toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + public synchronized byte[] getInfo() throws AttestationException, NetworkException { + NetworkingCall networkingCall = + new NetworkingCall<>( + () -> { + final GRPCMistySwapCommonClientService mistySwapClientService = + getMistySwapCommonClientService((GRPCTransport)getNetworkTransport()); + final MistyswapCommon.GetInfoResponse response = + mistySwapClientService.getInfo(com.google.protobuf.Empty.newBuilder().build()); + return response.toByteArray(); + } + ); + try { + return networkingCall.run(); + } catch (AttestationException | NetworkException | RuntimeException exception) { + attestReset(); + throw exception; + } catch (Exception exception) { + throw new IllegalStateException("BUG: unreachable code", exception); + } + } + + static GRPCMistySwapOfframpClientService getMistySwapOfframpClientService(@NonNull GRPCTransport transport) { + return new GRPCMistySwapOfframpClientService(transport.getManagedChannel()); + } + + static GRPCMistySwapOnrampClientService getMistySwapOnrampClientService(@NonNull GRPCTransport transport) { + return new GRPCMistySwapOnrampClientService(transport.getManagedChannel()); + } + + static GRPCMistySwapCommonClientService getMistySwapCommonClientService(@NonNull GRPCTransport transport) { + return new GRPCMistySwapCommonClientService(transport.getManagedChannel()); + } + +} diff --git a/android/src/main/java/mistyswap/GRPCMistySwapCommonClientService.java b/android/src/main/java/mistyswap/GRPCMistySwapCommonClientService.java new file mode 100644 index 0000000..d6e3dde --- /dev/null +++ b/android/src/main/java/mistyswap/GRPCMistySwapCommonClientService.java @@ -0,0 +1,40 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import androidx.annotation.NonNull; + +import com.mobilecoin.lib.exceptions.NetworkException; +import com.mobilecoin.lib.network.NetworkResult; +import com.mobilecoin.lib.network.grpc.AuthInterceptor; +import com.mobilecoin.lib.network.grpc.CookieInterceptor; +import com.mobilecoin.lib.network.grpc.GRPCStatusResponse; +import com.mobilecoin.lib.network.services.grpc.GRPCService; + +import java.util.concurrent.Executors; + +import io.grpc.ManagedChannel; +import io.grpc.StatusRuntimeException; + +public class GRPCMistySwapCommonClientService + extends GRPCService { + + public GRPCMistySwapCommonClientService(@NonNull ManagedChannel managedChannel) { + super(managedChannel, new CookieInterceptor(), new AuthInterceptor(), Executors.newSingleThreadExecutor()); + } + + @NonNull + protected MistyswapCommonApiGrpc.MistyswapCommonApiBlockingStub newBlockingStub(@NonNull ManagedChannel managedChannel) { + return MistyswapCommonApiGrpc.newBlockingStub(managedChannel); + } + + @NonNull + public MistyswapCommon.GetInfoResponse getInfo(@NonNull com.google.protobuf.Empty message) throws NetworkException { + try { + return getApiBlockingStub().getInfo(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + +} diff --git a/android/src/main/java/mistyswap/GRPCMistySwapOfframpClientService.java b/android/src/main/java/mistyswap/GRPCMistySwapOfframpClientService.java new file mode 100644 index 0000000..06ae250 --- /dev/null +++ b/android/src/main/java/mistyswap/GRPCMistySwapOfframpClientService.java @@ -0,0 +1,68 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import androidx.annotation.NonNull; + +import com.mobilecoin.lib.exceptions.NetworkException; +import com.mobilecoin.lib.network.NetworkResult; +import com.mobilecoin.lib.network.grpc.AuthInterceptor; +import com.mobilecoin.lib.network.grpc.CookieInterceptor; +import com.mobilecoin.lib.network.grpc.GRPCStatusResponse; +import com.mobilecoin.lib.network.services.grpc.GRPCService; + +import java.util.concurrent.Executors; + +import attest.Attest; +import io.grpc.ManagedChannel; +import io.grpc.StatusRuntimeException; + +public class GRPCMistySwapOfframpClientService + extends GRPCService { + + public GRPCMistySwapOfframpClientService(@NonNull ManagedChannel managedChannel) { + super(managedChannel, new CookieInterceptor(), new AuthInterceptor(), Executors.newSingleThreadExecutor()); + } + + @NonNull + protected MistyswapOfframpApiGrpc.MistyswapOfframpApiBlockingStub newBlockingStub(@NonNull ManagedChannel managedChannel) { + return MistyswapOfframpApiGrpc.newBlockingStub(managedChannel); + } + + @NonNull + public Attest.Message initiateOfframp(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().initiateOfframp(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + + @NonNull + public Attest.Message forgetOfframp(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().forgetOfframp(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + + @NonNull + public Attest.Message getOfframpStatus(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().getOfframpStatus(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + + @NonNull + public Attest.Message getOfframpDebugInfo(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().getOfframpDebugInfo(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + +} diff --git a/android/src/main/java/mistyswap/GRPCMistySwapOnrampClientService.java b/android/src/main/java/mistyswap/GRPCMistySwapOnrampClientService.java new file mode 100644 index 0000000..464be85 --- /dev/null +++ b/android/src/main/java/mistyswap/GRPCMistySwapOnrampClientService.java @@ -0,0 +1,68 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import androidx.annotation.NonNull; + +import com.mobilecoin.lib.exceptions.NetworkException; +import com.mobilecoin.lib.network.NetworkResult; +import com.mobilecoin.lib.network.grpc.AuthInterceptor; +import com.mobilecoin.lib.network.grpc.CookieInterceptor; +import com.mobilecoin.lib.network.grpc.GRPCStatusResponse; +import com.mobilecoin.lib.network.services.grpc.GRPCService; + +import java.util.concurrent.Executors; + +import attest.Attest; +import io.grpc.ManagedChannel; +import io.grpc.StatusRuntimeException; + +public class GRPCMistySwapOnrampClientService + extends GRPCService { + + public GRPCMistySwapOnrampClientService(@NonNull ManagedChannel managedChannel) { + super(managedChannel, new CookieInterceptor(), new AuthInterceptor(), Executors.newSingleThreadExecutor()); + } + + @NonNull + protected MistyswapOnrampApiGrpc.MistyswapOnrampApiBlockingStub newBlockingStub(@NonNull ManagedChannel managedChannel) { + return MistyswapOnrampApiGrpc.newBlockingStub(managedChannel); + } + + @NonNull + public Attest.Message setupOnramp(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().setupOnramp(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + + @NonNull + public Attest.Message forgetOnramp(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().forgetOnramp(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + + @NonNull + public Attest.Message getOnrampStatus(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().getOnrampStatus(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + + @NonNull + public Attest.Message getOnrampDebugInfo(@NonNull Attest.Message message) throws NetworkException { + try { + return getApiBlockingStub().getOnrampDebugInfo(message); + } catch(StatusRuntimeException e) { + throw new NetworkException(new NetworkResult(new GRPCStatusResponse(e.getStatus()))); + } + } + +} diff --git a/android/src/main/java/mistyswap/MistySwapScheme.java b/android/src/main/java/mistyswap/MistySwapScheme.java new file mode 100644 index 0000000..a7701a7 --- /dev/null +++ b/android/src/main/java/mistyswap/MistySwapScheme.java @@ -0,0 +1,33 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import androidx.annotation.NonNull; + +import com.mobilecoin.lib.network.uri.MobileCoinScheme; + +public final class MistySwapScheme implements MobileCoinScheme { + + @NonNull + @Override + public String secureScheme() { + return"mistyswap"; + } + + @NonNull + @Override + public String insecureScheme() { + return "insecure-mistyswap"; + } + + @Override + public int securePort() { + return 443;// TODO: Is this correct? + } + + @Override + public int insecurePort() { + return 4040;// TODO: Has this value been decided yet? + } + +} diff --git a/android/src/main/java/mistyswap/MistySwapUri.java b/android/src/main/java/mistyswap/MistySwapUri.java new file mode 100644 index 0000000..ba42b7a --- /dev/null +++ b/android/src/main/java/mistyswap/MistySwapUri.java @@ -0,0 +1,22 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import android.net.Uri; + +import androidx.annotation.NonNull; + +import com.mobilecoin.lib.exceptions.InvalidUriException; +import com.mobilecoin.lib.network.uri.MobileCoinUri; + +public final class MistySwapUri extends MobileCoinUri { + + public MistySwapUri(@NonNull final String uriString) throws InvalidUriException { + super(uriString, new MistySwapScheme()); + } + + public MistySwapUri(@NonNull final Uri uri) throws InvalidUriException { + super(uri, new MistySwapScheme()); + } + +} diff --git a/android/src/main/java/mistyswap/MistyswapCommon.java b/android/src/main/java/mistyswap/MistyswapCommon.java new file mode 100644 index 0000000..f2039d6 --- /dev/null +++ b/android/src/main/java/mistyswap/MistyswapCommon.java @@ -0,0 +1,3534 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mistyswap_common.proto + +package mistyswap; + +public final class MistyswapCommon { + private MistyswapCommon() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + public interface OngoingSwapOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_common.OngoingSwap) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *

+     */ The Mixin trace ID of the swap.
+     * 
+ * + * string trace_id = 1; + * @return The traceId. + */ + java.lang.String getTraceId(); + /** + *
+     */ The Mixin trace ID of the swap.
+     * 
+ * + * string trace_id = 1; + * @return The bytes for traceId. + */ + com.google.protobuf.ByteString + getTraceIdBytes(); + + /** + *
+     */ The Mixin user ID of the swap.
+     * 
+ * + * string follow_id = 2; + * @return The followId. + */ + java.lang.String getFollowId(); + /** + *
+     */ The Mixin user ID of the swap.
+     * 
+ * + * string follow_id = 2; + * @return The bytes for followId. + */ + com.google.protobuf.ByteString + getFollowIdBytes(); + + /** + *
+     */ Asset UUID we are swapping from.
+     * 
+ * + * string src_asset_id = 3; + * @return The srcAssetId. + */ + java.lang.String getSrcAssetId(); + /** + *
+     */ Asset UUID we are swapping from.
+     * 
+ * + * string src_asset_id = 3; + * @return The bytes for srcAssetId. + */ + com.google.protobuf.ByteString + getSrcAssetIdBytes(); + + /** + *
+     */ Amount we are swapping (string since it can be decimal).
+     * 
+ * + * string src_amount = 4; + * @return The srcAmount. + */ + java.lang.String getSrcAmount(); + /** + *
+     */ Amount we are swapping (string since it can be decimal).
+     * 
+ * + * string src_amount = 4; + * @return The bytes for srcAmount. + */ + com.google.protobuf.ByteString + getSrcAmountBytes(); + + /** + *
+     */ Asset UUID we are swapping to.
+     * 
+ * + * string dst_asset_id = 5; + * @return The dstAssetId. + */ + java.lang.String getDstAssetId(); + /** + *
+     */ Asset UUID we are swapping to.
+     * 
+ * + * string dst_asset_id = 5; + * @return The bytes for dstAssetId. + */ + com.google.protobuf.ByteString + getDstAssetIdBytes(); + + /** + *
+     */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+     * 
+ * + * string dst_amount_min = 6; + * @return The dstAmountMin. + */ + java.lang.String getDstAmountMin(); + /** + *
+     */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+     * 
+ * + * string dst_amount_min = 6; + * @return The bytes for dstAmountMin. + */ + com.google.protobuf.ByteString + getDstAmountMinBytes(); + + /** + *
+     */ Mixin route hash ids.
+     * 
+ * + * string route_hash_ids = 7; + * @return The routeHashIds. + */ + java.lang.String getRouteHashIds(); + /** + *
+     */ Mixin route hash ids.
+     * 
+ * + * string route_hash_ids = 7; + * @return The bytes for routeHashIds. + */ + com.google.protobuf.ByteString + getRouteHashIdsBytes(); + + /** + *
+     */ The Mixin snapshot JSON blob.
+     * 
+ * + * string transfer_json = 8; + * @return The transferJson. + */ + java.lang.String getTransferJson(); + /** + *
+     */ The Mixin snapshot JSON blob.
+     * 
+ * + * string transfer_json = 8; + * @return The bytes for transferJson. + */ + com.google.protobuf.ByteString + getTransferJsonBytes(); + + /** + *
+     */ Our balance of the src asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_src_balance = 9; + * @return The preSwapSrcBalance. + */ + java.lang.String getPreSwapSrcBalance(); + /** + *
+     */ Our balance of the src asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_src_balance = 9; + * @return The bytes for preSwapSrcBalance. + */ + com.google.protobuf.ByteString + getPreSwapSrcBalanceBytes(); + + /** + *
+     */ Our balance of the dst asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_dst_balance = 10; + * @return The preSwapDstBalance. + */ + java.lang.String getPreSwapDstBalance(); + /** + *
+     */ Our balance of the dst asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_dst_balance = 10; + * @return The bytes for preSwapDstBalance. + */ + com.google.protobuf.ByteString + getPreSwapDstBalanceBytes(); + } + /** + *
+   */ On-going swap info.
+   * 
+ * + * Protobuf type {@code mistyswap_common.OngoingSwap} + */ + public static final class OngoingSwap extends + com.google.protobuf.GeneratedMessageLite< + OngoingSwap, OngoingSwap.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_common.OngoingSwap) + OngoingSwapOrBuilder { + private OngoingSwap() { + traceId_ = ""; + followId_ = ""; + srcAssetId_ = ""; + srcAmount_ = ""; + dstAssetId_ = ""; + dstAmountMin_ = ""; + routeHashIds_ = ""; + transferJson_ = ""; + preSwapSrcBalance_ = ""; + preSwapDstBalance_ = ""; + } + public static final int TRACE_ID_FIELD_NUMBER = 1; + private java.lang.String traceId_; + /** + *
+     */ The Mixin trace ID of the swap.
+     * 
+ * + * string trace_id = 1; + * @return The traceId. + */ + @java.lang.Override + public java.lang.String getTraceId() { + return traceId_; + } + /** + *
+     */ The Mixin trace ID of the swap.
+     * 
+ * + * string trace_id = 1; + * @return The bytes for traceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTraceIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(traceId_); + } + /** + *
+     */ The Mixin trace ID of the swap.
+     * 
+ * + * string trace_id = 1; + * @param value The traceId to set. + */ + private void setTraceId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + traceId_ = value; + } + /** + *
+     */ The Mixin trace ID of the swap.
+     * 
+ * + * string trace_id = 1; + */ + private void clearTraceId() { + + traceId_ = getDefaultInstance().getTraceId(); + } + /** + *
+     */ The Mixin trace ID of the swap.
+     * 
+ * + * string trace_id = 1; + * @param value The bytes for traceId to set. + */ + private void setTraceIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + traceId_ = value.toStringUtf8(); + + } + + public static final int FOLLOW_ID_FIELD_NUMBER = 2; + private java.lang.String followId_; + /** + *
+     */ The Mixin user ID of the swap.
+     * 
+ * + * string follow_id = 2; + * @return The followId. + */ + @java.lang.Override + public java.lang.String getFollowId() { + return followId_; + } + /** + *
+     */ The Mixin user ID of the swap.
+     * 
+ * + * string follow_id = 2; + * @return The bytes for followId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFollowIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(followId_); + } + /** + *
+     */ The Mixin user ID of the swap.
+     * 
+ * + * string follow_id = 2; + * @param value The followId to set. + */ + private void setFollowId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + followId_ = value; + } + /** + *
+     */ The Mixin user ID of the swap.
+     * 
+ * + * string follow_id = 2; + */ + private void clearFollowId() { + + followId_ = getDefaultInstance().getFollowId(); + } + /** + *
+     */ The Mixin user ID of the swap.
+     * 
+ * + * string follow_id = 2; + * @param value The bytes for followId to set. + */ + private void setFollowIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + followId_ = value.toStringUtf8(); + + } + + public static final int SRC_ASSET_ID_FIELD_NUMBER = 3; + private java.lang.String srcAssetId_; + /** + *
+     */ Asset UUID we are swapping from.
+     * 
+ * + * string src_asset_id = 3; + * @return The srcAssetId. + */ + @java.lang.Override + public java.lang.String getSrcAssetId() { + return srcAssetId_; + } + /** + *
+     */ Asset UUID we are swapping from.
+     * 
+ * + * string src_asset_id = 3; + * @return The bytes for srcAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAssetIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(srcAssetId_); + } + /** + *
+     */ Asset UUID we are swapping from.
+     * 
+ * + * string src_asset_id = 3; + * @param value The srcAssetId to set. + */ + private void setSrcAssetId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + srcAssetId_ = value; + } + /** + *
+     */ Asset UUID we are swapping from.
+     * 
+ * + * string src_asset_id = 3; + */ + private void clearSrcAssetId() { + + srcAssetId_ = getDefaultInstance().getSrcAssetId(); + } + /** + *
+     */ Asset UUID we are swapping from.
+     * 
+ * + * string src_asset_id = 3; + * @param value The bytes for srcAssetId to set. + */ + private void setSrcAssetIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + srcAssetId_ = value.toStringUtf8(); + + } + + public static final int SRC_AMOUNT_FIELD_NUMBER = 4; + private java.lang.String srcAmount_; + /** + *
+     */ Amount we are swapping (string since it can be decimal).
+     * 
+ * + * string src_amount = 4; + * @return The srcAmount. + */ + @java.lang.Override + public java.lang.String getSrcAmount() { + return srcAmount_; + } + /** + *
+     */ Amount we are swapping (string since it can be decimal).
+     * 
+ * + * string src_amount = 4; + * @return The bytes for srcAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAmountBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(srcAmount_); + } + /** + *
+     */ Amount we are swapping (string since it can be decimal).
+     * 
+ * + * string src_amount = 4; + * @param value The srcAmount to set. + */ + private void setSrcAmount( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + srcAmount_ = value; + } + /** + *
+     */ Amount we are swapping (string since it can be decimal).
+     * 
+ * + * string src_amount = 4; + */ + private void clearSrcAmount() { + + srcAmount_ = getDefaultInstance().getSrcAmount(); + } + /** + *
+     */ Amount we are swapping (string since it can be decimal).
+     * 
+ * + * string src_amount = 4; + * @param value The bytes for srcAmount to set. + */ + private void setSrcAmountBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + srcAmount_ = value.toStringUtf8(); + + } + + public static final int DST_ASSET_ID_FIELD_NUMBER = 5; + private java.lang.String dstAssetId_; + /** + *
+     */ Asset UUID we are swapping to.
+     * 
+ * + * string dst_asset_id = 5; + * @return The dstAssetId. + */ + @java.lang.Override + public java.lang.String getDstAssetId() { + return dstAssetId_; + } + /** + *
+     */ Asset UUID we are swapping to.
+     * 
+ * + * string dst_asset_id = 5; + * @return The bytes for dstAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAssetIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(dstAssetId_); + } + /** + *
+     */ Asset UUID we are swapping to.
+     * 
+ * + * string dst_asset_id = 5; + * @param value The dstAssetId to set. + */ + private void setDstAssetId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + dstAssetId_ = value; + } + /** + *
+     */ Asset UUID we are swapping to.
+     * 
+ * + * string dst_asset_id = 5; + */ + private void clearDstAssetId() { + + dstAssetId_ = getDefaultInstance().getDstAssetId(); + } + /** + *
+     */ Asset UUID we are swapping to.
+     * 
+ * + * string dst_asset_id = 5; + * @param value The bytes for dstAssetId to set. + */ + private void setDstAssetIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + dstAssetId_ = value.toStringUtf8(); + + } + + public static final int DST_AMOUNT_MIN_FIELD_NUMBER = 6; + private java.lang.String dstAmountMin_; + /** + *
+     */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+     * 
+ * + * string dst_amount_min = 6; + * @return The dstAmountMin. + */ + @java.lang.Override + public java.lang.String getDstAmountMin() { + return dstAmountMin_; + } + /** + *
+     */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+     * 
+ * + * string dst_amount_min = 6; + * @return The bytes for dstAmountMin. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAmountMinBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(dstAmountMin_); + } + /** + *
+     */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+     * 
+ * + * string dst_amount_min = 6; + * @param value The dstAmountMin to set. + */ + private void setDstAmountMin( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + dstAmountMin_ = value; + } + /** + *
+     */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+     * 
+ * + * string dst_amount_min = 6; + */ + private void clearDstAmountMin() { + + dstAmountMin_ = getDefaultInstance().getDstAmountMin(); + } + /** + *
+     */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+     * 
+ * + * string dst_amount_min = 6; + * @param value The bytes for dstAmountMin to set. + */ + private void setDstAmountMinBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + dstAmountMin_ = value.toStringUtf8(); + + } + + public static final int ROUTE_HASH_IDS_FIELD_NUMBER = 7; + private java.lang.String routeHashIds_; + /** + *
+     */ Mixin route hash ids.
+     * 
+ * + * string route_hash_ids = 7; + * @return The routeHashIds. + */ + @java.lang.Override + public java.lang.String getRouteHashIds() { + return routeHashIds_; + } + /** + *
+     */ Mixin route hash ids.
+     * 
+ * + * string route_hash_ids = 7; + * @return The bytes for routeHashIds. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRouteHashIdsBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(routeHashIds_); + } + /** + *
+     */ Mixin route hash ids.
+     * 
+ * + * string route_hash_ids = 7; + * @param value The routeHashIds to set. + */ + private void setRouteHashIds( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + routeHashIds_ = value; + } + /** + *
+     */ Mixin route hash ids.
+     * 
+ * + * string route_hash_ids = 7; + */ + private void clearRouteHashIds() { + + routeHashIds_ = getDefaultInstance().getRouteHashIds(); + } + /** + *
+     */ Mixin route hash ids.
+     * 
+ * + * string route_hash_ids = 7; + * @param value The bytes for routeHashIds to set. + */ + private void setRouteHashIdsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + routeHashIds_ = value.toStringUtf8(); + + } + + public static final int TRANSFER_JSON_FIELD_NUMBER = 8; + private java.lang.String transferJson_; + /** + *
+     */ The Mixin snapshot JSON blob.
+     * 
+ * + * string transfer_json = 8; + * @return The transferJson. + */ + @java.lang.Override + public java.lang.String getTransferJson() { + return transferJson_; + } + /** + *
+     */ The Mixin snapshot JSON blob.
+     * 
+ * + * string transfer_json = 8; + * @return The bytes for transferJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTransferJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(transferJson_); + } + /** + *
+     */ The Mixin snapshot JSON blob.
+     * 
+ * + * string transfer_json = 8; + * @param value The transferJson to set. + */ + private void setTransferJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + transferJson_ = value; + } + /** + *
+     */ The Mixin snapshot JSON blob.
+     * 
+ * + * string transfer_json = 8; + */ + private void clearTransferJson() { + + transferJson_ = getDefaultInstance().getTransferJson(); + } + /** + *
+     */ The Mixin snapshot JSON blob.
+     * 
+ * + * string transfer_json = 8; + * @param value The bytes for transferJson to set. + */ + private void setTransferJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + transferJson_ = value.toStringUtf8(); + + } + + public static final int PRE_SWAP_SRC_BALANCE_FIELD_NUMBER = 9; + private java.lang.String preSwapSrcBalance_; + /** + *
+     */ Our balance of the src asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_src_balance = 9; + * @return The preSwapSrcBalance. + */ + @java.lang.Override + public java.lang.String getPreSwapSrcBalance() { + return preSwapSrcBalance_; + } + /** + *
+     */ Our balance of the src asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_src_balance = 9; + * @return The bytes for preSwapSrcBalance. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPreSwapSrcBalanceBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(preSwapSrcBalance_); + } + /** + *
+     */ Our balance of the src asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_src_balance = 9; + * @param value The preSwapSrcBalance to set. + */ + private void setPreSwapSrcBalance( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + preSwapSrcBalance_ = value; + } + /** + *
+     */ Our balance of the src asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_src_balance = 9; + */ + private void clearPreSwapSrcBalance() { + + preSwapSrcBalance_ = getDefaultInstance().getPreSwapSrcBalance(); + } + /** + *
+     */ Our balance of the src asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_src_balance = 9; + * @param value The bytes for preSwapSrcBalance to set. + */ + private void setPreSwapSrcBalanceBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + preSwapSrcBalance_ = value.toStringUtf8(); + + } + + public static final int PRE_SWAP_DST_BALANCE_FIELD_NUMBER = 10; + private java.lang.String preSwapDstBalance_; + /** + *
+     */ Our balance of the dst asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_dst_balance = 10; + * @return The preSwapDstBalance. + */ + @java.lang.Override + public java.lang.String getPreSwapDstBalance() { + return preSwapDstBalance_; + } + /** + *
+     */ Our balance of the dst asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_dst_balance = 10; + * @return The bytes for preSwapDstBalance. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPreSwapDstBalanceBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(preSwapDstBalance_); + } + /** + *
+     */ Our balance of the dst asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_dst_balance = 10; + * @param value The preSwapDstBalance to set. + */ + private void setPreSwapDstBalance( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + preSwapDstBalance_ = value; + } + /** + *
+     */ Our balance of the dst asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_dst_balance = 10; + */ + private void clearPreSwapDstBalance() { + + preSwapDstBalance_ = getDefaultInstance().getPreSwapDstBalance(); + } + /** + *
+     */ Our balance of the dst asset before we sent the swap transaction.
+     * 
+ * + * string pre_swap_dst_balance = 10; + * @param value The bytes for preSwapDstBalance to set. + */ + private void setPreSwapDstBalanceBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + preSwapDstBalance_ = value.toStringUtf8(); + + } + + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapCommon.OngoingSwap parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapCommon.OngoingSwap prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ On-going swap info.
+     * 
+ * + * Protobuf type {@code mistyswap_common.OngoingSwap} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapCommon.OngoingSwap, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_common.OngoingSwap) + mistyswap.MistyswapCommon.OngoingSwapOrBuilder { + // Construct using mistyswap.MistyswapCommon.OngoingSwap.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ The Mixin trace ID of the swap.
+       * 
+ * + * string trace_id = 1; + * @return The traceId. + */ + @java.lang.Override + public java.lang.String getTraceId() { + return instance.getTraceId(); + } + /** + *
+       */ The Mixin trace ID of the swap.
+       * 
+ * + * string trace_id = 1; + * @return The bytes for traceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTraceIdBytes() { + return instance.getTraceIdBytes(); + } + /** + *
+       */ The Mixin trace ID of the swap.
+       * 
+ * + * string trace_id = 1; + * @param value The traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceId( + java.lang.String value) { + copyOnWrite(); + instance.setTraceId(value); + return this; + } + /** + *
+       */ The Mixin trace ID of the swap.
+       * 
+ * + * string trace_id = 1; + * @return This builder for chaining. + */ + public Builder clearTraceId() { + copyOnWrite(); + instance.clearTraceId(); + return this; + } + /** + *
+       */ The Mixin trace ID of the swap.
+       * 
+ * + * string trace_id = 1; + * @param value The bytes for traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTraceIdBytes(value); + return this; + } + + /** + *
+       */ The Mixin user ID of the swap.
+       * 
+ * + * string follow_id = 2; + * @return The followId. + */ + @java.lang.Override + public java.lang.String getFollowId() { + return instance.getFollowId(); + } + /** + *
+       */ The Mixin user ID of the swap.
+       * 
+ * + * string follow_id = 2; + * @return The bytes for followId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFollowIdBytes() { + return instance.getFollowIdBytes(); + } + /** + *
+       */ The Mixin user ID of the swap.
+       * 
+ * + * string follow_id = 2; + * @param value The followId to set. + * @return This builder for chaining. + */ + public Builder setFollowId( + java.lang.String value) { + copyOnWrite(); + instance.setFollowId(value); + return this; + } + /** + *
+       */ The Mixin user ID of the swap.
+       * 
+ * + * string follow_id = 2; + * @return This builder for chaining. + */ + public Builder clearFollowId() { + copyOnWrite(); + instance.clearFollowId(); + return this; + } + /** + *
+       */ The Mixin user ID of the swap.
+       * 
+ * + * string follow_id = 2; + * @param value The bytes for followId to set. + * @return This builder for chaining. + */ + public Builder setFollowIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setFollowIdBytes(value); + return this; + } + + /** + *
+       */ Asset UUID we are swapping from.
+       * 
+ * + * string src_asset_id = 3; + * @return The srcAssetId. + */ + @java.lang.Override + public java.lang.String getSrcAssetId() { + return instance.getSrcAssetId(); + } + /** + *
+       */ Asset UUID we are swapping from.
+       * 
+ * + * string src_asset_id = 3; + * @return The bytes for srcAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAssetIdBytes() { + return instance.getSrcAssetIdBytes(); + } + /** + *
+       */ Asset UUID we are swapping from.
+       * 
+ * + * string src_asset_id = 3; + * @param value The srcAssetId to set. + * @return This builder for chaining. + */ + public Builder setSrcAssetId( + java.lang.String value) { + copyOnWrite(); + instance.setSrcAssetId(value); + return this; + } + /** + *
+       */ Asset UUID we are swapping from.
+       * 
+ * + * string src_asset_id = 3; + * @return This builder for chaining. + */ + public Builder clearSrcAssetId() { + copyOnWrite(); + instance.clearSrcAssetId(); + return this; + } + /** + *
+       */ Asset UUID we are swapping from.
+       * 
+ * + * string src_asset_id = 3; + * @param value The bytes for srcAssetId to set. + * @return This builder for chaining. + */ + public Builder setSrcAssetIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSrcAssetIdBytes(value); + return this; + } + + /** + *
+       */ Amount we are swapping (string since it can be decimal).
+       * 
+ * + * string src_amount = 4; + * @return The srcAmount. + */ + @java.lang.Override + public java.lang.String getSrcAmount() { + return instance.getSrcAmount(); + } + /** + *
+       */ Amount we are swapping (string since it can be decimal).
+       * 
+ * + * string src_amount = 4; + * @return The bytes for srcAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAmountBytes() { + return instance.getSrcAmountBytes(); + } + /** + *
+       */ Amount we are swapping (string since it can be decimal).
+       * 
+ * + * string src_amount = 4; + * @param value The srcAmount to set. + * @return This builder for chaining. + */ + public Builder setSrcAmount( + java.lang.String value) { + copyOnWrite(); + instance.setSrcAmount(value); + return this; + } + /** + *
+       */ Amount we are swapping (string since it can be decimal).
+       * 
+ * + * string src_amount = 4; + * @return This builder for chaining. + */ + public Builder clearSrcAmount() { + copyOnWrite(); + instance.clearSrcAmount(); + return this; + } + /** + *
+       */ Amount we are swapping (string since it can be decimal).
+       * 
+ * + * string src_amount = 4; + * @param value The bytes for srcAmount to set. + * @return This builder for chaining. + */ + public Builder setSrcAmountBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSrcAmountBytes(value); + return this; + } + + /** + *
+       */ Asset UUID we are swapping to.
+       * 
+ * + * string dst_asset_id = 5; + * @return The dstAssetId. + */ + @java.lang.Override + public java.lang.String getDstAssetId() { + return instance.getDstAssetId(); + } + /** + *
+       */ Asset UUID we are swapping to.
+       * 
+ * + * string dst_asset_id = 5; + * @return The bytes for dstAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAssetIdBytes() { + return instance.getDstAssetIdBytes(); + } + /** + *
+       */ Asset UUID we are swapping to.
+       * 
+ * + * string dst_asset_id = 5; + * @param value The dstAssetId to set. + * @return This builder for chaining. + */ + public Builder setDstAssetId( + java.lang.String value) { + copyOnWrite(); + instance.setDstAssetId(value); + return this; + } + /** + *
+       */ Asset UUID we are swapping to.
+       * 
+ * + * string dst_asset_id = 5; + * @return This builder for chaining. + */ + public Builder clearDstAssetId() { + copyOnWrite(); + instance.clearDstAssetId(); + return this; + } + /** + *
+       */ Asset UUID we are swapping to.
+       * 
+ * + * string dst_asset_id = 5; + * @param value The bytes for dstAssetId to set. + * @return This builder for chaining. + */ + public Builder setDstAssetIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDstAssetIdBytes(value); + return this; + } + + /** + *
+       */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+       * 
+ * + * string dst_amount_min = 6; + * @return The dstAmountMin. + */ + @java.lang.Override + public java.lang.String getDstAmountMin() { + return instance.getDstAmountMin(); + } + /** + *
+       */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+       * 
+ * + * string dst_amount_min = 6; + * @return The bytes for dstAmountMin. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAmountMinBytes() { + return instance.getDstAmountMinBytes(); + } + /** + *
+       */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+       * 
+ * + * string dst_amount_min = 6; + * @param value The dstAmountMin to set. + * @return This builder for chaining. + */ + public Builder setDstAmountMin( + java.lang.String value) { + copyOnWrite(); + instance.setDstAmountMin(value); + return this; + } + /** + *
+       */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+       * 
+ * + * string dst_amount_min = 6; + * @return This builder for chaining. + */ + public Builder clearDstAmountMin() { + copyOnWrite(); + instance.clearDstAmountMin(); + return this; + } + /** + *
+       */ Minimum amount we will accept, otherwise the swap gets rejected (string since it can be decimal).
+       * 
+ * + * string dst_amount_min = 6; + * @param value The bytes for dstAmountMin to set. + * @return This builder for chaining. + */ + public Builder setDstAmountMinBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDstAmountMinBytes(value); + return this; + } + + /** + *
+       */ Mixin route hash ids.
+       * 
+ * + * string route_hash_ids = 7; + * @return The routeHashIds. + */ + @java.lang.Override + public java.lang.String getRouteHashIds() { + return instance.getRouteHashIds(); + } + /** + *
+       */ Mixin route hash ids.
+       * 
+ * + * string route_hash_ids = 7; + * @return The bytes for routeHashIds. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRouteHashIdsBytes() { + return instance.getRouteHashIdsBytes(); + } + /** + *
+       */ Mixin route hash ids.
+       * 
+ * + * string route_hash_ids = 7; + * @param value The routeHashIds to set. + * @return This builder for chaining. + */ + public Builder setRouteHashIds( + java.lang.String value) { + copyOnWrite(); + instance.setRouteHashIds(value); + return this; + } + /** + *
+       */ Mixin route hash ids.
+       * 
+ * + * string route_hash_ids = 7; + * @return This builder for chaining. + */ + public Builder clearRouteHashIds() { + copyOnWrite(); + instance.clearRouteHashIds(); + return this; + } + /** + *
+       */ Mixin route hash ids.
+       * 
+ * + * string route_hash_ids = 7; + * @param value The bytes for routeHashIds to set. + * @return This builder for chaining. + */ + public Builder setRouteHashIdsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setRouteHashIdsBytes(value); + return this; + } + + /** + *
+       */ The Mixin snapshot JSON blob.
+       * 
+ * + * string transfer_json = 8; + * @return The transferJson. + */ + @java.lang.Override + public java.lang.String getTransferJson() { + return instance.getTransferJson(); + } + /** + *
+       */ The Mixin snapshot JSON blob.
+       * 
+ * + * string transfer_json = 8; + * @return The bytes for transferJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTransferJsonBytes() { + return instance.getTransferJsonBytes(); + } + /** + *
+       */ The Mixin snapshot JSON blob.
+       * 
+ * + * string transfer_json = 8; + * @param value The transferJson to set. + * @return This builder for chaining. + */ + public Builder setTransferJson( + java.lang.String value) { + copyOnWrite(); + instance.setTransferJson(value); + return this; + } + /** + *
+       */ The Mixin snapshot JSON blob.
+       * 
+ * + * string transfer_json = 8; + * @return This builder for chaining. + */ + public Builder clearTransferJson() { + copyOnWrite(); + instance.clearTransferJson(); + return this; + } + /** + *
+       */ The Mixin snapshot JSON blob.
+       * 
+ * + * string transfer_json = 8; + * @param value The bytes for transferJson to set. + * @return This builder for chaining. + */ + public Builder setTransferJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setTransferJsonBytes(value); + return this; + } + + /** + *
+       */ Our balance of the src asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_src_balance = 9; + * @return The preSwapSrcBalance. + */ + @java.lang.Override + public java.lang.String getPreSwapSrcBalance() { + return instance.getPreSwapSrcBalance(); + } + /** + *
+       */ Our balance of the src asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_src_balance = 9; + * @return The bytes for preSwapSrcBalance. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPreSwapSrcBalanceBytes() { + return instance.getPreSwapSrcBalanceBytes(); + } + /** + *
+       */ Our balance of the src asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_src_balance = 9; + * @param value The preSwapSrcBalance to set. + * @return This builder for chaining. + */ + public Builder setPreSwapSrcBalance( + java.lang.String value) { + copyOnWrite(); + instance.setPreSwapSrcBalance(value); + return this; + } + /** + *
+       */ Our balance of the src asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_src_balance = 9; + * @return This builder for chaining. + */ + public Builder clearPreSwapSrcBalance() { + copyOnWrite(); + instance.clearPreSwapSrcBalance(); + return this; + } + /** + *
+       */ Our balance of the src asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_src_balance = 9; + * @param value The bytes for preSwapSrcBalance to set. + * @return This builder for chaining. + */ + public Builder setPreSwapSrcBalanceBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPreSwapSrcBalanceBytes(value); + return this; + } + + /** + *
+       */ Our balance of the dst asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_dst_balance = 10; + * @return The preSwapDstBalance. + */ + @java.lang.Override + public java.lang.String getPreSwapDstBalance() { + return instance.getPreSwapDstBalance(); + } + /** + *
+       */ Our balance of the dst asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_dst_balance = 10; + * @return The bytes for preSwapDstBalance. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPreSwapDstBalanceBytes() { + return instance.getPreSwapDstBalanceBytes(); + } + /** + *
+       */ Our balance of the dst asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_dst_balance = 10; + * @param value The preSwapDstBalance to set. + * @return This builder for chaining. + */ + public Builder setPreSwapDstBalance( + java.lang.String value) { + copyOnWrite(); + instance.setPreSwapDstBalance(value); + return this; + } + /** + *
+       */ Our balance of the dst asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_dst_balance = 10; + * @return This builder for chaining. + */ + public Builder clearPreSwapDstBalance() { + copyOnWrite(); + instance.clearPreSwapDstBalance(); + return this; + } + /** + *
+       */ Our balance of the dst asset before we sent the swap transaction.
+       * 
+ * + * string pre_swap_dst_balance = 10; + * @param value The bytes for preSwapDstBalance to set. + * @return This builder for chaining. + */ + public Builder setPreSwapDstBalanceBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setPreSwapDstBalanceBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_common.OngoingSwap) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapCommon.OngoingSwap(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "traceId_", + "followId_", + "srcAssetId_", + "srcAmount_", + "dstAssetId_", + "dstAmountMin_", + "routeHashIds_", + "transferJson_", + "preSwapSrcBalance_", + "preSwapDstBalance_", + }; + java.lang.String info = + "\u0000\n\u0000\u0000\u0001\n\n\u0000\u0000\u0000\u0001\u0208\u0002\u0208\u0003\u0208" + + "\u0004\u0208\u0005\u0208\u0006\u0208\u0007\u0208\b\u0208\t\u0208\n\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapCommon.OngoingSwap.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_common.OngoingSwap) + private static final mistyswap.MistyswapCommon.OngoingSwap DEFAULT_INSTANCE; + static { + OngoingSwap defaultInstance = new OngoingSwap(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OngoingSwap.class, defaultInstance); + } + + public static mistyswap.MistyswapCommon.OngoingSwap getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetInfoResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_common.GetInfoResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Max concurrent offramps
+     * 
+ * + * uint64 max_concurrent_offramps = 1; + * @return The maxConcurrentOfframps. + */ + long getMaxConcurrentOfframps(); + + /** + *
+     */ Max concurrent onramps
+     * 
+ * + * uint64 max_concurrent_onramps = 2; + * @return The maxConcurrentOnramps. + */ + long getMaxConcurrentOnramps(); + + /** + *
+     */ Current number of offramps
+     * 
+ * + * uint64 current_offramps = 3; + * @return The currentOfframps. + */ + long getCurrentOfframps(); + + /** + *
+     */ Current number of onramps
+     * 
+ * + * uint64 current_onramps = 4; + * @return The currentOnramps. + */ + long getCurrentOnramps(); + + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @return A list containing the offrampAllowedSrcAssetIds. + */ + java.util.List + getOfframpAllowedSrcAssetIdsList(); + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @return The count of offrampAllowedSrcAssetIds. + */ + int getOfframpAllowedSrcAssetIdsCount(); + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index of the element to return. + * @return The offrampAllowedSrcAssetIds at the given index. + */ + java.lang.String getOfframpAllowedSrcAssetIds(int index); + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index of the element to return. + * @return The offrampAllowedSrcAssetIds at the given index. + */ + com.google.protobuf.ByteString + getOfframpAllowedSrcAssetIdsBytes(int index); + + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @return A list containing the offrampAllowedDstAssetIds. + */ + java.util.List + getOfframpAllowedDstAssetIdsList(); + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @return The count of offrampAllowedDstAssetIds. + */ + int getOfframpAllowedDstAssetIdsCount(); + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index of the element to return. + * @return The offrampAllowedDstAssetIds at the given index. + */ + java.lang.String getOfframpAllowedDstAssetIds(int index); + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index of the element to return. + * @return The offrampAllowedDstAssetIds at the given index. + */ + com.google.protobuf.ByteString + getOfframpAllowedDstAssetIdsBytes(int index); + + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @return A list containing the onrampAllowedSrcAssetIds. + */ + java.util.List + getOnrampAllowedSrcAssetIdsList(); + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @return The count of onrampAllowedSrcAssetIds. + */ + int getOnrampAllowedSrcAssetIdsCount(); + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index of the element to return. + * @return The onrampAllowedSrcAssetIds at the given index. + */ + java.lang.String getOnrampAllowedSrcAssetIds(int index); + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index of the element to return. + * @return The onrampAllowedSrcAssetIds at the given index. + */ + com.google.protobuf.ByteString + getOnrampAllowedSrcAssetIdsBytes(int index); + + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @return A list containing the onrampAllowedDstAssetIds. + */ + java.util.List + getOnrampAllowedDstAssetIdsList(); + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @return The count of onrampAllowedDstAssetIds. + */ + int getOnrampAllowedDstAssetIdsCount(); + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index of the element to return. + * @return The onrampAllowedDstAssetIds at the given index. + */ + java.lang.String getOnrampAllowedDstAssetIds(int index); + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index of the element to return. + * @return The onrampAllowedDstAssetIds at the given index. + */ + com.google.protobuf.ByteString + getOnrampAllowedDstAssetIdsBytes(int index); + } + /** + *
+   */ Response to the `GetInfo` request
+   * 
+ * + * Protobuf type {@code mistyswap_common.GetInfoResponse} + */ + public static final class GetInfoResponse extends + com.google.protobuf.GeneratedMessageLite< + GetInfoResponse, GetInfoResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_common.GetInfoResponse) + GetInfoResponseOrBuilder { + private GetInfoResponse() { + offrampAllowedSrcAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + offrampAllowedDstAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + onrampAllowedSrcAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + onrampAllowedDstAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + public static final int MAX_CONCURRENT_OFFRAMPS_FIELD_NUMBER = 1; + private long maxConcurrentOfframps_; + /** + *
+     */ Max concurrent offramps
+     * 
+ * + * uint64 max_concurrent_offramps = 1; + * @return The maxConcurrentOfframps. + */ + @java.lang.Override + public long getMaxConcurrentOfframps() { + return maxConcurrentOfframps_; + } + /** + *
+     */ Max concurrent offramps
+     * 
+ * + * uint64 max_concurrent_offramps = 1; + * @param value The maxConcurrentOfframps to set. + */ + private void setMaxConcurrentOfframps(long value) { + + maxConcurrentOfframps_ = value; + } + /** + *
+     */ Max concurrent offramps
+     * 
+ * + * uint64 max_concurrent_offramps = 1; + */ + private void clearMaxConcurrentOfframps() { + + maxConcurrentOfframps_ = 0L; + } + + public static final int MAX_CONCURRENT_ONRAMPS_FIELD_NUMBER = 2; + private long maxConcurrentOnramps_; + /** + *
+     */ Max concurrent onramps
+     * 
+ * + * uint64 max_concurrent_onramps = 2; + * @return The maxConcurrentOnramps. + */ + @java.lang.Override + public long getMaxConcurrentOnramps() { + return maxConcurrentOnramps_; + } + /** + *
+     */ Max concurrent onramps
+     * 
+ * + * uint64 max_concurrent_onramps = 2; + * @param value The maxConcurrentOnramps to set. + */ + private void setMaxConcurrentOnramps(long value) { + + maxConcurrentOnramps_ = value; + } + /** + *
+     */ Max concurrent onramps
+     * 
+ * + * uint64 max_concurrent_onramps = 2; + */ + private void clearMaxConcurrentOnramps() { + + maxConcurrentOnramps_ = 0L; + } + + public static final int CURRENT_OFFRAMPS_FIELD_NUMBER = 3; + private long currentOfframps_; + /** + *
+     */ Current number of offramps
+     * 
+ * + * uint64 current_offramps = 3; + * @return The currentOfframps. + */ + @java.lang.Override + public long getCurrentOfframps() { + return currentOfframps_; + } + /** + *
+     */ Current number of offramps
+     * 
+ * + * uint64 current_offramps = 3; + * @param value The currentOfframps to set. + */ + private void setCurrentOfframps(long value) { + + currentOfframps_ = value; + } + /** + *
+     */ Current number of offramps
+     * 
+ * + * uint64 current_offramps = 3; + */ + private void clearCurrentOfframps() { + + currentOfframps_ = 0L; + } + + public static final int CURRENT_ONRAMPS_FIELD_NUMBER = 4; + private long currentOnramps_; + /** + *
+     */ Current number of onramps
+     * 
+ * + * uint64 current_onramps = 4; + * @return The currentOnramps. + */ + @java.lang.Override + public long getCurrentOnramps() { + return currentOnramps_; + } + /** + *
+     */ Current number of onramps
+     * 
+ * + * uint64 current_onramps = 4; + * @param value The currentOnramps to set. + */ + private void setCurrentOnramps(long value) { + + currentOnramps_ = value; + } + /** + *
+     */ Current number of onramps
+     * 
+ * + * uint64 current_onramps = 4; + */ + private void clearCurrentOnramps() { + + currentOnramps_ = 0L; + } + + public static final int OFFRAMP_ALLOWED_SRC_ASSET_IDS_FIELD_NUMBER = 5; + private com.google.protobuf.Internal.ProtobufList offrampAllowedSrcAssetIds_; + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @return A list containing the offrampAllowedSrcAssetIds. + */ + @java.lang.Override + public java.util.List getOfframpAllowedSrcAssetIdsList() { + return offrampAllowedSrcAssetIds_; + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @return The count of offrampAllowedSrcAssetIds. + */ + @java.lang.Override + public int getOfframpAllowedSrcAssetIdsCount() { + return offrampAllowedSrcAssetIds_.size(); + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index of the element to return. + * @return The offrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOfframpAllowedSrcAssetIds(int index) { + return offrampAllowedSrcAssetIds_.get(index); + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index of the value to return. + * @return The bytes of the offrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOfframpAllowedSrcAssetIdsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + offrampAllowedSrcAssetIds_.get(index)); + } + private void ensureOfframpAllowedSrcAssetIdsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + offrampAllowedSrcAssetIds_; if (!tmp.isModifiable()) { + offrampAllowedSrcAssetIds_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index to set the value at. + * @param value The offrampAllowedSrcAssetIds to set. + */ + private void setOfframpAllowedSrcAssetIds( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOfframpAllowedSrcAssetIdsIsMutable(); + offrampAllowedSrcAssetIds_.set(index, value); + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param value The offrampAllowedSrcAssetIds to add. + */ + private void addOfframpAllowedSrcAssetIds( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOfframpAllowedSrcAssetIdsIsMutable(); + offrampAllowedSrcAssetIds_.add(value); + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param values The offrampAllowedSrcAssetIds to add. + */ + private void addAllOfframpAllowedSrcAssetIds( + java.lang.Iterable values) { + ensureOfframpAllowedSrcAssetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, offrampAllowedSrcAssetIds_); + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + */ + private void clearOfframpAllowedSrcAssetIds() { + offrampAllowedSrcAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+     */ List of supported offramp source asset ids.
+     * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param value The bytes of the offrampAllowedSrcAssetIds to add. + */ + private void addOfframpAllowedSrcAssetIdsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureOfframpAllowedSrcAssetIdsIsMutable(); + offrampAllowedSrcAssetIds_.add(value.toStringUtf8()); + } + + public static final int OFFRAMP_ALLOWED_DST_ASSET_IDS_FIELD_NUMBER = 6; + private com.google.protobuf.Internal.ProtobufList offrampAllowedDstAssetIds_; + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @return A list containing the offrampAllowedDstAssetIds. + */ + @java.lang.Override + public java.util.List getOfframpAllowedDstAssetIdsList() { + return offrampAllowedDstAssetIds_; + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @return The count of offrampAllowedDstAssetIds. + */ + @java.lang.Override + public int getOfframpAllowedDstAssetIdsCount() { + return offrampAllowedDstAssetIds_.size(); + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index of the element to return. + * @return The offrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOfframpAllowedDstAssetIds(int index) { + return offrampAllowedDstAssetIds_.get(index); + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index of the value to return. + * @return The bytes of the offrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOfframpAllowedDstAssetIdsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + offrampAllowedDstAssetIds_.get(index)); + } + private void ensureOfframpAllowedDstAssetIdsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + offrampAllowedDstAssetIds_; if (!tmp.isModifiable()) { + offrampAllowedDstAssetIds_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index to set the value at. + * @param value The offrampAllowedDstAssetIds to set. + */ + private void setOfframpAllowedDstAssetIds( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOfframpAllowedDstAssetIdsIsMutable(); + offrampAllowedDstAssetIds_.set(index, value); + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param value The offrampAllowedDstAssetIds to add. + */ + private void addOfframpAllowedDstAssetIds( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOfframpAllowedDstAssetIdsIsMutable(); + offrampAllowedDstAssetIds_.add(value); + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param values The offrampAllowedDstAssetIds to add. + */ + private void addAllOfframpAllowedDstAssetIds( + java.lang.Iterable values) { + ensureOfframpAllowedDstAssetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, offrampAllowedDstAssetIds_); + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + */ + private void clearOfframpAllowedDstAssetIds() { + offrampAllowedDstAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+     */ List of supported offramp destination asset ids.
+     * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param value The bytes of the offrampAllowedDstAssetIds to add. + */ + private void addOfframpAllowedDstAssetIdsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureOfframpAllowedDstAssetIdsIsMutable(); + offrampAllowedDstAssetIds_.add(value.toStringUtf8()); + } + + public static final int ONRAMP_ALLOWED_SRC_ASSET_IDS_FIELD_NUMBER = 7; + private com.google.protobuf.Internal.ProtobufList onrampAllowedSrcAssetIds_; + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @return A list containing the onrampAllowedSrcAssetIds. + */ + @java.lang.Override + public java.util.List getOnrampAllowedSrcAssetIdsList() { + return onrampAllowedSrcAssetIds_; + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @return The count of onrampAllowedSrcAssetIds. + */ + @java.lang.Override + public int getOnrampAllowedSrcAssetIdsCount() { + return onrampAllowedSrcAssetIds_.size(); + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index of the element to return. + * @return The onrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOnrampAllowedSrcAssetIds(int index) { + return onrampAllowedSrcAssetIds_.get(index); + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index of the value to return. + * @return The bytes of the onrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOnrampAllowedSrcAssetIdsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + onrampAllowedSrcAssetIds_.get(index)); + } + private void ensureOnrampAllowedSrcAssetIdsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + onrampAllowedSrcAssetIds_; if (!tmp.isModifiable()) { + onrampAllowedSrcAssetIds_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index to set the value at. + * @param value The onrampAllowedSrcAssetIds to set. + */ + private void setOnrampAllowedSrcAssetIds( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOnrampAllowedSrcAssetIdsIsMutable(); + onrampAllowedSrcAssetIds_.set(index, value); + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param value The onrampAllowedSrcAssetIds to add. + */ + private void addOnrampAllowedSrcAssetIds( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOnrampAllowedSrcAssetIdsIsMutable(); + onrampAllowedSrcAssetIds_.add(value); + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param values The onrampAllowedSrcAssetIds to add. + */ + private void addAllOnrampAllowedSrcAssetIds( + java.lang.Iterable values) { + ensureOnrampAllowedSrcAssetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, onrampAllowedSrcAssetIds_); + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + */ + private void clearOnrampAllowedSrcAssetIds() { + onrampAllowedSrcAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+     */ List of supported onramp source asset ids.
+     * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param value The bytes of the onrampAllowedSrcAssetIds to add. + */ + private void addOnrampAllowedSrcAssetIdsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureOnrampAllowedSrcAssetIdsIsMutable(); + onrampAllowedSrcAssetIds_.add(value.toStringUtf8()); + } + + public static final int ONRAMP_ALLOWED_DST_ASSET_IDS_FIELD_NUMBER = 8; + private com.google.protobuf.Internal.ProtobufList onrampAllowedDstAssetIds_; + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @return A list containing the onrampAllowedDstAssetIds. + */ + @java.lang.Override + public java.util.List getOnrampAllowedDstAssetIdsList() { + return onrampAllowedDstAssetIds_; + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @return The count of onrampAllowedDstAssetIds. + */ + @java.lang.Override + public int getOnrampAllowedDstAssetIdsCount() { + return onrampAllowedDstAssetIds_.size(); + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index of the element to return. + * @return The onrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOnrampAllowedDstAssetIds(int index) { + return onrampAllowedDstAssetIds_.get(index); + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index of the value to return. + * @return The bytes of the onrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOnrampAllowedDstAssetIdsBytes(int index) { + return com.google.protobuf.ByteString.copyFromUtf8( + onrampAllowedDstAssetIds_.get(index)); + } + private void ensureOnrampAllowedDstAssetIdsIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = + onrampAllowedDstAssetIds_; if (!tmp.isModifiable()) { + onrampAllowedDstAssetIds_ = + com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); + } + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index to set the value at. + * @param value The onrampAllowedDstAssetIds to set. + */ + private void setOnrampAllowedDstAssetIds( + int index, java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOnrampAllowedDstAssetIdsIsMutable(); + onrampAllowedDstAssetIds_.set(index, value); + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param value The onrampAllowedDstAssetIds to add. + */ + private void addOnrampAllowedDstAssetIds( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + ensureOnrampAllowedDstAssetIdsIsMutable(); + onrampAllowedDstAssetIds_.add(value); + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param values The onrampAllowedDstAssetIds to add. + */ + private void addAllOnrampAllowedDstAssetIds( + java.lang.Iterable values) { + ensureOnrampAllowedDstAssetIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.addAll( + values, onrampAllowedDstAssetIds_); + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + */ + private void clearOnrampAllowedDstAssetIds() { + onrampAllowedDstAssetIds_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList(); + } + /** + *
+     */ List of supported onramp destination asset ids.
+     * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param value The bytes of the onrampAllowedDstAssetIds to add. + */ + private void addOnrampAllowedDstAssetIdsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ensureOnrampAllowedDstAssetIdsIsMutable(); + onrampAllowedDstAssetIds_.add(value.toStringUtf8()); + } + + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapCommon.GetInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapCommon.GetInfoResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Response to the `GetInfo` request
+     * 
+ * + * Protobuf type {@code mistyswap_common.GetInfoResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapCommon.GetInfoResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_common.GetInfoResponse) + mistyswap.MistyswapCommon.GetInfoResponseOrBuilder { + // Construct using mistyswap.MistyswapCommon.GetInfoResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Max concurrent offramps
+       * 
+ * + * uint64 max_concurrent_offramps = 1; + * @return The maxConcurrentOfframps. + */ + @java.lang.Override + public long getMaxConcurrentOfframps() { + return instance.getMaxConcurrentOfframps(); + } + /** + *
+       */ Max concurrent offramps
+       * 
+ * + * uint64 max_concurrent_offramps = 1; + * @param value The maxConcurrentOfframps to set. + * @return This builder for chaining. + */ + public Builder setMaxConcurrentOfframps(long value) { + copyOnWrite(); + instance.setMaxConcurrentOfframps(value); + return this; + } + /** + *
+       */ Max concurrent offramps
+       * 
+ * + * uint64 max_concurrent_offramps = 1; + * @return This builder for chaining. + */ + public Builder clearMaxConcurrentOfframps() { + copyOnWrite(); + instance.clearMaxConcurrentOfframps(); + return this; + } + + /** + *
+       */ Max concurrent onramps
+       * 
+ * + * uint64 max_concurrent_onramps = 2; + * @return The maxConcurrentOnramps. + */ + @java.lang.Override + public long getMaxConcurrentOnramps() { + return instance.getMaxConcurrentOnramps(); + } + /** + *
+       */ Max concurrent onramps
+       * 
+ * + * uint64 max_concurrent_onramps = 2; + * @param value The maxConcurrentOnramps to set. + * @return This builder for chaining. + */ + public Builder setMaxConcurrentOnramps(long value) { + copyOnWrite(); + instance.setMaxConcurrentOnramps(value); + return this; + } + /** + *
+       */ Max concurrent onramps
+       * 
+ * + * uint64 max_concurrent_onramps = 2; + * @return This builder for chaining. + */ + public Builder clearMaxConcurrentOnramps() { + copyOnWrite(); + instance.clearMaxConcurrentOnramps(); + return this; + } + + /** + *
+       */ Current number of offramps
+       * 
+ * + * uint64 current_offramps = 3; + * @return The currentOfframps. + */ + @java.lang.Override + public long getCurrentOfframps() { + return instance.getCurrentOfframps(); + } + /** + *
+       */ Current number of offramps
+       * 
+ * + * uint64 current_offramps = 3; + * @param value The currentOfframps to set. + * @return This builder for chaining. + */ + public Builder setCurrentOfframps(long value) { + copyOnWrite(); + instance.setCurrentOfframps(value); + return this; + } + /** + *
+       */ Current number of offramps
+       * 
+ * + * uint64 current_offramps = 3; + * @return This builder for chaining. + */ + public Builder clearCurrentOfframps() { + copyOnWrite(); + instance.clearCurrentOfframps(); + return this; + } + + /** + *
+       */ Current number of onramps
+       * 
+ * + * uint64 current_onramps = 4; + * @return The currentOnramps. + */ + @java.lang.Override + public long getCurrentOnramps() { + return instance.getCurrentOnramps(); + } + /** + *
+       */ Current number of onramps
+       * 
+ * + * uint64 current_onramps = 4; + * @param value The currentOnramps to set. + * @return This builder for chaining. + */ + public Builder setCurrentOnramps(long value) { + copyOnWrite(); + instance.setCurrentOnramps(value); + return this; + } + /** + *
+       */ Current number of onramps
+       * 
+ * + * uint64 current_onramps = 4; + * @return This builder for chaining. + */ + public Builder clearCurrentOnramps() { + copyOnWrite(); + instance.clearCurrentOnramps(); + return this; + } + + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @return A list containing the offrampAllowedSrcAssetIds. + */ + @java.lang.Override + public java.util.List + getOfframpAllowedSrcAssetIdsList() { + return java.util.Collections.unmodifiableList( + instance.getOfframpAllowedSrcAssetIdsList()); + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @return The count of offrampAllowedSrcAssetIds. + */ + @java.lang.Override + public int getOfframpAllowedSrcAssetIdsCount() { + return instance.getOfframpAllowedSrcAssetIdsCount(); + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index of the element to return. + * @return The offrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOfframpAllowedSrcAssetIds(int index) { + return instance.getOfframpAllowedSrcAssetIds(index); + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index of the value to return. + * @return The bytes of the offrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOfframpAllowedSrcAssetIdsBytes(int index) { + return instance.getOfframpAllowedSrcAssetIdsBytes(index); + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param index The index to set the value at. + * @param value The offrampAllowedSrcAssetIds to set. + * @return This builder for chaining. + */ + public Builder setOfframpAllowedSrcAssetIds( + int index, java.lang.String value) { + copyOnWrite(); + instance.setOfframpAllowedSrcAssetIds(index, value); + return this; + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param value The offrampAllowedSrcAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOfframpAllowedSrcAssetIds( + java.lang.String value) { + copyOnWrite(); + instance.addOfframpAllowedSrcAssetIds(value); + return this; + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param values The offrampAllowedSrcAssetIds to add. + * @return This builder for chaining. + */ + public Builder addAllOfframpAllowedSrcAssetIds( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllOfframpAllowedSrcAssetIds(values); + return this; + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @return This builder for chaining. + */ + public Builder clearOfframpAllowedSrcAssetIds() { + copyOnWrite(); + instance.clearOfframpAllowedSrcAssetIds(); + return this; + } + /** + *
+       */ List of supported offramp source asset ids.
+       * 
+ * + * repeated string offramp_allowed_src_asset_ids = 5; + * @param value The bytes of the offrampAllowedSrcAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOfframpAllowedSrcAssetIdsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addOfframpAllowedSrcAssetIdsBytes(value); + return this; + } + + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @return A list containing the offrampAllowedDstAssetIds. + */ + @java.lang.Override + public java.util.List + getOfframpAllowedDstAssetIdsList() { + return java.util.Collections.unmodifiableList( + instance.getOfframpAllowedDstAssetIdsList()); + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @return The count of offrampAllowedDstAssetIds. + */ + @java.lang.Override + public int getOfframpAllowedDstAssetIdsCount() { + return instance.getOfframpAllowedDstAssetIdsCount(); + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index of the element to return. + * @return The offrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOfframpAllowedDstAssetIds(int index) { + return instance.getOfframpAllowedDstAssetIds(index); + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index of the value to return. + * @return The bytes of the offrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOfframpAllowedDstAssetIdsBytes(int index) { + return instance.getOfframpAllowedDstAssetIdsBytes(index); + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param index The index to set the value at. + * @param value The offrampAllowedDstAssetIds to set. + * @return This builder for chaining. + */ + public Builder setOfframpAllowedDstAssetIds( + int index, java.lang.String value) { + copyOnWrite(); + instance.setOfframpAllowedDstAssetIds(index, value); + return this; + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param value The offrampAllowedDstAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOfframpAllowedDstAssetIds( + java.lang.String value) { + copyOnWrite(); + instance.addOfframpAllowedDstAssetIds(value); + return this; + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param values The offrampAllowedDstAssetIds to add. + * @return This builder for chaining. + */ + public Builder addAllOfframpAllowedDstAssetIds( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllOfframpAllowedDstAssetIds(values); + return this; + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @return This builder for chaining. + */ + public Builder clearOfframpAllowedDstAssetIds() { + copyOnWrite(); + instance.clearOfframpAllowedDstAssetIds(); + return this; + } + /** + *
+       */ List of supported offramp destination asset ids.
+       * 
+ * + * repeated string offramp_allowed_dst_asset_ids = 6; + * @param value The bytes of the offrampAllowedDstAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOfframpAllowedDstAssetIdsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addOfframpAllowedDstAssetIdsBytes(value); + return this; + } + + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @return A list containing the onrampAllowedSrcAssetIds. + */ + @java.lang.Override + public java.util.List + getOnrampAllowedSrcAssetIdsList() { + return java.util.Collections.unmodifiableList( + instance.getOnrampAllowedSrcAssetIdsList()); + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @return The count of onrampAllowedSrcAssetIds. + */ + @java.lang.Override + public int getOnrampAllowedSrcAssetIdsCount() { + return instance.getOnrampAllowedSrcAssetIdsCount(); + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index of the element to return. + * @return The onrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOnrampAllowedSrcAssetIds(int index) { + return instance.getOnrampAllowedSrcAssetIds(index); + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index of the value to return. + * @return The bytes of the onrampAllowedSrcAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOnrampAllowedSrcAssetIdsBytes(int index) { + return instance.getOnrampAllowedSrcAssetIdsBytes(index); + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param index The index to set the value at. + * @param value The onrampAllowedSrcAssetIds to set. + * @return This builder for chaining. + */ + public Builder setOnrampAllowedSrcAssetIds( + int index, java.lang.String value) { + copyOnWrite(); + instance.setOnrampAllowedSrcAssetIds(index, value); + return this; + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param value The onrampAllowedSrcAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOnrampAllowedSrcAssetIds( + java.lang.String value) { + copyOnWrite(); + instance.addOnrampAllowedSrcAssetIds(value); + return this; + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param values The onrampAllowedSrcAssetIds to add. + * @return This builder for chaining. + */ + public Builder addAllOnrampAllowedSrcAssetIds( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllOnrampAllowedSrcAssetIds(values); + return this; + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @return This builder for chaining. + */ + public Builder clearOnrampAllowedSrcAssetIds() { + copyOnWrite(); + instance.clearOnrampAllowedSrcAssetIds(); + return this; + } + /** + *
+       */ List of supported onramp source asset ids.
+       * 
+ * + * repeated string onramp_allowed_src_asset_ids = 7; + * @param value The bytes of the onrampAllowedSrcAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOnrampAllowedSrcAssetIdsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addOnrampAllowedSrcAssetIdsBytes(value); + return this; + } + + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @return A list containing the onrampAllowedDstAssetIds. + */ + @java.lang.Override + public java.util.List + getOnrampAllowedDstAssetIdsList() { + return java.util.Collections.unmodifiableList( + instance.getOnrampAllowedDstAssetIdsList()); + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @return The count of onrampAllowedDstAssetIds. + */ + @java.lang.Override + public int getOnrampAllowedDstAssetIdsCount() { + return instance.getOnrampAllowedDstAssetIdsCount(); + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index of the element to return. + * @return The onrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public java.lang.String getOnrampAllowedDstAssetIds(int index) { + return instance.getOnrampAllowedDstAssetIds(index); + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index of the value to return. + * @return The bytes of the onrampAllowedDstAssetIds at the given index. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOnrampAllowedDstAssetIdsBytes(int index) { + return instance.getOnrampAllowedDstAssetIdsBytes(index); + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param index The index to set the value at. + * @param value The onrampAllowedDstAssetIds to set. + * @return This builder for chaining. + */ + public Builder setOnrampAllowedDstAssetIds( + int index, java.lang.String value) { + copyOnWrite(); + instance.setOnrampAllowedDstAssetIds(index, value); + return this; + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param value The onrampAllowedDstAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOnrampAllowedDstAssetIds( + java.lang.String value) { + copyOnWrite(); + instance.addOnrampAllowedDstAssetIds(value); + return this; + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param values The onrampAllowedDstAssetIds to add. + * @return This builder for chaining. + */ + public Builder addAllOnrampAllowedDstAssetIds( + java.lang.Iterable values) { + copyOnWrite(); + instance.addAllOnrampAllowedDstAssetIds(values); + return this; + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @return This builder for chaining. + */ + public Builder clearOnrampAllowedDstAssetIds() { + copyOnWrite(); + instance.clearOnrampAllowedDstAssetIds(); + return this; + } + /** + *
+       */ List of supported onramp destination asset ids.
+       * 
+ * + * repeated string onramp_allowed_dst_asset_ids = 8; + * @param value The bytes of the onrampAllowedDstAssetIds to add. + * @return This builder for chaining. + */ + public Builder addOnrampAllowedDstAssetIdsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.addOnrampAllowedDstAssetIdsBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_common.GetInfoResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapCommon.GetInfoResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "maxConcurrentOfframps_", + "maxConcurrentOnramps_", + "currentOfframps_", + "currentOnramps_", + "offrampAllowedSrcAssetIds_", + "offrampAllowedDstAssetIds_", + "onrampAllowedSrcAssetIds_", + "onrampAllowedDstAssetIds_", + }; + java.lang.String info = + "\u0000\b\u0000\u0000\u0001\b\b\u0000\u0004\u0000\u0001\u0003\u0002\u0003\u0003\u0003" + + "\u0004\u0003\u0005\u021a\u0006\u021a\u0007\u021a\b\u021a"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapCommon.GetInfoResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_common.GetInfoResponse) + private static final mistyswap.MistyswapCommon.GetInfoResponse DEFAULT_INSTANCE; + static { + GetInfoResponse defaultInstance = new GetInfoResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetInfoResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapCommon.GetInfoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/android/src/main/java/mistyswap/MistyswapCommonApiGrpc.java b/android/src/main/java/mistyswap/MistyswapCommonApiGrpc.java new file mode 100644 index 0000000..4128eea --- /dev/null +++ b/android/src/main/java/mistyswap/MistyswapCommonApiGrpc.java @@ -0,0 +1,270 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.55.1)", + comments = "Source: mistyswap_common.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class MistyswapCommonApiGrpc { + + private MistyswapCommonApiGrpc() {} + + public static final String SERVICE_NAME = "mistyswap_common.MistyswapCommonApi"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getGetInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInfo", + requestType = com.google.protobuf.Empty.class, + responseType = mistyswap.MistyswapCommon.GetInfoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetInfoMethod() { + io.grpc.MethodDescriptor getGetInfoMethod; + if ((getGetInfoMethod = MistyswapCommonApiGrpc.getGetInfoMethod) == null) { + synchronized (MistyswapCommonApiGrpc.class) { + if ((getGetInfoMethod = MistyswapCommonApiGrpc.getGetInfoMethod) == null) { + MistyswapCommonApiGrpc.getGetInfoMethod = getGetInfoMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + mistyswap.MistyswapCommon.GetInfoResponse.getDefaultInstance())) + .build(); + } + } + } + return getGetInfoMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MistyswapCommonApiStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapCommonApiStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapCommonApiStub(channel, callOptions); + } + }; + return MistyswapCommonApiStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MistyswapCommonApiBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapCommonApiBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapCommonApiBlockingStub(channel, callOptions); + } + }; + return MistyswapCommonApiBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MistyswapCommonApiFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapCommonApiFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapCommonApiFutureStub(channel, callOptions); + } + }; + return MistyswapCommonApiFutureStub.newStub(factory, channel); + } + + /** + */ + public interface AsyncService { + + /** + *
+     */ Get information about this mistyswap instance.
+     * 
+ */ + default void getInfo(com.google.protobuf.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetInfoMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service MistyswapCommonApi. + */ + public static abstract class MistyswapCommonApiImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return MistyswapCommonApiGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service MistyswapCommonApi. + */ + public static final class MistyswapCommonApiStub + extends io.grpc.stub.AbstractAsyncStub { + private MistyswapCommonApiStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapCommonApiStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapCommonApiStub(channel, callOptions); + } + + /** + *
+     */ Get information about this mistyswap instance.
+     * 
+ */ + public void getInfo(com.google.protobuf.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInfoMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service MistyswapCommonApi. + */ + public static final class MistyswapCommonApiBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MistyswapCommonApiBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapCommonApiBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapCommonApiBlockingStub(channel, callOptions); + } + + /** + *
+     */ Get information about this mistyswap instance.
+     * 
+ */ + public mistyswap.MistyswapCommon.GetInfoResponse getInfo(com.google.protobuf.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInfoMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MistyswapCommonApi. + */ + public static final class MistyswapCommonApiFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MistyswapCommonApiFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapCommonApiFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapCommonApiFutureStub(channel, callOptions); + } + + /** + *
+     */ Get information about this mistyswap instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getInfo( + com.google.protobuf.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInfoMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_INFO = 0; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_INFO: + serviceImpl.getInfo((com.google.protobuf.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.protobuf.Empty, + mistyswap.MistyswapCommon.GetInfoResponse>( + service, METHODID_GET_INFO))) + .build(); + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (MistyswapCommonApiGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .addMethod(getGetInfoMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/android/src/main/java/mistyswap/MistyswapOfframp.java b/android/src/main/java/mistyswap/MistyswapOfframp.java new file mode 100644 index 0000000..bd7ae97 --- /dev/null +++ b/android/src/main/java/mistyswap/MistyswapOfframp.java @@ -0,0 +1,7032 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mistyswap_offramp.proto + +package mistyswap; + +public final class MistyswapOfframp { + private MistyswapOfframp() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + /** + *
+   */ Various possible offramp error codes.
+   * / This should be kept in sync with mistyswap_offramp_api::Error
+   * / The ORC prefix is needed since enum variants have to be unique across all enums in the file.
+   * 
+ * + * Protobuf enum {@code mistyswap_offramp.OfframpResultCode} + */ + public enum OfframpResultCode + implements com.google.protobuf.Internal.EnumLite { + /** + * ORC_INVALID = 0; + */ + ORC_INVALID(0), + /** + * ORC_OK = 1; + */ + ORC_OK(1), + /** + * ORC_TOO_MANY_OFFRAMPS = 2; + */ + ORC_TOO_MANY_OFFRAMPS(2), + /** + * ORC_MIXIN_CREDENTIALS_JSON = 3; + */ + ORC_MIXIN_CREDENTIALS_JSON(3), + /** + * ORC_OFFRAMP_ALREADY_IN_PROGRESS = 4; + */ + ORC_OFFRAMP_ALREADY_IN_PROGRESS(4), + /** + * ORC_MIXIN = 5; + */ + ORC_MIXIN(5), + /** + * ORC_INVALID_SRC_ASSET_ID = 6; + */ + ORC_INVALID_SRC_ASSET_ID(6), + /** + * ORC_INVALID_DST_ASSET_ID = 7; + */ + ORC_INVALID_DST_ASSET_ID(7), + /** + * ORC_OFFRAMP_ID_NOT_FOUND = 8; + */ + ORC_OFFRAMP_ID_NOT_FOUND(8), + /** + * ORC_INVALID_SRC_EXPECTED_AMOUNT = 9; + */ + ORC_INVALID_SRC_EXPECTED_AMOUNT(9), + /** + * ORC_INVALID_MIN_DST_RECEIVED_AMOUNT = 10; + */ + ORC_INVALID_MIN_DST_RECEIVED_AMOUNT(10), + /** + * ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS = 11; + */ + ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS(11), + /** + * ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER = 12; + */ + ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER(12), + UNRECOGNIZED(-1), + ; + + /** + * ORC_INVALID = 0; + */ + public static final int ORC_INVALID_VALUE = 0; + /** + * ORC_OK = 1; + */ + public static final int ORC_OK_VALUE = 1; + /** + * ORC_TOO_MANY_OFFRAMPS = 2; + */ + public static final int ORC_TOO_MANY_OFFRAMPS_VALUE = 2; + /** + * ORC_MIXIN_CREDENTIALS_JSON = 3; + */ + public static final int ORC_MIXIN_CREDENTIALS_JSON_VALUE = 3; + /** + * ORC_OFFRAMP_ALREADY_IN_PROGRESS = 4; + */ + public static final int ORC_OFFRAMP_ALREADY_IN_PROGRESS_VALUE = 4; + /** + * ORC_MIXIN = 5; + */ + public static final int ORC_MIXIN_VALUE = 5; + /** + * ORC_INVALID_SRC_ASSET_ID = 6; + */ + public static final int ORC_INVALID_SRC_ASSET_ID_VALUE = 6; + /** + * ORC_INVALID_DST_ASSET_ID = 7; + */ + public static final int ORC_INVALID_DST_ASSET_ID_VALUE = 7; + /** + * ORC_OFFRAMP_ID_NOT_FOUND = 8; + */ + public static final int ORC_OFFRAMP_ID_NOT_FOUND_VALUE = 8; + /** + * ORC_INVALID_SRC_EXPECTED_AMOUNT = 9; + */ + public static final int ORC_INVALID_SRC_EXPECTED_AMOUNT_VALUE = 9; + /** + * ORC_INVALID_MIN_DST_RECEIVED_AMOUNT = 10; + */ + public static final int ORC_INVALID_MIN_DST_RECEIVED_AMOUNT_VALUE = 10; + /** + * ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS = 11; + */ + public static final int ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS_VALUE = 11; + /** + * ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER = 12; + */ + public static final int ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER_VALUE = 12; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OfframpResultCode valueOf(int value) { + return forNumber(value); + } + + public static OfframpResultCode forNumber(int value) { + switch (value) { + case 0: return ORC_INVALID; + case 1: return ORC_OK; + case 2: return ORC_TOO_MANY_OFFRAMPS; + case 3: return ORC_MIXIN_CREDENTIALS_JSON; + case 4: return ORC_OFFRAMP_ALREADY_IN_PROGRESS; + case 5: return ORC_MIXIN; + case 6: return ORC_INVALID_SRC_ASSET_ID; + case 7: return ORC_INVALID_DST_ASSET_ID; + case 8: return ORC_OFFRAMP_ID_NOT_FOUND; + case 9: return ORC_INVALID_SRC_EXPECTED_AMOUNT; + case 10: return ORC_INVALID_MIN_DST_RECEIVED_AMOUNT; + case 11: return ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS; + case 12: return ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OfframpResultCode> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public OfframpResultCode findValueByNumber(int number) { + return OfframpResultCode.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return OfframpResultCodeVerifier.INSTANCE; + } + + private static final class OfframpResultCodeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new OfframpResultCodeVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return OfframpResultCode.forNumber(number) != null; + } + }; + + private final int value; + + private OfframpResultCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:mistyswap_offramp.OfframpResultCode) + } + + /** + *
+   */ Current offramp state.
+   * / This should be kept in sync with offramp_impl::OfframpState
+   * / The OS prefix is needed since enum variants have to be unique across all enums in the file.
+   * 
+ * + * Protobuf enum {@code mistyswap_offramp.OfframpState} + */ + public enum OfframpState + implements com.google.protobuf.Internal.EnumLite { + /** + * OS_INVALID = 0; + */ + OS_INVALID(0), + /** + * OS_NOT_STARTED = 1; + */ + OS_NOT_STARTED(1), + /** + * OS_POLLING = 2; + */ + OS_POLLING(2), + /** + * OS_WAITING = 3; + */ + OS_WAITING(3), + /** + * OS_INVALID_WITHDRAWAL_ADDRESS = 4; + */ + OS_INVALID_WITHDRAWAL_ADDRESS(4), + /** + * OS_INTERMITTENT_ERROR = 5; + */ + OS_INTERMITTENT_ERROR(5), + /** + * OS_BLOCKED_ON_SWAP = 6; + */ + OS_BLOCKED_ON_SWAP(6), + /** + * OS_BLOCKED_ON_WITHDRAWAL = 7; + */ + OS_BLOCKED_ON_WITHDRAWAL(7), + /** + * OS_WITHDRAWAL_COMPLETED = 8; + */ + OS_WITHDRAWAL_COMPLETED(8), + /** + * OS_UNRECOVERABLE_ERROR = 9; + */ + OS_UNRECOVERABLE_ERROR(9), + UNRECOGNIZED(-1), + ; + + /** + * OS_INVALID = 0; + */ + public static final int OS_INVALID_VALUE = 0; + /** + * OS_NOT_STARTED = 1; + */ + public static final int OS_NOT_STARTED_VALUE = 1; + /** + * OS_POLLING = 2; + */ + public static final int OS_POLLING_VALUE = 2; + /** + * OS_WAITING = 3; + */ + public static final int OS_WAITING_VALUE = 3; + /** + * OS_INVALID_WITHDRAWAL_ADDRESS = 4; + */ + public static final int OS_INVALID_WITHDRAWAL_ADDRESS_VALUE = 4; + /** + * OS_INTERMITTENT_ERROR = 5; + */ + public static final int OS_INTERMITTENT_ERROR_VALUE = 5; + /** + * OS_BLOCKED_ON_SWAP = 6; + */ + public static final int OS_BLOCKED_ON_SWAP_VALUE = 6; + /** + * OS_BLOCKED_ON_WITHDRAWAL = 7; + */ + public static final int OS_BLOCKED_ON_WITHDRAWAL_VALUE = 7; + /** + * OS_WITHDRAWAL_COMPLETED = 8; + */ + public static final int OS_WITHDRAWAL_COMPLETED_VALUE = 8; + /** + * OS_UNRECOVERABLE_ERROR = 9; + */ + public static final int OS_UNRECOVERABLE_ERROR_VALUE = 9; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OfframpState valueOf(int value) { + return forNumber(value); + } + + public static OfframpState forNumber(int value) { + switch (value) { + case 0: return OS_INVALID; + case 1: return OS_NOT_STARTED; + case 2: return OS_POLLING; + case 3: return OS_WAITING; + case 4: return OS_INVALID_WITHDRAWAL_ADDRESS; + case 5: return OS_INTERMITTENT_ERROR; + case 6: return OS_BLOCKED_ON_SWAP; + case 7: return OS_BLOCKED_ON_WITHDRAWAL; + case 8: return OS_WITHDRAWAL_COMPLETED; + case 9: return OS_UNRECOVERABLE_ERROR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OfframpState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public OfframpState findValueByNumber(int number) { + return OfframpState.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return OfframpStateVerifier.INSTANCE; + } + + private static final class OfframpStateVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new OfframpStateVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return OfframpState.forNumber(number) != null; + } + }; + + private final int value; + + private OfframpState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:mistyswap_offramp.OfframpState) + } + + public interface OfframpResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.OfframpResult) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @return The code. + */ + mistyswap.MistyswapOfframp.OfframpResultCode getCode(); + + /** + * string message = 2; + * @return The message. + */ + java.lang.String getMessage(); + /** + * string message = 2; + * @return The bytes for message. + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + *
+     * For OfframAlreadyInProgress, this is the offramp_id of the existing offramp.
+     * 
+ * + * bytes offramp_id = 3; + * @return The offrampId. + */ + com.google.protobuf.ByteString getOfframpId(); + } + /** + *
+   */ A simplified GRPC-compatible wrapper for Result<_, mistyswap_offramp_api::Error>
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.OfframpResult} + */ + public static final class OfframpResult extends + com.google.protobuf.GeneratedMessageLite< + OfframpResult, OfframpResult.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.OfframpResult) + OfframpResultOrBuilder { + private OfframpResult() { + message_ = ""; + offrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @return The code. + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResultCode getCode() { + mistyswap.MistyswapOfframp.OfframpResultCode result = mistyswap.MistyswapOfframp.OfframpResultCode.forNumber(code_); + return result == null ? mistyswap.MistyswapOfframp.OfframpResultCode.UNRECOGNIZED : result; + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @param value The enum numeric value on the wire for code to set. + */ + private void setCodeValue(int value) { + code_ = value; + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @param value The code to set. + */ + private void setCode(mistyswap.MistyswapOfframp.OfframpResultCode value) { + code_ = value.getNumber(); + + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + */ + private void clearCode() { + + code_ = 0; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private java.lang.String message_; + /** + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + return message_; + } + /** + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(message_); + } + /** + * string message = 2; + * @param value The message to set. + */ + private void setMessage( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + message_ = value; + } + /** + * string message = 2; + */ + private void clearMessage() { + + message_ = getDefaultInstance().getMessage(); + } + /** + * string message = 2; + * @param value The bytes for message to set. + */ + private void setMessageBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + message_ = value.toStringUtf8(); + + } + + public static final int OFFRAMP_ID_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString offrampId_; + /** + *
+     * For OfframAlreadyInProgress, this is the offramp_id of the existing offramp.
+     * 
+ * + * bytes offramp_id = 3; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return offrampId_; + } + /** + *
+     * For OfframAlreadyInProgress, this is the offramp_id of the existing offramp.
+     * 
+ * + * bytes offramp_id = 3; + * @param value The offrampId to set. + */ + private void setOfframpId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + offrampId_ = value; + } + /** + *
+     * For OfframAlreadyInProgress, this is the offramp_id of the existing offramp.
+     * 
+ * + * bytes offramp_id = 3; + */ + private void clearOfframpId() { + + offrampId_ = getDefaultInstance().getOfframpId(); + } + + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.OfframpResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.OfframpResult prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A simplified GRPC-compatible wrapper for Result<_, mistyswap_offramp_api::Error>
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.OfframpResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.OfframpResult, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.OfframpResult) + mistyswap.MistyswapOfframp.OfframpResultOrBuilder { + // Construct using mistyswap.MistyswapOfframp.OfframpResult.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return instance.getCodeValue(); + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + copyOnWrite(); + instance.setCodeValue(value); + return this; + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @return The code. + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResultCode getCode() { + return instance.getCode(); + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCode(mistyswap.MistyswapOfframp.OfframpResultCode value) { + copyOnWrite(); + instance.setCode(value); + return this; + } + /** + * .mistyswap_offramp.OfframpResultCode code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + copyOnWrite(); + instance.clearCode(); + return this; + } + + /** + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + return instance.getMessage(); + } + /** + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + return instance.getMessageBytes(); + } + /** + * string message = 2; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage( + java.lang.String value) { + copyOnWrite(); + instance.setMessage(value); + return this; + } + /** + * string message = 2; + * @return This builder for chaining. + */ + public Builder clearMessage() { + copyOnWrite(); + instance.clearMessage(); + return this; + } + /** + * string message = 2; + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMessageBytes(value); + return this; + } + + /** + *
+       * For OfframAlreadyInProgress, this is the offramp_id of the existing offramp.
+       * 
+ * + * bytes offramp_id = 3; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return instance.getOfframpId(); + } + /** + *
+       * For OfframAlreadyInProgress, this is the offramp_id of the existing offramp.
+       * 
+ * + * bytes offramp_id = 3; + * @param value The offrampId to set. + * @return This builder for chaining. + */ + public Builder setOfframpId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOfframpId(value); + return this; + } + /** + *
+       * For OfframAlreadyInProgress, this is the offramp_id of the existing offramp.
+       * 
+ * + * bytes offramp_id = 3; + * @return This builder for chaining. + */ + public Builder clearOfframpId() { + copyOnWrite(); + instance.clearOfframpId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.OfframpResult) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.OfframpResult(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "code_", + "message_", + "offrampId_", + }; + java.lang.String info = + "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\f\u0002\u0208" + + "\u0003\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.OfframpResult.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.OfframpResult) + private static final mistyswap.MistyswapOfframp.OfframpResult DEFAULT_INSTANCE; + static { + OfframpResult defaultInstance = new OfframpResult(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OfframpResult.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.OfframpResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface OfframpParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.OfframpParams) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ The asset being offramped (the token id we will be swapping from). This
+     * / would be MOB or eUSD. This is the mixin asset uuid.
+     * 
+ * + * string src_asset_id = 1; + * @return The srcAssetId. + */ + java.lang.String getSrcAssetId(); + /** + *
+     */ The asset being offramped (the token id we will be swapping from). This
+     * / would be MOB or eUSD. This is the mixin asset uuid.
+     * 
+ * + * string src_asset_id = 1; + * @return The bytes for srcAssetId. + */ + com.google.protobuf.ByteString + getSrcAssetIdBytes(); + + /** + *
+     */ The amount we are going to be swapping. We use  strings to allow
+     * / decimals.
+     * 
+ * + * string src_expected_amount = 2; + * @return The srcExpectedAmount. + */ + java.lang.String getSrcExpectedAmount(); + /** + *
+     */ The amount we are going to be swapping. We use  strings to allow
+     * / decimals.
+     * 
+ * + * string src_expected_amount = 2; + * @return The bytes for srcExpectedAmount. + */ + com.google.protobuf.ByteString + getSrcExpectedAmountBytes(); + + /** + *
+     */ The Mixin destination asset id (the token id we will be swapping into).
+     * / This is the mixin asset uuid.
+     * 
+ * + * string dst_asset_id = 3; + * @return The dstAssetId. + */ + java.lang.String getDstAssetId(); + /** + *
+     */ The Mixin destination asset id (the token id we will be swapping into).
+     * / This is the mixin asset uuid.
+     * 
+ * + * string dst_asset_id = 3; + * @return The bytes for dstAssetId. + */ + com.google.protobuf.ByteString + getDstAssetIdBytes(); + + /** + *
+     */ The token-specific address to withdraw into.
+     * 
+ * + * string dst_address = 4; + * @return The dstAddress. + */ + java.lang.String getDstAddress(); + /** + *
+     */ The token-specific address to withdraw into.
+     * 
+ * + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + com.google.protobuf.ByteString + getDstAddressBytes(); + + /** + *
+     */ The token-specific address tag, if any.
+     * 
+ * + * string dst_address_tag = 5; + * @return The dstAddressTag. + */ + java.lang.String getDstAddressTag(); + /** + *
+     */ The token-specific address tag, if any.
+     * 
+ * + * string dst_address_tag = 5; + * @return The bytes for dstAddressTag. + */ + com.google.protobuf.ByteString + getDstAddressTagBytes(); + + /** + *
+     */ The minimum amount of destination tokens we expect to receive from
+     * / swapping the source tokens. Note that this includes tokens that will
+     * / later be swapped for fees if the fee token is not the destination token.
+     * 
+ * + * string min_dst_received_amount = 6; + * @return The minDstReceivedAmount. + */ + java.lang.String getMinDstReceivedAmount(); + /** + *
+     */ The minimum amount of destination tokens we expect to receive from
+     * / swapping the source tokens. Note that this includes tokens that will
+     * / later be swapped for fees if the fee token is not the destination token.
+     * 
+ * + * string min_dst_received_amount = 6; + * @return The bytes for minDstReceivedAmount. + */ + com.google.protobuf.ByteString + getMinDstReceivedAmountBytes(); + + /** + *
+     */ The maximum amount of destination tokens we are willing to use for fees.
+     * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @return The maxFeeAmountInDstTokens. + */ + java.lang.String getMaxFeeAmountInDstTokens(); + /** + *
+     */ The maximum amount of destination tokens we are willing to use for fees.
+     * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @return The bytes for maxFeeAmountInDstTokens. + */ + com.google.protobuf.ByteString + getMaxFeeAmountInDstTokensBytes(); + + /** + *
+     */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+     * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+     * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+     * / The default is used if this field is set to an empty string.
+     * / Setting it to a value lower than 1.0 will result in an error.
+     * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+     * 
+ * + * string fee_token_swap_multiplier = 8; + * @return The feeTokenSwapMultiplier. + */ + java.lang.String getFeeTokenSwapMultiplier(); + /** + *
+     */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+     * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+     * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+     * / The default is used if this field is set to an empty string.
+     * / Setting it to a value lower than 1.0 will result in an error.
+     * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+     * 
+ * + * string fee_token_swap_multiplier = 8; + * @return The bytes for feeTokenSwapMultiplier. + */ + com.google.protobuf.ByteString + getFeeTokenSwapMultiplierBytes(); + } + /** + *
+   */ Offramp parameters.
+   * / They are separated from the credentials since they are not as sensitive, and it makes it
+   * / easier to include them to the client in the response to GetOfframpStatus calls.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.OfframpParams} + */ + public static final class OfframpParams extends + com.google.protobuf.GeneratedMessageLite< + OfframpParams, OfframpParams.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.OfframpParams) + OfframpParamsOrBuilder { + private OfframpParams() { + srcAssetId_ = ""; + srcExpectedAmount_ = ""; + dstAssetId_ = ""; + dstAddress_ = ""; + dstAddressTag_ = ""; + minDstReceivedAmount_ = ""; + maxFeeAmountInDstTokens_ = ""; + feeTokenSwapMultiplier_ = ""; + } + public static final int SRC_ASSET_ID_FIELD_NUMBER = 1; + private java.lang.String srcAssetId_; + /** + *
+     */ The asset being offramped (the token id we will be swapping from). This
+     * / would be MOB or eUSD. This is the mixin asset uuid.
+     * 
+ * + * string src_asset_id = 1; + * @return The srcAssetId. + */ + @java.lang.Override + public java.lang.String getSrcAssetId() { + return srcAssetId_; + } + /** + *
+     */ The asset being offramped (the token id we will be swapping from). This
+     * / would be MOB or eUSD. This is the mixin asset uuid.
+     * 
+ * + * string src_asset_id = 1; + * @return The bytes for srcAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAssetIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(srcAssetId_); + } + /** + *
+     */ The asset being offramped (the token id we will be swapping from). This
+     * / would be MOB or eUSD. This is the mixin asset uuid.
+     * 
+ * + * string src_asset_id = 1; + * @param value The srcAssetId to set. + */ + private void setSrcAssetId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + srcAssetId_ = value; + } + /** + *
+     */ The asset being offramped (the token id we will be swapping from). This
+     * / would be MOB or eUSD. This is the mixin asset uuid.
+     * 
+ * + * string src_asset_id = 1; + */ + private void clearSrcAssetId() { + + srcAssetId_ = getDefaultInstance().getSrcAssetId(); + } + /** + *
+     */ The asset being offramped (the token id we will be swapping from). This
+     * / would be MOB or eUSD. This is the mixin asset uuid.
+     * 
+ * + * string src_asset_id = 1; + * @param value The bytes for srcAssetId to set. + */ + private void setSrcAssetIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + srcAssetId_ = value.toStringUtf8(); + + } + + public static final int SRC_EXPECTED_AMOUNT_FIELD_NUMBER = 2; + private java.lang.String srcExpectedAmount_; + /** + *
+     */ The amount we are going to be swapping. We use  strings to allow
+     * / decimals.
+     * 
+ * + * string src_expected_amount = 2; + * @return The srcExpectedAmount. + */ + @java.lang.Override + public java.lang.String getSrcExpectedAmount() { + return srcExpectedAmount_; + } + /** + *
+     */ The amount we are going to be swapping. We use  strings to allow
+     * / decimals.
+     * 
+ * + * string src_expected_amount = 2; + * @return The bytes for srcExpectedAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcExpectedAmountBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(srcExpectedAmount_); + } + /** + *
+     */ The amount we are going to be swapping. We use  strings to allow
+     * / decimals.
+     * 
+ * + * string src_expected_amount = 2; + * @param value The srcExpectedAmount to set. + */ + private void setSrcExpectedAmount( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + srcExpectedAmount_ = value; + } + /** + *
+     */ The amount we are going to be swapping. We use  strings to allow
+     * / decimals.
+     * 
+ * + * string src_expected_amount = 2; + */ + private void clearSrcExpectedAmount() { + + srcExpectedAmount_ = getDefaultInstance().getSrcExpectedAmount(); + } + /** + *
+     */ The amount we are going to be swapping. We use  strings to allow
+     * / decimals.
+     * 
+ * + * string src_expected_amount = 2; + * @param value The bytes for srcExpectedAmount to set. + */ + private void setSrcExpectedAmountBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + srcExpectedAmount_ = value.toStringUtf8(); + + } + + public static final int DST_ASSET_ID_FIELD_NUMBER = 3; + private java.lang.String dstAssetId_; + /** + *
+     */ The Mixin destination asset id (the token id we will be swapping into).
+     * / This is the mixin asset uuid.
+     * 
+ * + * string dst_asset_id = 3; + * @return The dstAssetId. + */ + @java.lang.Override + public java.lang.String getDstAssetId() { + return dstAssetId_; + } + /** + *
+     */ The Mixin destination asset id (the token id we will be swapping into).
+     * / This is the mixin asset uuid.
+     * 
+ * + * string dst_asset_id = 3; + * @return The bytes for dstAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAssetIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(dstAssetId_); + } + /** + *
+     */ The Mixin destination asset id (the token id we will be swapping into).
+     * / This is the mixin asset uuid.
+     * 
+ * + * string dst_asset_id = 3; + * @param value The dstAssetId to set. + */ + private void setDstAssetId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + dstAssetId_ = value; + } + /** + *
+     */ The Mixin destination asset id (the token id we will be swapping into).
+     * / This is the mixin asset uuid.
+     * 
+ * + * string dst_asset_id = 3; + */ + private void clearDstAssetId() { + + dstAssetId_ = getDefaultInstance().getDstAssetId(); + } + /** + *
+     */ The Mixin destination asset id (the token id we will be swapping into).
+     * / This is the mixin asset uuid.
+     * 
+ * + * string dst_asset_id = 3; + * @param value The bytes for dstAssetId to set. + */ + private void setDstAssetIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + dstAssetId_ = value.toStringUtf8(); + + } + + public static final int DST_ADDRESS_FIELD_NUMBER = 4; + private java.lang.String dstAddress_; + /** + *
+     */ The token-specific address to withdraw into.
+     * 
+ * + * string dst_address = 4; + * @return The dstAddress. + */ + @java.lang.Override + public java.lang.String getDstAddress() { + return dstAddress_; + } + /** + *
+     */ The token-specific address to withdraw into.
+     * 
+ * + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(dstAddress_); + } + /** + *
+     */ The token-specific address to withdraw into.
+     * 
+ * + * string dst_address = 4; + * @param value The dstAddress to set. + */ + private void setDstAddress( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + dstAddress_ = value; + } + /** + *
+     */ The token-specific address to withdraw into.
+     * 
+ * + * string dst_address = 4; + */ + private void clearDstAddress() { + + dstAddress_ = getDefaultInstance().getDstAddress(); + } + /** + *
+     */ The token-specific address to withdraw into.
+     * 
+ * + * string dst_address = 4; + * @param value The bytes for dstAddress to set. + */ + private void setDstAddressBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + dstAddress_ = value.toStringUtf8(); + + } + + public static final int DST_ADDRESS_TAG_FIELD_NUMBER = 5; + private java.lang.String dstAddressTag_; + /** + *
+     */ The token-specific address tag, if any.
+     * 
+ * + * string dst_address_tag = 5; + * @return The dstAddressTag. + */ + @java.lang.Override + public java.lang.String getDstAddressTag() { + return dstAddressTag_; + } + /** + *
+     */ The token-specific address tag, if any.
+     * 
+ * + * string dst_address_tag = 5; + * @return The bytes for dstAddressTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressTagBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(dstAddressTag_); + } + /** + *
+     */ The token-specific address tag, if any.
+     * 
+ * + * string dst_address_tag = 5; + * @param value The dstAddressTag to set. + */ + private void setDstAddressTag( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + dstAddressTag_ = value; + } + /** + *
+     */ The token-specific address tag, if any.
+     * 
+ * + * string dst_address_tag = 5; + */ + private void clearDstAddressTag() { + + dstAddressTag_ = getDefaultInstance().getDstAddressTag(); + } + /** + *
+     */ The token-specific address tag, if any.
+     * 
+ * + * string dst_address_tag = 5; + * @param value The bytes for dstAddressTag to set. + */ + private void setDstAddressTagBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + dstAddressTag_ = value.toStringUtf8(); + + } + + public static final int MIN_DST_RECEIVED_AMOUNT_FIELD_NUMBER = 6; + private java.lang.String minDstReceivedAmount_; + /** + *
+     */ The minimum amount of destination tokens we expect to receive from
+     * / swapping the source tokens. Note that this includes tokens that will
+     * / later be swapped for fees if the fee token is not the destination token.
+     * 
+ * + * string min_dst_received_amount = 6; + * @return The minDstReceivedAmount. + */ + @java.lang.Override + public java.lang.String getMinDstReceivedAmount() { + return minDstReceivedAmount_; + } + /** + *
+     */ The minimum amount of destination tokens we expect to receive from
+     * / swapping the source tokens. Note that this includes tokens that will
+     * / later be swapped for fees if the fee token is not the destination token.
+     * 
+ * + * string min_dst_received_amount = 6; + * @return The bytes for minDstReceivedAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMinDstReceivedAmountBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(minDstReceivedAmount_); + } + /** + *
+     */ The minimum amount of destination tokens we expect to receive from
+     * / swapping the source tokens. Note that this includes tokens that will
+     * / later be swapped for fees if the fee token is not the destination token.
+     * 
+ * + * string min_dst_received_amount = 6; + * @param value The minDstReceivedAmount to set. + */ + private void setMinDstReceivedAmount( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + minDstReceivedAmount_ = value; + } + /** + *
+     */ The minimum amount of destination tokens we expect to receive from
+     * / swapping the source tokens. Note that this includes tokens that will
+     * / later be swapped for fees if the fee token is not the destination token.
+     * 
+ * + * string min_dst_received_amount = 6; + */ + private void clearMinDstReceivedAmount() { + + minDstReceivedAmount_ = getDefaultInstance().getMinDstReceivedAmount(); + } + /** + *
+     */ The minimum amount of destination tokens we expect to receive from
+     * / swapping the source tokens. Note that this includes tokens that will
+     * / later be swapped for fees if the fee token is not the destination token.
+     * 
+ * + * string min_dst_received_amount = 6; + * @param value The bytes for minDstReceivedAmount to set. + */ + private void setMinDstReceivedAmountBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + minDstReceivedAmount_ = value.toStringUtf8(); + + } + + public static final int MAX_FEE_AMOUNT_IN_DST_TOKENS_FIELD_NUMBER = 7; + private java.lang.String maxFeeAmountInDstTokens_; + /** + *
+     */ The maximum amount of destination tokens we are willing to use for fees.
+     * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @return The maxFeeAmountInDstTokens. + */ + @java.lang.Override + public java.lang.String getMaxFeeAmountInDstTokens() { + return maxFeeAmountInDstTokens_; + } + /** + *
+     */ The maximum amount of destination tokens we are willing to use for fees.
+     * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @return The bytes for maxFeeAmountInDstTokens. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMaxFeeAmountInDstTokensBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(maxFeeAmountInDstTokens_); + } + /** + *
+     */ The maximum amount of destination tokens we are willing to use for fees.
+     * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @param value The maxFeeAmountInDstTokens to set. + */ + private void setMaxFeeAmountInDstTokens( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + maxFeeAmountInDstTokens_ = value; + } + /** + *
+     */ The maximum amount of destination tokens we are willing to use for fees.
+     * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + */ + private void clearMaxFeeAmountInDstTokens() { + + maxFeeAmountInDstTokens_ = getDefaultInstance().getMaxFeeAmountInDstTokens(); + } + /** + *
+     */ The maximum amount of destination tokens we are willing to use for fees.
+     * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @param value The bytes for maxFeeAmountInDstTokens to set. + */ + private void setMaxFeeAmountInDstTokensBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + maxFeeAmountInDstTokens_ = value.toStringUtf8(); + + } + + public static final int FEE_TOKEN_SWAP_MULTIPLIER_FIELD_NUMBER = 8; + private java.lang.String feeTokenSwapMultiplier_; + /** + *
+     */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+     * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+     * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+     * / The default is used if this field is set to an empty string.
+     * / Setting it to a value lower than 1.0 will result in an error.
+     * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+     * 
+ * + * string fee_token_swap_multiplier = 8; + * @return The feeTokenSwapMultiplier. + */ + @java.lang.Override + public java.lang.String getFeeTokenSwapMultiplier() { + return feeTokenSwapMultiplier_; + } + /** + *
+     */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+     * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+     * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+     * / The default is used if this field is set to an empty string.
+     * / Setting it to a value lower than 1.0 will result in an error.
+     * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+     * 
+ * + * string fee_token_swap_multiplier = 8; + * @return The bytes for feeTokenSwapMultiplier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFeeTokenSwapMultiplierBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(feeTokenSwapMultiplier_); + } + /** + *
+     */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+     * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+     * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+     * / The default is used if this field is set to an empty string.
+     * / Setting it to a value lower than 1.0 will result in an error.
+     * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+     * 
+ * + * string fee_token_swap_multiplier = 8; + * @param value The feeTokenSwapMultiplier to set. + */ + private void setFeeTokenSwapMultiplier( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + feeTokenSwapMultiplier_ = value; + } + /** + *
+     */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+     * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+     * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+     * / The default is used if this field is set to an empty string.
+     * / Setting it to a value lower than 1.0 will result in an error.
+     * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+     * 
+ * + * string fee_token_swap_multiplier = 8; + */ + private void clearFeeTokenSwapMultiplier() { + + feeTokenSwapMultiplier_ = getDefaultInstance().getFeeTokenSwapMultiplier(); + } + /** + *
+     */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+     * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+     * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+     * / The default is used if this field is set to an empty string.
+     * / Setting it to a value lower than 1.0 will result in an error.
+     * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+     * 
+ * + * string fee_token_swap_multiplier = 8; + * @param value The bytes for feeTokenSwapMultiplier to set. + */ + private void setFeeTokenSwapMultiplierBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + feeTokenSwapMultiplier_ = value.toStringUtf8(); + + } + + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.OfframpParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.OfframpParams prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Offramp parameters.
+     * / They are separated from the credentials since they are not as sensitive, and it makes it
+     * / easier to include them to the client in the response to GetOfframpStatus calls.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.OfframpParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.OfframpParams, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.OfframpParams) + mistyswap.MistyswapOfframp.OfframpParamsOrBuilder { + // Construct using mistyswap.MistyswapOfframp.OfframpParams.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ The asset being offramped (the token id we will be swapping from). This
+       * / would be MOB or eUSD. This is the mixin asset uuid.
+       * 
+ * + * string src_asset_id = 1; + * @return The srcAssetId. + */ + @java.lang.Override + public java.lang.String getSrcAssetId() { + return instance.getSrcAssetId(); + } + /** + *
+       */ The asset being offramped (the token id we will be swapping from). This
+       * / would be MOB or eUSD. This is the mixin asset uuid.
+       * 
+ * + * string src_asset_id = 1; + * @return The bytes for srcAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAssetIdBytes() { + return instance.getSrcAssetIdBytes(); + } + /** + *
+       */ The asset being offramped (the token id we will be swapping from). This
+       * / would be MOB or eUSD. This is the mixin asset uuid.
+       * 
+ * + * string src_asset_id = 1; + * @param value The srcAssetId to set. + * @return This builder for chaining. + */ + public Builder setSrcAssetId( + java.lang.String value) { + copyOnWrite(); + instance.setSrcAssetId(value); + return this; + } + /** + *
+       */ The asset being offramped (the token id we will be swapping from). This
+       * / would be MOB or eUSD. This is the mixin asset uuid.
+       * 
+ * + * string src_asset_id = 1; + * @return This builder for chaining. + */ + public Builder clearSrcAssetId() { + copyOnWrite(); + instance.clearSrcAssetId(); + return this; + } + /** + *
+       */ The asset being offramped (the token id we will be swapping from). This
+       * / would be MOB or eUSD. This is the mixin asset uuid.
+       * 
+ * + * string src_asset_id = 1; + * @param value The bytes for srcAssetId to set. + * @return This builder for chaining. + */ + public Builder setSrcAssetIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSrcAssetIdBytes(value); + return this; + } + + /** + *
+       */ The amount we are going to be swapping. We use  strings to allow
+       * / decimals.
+       * 
+ * + * string src_expected_amount = 2; + * @return The srcExpectedAmount. + */ + @java.lang.Override + public java.lang.String getSrcExpectedAmount() { + return instance.getSrcExpectedAmount(); + } + /** + *
+       */ The amount we are going to be swapping. We use  strings to allow
+       * / decimals.
+       * 
+ * + * string src_expected_amount = 2; + * @return The bytes for srcExpectedAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcExpectedAmountBytes() { + return instance.getSrcExpectedAmountBytes(); + } + /** + *
+       */ The amount we are going to be swapping. We use  strings to allow
+       * / decimals.
+       * 
+ * + * string src_expected_amount = 2; + * @param value The srcExpectedAmount to set. + * @return This builder for chaining. + */ + public Builder setSrcExpectedAmount( + java.lang.String value) { + copyOnWrite(); + instance.setSrcExpectedAmount(value); + return this; + } + /** + *
+       */ The amount we are going to be swapping. We use  strings to allow
+       * / decimals.
+       * 
+ * + * string src_expected_amount = 2; + * @return This builder for chaining. + */ + public Builder clearSrcExpectedAmount() { + copyOnWrite(); + instance.clearSrcExpectedAmount(); + return this; + } + /** + *
+       */ The amount we are going to be swapping. We use  strings to allow
+       * / decimals.
+       * 
+ * + * string src_expected_amount = 2; + * @param value The bytes for srcExpectedAmount to set. + * @return This builder for chaining. + */ + public Builder setSrcExpectedAmountBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setSrcExpectedAmountBytes(value); + return this; + } + + /** + *
+       */ The Mixin destination asset id (the token id we will be swapping into).
+       * / This is the mixin asset uuid.
+       * 
+ * + * string dst_asset_id = 3; + * @return The dstAssetId. + */ + @java.lang.Override + public java.lang.String getDstAssetId() { + return instance.getDstAssetId(); + } + /** + *
+       */ The Mixin destination asset id (the token id we will be swapping into).
+       * / This is the mixin asset uuid.
+       * 
+ * + * string dst_asset_id = 3; + * @return The bytes for dstAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAssetIdBytes() { + return instance.getDstAssetIdBytes(); + } + /** + *
+       */ The Mixin destination asset id (the token id we will be swapping into).
+       * / This is the mixin asset uuid.
+       * 
+ * + * string dst_asset_id = 3; + * @param value The dstAssetId to set. + * @return This builder for chaining. + */ + public Builder setDstAssetId( + java.lang.String value) { + copyOnWrite(); + instance.setDstAssetId(value); + return this; + } + /** + *
+       */ The Mixin destination asset id (the token id we will be swapping into).
+       * / This is the mixin asset uuid.
+       * 
+ * + * string dst_asset_id = 3; + * @return This builder for chaining. + */ + public Builder clearDstAssetId() { + copyOnWrite(); + instance.clearDstAssetId(); + return this; + } + /** + *
+       */ The Mixin destination asset id (the token id we will be swapping into).
+       * / This is the mixin asset uuid.
+       * 
+ * + * string dst_asset_id = 3; + * @param value The bytes for dstAssetId to set. + * @return This builder for chaining. + */ + public Builder setDstAssetIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDstAssetIdBytes(value); + return this; + } + + /** + *
+       */ The token-specific address to withdraw into.
+       * 
+ * + * string dst_address = 4; + * @return The dstAddress. + */ + @java.lang.Override + public java.lang.String getDstAddress() { + return instance.getDstAddress(); + } + /** + *
+       */ The token-specific address to withdraw into.
+       * 
+ * + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressBytes() { + return instance.getDstAddressBytes(); + } + /** + *
+       */ The token-specific address to withdraw into.
+       * 
+ * + * string dst_address = 4; + * @param value The dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddress( + java.lang.String value) { + copyOnWrite(); + instance.setDstAddress(value); + return this; + } + /** + *
+       */ The token-specific address to withdraw into.
+       * 
+ * + * string dst_address = 4; + * @return This builder for chaining. + */ + public Builder clearDstAddress() { + copyOnWrite(); + instance.clearDstAddress(); + return this; + } + /** + *
+       */ The token-specific address to withdraw into.
+       * 
+ * + * string dst_address = 4; + * @param value The bytes for dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddressBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDstAddressBytes(value); + return this; + } + + /** + *
+       */ The token-specific address tag, if any.
+       * 
+ * + * string dst_address_tag = 5; + * @return The dstAddressTag. + */ + @java.lang.Override + public java.lang.String getDstAddressTag() { + return instance.getDstAddressTag(); + } + /** + *
+       */ The token-specific address tag, if any.
+       * 
+ * + * string dst_address_tag = 5; + * @return The bytes for dstAddressTag. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressTagBytes() { + return instance.getDstAddressTagBytes(); + } + /** + *
+       */ The token-specific address tag, if any.
+       * 
+ * + * string dst_address_tag = 5; + * @param value The dstAddressTag to set. + * @return This builder for chaining. + */ + public Builder setDstAddressTag( + java.lang.String value) { + copyOnWrite(); + instance.setDstAddressTag(value); + return this; + } + /** + *
+       */ The token-specific address tag, if any.
+       * 
+ * + * string dst_address_tag = 5; + * @return This builder for chaining. + */ + public Builder clearDstAddressTag() { + copyOnWrite(); + instance.clearDstAddressTag(); + return this; + } + /** + *
+       */ The token-specific address tag, if any.
+       * 
+ * + * string dst_address_tag = 5; + * @param value The bytes for dstAddressTag to set. + * @return This builder for chaining. + */ + public Builder setDstAddressTagBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDstAddressTagBytes(value); + return this; + } + + /** + *
+       */ The minimum amount of destination tokens we expect to receive from
+       * / swapping the source tokens. Note that this includes tokens that will
+       * / later be swapped for fees if the fee token is not the destination token.
+       * 
+ * + * string min_dst_received_amount = 6; + * @return The minDstReceivedAmount. + */ + @java.lang.Override + public java.lang.String getMinDstReceivedAmount() { + return instance.getMinDstReceivedAmount(); + } + /** + *
+       */ The minimum amount of destination tokens we expect to receive from
+       * / swapping the source tokens. Note that this includes tokens that will
+       * / later be swapped for fees if the fee token is not the destination token.
+       * 
+ * + * string min_dst_received_amount = 6; + * @return The bytes for minDstReceivedAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMinDstReceivedAmountBytes() { + return instance.getMinDstReceivedAmountBytes(); + } + /** + *
+       */ The minimum amount of destination tokens we expect to receive from
+       * / swapping the source tokens. Note that this includes tokens that will
+       * / later be swapped for fees if the fee token is not the destination token.
+       * 
+ * + * string min_dst_received_amount = 6; + * @param value The minDstReceivedAmount to set. + * @return This builder for chaining. + */ + public Builder setMinDstReceivedAmount( + java.lang.String value) { + copyOnWrite(); + instance.setMinDstReceivedAmount(value); + return this; + } + /** + *
+       */ The minimum amount of destination tokens we expect to receive from
+       * / swapping the source tokens. Note that this includes tokens that will
+       * / later be swapped for fees if the fee token is not the destination token.
+       * 
+ * + * string min_dst_received_amount = 6; + * @return This builder for chaining. + */ + public Builder clearMinDstReceivedAmount() { + copyOnWrite(); + instance.clearMinDstReceivedAmount(); + return this; + } + /** + *
+       */ The minimum amount of destination tokens we expect to receive from
+       * / swapping the source tokens. Note that this includes tokens that will
+       * / later be swapped for fees if the fee token is not the destination token.
+       * 
+ * + * string min_dst_received_amount = 6; + * @param value The bytes for minDstReceivedAmount to set. + * @return This builder for chaining. + */ + public Builder setMinDstReceivedAmountBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMinDstReceivedAmountBytes(value); + return this; + } + + /** + *
+       */ The maximum amount of destination tokens we are willing to use for fees.
+       * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @return The maxFeeAmountInDstTokens. + */ + @java.lang.Override + public java.lang.String getMaxFeeAmountInDstTokens() { + return instance.getMaxFeeAmountInDstTokens(); + } + /** + *
+       */ The maximum amount of destination tokens we are willing to use for fees.
+       * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @return The bytes for maxFeeAmountInDstTokens. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMaxFeeAmountInDstTokensBytes() { + return instance.getMaxFeeAmountInDstTokensBytes(); + } + /** + *
+       */ The maximum amount of destination tokens we are willing to use for fees.
+       * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @param value The maxFeeAmountInDstTokens to set. + * @return This builder for chaining. + */ + public Builder setMaxFeeAmountInDstTokens( + java.lang.String value) { + copyOnWrite(); + instance.setMaxFeeAmountInDstTokens(value); + return this; + } + /** + *
+       */ The maximum amount of destination tokens we are willing to use for fees.
+       * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @return This builder for chaining. + */ + public Builder clearMaxFeeAmountInDstTokens() { + copyOnWrite(); + instance.clearMaxFeeAmountInDstTokens(); + return this; + } + /** + *
+       */ The maximum amount of destination tokens we are willing to use for fees.
+       * 
+ * + * string max_fee_amount_in_dst_tokens = 7; + * @param value The bytes for maxFeeAmountInDstTokens to set. + * @return This builder for chaining. + */ + public Builder setMaxFeeAmountInDstTokensBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMaxFeeAmountInDstTokensBytes(value); + return this; + } + + /** + *
+       */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+       * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+       * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+       * / The default is used if this field is set to an empty string.
+       * / Setting it to a value lower than 1.0 will result in an error.
+       * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+       * 
+ * + * string fee_token_swap_multiplier = 8; + * @return The feeTokenSwapMultiplier. + */ + @java.lang.Override + public java.lang.String getFeeTokenSwapMultiplier() { + return instance.getFeeTokenSwapMultiplier(); + } + /** + *
+       */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+       * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+       * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+       * / The default is used if this field is set to an empty string.
+       * / Setting it to a value lower than 1.0 will result in an error.
+       * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+       * 
+ * + * string fee_token_swap_multiplier = 8; + * @return The bytes for feeTokenSwapMultiplier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFeeTokenSwapMultiplierBytes() { + return instance.getFeeTokenSwapMultiplierBytes(); + } + /** + *
+       */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+       * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+       * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+       * / The default is used if this field is set to an empty string.
+       * / Setting it to a value lower than 1.0 will result in an error.
+       * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+       * 
+ * + * string fee_token_swap_multiplier = 8; + * @param value The feeTokenSwapMultiplier to set. + * @return This builder for chaining. + */ + public Builder setFeeTokenSwapMultiplier( + java.lang.String value) { + copyOnWrite(); + instance.setFeeTokenSwapMultiplier(value); + return this; + } + /** + *
+       */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+       * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+       * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+       * / The default is used if this field is set to an empty string.
+       * / Setting it to a value lower than 1.0 will result in an error.
+       * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+       * 
+ * + * string fee_token_swap_multiplier = 8; + * @return This builder for chaining. + */ + public Builder clearFeeTokenSwapMultiplier() { + copyOnWrite(); + instance.clearFeeTokenSwapMultiplier(); + return this; + } + /** + *
+       */ A multiplier to be applied to the amount of destination tokens swapped for fee tokens.
+       * / This allows controlling how many extra destination tokens are swapped for fee tokens.
+       * / Extra tokens are desierable to avoid running into insufficient withdrawal fee issues originating from swap rate fluctuations.
+       * / The default is used if this field is set to an empty string.
+       * / Setting it to a value lower than 1.0 will result in an error.
+       * / The default value is set by the `DEFAULT_FEE_TOKEN_SWAP_MULTIPLIER` constant in the `mistyswap_offramp_impl` crate.
+       * 
+ * + * string fee_token_swap_multiplier = 8; + * @param value The bytes for feeTokenSwapMultiplier to set. + * @return This builder for chaining. + */ + public Builder setFeeTokenSwapMultiplierBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setFeeTokenSwapMultiplierBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.OfframpParams) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.OfframpParams(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "srcAssetId_", + "srcExpectedAmount_", + "dstAssetId_", + "dstAddress_", + "dstAddressTag_", + "minDstReceivedAmount_", + "maxFeeAmountInDstTokens_", + "feeTokenSwapMultiplier_", + }; + java.lang.String info = + "\u0000\b\u0000\u0000\u0001\b\b\u0000\u0000\u0000\u0001\u0208\u0002\u0208\u0003\u0208" + + "\u0004\u0208\u0005\u0208\u0006\u0208\u0007\u0208\b\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.OfframpParams.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.OfframpParams) + private static final mistyswap.MistyswapOfframp.OfframpParams DEFAULT_INSTANCE; + static { + OfframpParams defaultInstance = new OfframpParams(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OfframpParams.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.OfframpParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface InitiateOfframpRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.InitiateOfframpRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The mixinCredentialsJson. + */ + java.lang.String getMixinCredentialsJson(); + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The bytes for mixinCredentialsJson. + */ + com.google.protobuf.ByteString + getMixinCredentialsJsonBytes(); + + /** + *
+     */ Offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + * @return Whether the params field is set. + */ + boolean hasParams(); + /** + *
+     */ Offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + * @return The params. + */ + mistyswap.MistyswapOfframp.OfframpParams getParams(); + } + /** + *
+   */ A request to initiate an offramp.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.InitiateOfframpRequest} + */ + public static final class InitiateOfframpRequest extends + com.google.protobuf.GeneratedMessageLite< + InitiateOfframpRequest, InitiateOfframpRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.InitiateOfframpRequest) + InitiateOfframpRequestOrBuilder { + private InitiateOfframpRequest() { + mixinCredentialsJson_ = ""; + } + public static final int MIXIN_CREDENTIALS_JSON_FIELD_NUMBER = 1; + private java.lang.String mixinCredentialsJson_; + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The mixinCredentialsJson. + */ + @java.lang.Override + public java.lang.String getMixinCredentialsJson() { + return mixinCredentialsJson_; + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The bytes for mixinCredentialsJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinCredentialsJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(mixinCredentialsJson_); + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @param value The mixinCredentialsJson to set. + */ + private void setMixinCredentialsJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + mixinCredentialsJson_ = value; + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + */ + private void clearMixinCredentialsJson() { + + mixinCredentialsJson_ = getDefaultInstance().getMixinCredentialsJson(); + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @param value The bytes for mixinCredentialsJson to set. + */ + private void setMixinCredentialsJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + mixinCredentialsJson_ = value.toStringUtf8(); + + } + + public static final int PARAMS_FIELD_NUMBER = 2; + private mistyswap.MistyswapOfframp.OfframpParams params_; + /** + *
+     */ Offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + @java.lang.Override + public boolean hasParams() { + return params_ != null; + } + /** + *
+     */ Offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpParams getParams() { + return params_ == null ? mistyswap.MistyswapOfframp.OfframpParams.getDefaultInstance() : params_; + } + /** + *
+     */ Offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + private void setParams(mistyswap.MistyswapOfframp.OfframpParams value) { + value.getClass(); + params_ = value; + + } + /** + *
+     */ Offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeParams(mistyswap.MistyswapOfframp.OfframpParams value) { + value.getClass(); + if (params_ != null && + params_ != mistyswap.MistyswapOfframp.OfframpParams.getDefaultInstance()) { + params_ = + mistyswap.MistyswapOfframp.OfframpParams.newBuilder(params_).mergeFrom(value).buildPartial(); + } else { + params_ = value; + } + + } + /** + *
+     */ Offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + private void clearParams() { params_ = null; + + } + + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.InitiateOfframpRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A request to initiate an offramp.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.InitiateOfframpRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.InitiateOfframpRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.InitiateOfframpRequest) + mistyswap.MistyswapOfframp.InitiateOfframpRequestOrBuilder { + // Construct using mistyswap.MistyswapOfframp.InitiateOfframpRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @return The mixinCredentialsJson. + */ + @java.lang.Override + public java.lang.String getMixinCredentialsJson() { + return instance.getMixinCredentialsJson(); + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @return The bytes for mixinCredentialsJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinCredentialsJsonBytes() { + return instance.getMixinCredentialsJsonBytes(); + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @param value The mixinCredentialsJson to set. + * @return This builder for chaining. + */ + public Builder setMixinCredentialsJson( + java.lang.String value) { + copyOnWrite(); + instance.setMixinCredentialsJson(value); + return this; + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @return This builder for chaining. + */ + public Builder clearMixinCredentialsJson() { + copyOnWrite(); + instance.clearMixinCredentialsJson(); + return this; + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @param value The bytes for mixinCredentialsJson to set. + * @return This builder for chaining. + */ + public Builder setMixinCredentialsJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMixinCredentialsJsonBytes(value); + return this; + } + + /** + *
+       */ Offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + @java.lang.Override + public boolean hasParams() { + return instance.hasParams(); + } + /** + *
+       */ Offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpParams getParams() { + return instance.getParams(); + } + /** + *
+       */ Offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + public Builder setParams(mistyswap.MistyswapOfframp.OfframpParams value) { + copyOnWrite(); + instance.setParams(value); + return this; + } + /** + *
+       */ Offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + public Builder setParams( + mistyswap.MistyswapOfframp.OfframpParams.Builder builderForValue) { + copyOnWrite(); + instance.setParams(builderForValue.build()); + return this; + } + /** + *
+       */ Offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + public Builder mergeParams(mistyswap.MistyswapOfframp.OfframpParams value) { + copyOnWrite(); + instance.mergeParams(value); + return this; + } + /** + *
+       */ Offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 2; + */ + public Builder clearParams() { copyOnWrite(); + instance.clearParams(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.InitiateOfframpRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.InitiateOfframpRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "mixinCredentialsJson_", + "params_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\t" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.InitiateOfframpRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.InitiateOfframpRequest) + private static final mistyswap.MistyswapOfframp.InitiateOfframpRequest DEFAULT_INSTANCE; + static { + InitiateOfframpRequest defaultInstance = new InitiateOfframpRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + InitiateOfframpRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.InitiateOfframpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface InitiateOfframpResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.InitiateOfframpResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOfframp.OfframpResult getResult(); + + /** + *
+     */ Unique ID derived from the offramp request (set if result code is Ok)
+     * 
+ * + * bytes offramp_id = 2; + * @return The offrampId. + */ + com.google.protobuf.ByteString getOfframpId(); + } + /** + *
+   */ A successful response to an InitiateOfframpRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.InitiateOfframpResponse} + */ + public static final class InitiateOfframpResponse extends + com.google.protobuf.GeneratedMessageLite< + InitiateOfframpResponse, InitiateOfframpResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.InitiateOfframpResponse) + InitiateOfframpResponseOrBuilder { + private InitiateOfframpResponse() { + offrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOfframp.OfframpResult result_; + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return result_ == null ? mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOfframp.OfframpResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static final int OFFRAMP_ID_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString offrampId_; + /** + *
+     */ Unique ID derived from the offramp request (set if result code is Ok)
+     * 
+ * + * bytes offramp_id = 2; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return offrampId_; + } + /** + *
+     */ Unique ID derived from the offramp request (set if result code is Ok)
+     * 
+ * + * bytes offramp_id = 2; + * @param value The offrampId to set. + */ + private void setOfframpId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + offrampId_ = value; + } + /** + *
+     */ Unique ID derived from the offramp request (set if result code is Ok)
+     * 
+ * + * bytes offramp_id = 2; + */ + private void clearOfframpId() { + + offrampId_ = getDefaultInstance().getOfframpId(); + } + + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.InitiateOfframpResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A successful response to an InitiateOfframpRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.InitiateOfframpResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.InitiateOfframpResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.InitiateOfframpResponse) + mistyswap.MistyswapOfframp.InitiateOfframpResponseOrBuilder { + // Construct using mistyswap.MistyswapOfframp.InitiateOfframpResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOfframp.OfframpResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + /** + *
+       */ Unique ID derived from the offramp request (set if result code is Ok)
+       * 
+ * + * bytes offramp_id = 2; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return instance.getOfframpId(); + } + /** + *
+       */ Unique ID derived from the offramp request (set if result code is Ok)
+       * 
+ * + * bytes offramp_id = 2; + * @param value The offrampId to set. + * @return This builder for chaining. + */ + public Builder setOfframpId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOfframpId(value); + return this; + } + /** + *
+       */ Unique ID derived from the offramp request (set if result code is Ok)
+       * 
+ * + * bytes offramp_id = 2; + * @return This builder for chaining. + */ + public Builder clearOfframpId() { + copyOnWrite(); + instance.clearOfframpId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.InitiateOfframpResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.InitiateOfframpResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + "offrampId_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.InitiateOfframpResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.InitiateOfframpResponse) + private static final mistyswap.MistyswapOfframp.InitiateOfframpResponse DEFAULT_INSTANCE; + static { + InitiateOfframpResponse defaultInstance = new InitiateOfframpResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + InitiateOfframpResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.InitiateOfframpResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ForgetOfframpRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.ForgetOfframpRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Unique ID of the offramp to forget.
+     * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + com.google.protobuf.ByteString getOfframpId(); + } + /** + *
+   */ A request to forget an offramp.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.ForgetOfframpRequest} + */ + public static final class ForgetOfframpRequest extends + com.google.protobuf.GeneratedMessageLite< + ForgetOfframpRequest, ForgetOfframpRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.ForgetOfframpRequest) + ForgetOfframpRequestOrBuilder { + private ForgetOfframpRequest() { + offrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int OFFRAMP_ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString offrampId_; + /** + *
+     */ Unique ID of the offramp to forget.
+     * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return offrampId_; + } + /** + *
+     */ Unique ID of the offramp to forget.
+     * 
+ * + * bytes offramp_id = 1; + * @param value The offrampId to set. + */ + private void setOfframpId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + offrampId_ = value; + } + /** + *
+     */ Unique ID of the offramp to forget.
+     * 
+ * + * bytes offramp_id = 1; + */ + private void clearOfframpId() { + + offrampId_ = getDefaultInstance().getOfframpId(); + } + + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.ForgetOfframpRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A request to forget an offramp.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.ForgetOfframpRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.ForgetOfframpRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.ForgetOfframpRequest) + mistyswap.MistyswapOfframp.ForgetOfframpRequestOrBuilder { + // Construct using mistyswap.MistyswapOfframp.ForgetOfframpRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Unique ID of the offramp to forget.
+       * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return instance.getOfframpId(); + } + /** + *
+       */ Unique ID of the offramp to forget.
+       * 
+ * + * bytes offramp_id = 1; + * @param value The offrampId to set. + * @return This builder for chaining. + */ + public Builder setOfframpId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOfframpId(value); + return this; + } + /** + *
+       */ Unique ID of the offramp to forget.
+       * 
+ * + * bytes offramp_id = 1; + * @return This builder for chaining. + */ + public Builder clearOfframpId() { + copyOnWrite(); + instance.clearOfframpId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.ForgetOfframpRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.ForgetOfframpRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "offrampId_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.ForgetOfframpRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.ForgetOfframpRequest) + private static final mistyswap.MistyswapOfframp.ForgetOfframpRequest DEFAULT_INSTANCE; + static { + ForgetOfframpRequest defaultInstance = new ForgetOfframpRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ForgetOfframpRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.ForgetOfframpRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ForgetOfframpResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.ForgetOfframpResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOfframp.OfframpResult getResult(); + } + /** + *
+   */ A response to a ForgetOfframpRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.ForgetOfframpResponse} + */ + public static final class ForgetOfframpResponse extends + com.google.protobuf.GeneratedMessageLite< + ForgetOfframpResponse, ForgetOfframpResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.ForgetOfframpResponse) + ForgetOfframpResponseOrBuilder { + private ForgetOfframpResponse() { + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOfframp.OfframpResult result_; + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return result_ == null ? mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOfframp.OfframpResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.ForgetOfframpResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A response to a ForgetOfframpRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.ForgetOfframpResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.ForgetOfframpResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.ForgetOfframpResponse) + mistyswap.MistyswapOfframp.ForgetOfframpResponseOrBuilder { + // Construct using mistyswap.MistyswapOfframp.ForgetOfframpResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOfframp.OfframpResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.ForgetOfframpResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.ForgetOfframpResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.ForgetOfframpResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.ForgetOfframpResponse) + private static final mistyswap.MistyswapOfframp.ForgetOfframpResponse DEFAULT_INSTANCE; + static { + ForgetOfframpResponse defaultInstance = new ForgetOfframpResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ForgetOfframpResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.ForgetOfframpResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface OfframpOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.Offramp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ The original offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + * @return Whether the params field is set. + */ + boolean hasParams(); + /** + *
+     */ The original offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + * @return The params. + */ + mistyswap.MistyswapOfframp.OfframpParams getParams(); + + /** + *
+     */ Current state of the offramp.
+     * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + *
+     */ Current state of the offramp.
+     * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @return The state. + */ + mistyswap.MistyswapOfframp.OfframpState getState(); + + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The stateDetails. + */ + java.lang.String getStateDetails(); + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The bytes for stateDetails. + */ + com.google.protobuf.ByteString + getStateDetailsBytes(); + + /** + *
+     */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The mixinWithdrawalAddressJson. + */ + java.lang.String getMixinWithdrawalAddressJson(); + /** + *
+     */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The bytes for mixinWithdrawalAddressJson. + */ + com.google.protobuf.ByteString + getMixinWithdrawalAddressJsonBytes(); + + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + * @return Whether the ongoingSwap field is set. + */ + boolean hasOngoingSwap(); + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + * @return The ongoingSwap. + */ + mistyswap.MistyswapCommon.OngoingSwap getOngoingSwap(); + + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The ongoingWithdrawalJson. + */ + java.lang.String getOngoingWithdrawalJson(); + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The bytes for ongoingWithdrawalJson. + */ + com.google.protobuf.ByteString + getOngoingWithdrawalJsonBytes(); + + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + int getBalancesCount(); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + boolean containsBalances( + java.lang.String key); + /** + * Use {@link #getBalancesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getBalances(); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + java.util.Map + getBalancesMap(); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + + /* nullable */ +java.lang.String getBalancesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + + java.lang.String getBalancesOrThrow( + java.lang.String key); + } + /** + *
+   */ Details about a previously-initiated offramp.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.Offramp} + */ + public static final class Offramp extends + com.google.protobuf.GeneratedMessageLite< + Offramp, Offramp.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.Offramp) + OfframpOrBuilder { + private Offramp() { + stateDetails_ = ""; + mixinWithdrawalAddressJson_ = ""; + ongoingWithdrawalJson_ = ""; + } + public static final int PARAMS_FIELD_NUMBER = 1; + private mistyswap.MistyswapOfframp.OfframpParams params_; + /** + *
+     */ The original offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + @java.lang.Override + public boolean hasParams() { + return params_ != null; + } + /** + *
+     */ The original offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpParams getParams() { + return params_ == null ? mistyswap.MistyswapOfframp.OfframpParams.getDefaultInstance() : params_; + } + /** + *
+     */ The original offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + private void setParams(mistyswap.MistyswapOfframp.OfframpParams value) { + value.getClass(); + params_ = value; + + } + /** + *
+     */ The original offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeParams(mistyswap.MistyswapOfframp.OfframpParams value) { + value.getClass(); + if (params_ != null && + params_ != mistyswap.MistyswapOfframp.OfframpParams.getDefaultInstance()) { + params_ = + mistyswap.MistyswapOfframp.OfframpParams.newBuilder(params_).mergeFrom(value).buildPartial(); + } else { + params_ = value; + } + + } + /** + *
+     */ The original offramp parameters.
+     * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + private void clearParams() { params_ = null; + + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_; + /** + *
+     */ Current state of the offramp.
+     * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + *
+     */ Current state of the offramp.
+     * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @return The state. + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpState getState() { + mistyswap.MistyswapOfframp.OfframpState result = mistyswap.MistyswapOfframp.OfframpState.forNumber(state_); + return result == null ? mistyswap.MistyswapOfframp.OfframpState.UNRECOGNIZED : result; + } + /** + *
+     */ Current state of the offramp.
+     * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @param value The enum numeric value on the wire for state to set. + */ + private void setStateValue(int value) { + state_ = value; + } + /** + *
+     */ Current state of the offramp.
+     * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @param value The state to set. + */ + private void setState(mistyswap.MistyswapOfframp.OfframpState value) { + state_ = value.getNumber(); + + } + /** + *
+     */ Current state of the offramp.
+     * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + */ + private void clearState() { + + state_ = 0; + } + + public static final int STATE_DETAILS_FIELD_NUMBER = 3; + private java.lang.String stateDetails_; + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The stateDetails. + */ + @java.lang.Override + public java.lang.String getStateDetails() { + return stateDetails_; + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The bytes for stateDetails. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStateDetailsBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(stateDetails_); + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @param value The stateDetails to set. + */ + private void setStateDetails( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + stateDetails_ = value; + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + */ + private void clearStateDetails() { + + stateDetails_ = getDefaultInstance().getStateDetails(); + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @param value The bytes for stateDetails to set. + */ + private void setStateDetailsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + stateDetails_ = value.toStringUtf8(); + + } + + public static final int MIXIN_WITHDRAWAL_ADDRESS_JSON_FIELD_NUMBER = 4; + private java.lang.String mixinWithdrawalAddressJson_; + /** + *
+     */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The mixinWithdrawalAddressJson. + */ + @java.lang.Override + public java.lang.String getMixinWithdrawalAddressJson() { + return mixinWithdrawalAddressJson_; + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The bytes for mixinWithdrawalAddressJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinWithdrawalAddressJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(mixinWithdrawalAddressJson_); + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The mixinWithdrawalAddressJson to set. + */ + private void setMixinWithdrawalAddressJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + mixinWithdrawalAddressJson_ = value; + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + */ + private void clearMixinWithdrawalAddressJson() { + + mixinWithdrawalAddressJson_ = getDefaultInstance().getMixinWithdrawalAddressJson(); + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The bytes for mixinWithdrawalAddressJson to set. + */ + private void setMixinWithdrawalAddressJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + mixinWithdrawalAddressJson_ = value.toStringUtf8(); + + } + + public static final int ONGOING_SWAP_FIELD_NUMBER = 5; + private mistyswap.MistyswapCommon.OngoingSwap ongoingSwap_; + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public boolean hasOngoingSwap() { + return ongoingSwap_ != null; + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public mistyswap.MistyswapCommon.OngoingSwap getOngoingSwap() { + return ongoingSwap_ == null ? mistyswap.MistyswapCommon.OngoingSwap.getDefaultInstance() : ongoingSwap_; + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + private void setOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + value.getClass(); + ongoingSwap_ = value; + + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + value.getClass(); + if (ongoingSwap_ != null && + ongoingSwap_ != mistyswap.MistyswapCommon.OngoingSwap.getDefaultInstance()) { + ongoingSwap_ = + mistyswap.MistyswapCommon.OngoingSwap.newBuilder(ongoingSwap_).mergeFrom(value).buildPartial(); + } else { + ongoingSwap_ = value; + } + + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + private void clearOngoingSwap() { ongoingSwap_ = null; + + } + + public static final int ONGOING_WITHDRAWAL_JSON_FIELD_NUMBER = 6; + private java.lang.String ongoingWithdrawalJson_; + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The ongoingWithdrawalJson. + */ + @java.lang.Override + public java.lang.String getOngoingWithdrawalJson() { + return ongoingWithdrawalJson_; + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The bytes for ongoingWithdrawalJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOngoingWithdrawalJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(ongoingWithdrawalJson_); + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The ongoingWithdrawalJson to set. + */ + private void setOngoingWithdrawalJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + ongoingWithdrawalJson_ = value; + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + */ + private void clearOngoingWithdrawalJson() { + + ongoingWithdrawalJson_ = getDefaultInstance().getOngoingWithdrawalJson(); + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The bytes for ongoingWithdrawalJson to set. + */ + private void setOngoingWithdrawalJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ongoingWithdrawalJson_ = value.toStringUtf8(); + + } + + public static final int BALANCES_FIELD_NUMBER = 7; + private static final class BalancesDefaultEntryHolder { + static final com.google.protobuf.MapEntryLite< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntryLite + .newDefaultInstance( + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapFieldLite< + java.lang.String, java.lang.String> balances_ = + com.google.protobuf.MapFieldLite.emptyMapField(); + private com.google.protobuf.MapFieldLite + internalGetBalances() { + return balances_; + } + private com.google.protobuf.MapFieldLite + internalGetMutableBalances() { + if (!balances_.isMutable()) { + balances_ = balances_.mutableCopy(); + } + return balances_; + } + @java.lang.Override + + public int getBalancesCount() { + return internalGetBalances().size(); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public boolean containsBalances( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + return internalGetBalances().containsKey(key); + } + /** + * Use {@link #getBalancesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBalances() { + return getBalancesMap(); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public java.util.Map getBalancesMap() { + return java.util.Collections.unmodifiableMap( + internalGetBalances()); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public /* nullable */ +java.lang.String getBalancesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + internalGetBalances(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public java.lang.String getBalancesOrThrow( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + internalGetBalances(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + private java.util.Map + getMutableBalancesMap() { + return internalGetMutableBalances(); + } + + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.Offramp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.Offramp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.Offramp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.Offramp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Details about a previously-initiated offramp.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.Offramp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.Offramp, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.Offramp) + mistyswap.MistyswapOfframp.OfframpOrBuilder { + // Construct using mistyswap.MistyswapOfframp.Offramp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ The original offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + @java.lang.Override + public boolean hasParams() { + return instance.hasParams(); + } + /** + *
+       */ The original offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpParams getParams() { + return instance.getParams(); + } + /** + *
+       */ The original offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + public Builder setParams(mistyswap.MistyswapOfframp.OfframpParams value) { + copyOnWrite(); + instance.setParams(value); + return this; + } + /** + *
+       */ The original offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + public Builder setParams( + mistyswap.MistyswapOfframp.OfframpParams.Builder builderForValue) { + copyOnWrite(); + instance.setParams(builderForValue.build()); + return this; + } + /** + *
+       */ The original offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + public Builder mergeParams(mistyswap.MistyswapOfframp.OfframpParams value) { + copyOnWrite(); + instance.mergeParams(value); + return this; + } + /** + *
+       */ The original offramp parameters.
+       * 
+ * + * .mistyswap_offramp.OfframpParams params = 1; + */ + public Builder clearParams() { copyOnWrite(); + instance.clearParams(); + return this; + } + + /** + *
+       */ Current state of the offramp.
+       * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return instance.getStateValue(); + } + /** + *
+       */ Current state of the offramp.
+       * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + copyOnWrite(); + instance.setStateValue(value); + return this; + } + /** + *
+       */ Current state of the offramp.
+       * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @return The state. + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpState getState() { + return instance.getState(); + } + /** + *
+       */ Current state of the offramp.
+       * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setState(mistyswap.MistyswapOfframp.OfframpState value) { + copyOnWrite(); + instance.setState(value); + return this; + } + /** + *
+       */ Current state of the offramp.
+       * 
+ * + * .mistyswap_offramp.OfframpState state = 2; + * @return This builder for chaining. + */ + public Builder clearState() { + copyOnWrite(); + instance.clearState(); + return this; + } + + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @return The stateDetails. + */ + @java.lang.Override + public java.lang.String getStateDetails() { + return instance.getStateDetails(); + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @return The bytes for stateDetails. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStateDetailsBytes() { + return instance.getStateDetailsBytes(); + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @param value The stateDetails to set. + * @return This builder for chaining. + */ + public Builder setStateDetails( + java.lang.String value) { + copyOnWrite(); + instance.setStateDetails(value); + return this; + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @return This builder for chaining. + */ + public Builder clearStateDetails() { + copyOnWrite(); + instance.clearStateDetails(); + return this; + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @param value The bytes for stateDetails to set. + * @return This builder for chaining. + */ + public Builder setStateDetailsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setStateDetailsBytes(value); + return this; + } + + /** + *
+       */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The mixinWithdrawalAddressJson. + */ + @java.lang.Override + public java.lang.String getMixinWithdrawalAddressJson() { + return instance.getMixinWithdrawalAddressJson(); + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The bytes for mixinWithdrawalAddressJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinWithdrawalAddressJsonBytes() { + return instance.getMixinWithdrawalAddressJsonBytes(); + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The mixinWithdrawalAddressJson to set. + * @return This builder for chaining. + */ + public Builder setMixinWithdrawalAddressJson( + java.lang.String value) { + copyOnWrite(); + instance.setMixinWithdrawalAddressJson(value); + return this; + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return This builder for chaining. + */ + public Builder clearMixinWithdrawalAddressJson() { + copyOnWrite(); + instance.clearMixinWithdrawalAddressJson(); + return this; + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob (if available, empty string otherwise)
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The bytes for mixinWithdrawalAddressJson to set. + * @return This builder for chaining. + */ + public Builder setMixinWithdrawalAddressJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMixinWithdrawalAddressJsonBytes(value); + return this; + } + + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public boolean hasOngoingSwap() { + return instance.hasOngoingSwap(); + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public mistyswap.MistyswapCommon.OngoingSwap getOngoingSwap() { + return instance.getOngoingSwap(); + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder setOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + copyOnWrite(); + instance.setOngoingSwap(value); + return this; + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder setOngoingSwap( + mistyswap.MistyswapCommon.OngoingSwap.Builder builderForValue) { + copyOnWrite(); + instance.setOngoingSwap(builderForValue.build()); + return this; + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder mergeOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + copyOnWrite(); + instance.mergeOngoingSwap(value); + return this; + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder clearOngoingSwap() { copyOnWrite(); + instance.clearOngoingSwap(); + return this; + } + + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The ongoingWithdrawalJson. + */ + @java.lang.Override + public java.lang.String getOngoingWithdrawalJson() { + return instance.getOngoingWithdrawalJson(); + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The bytes for ongoingWithdrawalJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOngoingWithdrawalJsonBytes() { + return instance.getOngoingWithdrawalJsonBytes(); + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The ongoingWithdrawalJson to set. + * @return This builder for chaining. + */ + public Builder setOngoingWithdrawalJson( + java.lang.String value) { + copyOnWrite(); + instance.setOngoingWithdrawalJson(value); + return this; + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @return This builder for chaining. + */ + public Builder clearOngoingWithdrawalJson() { + copyOnWrite(); + instance.clearOngoingWithdrawalJson(); + return this; + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The bytes for ongoingWithdrawalJson to set. + * @return This builder for chaining. + */ + public Builder setOngoingWithdrawalJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOngoingWithdrawalJsonBytes(value); + return this; + } + + @java.lang.Override + + public int getBalancesCount() { + return instance.getBalancesMap().size(); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public boolean containsBalances( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + return instance.getBalancesMap().containsKey(key); + } + + public Builder clearBalances() { + copyOnWrite(); + instance.getMutableBalancesMap().clear(); + return this; + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + + public Builder removeBalances( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + copyOnWrite(); + instance.getMutableBalancesMap().remove(key); + return this; + } + /** + * Use {@link #getBalancesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBalances() { + return getBalancesMap(); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + public java.util.Map getBalancesMap() { + return java.util.Collections.unmodifiableMap( + instance.getBalancesMap()); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public /* nullable */ +java.lang.String getBalancesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + instance.getBalancesMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public java.lang.String getBalancesOrThrow( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + instance.getBalancesMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + public Builder putBalances( + java.lang.String key, + java.lang.String value) { + java.lang.Class keyClass = key.getClass(); + java.lang.Class valueClass = value.getClass(); + copyOnWrite(); + instance.getMutableBalancesMap().put(key, value); + return this; + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + public Builder putAllBalances( + java.util.Map values) { + copyOnWrite(); + instance.getMutableBalancesMap().putAll(values); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.Offramp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.Offramp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "params_", + "state_", + "stateDetails_", + "mixinWithdrawalAddressJson_", + "ongoingSwap_", + "ongoingWithdrawalJson_", + "balances_", + BalancesDefaultEntryHolder.defaultEntry, + }; + java.lang.String info = + "\u0000\u0007\u0000\u0000\u0001\u0007\u0007\u0001\u0000\u0000\u0001\t\u0002\f\u0003" + + "\u0208\u0004\u0208\u0005\t\u0006\u0208\u00072"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.Offramp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.Offramp) + private static final mistyswap.MistyswapOfframp.Offramp DEFAULT_INSTANCE; + static { + Offramp defaultInstance = new Offramp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Offramp.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.Offramp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOfframpStatusRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.GetOfframpStatusRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + com.google.protobuf.ByteString getOfframpId(); + } + /** + *
+   */ Get the status of an offramp.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpStatusRequest} + */ + public static final class GetOfframpStatusRequest extends + com.google.protobuf.GeneratedMessageLite< + GetOfframpStatusRequest, GetOfframpStatusRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.GetOfframpStatusRequest) + GetOfframpStatusRequestOrBuilder { + private GetOfframpStatusRequest() { + offrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int OFFRAMP_ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString offrampId_; + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return offrampId_; + } + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + * @param value The offrampId to set. + */ + private void setOfframpId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + offrampId_ = value; + } + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + */ + private void clearOfframpId() { + + offrampId_ = getDefaultInstance().getOfframpId(); + } + + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.GetOfframpStatusRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Get the status of an offramp.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpStatusRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.GetOfframpStatusRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.GetOfframpStatusRequest) + mistyswap.MistyswapOfframp.GetOfframpStatusRequestOrBuilder { + // Construct using mistyswap.MistyswapOfframp.GetOfframpStatusRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Unique ID of the offramp to get the status of.
+       * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return instance.getOfframpId(); + } + /** + *
+       */ Unique ID of the offramp to get the status of.
+       * 
+ * + * bytes offramp_id = 1; + * @param value The offrampId to set. + * @return This builder for chaining. + */ + public Builder setOfframpId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOfframpId(value); + return this; + } + /** + *
+       */ Unique ID of the offramp to get the status of.
+       * 
+ * + * bytes offramp_id = 1; + * @return This builder for chaining. + */ + public Builder clearOfframpId() { + copyOnWrite(); + instance.clearOfframpId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.GetOfframpStatusRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.GetOfframpStatusRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "offrampId_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.GetOfframpStatusRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.GetOfframpStatusRequest) + private static final mistyswap.MistyswapOfframp.GetOfframpStatusRequest DEFAULT_INSTANCE; + static { + GetOfframpStatusRequest defaultInstance = new GetOfframpStatusRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOfframpStatusRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.GetOfframpStatusRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOfframpStatusResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.GetOfframpStatusResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOfframp.OfframpResult getResult(); + + /** + *
+     */ The offramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + * @return Whether the offramp field is set. + */ + boolean hasOfframp(); + /** + *
+     */ The offramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + * @return The offramp. + */ + mistyswap.MistyswapOfframp.Offramp getOfframp(); + } + /** + *
+   */ A response to a GetOfframpStatusRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpStatusResponse} + */ + public static final class GetOfframpStatusResponse extends + com.google.protobuf.GeneratedMessageLite< + GetOfframpStatusResponse, GetOfframpStatusResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.GetOfframpStatusResponse) + GetOfframpStatusResponseOrBuilder { + private GetOfframpStatusResponse() { + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOfframp.OfframpResult result_; + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return result_ == null ? mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOfframp.OfframpResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static final int OFFRAMP_FIELD_NUMBER = 2; + private mistyswap.MistyswapOfframp.Offramp offramp_; + /** + *
+     */ The offramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + @java.lang.Override + public boolean hasOfframp() { + return offramp_ != null; + } + /** + *
+     */ The offramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.Offramp getOfframp() { + return offramp_ == null ? mistyswap.MistyswapOfframp.Offramp.getDefaultInstance() : offramp_; + } + /** + *
+     */ The offramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + private void setOfframp(mistyswap.MistyswapOfframp.Offramp value) { + value.getClass(); + offramp_ = value; + + } + /** + *
+     */ The offramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeOfframp(mistyswap.MistyswapOfframp.Offramp value) { + value.getClass(); + if (offramp_ != null && + offramp_ != mistyswap.MistyswapOfframp.Offramp.getDefaultInstance()) { + offramp_ = + mistyswap.MistyswapOfframp.Offramp.newBuilder(offramp_).mergeFrom(value).buildPartial(); + } else { + offramp_ = value; + } + + } + /** + *
+     */ The offramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + private void clearOfframp() { offramp_ = null; + + } + + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.GetOfframpStatusResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A response to a GetOfframpStatusRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpStatusResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.GetOfframpStatusResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.GetOfframpStatusResponse) + mistyswap.MistyswapOfframp.GetOfframpStatusResponseOrBuilder { + // Construct using mistyswap.MistyswapOfframp.GetOfframpStatusResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOfframp.OfframpResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + /** + *
+       */ The offramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + @java.lang.Override + public boolean hasOfframp() { + return instance.hasOfframp(); + } + /** + *
+       */ The offramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.Offramp getOfframp() { + return instance.getOfframp(); + } + /** + *
+       */ The offramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + public Builder setOfframp(mistyswap.MistyswapOfframp.Offramp value) { + copyOnWrite(); + instance.setOfframp(value); + return this; + } + /** + *
+       */ The offramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + public Builder setOfframp( + mistyswap.MistyswapOfframp.Offramp.Builder builderForValue) { + copyOnWrite(); + instance.setOfframp(builderForValue.build()); + return this; + } + /** + *
+       */ The offramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + public Builder mergeOfframp(mistyswap.MistyswapOfframp.Offramp value) { + copyOnWrite(); + instance.mergeOfframp(value); + return this; + } + /** + *
+       */ The offramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_offramp.Offramp offramp = 2; + */ + public Builder clearOfframp() { copyOnWrite(); + instance.clearOfframp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.GetOfframpStatusResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.GetOfframpStatusResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + "offramp_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.GetOfframpStatusResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.GetOfframpStatusResponse) + private static final mistyswap.MistyswapOfframp.GetOfframpStatusResponse DEFAULT_INSTANCE; + static { + GetOfframpStatusResponse defaultInstance = new GetOfframpStatusResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOfframpStatusResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.GetOfframpStatusResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOfframpDebugInfoRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.GetOfframpDebugInfoRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + com.google.protobuf.ByteString getOfframpId(); + } + /** + *
+   */ Get the state transitions of a given offramp (for debug purposes).
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpDebugInfoRequest} + */ + public static final class GetOfframpDebugInfoRequest extends + com.google.protobuf.GeneratedMessageLite< + GetOfframpDebugInfoRequest, GetOfframpDebugInfoRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.GetOfframpDebugInfoRequest) + GetOfframpDebugInfoRequestOrBuilder { + private GetOfframpDebugInfoRequest() { + offrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int OFFRAMP_ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString offrampId_; + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return offrampId_; + } + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + * @param value The offrampId to set. + */ + private void setOfframpId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + offrampId_ = value; + } + /** + *
+     */ Unique ID of the offramp to get the status of.
+     * 
+ * + * bytes offramp_id = 1; + */ + private void clearOfframpId() { + + offrampId_ = getDefaultInstance().getOfframpId(); + } + + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Get the state transitions of a given offramp (for debug purposes).
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpDebugInfoRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.GetOfframpDebugInfoRequest) + mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequestOrBuilder { + // Construct using mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Unique ID of the offramp to get the status of.
+       * 
+ * + * bytes offramp_id = 1; + * @return The offrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOfframpId() { + return instance.getOfframpId(); + } + /** + *
+       */ Unique ID of the offramp to get the status of.
+       * 
+ * + * bytes offramp_id = 1; + * @param value The offrampId to set. + * @return This builder for chaining. + */ + public Builder setOfframpId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOfframpId(value); + return this; + } + /** + *
+       */ Unique ID of the offramp to get the status of.
+       * 
+ * + * bytes offramp_id = 1; + * @return This builder for chaining. + */ + public Builder clearOfframpId() { + copyOnWrite(); + instance.clearOfframpId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.GetOfframpDebugInfoRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "offrampId_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.GetOfframpDebugInfoRequest) + private static final mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest DEFAULT_INSTANCE; + static { + GetOfframpDebugInfoRequest defaultInstance = new GetOfframpDebugInfoRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOfframpDebugInfoRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOfframpDebugInfoResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_offramp.GetOfframpDebugInfoResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOfframp.OfframpResult getResult(); + + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The debugInfoJson. + */ + java.lang.String getDebugInfoJson(); + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The bytes for debugInfoJson. + */ + com.google.protobuf.ByteString + getDebugInfoJsonBytes(); + } + /** + *
+   */ A response to a GetOfframpDebugInfoRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpDebugInfoResponse} + */ + public static final class GetOfframpDebugInfoResponse extends + com.google.protobuf.GeneratedMessageLite< + GetOfframpDebugInfoResponse, GetOfframpDebugInfoResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_offramp.GetOfframpDebugInfoResponse) + GetOfframpDebugInfoResponseOrBuilder { + private GetOfframpDebugInfoResponse() { + debugInfoJson_ = ""; + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOfframp.OfframpResult result_; + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return result_ == null ? mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOfframp.OfframpResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOfframp.OfframpResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the offramp request.
+     * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static final int DEBUG_INFO_JSON_FIELD_NUMBER = 2; + private java.lang.String debugInfoJson_; + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The debugInfoJson. + */ + @java.lang.Override + public java.lang.String getDebugInfoJson() { + return debugInfoJson_; + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The bytes for debugInfoJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDebugInfoJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(debugInfoJson_); + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @param value The debugInfoJson to set. + */ + private void setDebugInfoJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + debugInfoJson_ = value; + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + */ + private void clearDebugInfoJson() { + + debugInfoJson_ = getDefaultInstance().getDebugInfoJson(); + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @param value The bytes for debugInfoJson to set. + */ + private void setDebugInfoJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + debugInfoJson_ = value.toStringUtf8(); + + } + + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A response to a GetOfframpDebugInfoRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_offramp.GetOfframpDebugInfoResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_offramp.GetOfframpDebugInfoResponse) + mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponseOrBuilder { + // Construct using mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOfframp.OfframpResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOfframp.OfframpResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOfframp.OfframpResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the offramp request.
+       * 
+ * + * .mistyswap_offramp.OfframpResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @return The debugInfoJson. + */ + @java.lang.Override + public java.lang.String getDebugInfoJson() { + return instance.getDebugInfoJson(); + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @return The bytes for debugInfoJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDebugInfoJsonBytes() { + return instance.getDebugInfoJsonBytes(); + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @param value The debugInfoJson to set. + * @return This builder for chaining. + */ + public Builder setDebugInfoJson( + java.lang.String value) { + copyOnWrite(); + instance.setDebugInfoJson(value); + return this; + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @return This builder for chaining. + */ + public Builder clearDebugInfoJson() { + copyOnWrite(); + instance.clearDebugInfoJson(); + return this; + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OfframpDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @param value The bytes for debugInfoJson to set. + * @return This builder for chaining. + */ + public Builder setDebugInfoJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDebugInfoJsonBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_offramp.GetOfframpDebugInfoResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + "debugInfoJson_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_offramp.GetOfframpDebugInfoResponse) + private static final mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse DEFAULT_INSTANCE; + static { + GetOfframpDebugInfoResponse defaultInstance = new GetOfframpDebugInfoResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOfframpDebugInfoResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOfframp.GetOfframpDebugInfoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/android/src/main/java/mistyswap/MistyswapOfframpApiGrpc.java b/android/src/main/java/mistyswap/MistyswapOfframpApiGrpc.java new file mode 100644 index 0000000..0bb53bb --- /dev/null +++ b/android/src/main/java/mistyswap/MistyswapOfframpApiGrpc.java @@ -0,0 +1,541 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.55.1)", + comments = "Source: mistyswap_offramp.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class MistyswapOfframpApiGrpc { + + private MistyswapOfframpApiGrpc() {} + + public static final String SERVICE_NAME = "mistyswap_offramp.MistyswapOfframpApi"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getInitiateOfframpMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InitiateOfframp", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getInitiateOfframpMethod() { + io.grpc.MethodDescriptor getInitiateOfframpMethod; + if ((getInitiateOfframpMethod = MistyswapOfframpApiGrpc.getInitiateOfframpMethod) == null) { + synchronized (MistyswapOfframpApiGrpc.class) { + if ((getInitiateOfframpMethod = MistyswapOfframpApiGrpc.getInitiateOfframpMethod) == null) { + MistyswapOfframpApiGrpc.getInitiateOfframpMethod = getInitiateOfframpMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "InitiateOfframp")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getInitiateOfframpMethod; + } + + private static volatile io.grpc.MethodDescriptor getForgetOfframpMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ForgetOfframp", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getForgetOfframpMethod() { + io.grpc.MethodDescriptor getForgetOfframpMethod; + if ((getForgetOfframpMethod = MistyswapOfframpApiGrpc.getForgetOfframpMethod) == null) { + synchronized (MistyswapOfframpApiGrpc.class) { + if ((getForgetOfframpMethod = MistyswapOfframpApiGrpc.getForgetOfframpMethod) == null) { + MistyswapOfframpApiGrpc.getForgetOfframpMethod = getForgetOfframpMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ForgetOfframp")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getForgetOfframpMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetOfframpStatusMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOfframpStatus", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetOfframpStatusMethod() { + io.grpc.MethodDescriptor getGetOfframpStatusMethod; + if ((getGetOfframpStatusMethod = MistyswapOfframpApiGrpc.getGetOfframpStatusMethod) == null) { + synchronized (MistyswapOfframpApiGrpc.class) { + if ((getGetOfframpStatusMethod = MistyswapOfframpApiGrpc.getGetOfframpStatusMethod) == null) { + MistyswapOfframpApiGrpc.getGetOfframpStatusMethod = getGetOfframpStatusMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetOfframpStatus")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getGetOfframpStatusMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetOfframpDebugInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOfframpDebugInfo", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetOfframpDebugInfoMethod() { + io.grpc.MethodDescriptor getGetOfframpDebugInfoMethod; + if ((getGetOfframpDebugInfoMethod = MistyswapOfframpApiGrpc.getGetOfframpDebugInfoMethod) == null) { + synchronized (MistyswapOfframpApiGrpc.class) { + if ((getGetOfframpDebugInfoMethod = MistyswapOfframpApiGrpc.getGetOfframpDebugInfoMethod) == null) { + MistyswapOfframpApiGrpc.getGetOfframpDebugInfoMethod = getGetOfframpDebugInfoMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetOfframpDebugInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getGetOfframpDebugInfoMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MistyswapOfframpApiStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapOfframpApiStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOfframpApiStub(channel, callOptions); + } + }; + return MistyswapOfframpApiStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MistyswapOfframpApiBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapOfframpApiBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOfframpApiBlockingStub(channel, callOptions); + } + }; + return MistyswapOfframpApiBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MistyswapOfframpApiFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapOfframpApiFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOfframpApiFutureStub(channel, callOptions); + } + }; + return MistyswapOfframpApiFutureStub.newStub(factory, channel); + } + + /** + */ + public interface AsyncService { + + /** + *
+     */ Initiate (or pick up a previously initiated) offramp.
+     * / Input should be an encrypted InitiateOfframpRequest, output is an encrypted InitiateOfframpResponse.
+     * 
+ */ + default void initiateOfframp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInitiateOfframpMethod(), responseObserver); + } + + /** + *
+     */ Forget an offramp.
+     * / Input should be an encrypted ForgetOfframpRequest, output is an encrypted ForgetOfframpResponse.
+     * 
+ */ + default void forgetOfframp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getForgetOfframpMethod(), responseObserver); + } + + /** + *
+     */ Get the status of an offramp.
+     * / Input should be an encrypted GetOfframpStatusRequest, output is an encrypted GetOfframpStatusResponse.
+     * 
+ */ + default void getOfframpStatus(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetOfframpStatusMethod(), responseObserver); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOfframpDebugInfoRequest, output is an encrypted GetOfframpDebugInfoResponse.
+     * 
+ */ + default void getOfframpDebugInfo(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetOfframpDebugInfoMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service MistyswapOfframpApi. + */ + public static abstract class MistyswapOfframpApiImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return MistyswapOfframpApiGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service MistyswapOfframpApi. + */ + public static final class MistyswapOfframpApiStub + extends io.grpc.stub.AbstractAsyncStub { + private MistyswapOfframpApiStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapOfframpApiStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOfframpApiStub(channel, callOptions); + } + + /** + *
+     */ Initiate (or pick up a previously initiated) offramp.
+     * / Input should be an encrypted InitiateOfframpRequest, output is an encrypted InitiateOfframpResponse.
+     * 
+ */ + public void initiateOfframp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInitiateOfframpMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     */ Forget an offramp.
+     * / Input should be an encrypted ForgetOfframpRequest, output is an encrypted ForgetOfframpResponse.
+     * 
+ */ + public void forgetOfframp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getForgetOfframpMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     */ Get the status of an offramp.
+     * / Input should be an encrypted GetOfframpStatusRequest, output is an encrypted GetOfframpStatusResponse.
+     * 
+ */ + public void getOfframpStatus(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOfframpStatusMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOfframpDebugInfoRequest, output is an encrypted GetOfframpDebugInfoResponse.
+     * 
+ */ + public void getOfframpDebugInfo(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOfframpDebugInfoMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service MistyswapOfframpApi. + */ + public static final class MistyswapOfframpApiBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MistyswapOfframpApiBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapOfframpApiBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOfframpApiBlockingStub(channel, callOptions); + } + + /** + *
+     */ Initiate (or pick up a previously initiated) offramp.
+     * / Input should be an encrypted InitiateOfframpRequest, output is an encrypted InitiateOfframpResponse.
+     * 
+ */ + public attest.Attest.Message initiateOfframp(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInitiateOfframpMethod(), getCallOptions(), request); + } + + /** + *
+     */ Forget an offramp.
+     * / Input should be an encrypted ForgetOfframpRequest, output is an encrypted ForgetOfframpResponse.
+     * 
+ */ + public attest.Attest.Message forgetOfframp(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getForgetOfframpMethod(), getCallOptions(), request); + } + + /** + *
+     */ Get the status of an offramp.
+     * / Input should be an encrypted GetOfframpStatusRequest, output is an encrypted GetOfframpStatusResponse.
+     * 
+ */ + public attest.Attest.Message getOfframpStatus(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOfframpStatusMethod(), getCallOptions(), request); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOfframpDebugInfoRequest, output is an encrypted GetOfframpDebugInfoResponse.
+     * 
+ */ + public attest.Attest.Message getOfframpDebugInfo(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOfframpDebugInfoMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MistyswapOfframpApi. + */ + public static final class MistyswapOfframpApiFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MistyswapOfframpApiFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapOfframpApiFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOfframpApiFutureStub(channel, callOptions); + } + + /** + *
+     */ Initiate (or pick up a previously initiated) offramp.
+     * / Input should be an encrypted InitiateOfframpRequest, output is an encrypted InitiateOfframpResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture initiateOfframp( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInitiateOfframpMethod(), getCallOptions()), request); + } + + /** + *
+     */ Forget an offramp.
+     * / Input should be an encrypted ForgetOfframpRequest, output is an encrypted ForgetOfframpResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture forgetOfframp( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getForgetOfframpMethod(), getCallOptions()), request); + } + + /** + *
+     */ Get the status of an offramp.
+     * / Input should be an encrypted GetOfframpStatusRequest, output is an encrypted GetOfframpStatusResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getOfframpStatus( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOfframpStatusMethod(), getCallOptions()), request); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOfframpDebugInfoRequest, output is an encrypted GetOfframpDebugInfoResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getOfframpDebugInfo( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOfframpDebugInfoMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_INITIATE_OFFRAMP = 0; + private static final int METHODID_FORGET_OFFRAMP = 1; + private static final int METHODID_GET_OFFRAMP_STATUS = 2; + private static final int METHODID_GET_OFFRAMP_DEBUG_INFO = 3; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_INITIATE_OFFRAMP: + serviceImpl.initiateOfframp((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FORGET_OFFRAMP: + serviceImpl.forgetOfframp((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_OFFRAMP_STATUS: + serviceImpl.getOfframpStatus((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_OFFRAMP_DEBUG_INFO: + serviceImpl.getOfframpDebugInfo((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getInitiateOfframpMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_INITIATE_OFFRAMP))) + .addMethod( + getForgetOfframpMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_FORGET_OFFRAMP))) + .addMethod( + getGetOfframpStatusMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_GET_OFFRAMP_STATUS))) + .addMethod( + getGetOfframpDebugInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_GET_OFFRAMP_DEBUG_INFO))) + .build(); + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (MistyswapOfframpApiGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .addMethod(getInitiateOfframpMethod()) + .addMethod(getForgetOfframpMethod()) + .addMethod(getGetOfframpStatusMethod()) + .addMethod(getGetOfframpDebugInfoMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/android/src/main/java/mistyswap/MistyswapOnramp.java b/android/src/main/java/mistyswap/MistyswapOnramp.java new file mode 100644 index 0000000..f815cec --- /dev/null +++ b/android/src/main/java/mistyswap/MistyswapOnramp.java @@ -0,0 +1,6608 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: mistyswap_onramp.proto + +package mistyswap; + +public final class MistyswapOnramp { + private MistyswapOnramp() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + /** + *
+   */ Various possible onramp error codes.
+   * / This should be kept in sync with mistyswap_onramp_api::Error
+   * / The ORC prefix is needed since enum variants have to be unique across all enums in the file.
+   * 
+ * + * Protobuf enum {@code mistyswap_onramp.OnrampResultCode} + */ + public enum OnrampResultCode + implements com.google.protobuf.Internal.EnumLite { + /** + * ORC_INVALID = 0; + */ + ORC_INVALID(0), + /** + * ORC_OK = 1; + */ + ORC_OK(1), + /** + * ORC_TOO_MANY_ONRAMPS = 2; + */ + ORC_TOO_MANY_ONRAMPS(2), + /** + * ORC_MIXIN_CREDENTIALS_JSON = 3; + */ + ORC_MIXIN_CREDENTIALS_JSON(3), + /** + * ORC_CREDENTIALS_ALREADY_IN_USE = 4; + */ + ORC_CREDENTIALS_ALREADY_IN_USE(4), + /** + * ORC_MIXIN = 5; + */ + ORC_MIXIN(5), + /** + * ORC_ONRAMP_NOT_FOUND = 6; + */ + ORC_ONRAMP_NOT_FOUND(6), + /** + * ORC_INVALID_SRC_ASSET_ID = 7; + */ + ORC_INVALID_SRC_ASSET_ID(7), + /** + * ORC_INVALID_DST_ASSET_ID = 8; + */ + ORC_INVALID_DST_ASSET_ID(8), + /** + * ORC_INVALID_WITHDRAWAL_ADDRESS = 9; + */ + ORC_INVALID_WITHDRAWAL_ADDRESS(9), + /** + * ORC_INVALID_MIN_WITHDRAWAL_AMOUNT = 10; + */ + ORC_INVALID_MIN_WITHDRAWAL_AMOUNT(10), + /** + * ORC_INVALID_MIN_SWAP_RATE = 11; + */ + ORC_INVALID_MIN_SWAP_RATE(11), + UNRECOGNIZED(-1), + ; + + /** + * ORC_INVALID = 0; + */ + public static final int ORC_INVALID_VALUE = 0; + /** + * ORC_OK = 1; + */ + public static final int ORC_OK_VALUE = 1; + /** + * ORC_TOO_MANY_ONRAMPS = 2; + */ + public static final int ORC_TOO_MANY_ONRAMPS_VALUE = 2; + /** + * ORC_MIXIN_CREDENTIALS_JSON = 3; + */ + public static final int ORC_MIXIN_CREDENTIALS_JSON_VALUE = 3; + /** + * ORC_CREDENTIALS_ALREADY_IN_USE = 4; + */ + public static final int ORC_CREDENTIALS_ALREADY_IN_USE_VALUE = 4; + /** + * ORC_MIXIN = 5; + */ + public static final int ORC_MIXIN_VALUE = 5; + /** + * ORC_ONRAMP_NOT_FOUND = 6; + */ + public static final int ORC_ONRAMP_NOT_FOUND_VALUE = 6; + /** + * ORC_INVALID_SRC_ASSET_ID = 7; + */ + public static final int ORC_INVALID_SRC_ASSET_ID_VALUE = 7; + /** + * ORC_INVALID_DST_ASSET_ID = 8; + */ + public static final int ORC_INVALID_DST_ASSET_ID_VALUE = 8; + /** + * ORC_INVALID_WITHDRAWAL_ADDRESS = 9; + */ + public static final int ORC_INVALID_WITHDRAWAL_ADDRESS_VALUE = 9; + /** + * ORC_INVALID_MIN_WITHDRAWAL_AMOUNT = 10; + */ + public static final int ORC_INVALID_MIN_WITHDRAWAL_AMOUNT_VALUE = 10; + /** + * ORC_INVALID_MIN_SWAP_RATE = 11; + */ + public static final int ORC_INVALID_MIN_SWAP_RATE_VALUE = 11; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OnrampResultCode valueOf(int value) { + return forNumber(value); + } + + public static OnrampResultCode forNumber(int value) { + switch (value) { + case 0: return ORC_INVALID; + case 1: return ORC_OK; + case 2: return ORC_TOO_MANY_ONRAMPS; + case 3: return ORC_MIXIN_CREDENTIALS_JSON; + case 4: return ORC_CREDENTIALS_ALREADY_IN_USE; + case 5: return ORC_MIXIN; + case 6: return ORC_ONRAMP_NOT_FOUND; + case 7: return ORC_INVALID_SRC_ASSET_ID; + case 8: return ORC_INVALID_DST_ASSET_ID; + case 9: return ORC_INVALID_WITHDRAWAL_ADDRESS; + case 10: return ORC_INVALID_MIN_WITHDRAWAL_AMOUNT; + case 11: return ORC_INVALID_MIN_SWAP_RATE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OnrampResultCode> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public OnrampResultCode findValueByNumber(int number) { + return OnrampResultCode.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return OnrampResultCodeVerifier.INSTANCE; + } + + private static final class OnrampResultCodeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new OnrampResultCodeVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return OnrampResultCode.forNumber(number) != null; + } + }; + + private final int value; + + private OnrampResultCode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:mistyswap_onramp.OnrampResultCode) + } + + /** + *
+   */ Current onramp state.
+   * / This should be kept in sync with onramp_impl::OnrampState
+   * / The OS prefix is needed since enum variants have to be unique across all enums in the file.
+   * 
+ * + * Protobuf enum {@code mistyswap_onramp.OnrampState} + */ + public enum OnrampState + implements com.google.protobuf.Internal.EnumLite { + /** + * OS_INVALID = 0; + */ + OS_INVALID(0), + /** + * OS_NOT_STARTED = 1; + */ + OS_NOT_STARTED(1), + /** + * OS_POLLING = 2; + */ + OS_POLLING(2), + /** + * OS_WAITING = 3; + */ + OS_WAITING(3), + /** + * OS_INTERMITTENT_ERROR = 4; + */ + OS_INTERMITTENT_ERROR(4), + /** + * OS_BLOCKED_ON_SWAP = 5; + */ + OS_BLOCKED_ON_SWAP(5), + /** + * OS_BLOCKED_ON_WITHDRAWAL = 6; + */ + OS_BLOCKED_ON_WITHDRAWAL(6), + UNRECOGNIZED(-1), + ; + + /** + * OS_INVALID = 0; + */ + public static final int OS_INVALID_VALUE = 0; + /** + * OS_NOT_STARTED = 1; + */ + public static final int OS_NOT_STARTED_VALUE = 1; + /** + * OS_POLLING = 2; + */ + public static final int OS_POLLING_VALUE = 2; + /** + * OS_WAITING = 3; + */ + public static final int OS_WAITING_VALUE = 3; + /** + * OS_INTERMITTENT_ERROR = 4; + */ + public static final int OS_INTERMITTENT_ERROR_VALUE = 4; + /** + * OS_BLOCKED_ON_SWAP = 5; + */ + public static final int OS_BLOCKED_ON_SWAP_VALUE = 5; + /** + * OS_BLOCKED_ON_WITHDRAWAL = 6; + */ + public static final int OS_BLOCKED_ON_WITHDRAWAL_VALUE = 6; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OnrampState valueOf(int value) { + return forNumber(value); + } + + public static OnrampState forNumber(int value) { + switch (value) { + case 0: return OS_INVALID; + case 1: return OS_NOT_STARTED; + case 2: return OS_POLLING; + case 3: return OS_WAITING; + case 4: return OS_INTERMITTENT_ERROR; + case 5: return OS_BLOCKED_ON_SWAP; + case 6: return OS_BLOCKED_ON_WITHDRAWAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OnrampState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public OnrampState findValueByNumber(int number) { + return OnrampState.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return OnrampStateVerifier.INSTANCE; + } + + private static final class OnrampStateVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new OnrampStateVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return OnrampState.forNumber(number) != null; + } + }; + + private final int value; + + private OnrampState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:mistyswap_onramp.OnrampState) + } + + public interface OnrampResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.OnrampResult) + com.google.protobuf.MessageLiteOrBuilder { + + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @return The code. + */ + mistyswap.MistyswapOnramp.OnrampResultCode getCode(); + + /** + * string message = 2; + * @return The message. + */ + java.lang.String getMessage(); + /** + * string message = 2; + * @return The bytes for message. + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + *
+     * For Credentials Already In Use, this is the onramp_id of the existing onramp.
+     * 
+ * + * bytes onramp_id = 3; + * @return The onrampId. + */ + com.google.protobuf.ByteString getOnrampId(); + + /** + *
+     * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+     * 
+ * + * string asset_id = 4; + * @return The assetId. + */ + java.lang.String getAssetId(); + /** + *
+     * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+     * 
+ * + * string asset_id = 4; + * @return The bytes for assetId. + */ + com.google.protobuf.ByteString + getAssetIdBytes(); + } + /** + *
+   */ A simplified GRPC-compatible wrapper for Result<_, mistyswap_onramp_api::Error>
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.OnrampResult} + */ + public static final class OnrampResult extends + com.google.protobuf.GeneratedMessageLite< + OnrampResult, OnrampResult.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.OnrampResult) + OnrampResultOrBuilder { + private OnrampResult() { + message_ = ""; + onrampId_ = com.google.protobuf.ByteString.EMPTY; + assetId_ = ""; + } + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @return The code. + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResultCode getCode() { + mistyswap.MistyswapOnramp.OnrampResultCode result = mistyswap.MistyswapOnramp.OnrampResultCode.forNumber(code_); + return result == null ? mistyswap.MistyswapOnramp.OnrampResultCode.UNRECOGNIZED : result; + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @param value The enum numeric value on the wire for code to set. + */ + private void setCodeValue(int value) { + code_ = value; + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @param value The code to set. + */ + private void setCode(mistyswap.MistyswapOnramp.OnrampResultCode value) { + code_ = value.getNumber(); + + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + */ + private void clearCode() { + + code_ = 0; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private java.lang.String message_; + /** + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + return message_; + } + /** + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(message_); + } + /** + * string message = 2; + * @param value The message to set. + */ + private void setMessage( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + message_ = value; + } + /** + * string message = 2; + */ + private void clearMessage() { + + message_ = getDefaultInstance().getMessage(); + } + /** + * string message = 2; + * @param value The bytes for message to set. + */ + private void setMessageBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + message_ = value.toStringUtf8(); + + } + + public static final int ONRAMP_ID_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString onrampId_; + /** + *
+     * For Credentials Already In Use, this is the onramp_id of the existing onramp.
+     * 
+ * + * bytes onramp_id = 3; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return onrampId_; + } + /** + *
+     * For Credentials Already In Use, this is the onramp_id of the existing onramp.
+     * 
+ * + * bytes onramp_id = 3; + * @param value The onrampId to set. + */ + private void setOnrampId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + onrampId_ = value; + } + /** + *
+     * For Credentials Already In Use, this is the onramp_id of the existing onramp.
+     * 
+ * + * bytes onramp_id = 3; + */ + private void clearOnrampId() { + + onrampId_ = getDefaultInstance().getOnrampId(); + } + + public static final int ASSET_ID_FIELD_NUMBER = 4; + private java.lang.String assetId_; + /** + *
+     * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+     * 
+ * + * string asset_id = 4; + * @return The assetId. + */ + @java.lang.Override + public java.lang.String getAssetId() { + return assetId_; + } + /** + *
+     * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+     * 
+ * + * string asset_id = 4; + * @return The bytes for assetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAssetIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(assetId_); + } + /** + *
+     * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+     * 
+ * + * string asset_id = 4; + * @param value The assetId to set. + */ + private void setAssetId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + assetId_ = value; + } + /** + *
+     * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+     * 
+ * + * string asset_id = 4; + */ + private void clearAssetId() { + + assetId_ = getDefaultInstance().getAssetId(); + } + /** + *
+     * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+     * 
+ * + * string asset_id = 4; + * @param value The bytes for assetId to set. + */ + private void setAssetIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + assetId_ = value.toStringUtf8(); + + } + + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.OnrampResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.OnrampResult prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A simplified GRPC-compatible wrapper for Result<_, mistyswap_onramp_api::Error>
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.OnrampResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.OnrampResult, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.OnrampResult) + mistyswap.MistyswapOnramp.OnrampResultOrBuilder { + // Construct using mistyswap.MistyswapOnramp.OnrampResult.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return instance.getCodeValue(); + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + copyOnWrite(); + instance.setCodeValue(value); + return this; + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @return The code. + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResultCode getCode() { + return instance.getCode(); + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCode(mistyswap.MistyswapOnramp.OnrampResultCode value) { + copyOnWrite(); + instance.setCode(value); + return this; + } + /** + * .mistyswap_onramp.OnrampResultCode code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + copyOnWrite(); + instance.clearCode(); + return this; + } + + /** + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + return instance.getMessage(); + } + /** + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + return instance.getMessageBytes(); + } + /** + * string message = 2; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage( + java.lang.String value) { + copyOnWrite(); + instance.setMessage(value); + return this; + } + /** + * string message = 2; + * @return This builder for chaining. + */ + public Builder clearMessage() { + copyOnWrite(); + instance.clearMessage(); + return this; + } + /** + * string message = 2; + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMessageBytes(value); + return this; + } + + /** + *
+       * For Credentials Already In Use, this is the onramp_id of the existing onramp.
+       * 
+ * + * bytes onramp_id = 3; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return instance.getOnrampId(); + } + /** + *
+       * For Credentials Already In Use, this is the onramp_id of the existing onramp.
+       * 
+ * + * bytes onramp_id = 3; + * @param value The onrampId to set. + * @return This builder for chaining. + */ + public Builder setOnrampId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOnrampId(value); + return this; + } + /** + *
+       * For Credentials Already In Use, this is the onramp_id of the existing onramp.
+       * 
+ * + * bytes onramp_id = 3; + * @return This builder for chaining. + */ + public Builder clearOnrampId() { + copyOnWrite(); + instance.clearOnrampId(); + return this; + } + + /** + *
+       * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+       * 
+ * + * string asset_id = 4; + * @return The assetId. + */ + @java.lang.Override + public java.lang.String getAssetId() { + return instance.getAssetId(); + } + /** + *
+       * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+       * 
+ * + * string asset_id = 4; + * @return The bytes for assetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAssetIdBytes() { + return instance.getAssetIdBytes(); + } + /** + *
+       * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+       * 
+ * + * string asset_id = 4; + * @param value The assetId to set. + * @return This builder for chaining. + */ + public Builder setAssetId( + java.lang.String value) { + copyOnWrite(); + instance.setAssetId(value); + return this; + } + /** + *
+       * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+       * 
+ * + * string asset_id = 4; + * @return This builder for chaining. + */ + public Builder clearAssetId() { + copyOnWrite(); + instance.clearAssetId(); + return this; + } + /** + *
+       * For Invalid Src/Dst asset id, this is the asset id that was invalid.
+       * 
+ * + * string asset_id = 4; + * @param value The bytes for assetId to set. + * @return This builder for chaining. + */ + public Builder setAssetIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setAssetIdBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.OnrampResult) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.OnrampResult(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "code_", + "message_", + "onrampId_", + "assetId_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\f\u0002\u0208" + + "\u0003\n\u0004\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.OnrampResult.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.OnrampResult) + private static final mistyswap.MistyswapOnramp.OnrampResult DEFAULT_INSTANCE; + static { + OnrampResult defaultInstance = new OnrampResult(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OnrampResult.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.OnrampResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface OnrampParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.OnrampParams) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+     * 
+ * + * string dst_asset_id = 1; + * @return The dstAssetId. + */ + java.lang.String getDstAssetId(); + /** + *
+     */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+     * 
+ * + * string dst_asset_id = 1; + * @return The bytes for dstAssetId. + */ + com.google.protobuf.ByteString + getDstAssetIdBytes(); + + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + int getSrcAssetIdToMinSwapRateCount(); + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + boolean containsSrcAssetIdToMinSwapRate( + java.lang.String key); + /** + * Use {@link #getSrcAssetIdToMinSwapRateMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getSrcAssetIdToMinSwapRate(); + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + java.util.Map + getSrcAssetIdToMinSwapRateMap(); + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + + /* nullable */ +java.lang.String getSrcAssetIdToMinSwapRateOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + + java.lang.String getSrcAssetIdToMinSwapRateOrThrow( + java.lang.String key); + + /** + *
+     */ The destination address to withdraw to after a successful swap.
+     * 
+ * + * string dst_address = 3; + * @return The dstAddress. + */ + java.lang.String getDstAddress(); + /** + *
+     */ The destination address to withdraw to after a successful swap.
+     * 
+ * + * string dst_address = 3; + * @return The bytes for dstAddress. + */ + com.google.protobuf.ByteString + getDstAddressBytes(); + + /** + *
+     */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+     * / This helps wasting fees on small withdrawals.
+     * 
+ * + * string min_withdrawal_amount = 4; + * @return The minWithdrawalAmount. + */ + java.lang.String getMinWithdrawalAmount(); + /** + *
+     */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+     * / This helps wasting fees on small withdrawals.
+     * 
+ * + * string min_withdrawal_amount = 4; + * @return The bytes for minWithdrawalAmount. + */ + com.google.protobuf.ByteString + getMinWithdrawalAmountBytes(); + } + /** + *
+   */ Onramp parameters.
+   * / They are separated from the credentials since they are not as sensitive, and it makes it
+   * / easier to include them to the client in the response to GetOnrampStatus calls.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.OnrampParams} + */ + public static final class OnrampParams extends + com.google.protobuf.GeneratedMessageLite< + OnrampParams, OnrampParams.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.OnrampParams) + OnrampParamsOrBuilder { + private OnrampParams() { + dstAssetId_ = ""; + dstAddress_ = ""; + minWithdrawalAmount_ = ""; + } + public static final int DST_ASSET_ID_FIELD_NUMBER = 1; + private java.lang.String dstAssetId_; + /** + *
+     */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+     * 
+ * + * string dst_asset_id = 1; + * @return The dstAssetId. + */ + @java.lang.Override + public java.lang.String getDstAssetId() { + return dstAssetId_; + } + /** + *
+     */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+     * 
+ * + * string dst_asset_id = 1; + * @return The bytes for dstAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAssetIdBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(dstAssetId_); + } + /** + *
+     */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+     * 
+ * + * string dst_asset_id = 1; + * @param value The dstAssetId to set. + */ + private void setDstAssetId( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + dstAssetId_ = value; + } + /** + *
+     */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+     * 
+ * + * string dst_asset_id = 1; + */ + private void clearDstAssetId() { + + dstAssetId_ = getDefaultInstance().getDstAssetId(); + } + /** + *
+     */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+     * 
+ * + * string dst_asset_id = 1; + * @param value The bytes for dstAssetId to set. + */ + private void setDstAssetIdBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + dstAssetId_ = value.toStringUtf8(); + + } + + public static final int SRC_ASSET_ID_TO_MIN_SWAP_RATE_FIELD_NUMBER = 2; + private static final class SrcAssetIdToMinSwapRateDefaultEntryHolder { + static final com.google.protobuf.MapEntryLite< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntryLite + .newDefaultInstance( + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapFieldLite< + java.lang.String, java.lang.String> srcAssetIdToMinSwapRate_ = + com.google.protobuf.MapFieldLite.emptyMapField(); + private com.google.protobuf.MapFieldLite + internalGetSrcAssetIdToMinSwapRate() { + return srcAssetIdToMinSwapRate_; + } + private com.google.protobuf.MapFieldLite + internalGetMutableSrcAssetIdToMinSwapRate() { + if (!srcAssetIdToMinSwapRate_.isMutable()) { + srcAssetIdToMinSwapRate_ = srcAssetIdToMinSwapRate_.mutableCopy(); + } + return srcAssetIdToMinSwapRate_; + } + @java.lang.Override + + public int getSrcAssetIdToMinSwapRateCount() { + return internalGetSrcAssetIdToMinSwapRate().size(); + } + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + + public boolean containsSrcAssetIdToMinSwapRate( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + return internalGetSrcAssetIdToMinSwapRate().containsKey(key); + } + /** + * Use {@link #getSrcAssetIdToMinSwapRateMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSrcAssetIdToMinSwapRate() { + return getSrcAssetIdToMinSwapRateMap(); + } + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + + public java.util.Map getSrcAssetIdToMinSwapRateMap() { + return java.util.Collections.unmodifiableMap( + internalGetSrcAssetIdToMinSwapRate()); + } + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + + public /* nullable */ +java.lang.String getSrcAssetIdToMinSwapRateOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + internalGetSrcAssetIdToMinSwapRate(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + + public java.lang.String getSrcAssetIdToMinSwapRateOrThrow( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + internalGetSrcAssetIdToMinSwapRate(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+     */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+     * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+     * / we will set the minimum amount received from the swap to 9.5 EUSD.
+     * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+     * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + private java.util.Map + getMutableSrcAssetIdToMinSwapRateMap() { + return internalGetMutableSrcAssetIdToMinSwapRate(); + } + + public static final int DST_ADDRESS_FIELD_NUMBER = 3; + private java.lang.String dstAddress_; + /** + *
+     */ The destination address to withdraw to after a successful swap.
+     * 
+ * + * string dst_address = 3; + * @return The dstAddress. + */ + @java.lang.Override + public java.lang.String getDstAddress() { + return dstAddress_; + } + /** + *
+     */ The destination address to withdraw to after a successful swap.
+     * 
+ * + * string dst_address = 3; + * @return The bytes for dstAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(dstAddress_); + } + /** + *
+     */ The destination address to withdraw to after a successful swap.
+     * 
+ * + * string dst_address = 3; + * @param value The dstAddress to set. + */ + private void setDstAddress( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + dstAddress_ = value; + } + /** + *
+     */ The destination address to withdraw to after a successful swap.
+     * 
+ * + * string dst_address = 3; + */ + private void clearDstAddress() { + + dstAddress_ = getDefaultInstance().getDstAddress(); + } + /** + *
+     */ The destination address to withdraw to after a successful swap.
+     * 
+ * + * string dst_address = 3; + * @param value The bytes for dstAddress to set. + */ + private void setDstAddressBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + dstAddress_ = value.toStringUtf8(); + + } + + public static final int MIN_WITHDRAWAL_AMOUNT_FIELD_NUMBER = 4; + private java.lang.String minWithdrawalAmount_; + /** + *
+     */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+     * / This helps wasting fees on small withdrawals.
+     * 
+ * + * string min_withdrawal_amount = 4; + * @return The minWithdrawalAmount. + */ + @java.lang.Override + public java.lang.String getMinWithdrawalAmount() { + return minWithdrawalAmount_; + } + /** + *
+     */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+     * / This helps wasting fees on small withdrawals.
+     * 
+ * + * string min_withdrawal_amount = 4; + * @return The bytes for minWithdrawalAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMinWithdrawalAmountBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(minWithdrawalAmount_); + } + /** + *
+     */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+     * / This helps wasting fees on small withdrawals.
+     * 
+ * + * string min_withdrawal_amount = 4; + * @param value The minWithdrawalAmount to set. + */ + private void setMinWithdrawalAmount( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + minWithdrawalAmount_ = value; + } + /** + *
+     */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+     * / This helps wasting fees on small withdrawals.
+     * 
+ * + * string min_withdrawal_amount = 4; + */ + private void clearMinWithdrawalAmount() { + + minWithdrawalAmount_ = getDefaultInstance().getMinWithdrawalAmount(); + } + /** + *
+     */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+     * / This helps wasting fees on small withdrawals.
+     * 
+ * + * string min_withdrawal_amount = 4; + * @param value The bytes for minWithdrawalAmount to set. + */ + private void setMinWithdrawalAmountBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + minWithdrawalAmount_ = value.toStringUtf8(); + + } + + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.OnrampParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.OnrampParams prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Onramp parameters.
+     * / They are separated from the credentials since they are not as sensitive, and it makes it
+     * / easier to include them to the client in the response to GetOnrampStatus calls.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.OnrampParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.OnrampParams, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.OnrampParams) + mistyswap.MistyswapOnramp.OnrampParamsOrBuilder { + // Construct using mistyswap.MistyswapOnramp.OnrampParams.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+       * 
+ * + * string dst_asset_id = 1; + * @return The dstAssetId. + */ + @java.lang.Override + public java.lang.String getDstAssetId() { + return instance.getDstAssetId(); + } + /** + *
+       */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+       * 
+ * + * string dst_asset_id = 1; + * @return The bytes for dstAssetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAssetIdBytes() { + return instance.getDstAssetIdBytes(); + } + /** + *
+       */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+       * 
+ * + * string dst_asset_id = 1; + * @param value The dstAssetId to set. + * @return This builder for chaining. + */ + public Builder setDstAssetId( + java.lang.String value) { + copyOnWrite(); + instance.setDstAssetId(value); + return this; + } + /** + *
+       */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+       * 
+ * + * string dst_asset_id = 1; + * @return This builder for chaining. + */ + public Builder clearDstAssetId() { + copyOnWrite(); + instance.clearDstAssetId(); + return this; + } + /** + *
+       */ The asset id we will be swapping into. This will be a MobileCoin token such as MOB or EUSD.
+       * 
+ * + * string dst_asset_id = 1; + * @param value The bytes for dstAssetId to set. + * @return This builder for chaining. + */ + public Builder setDstAssetIdBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDstAssetIdBytes(value); + return this; + } + + @java.lang.Override + + public int getSrcAssetIdToMinSwapRateCount() { + return instance.getSrcAssetIdToMinSwapRateMap().size(); + } + /** + *
+       */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+       * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+       * / we will set the minimum amount received from the swap to 9.5 EUSD.
+       * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+       * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + + public boolean containsSrcAssetIdToMinSwapRate( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + return instance.getSrcAssetIdToMinSwapRateMap().containsKey(key); + } + + public Builder clearSrcAssetIdToMinSwapRate() { + copyOnWrite(); + instance.getMutableSrcAssetIdToMinSwapRateMap().clear(); + return this; + } + /** + *
+       */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+       * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+       * / we will set the minimum amount received from the swap to 9.5 EUSD.
+       * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+       * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + + public Builder removeSrcAssetIdToMinSwapRate( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + copyOnWrite(); + instance.getMutableSrcAssetIdToMinSwapRateMap().remove(key); + return this; + } + /** + * Use {@link #getSrcAssetIdToMinSwapRateMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSrcAssetIdToMinSwapRate() { + return getSrcAssetIdToMinSwapRateMap(); + } + /** + *
+       */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+       * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+       * / we will set the minimum amount received from the swap to 9.5 EUSD.
+       * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+       * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + public java.util.Map getSrcAssetIdToMinSwapRateMap() { + return java.util.Collections.unmodifiableMap( + instance.getSrcAssetIdToMinSwapRateMap()); + } + /** + *
+       */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+       * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+       * / we will set the minimum amount received from the swap to 9.5 EUSD.
+       * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+       * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + + public /* nullable */ +java.lang.String getSrcAssetIdToMinSwapRateOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + instance.getSrcAssetIdToMinSwapRateMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+       * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+       * / we will set the minimum amount received from the swap to 9.5 EUSD.
+       * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+       * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + @java.lang.Override + + public java.lang.String getSrcAssetIdToMinSwapRateOrThrow( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + instance.getSrcAssetIdToMinSwapRateMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+       */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+       * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+       * / we will set the minimum amount received from the swap to 9.5 EUSD.
+       * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+       * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + public Builder putSrcAssetIdToMinSwapRate( + java.lang.String key, + java.lang.String value) { + java.lang.Class keyClass = key.getClass(); + java.lang.Class valueClass = value.getClass(); + copyOnWrite(); + instance.getMutableSrcAssetIdToMinSwapRateMap().put(key, value); + return this; + } + /** + *
+       */ A map of Mixin asset UUID to minimum swap rate (as a decimal number). For example,
+       * / if dst_asset_id is EUSD, and this map contains an entry (USDC, 0.95), and we receive 10 USDC,
+       * / we will set the minimum amount received from the swap to 9.5 EUSD.
+       * / This allows the client to control how much slippage it is willing to tolerate when performing swaps.
+       * 
+ * + * map<string, string> src_asset_id_to_min_swap_rate = 2; + */ + public Builder putAllSrcAssetIdToMinSwapRate( + java.util.Map values) { + copyOnWrite(); + instance.getMutableSrcAssetIdToMinSwapRateMap().putAll(values); + return this; + } + + /** + *
+       */ The destination address to withdraw to after a successful swap.
+       * 
+ * + * string dst_address = 3; + * @return The dstAddress. + */ + @java.lang.Override + public java.lang.String getDstAddress() { + return instance.getDstAddress(); + } + /** + *
+       */ The destination address to withdraw to after a successful swap.
+       * 
+ * + * string dst_address = 3; + * @return The bytes for dstAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressBytes() { + return instance.getDstAddressBytes(); + } + /** + *
+       */ The destination address to withdraw to after a successful swap.
+       * 
+ * + * string dst_address = 3; + * @param value The dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddress( + java.lang.String value) { + copyOnWrite(); + instance.setDstAddress(value); + return this; + } + /** + *
+       */ The destination address to withdraw to after a successful swap.
+       * 
+ * + * string dst_address = 3; + * @return This builder for chaining. + */ + public Builder clearDstAddress() { + copyOnWrite(); + instance.clearDstAddress(); + return this; + } + /** + *
+       */ The destination address to withdraw to after a successful swap.
+       * 
+ * + * string dst_address = 3; + * @param value The bytes for dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddressBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDstAddressBytes(value); + return this; + } + + /** + *
+       */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+       * / This helps wasting fees on small withdrawals.
+       * 
+ * + * string min_withdrawal_amount = 4; + * @return The minWithdrawalAmount. + */ + @java.lang.Override + public java.lang.String getMinWithdrawalAmount() { + return instance.getMinWithdrawalAmount(); + } + /** + *
+       */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+       * / This helps wasting fees on small withdrawals.
+       * 
+ * + * string min_withdrawal_amount = 4; + * @return The bytes for minWithdrawalAmount. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMinWithdrawalAmountBytes() { + return instance.getMinWithdrawalAmountBytes(); + } + /** + *
+       */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+       * / This helps wasting fees on small withdrawals.
+       * 
+ * + * string min_withdrawal_amount = 4; + * @param value The minWithdrawalAmount to set. + * @return This builder for chaining. + */ + public Builder setMinWithdrawalAmount( + java.lang.String value) { + copyOnWrite(); + instance.setMinWithdrawalAmount(value); + return this; + } + /** + *
+       */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+       * / This helps wasting fees on small withdrawals.
+       * 
+ * + * string min_withdrawal_amount = 4; + * @return This builder for chaining. + */ + public Builder clearMinWithdrawalAmount() { + copyOnWrite(); + instance.clearMinWithdrawalAmount(); + return this; + } + /** + *
+       */ The minimum withdrawal amount (as a decimal number). We will only withdraw if our balance exceeds this value.
+       * / This helps wasting fees on small withdrawals.
+       * 
+ * + * string min_withdrawal_amount = 4; + * @param value The bytes for minWithdrawalAmount to set. + * @return This builder for chaining. + */ + public Builder setMinWithdrawalAmountBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMinWithdrawalAmountBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.OnrampParams) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.OnrampParams(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "dstAssetId_", + "srcAssetIdToMinSwapRate_", + SrcAssetIdToMinSwapRateDefaultEntryHolder.defaultEntry, + "dstAddress_", + "minWithdrawalAmount_", + }; + java.lang.String info = + "\u0000\u0004\u0000\u0000\u0001\u0004\u0004\u0001\u0000\u0000\u0001\u0208\u00022\u0003" + + "\u0208\u0004\u0208"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.OnrampParams.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.OnrampParams) + private static final mistyswap.MistyswapOnramp.OnrampParams DEFAULT_INSTANCE; + static { + OnrampParams defaultInstance = new OnrampParams(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + OnrampParams.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.OnrampParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface SetupOnrampRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.SetupOnrampRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The mixinCredentialsJson. + */ + java.lang.String getMixinCredentialsJson(); + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The bytes for mixinCredentialsJson. + */ + com.google.protobuf.ByteString + getMixinCredentialsJsonBytes(); + + /** + *
+     */ Onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + * @return Whether the params field is set. + */ + boolean hasParams(); + /** + *
+     */ Onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + * @return The params. + */ + mistyswap.MistyswapOnramp.OnrampParams getParams(); + } + /** + *
+   */ A request to setup an onramp.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.SetupOnrampRequest} + */ + public static final class SetupOnrampRequest extends + com.google.protobuf.GeneratedMessageLite< + SetupOnrampRequest, SetupOnrampRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.SetupOnrampRequest) + SetupOnrampRequestOrBuilder { + private SetupOnrampRequest() { + mixinCredentialsJson_ = ""; + } + public static final int MIXIN_CREDENTIALS_JSON_FIELD_NUMBER = 1; + private java.lang.String mixinCredentialsJson_; + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The mixinCredentialsJson. + */ + @java.lang.Override + public java.lang.String getMixinCredentialsJson() { + return mixinCredentialsJson_; + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @return The bytes for mixinCredentialsJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinCredentialsJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(mixinCredentialsJson_); + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @param value The mixinCredentialsJson to set. + */ + private void setMixinCredentialsJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + mixinCredentialsJson_ = value; + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + */ + private void clearMixinCredentialsJson() { + + mixinCredentialsJson_ = getDefaultInstance().getMixinCredentialsJson(); + } + /** + *
+     */ Mixin credentials, as a JSON string.
+     * 
+ * + * string mixin_credentials_json = 1; + * @param value The bytes for mixinCredentialsJson to set. + */ + private void setMixinCredentialsJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + mixinCredentialsJson_ = value.toStringUtf8(); + + } + + public static final int PARAMS_FIELD_NUMBER = 2; + private mistyswap.MistyswapOnramp.OnrampParams params_; + /** + *
+     */ Onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + @java.lang.Override + public boolean hasParams() { + return params_ != null; + } + /** + *
+     */ Onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampParams getParams() { + return params_ == null ? mistyswap.MistyswapOnramp.OnrampParams.getDefaultInstance() : params_; + } + /** + *
+     */ Onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + private void setParams(mistyswap.MistyswapOnramp.OnrampParams value) { + value.getClass(); + params_ = value; + + } + /** + *
+     */ Onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeParams(mistyswap.MistyswapOnramp.OnrampParams value) { + value.getClass(); + if (params_ != null && + params_ != mistyswap.MistyswapOnramp.OnrampParams.getDefaultInstance()) { + params_ = + mistyswap.MistyswapOnramp.OnrampParams.newBuilder(params_).mergeFrom(value).buildPartial(); + } else { + params_ = value; + } + + } + /** + *
+     */ Onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + private void clearParams() { params_ = null; + + } + + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.SetupOnrampRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.SetupOnrampRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A request to setup an onramp.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.SetupOnrampRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.SetupOnrampRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.SetupOnrampRequest) + mistyswap.MistyswapOnramp.SetupOnrampRequestOrBuilder { + // Construct using mistyswap.MistyswapOnramp.SetupOnrampRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @return The mixinCredentialsJson. + */ + @java.lang.Override + public java.lang.String getMixinCredentialsJson() { + return instance.getMixinCredentialsJson(); + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @return The bytes for mixinCredentialsJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinCredentialsJsonBytes() { + return instance.getMixinCredentialsJsonBytes(); + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @param value The mixinCredentialsJson to set. + * @return This builder for chaining. + */ + public Builder setMixinCredentialsJson( + java.lang.String value) { + copyOnWrite(); + instance.setMixinCredentialsJson(value); + return this; + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @return This builder for chaining. + */ + public Builder clearMixinCredentialsJson() { + copyOnWrite(); + instance.clearMixinCredentialsJson(); + return this; + } + /** + *
+       */ Mixin credentials, as a JSON string.
+       * 
+ * + * string mixin_credentials_json = 1; + * @param value The bytes for mixinCredentialsJson to set. + * @return This builder for chaining. + */ + public Builder setMixinCredentialsJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMixinCredentialsJsonBytes(value); + return this; + } + + /** + *
+       */ Onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + @java.lang.Override + public boolean hasParams() { + return instance.hasParams(); + } + /** + *
+       */ Onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampParams getParams() { + return instance.getParams(); + } + /** + *
+       */ Onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + public Builder setParams(mistyswap.MistyswapOnramp.OnrampParams value) { + copyOnWrite(); + instance.setParams(value); + return this; + } + /** + *
+       */ Onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + public Builder setParams( + mistyswap.MistyswapOnramp.OnrampParams.Builder builderForValue) { + copyOnWrite(); + instance.setParams(builderForValue.build()); + return this; + } + /** + *
+       */ Onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + public Builder mergeParams(mistyswap.MistyswapOnramp.OnrampParams value) { + copyOnWrite(); + instance.mergeParams(value); + return this; + } + /** + *
+       */ Onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 2; + */ + public Builder clearParams() { copyOnWrite(); + instance.clearParams(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.SetupOnrampRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.SetupOnrampRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "mixinCredentialsJson_", + "params_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u0208\u0002\t" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.SetupOnrampRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.SetupOnrampRequest) + private static final mistyswap.MistyswapOnramp.SetupOnrampRequest DEFAULT_INSTANCE; + static { + SetupOnrampRequest defaultInstance = new SetupOnrampRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SetupOnrampRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.SetupOnrampRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface SetupOnrampResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.SetupOnrampResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOnramp.OnrampResult getResult(); + + /** + *
+     */ Unique ID derived from the onramp request (set if result code is Ok)
+     * 
+ * + * bytes onramp_id = 2; + * @return The onrampId. + */ + com.google.protobuf.ByteString getOnrampId(); + } + /** + *
+   */ A successful response to an SetupOnrampRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.SetupOnrampResponse} + */ + public static final class SetupOnrampResponse extends + com.google.protobuf.GeneratedMessageLite< + SetupOnrampResponse, SetupOnrampResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.SetupOnrampResponse) + SetupOnrampResponseOrBuilder { + private SetupOnrampResponse() { + onrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOnramp.OnrampResult result_; + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return result_ == null ? mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOnramp.OnrampResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static final int ONRAMP_ID_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString onrampId_; + /** + *
+     */ Unique ID derived from the onramp request (set if result code is Ok)
+     * 
+ * + * bytes onramp_id = 2; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return onrampId_; + } + /** + *
+     */ Unique ID derived from the onramp request (set if result code is Ok)
+     * 
+ * + * bytes onramp_id = 2; + * @param value The onrampId to set. + */ + private void setOnrampId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + onrampId_ = value; + } + /** + *
+     */ Unique ID derived from the onramp request (set if result code is Ok)
+     * 
+ * + * bytes onramp_id = 2; + */ + private void clearOnrampId() { + + onrampId_ = getDefaultInstance().getOnrampId(); + } + + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.SetupOnrampResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.SetupOnrampResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A successful response to an SetupOnrampRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.SetupOnrampResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.SetupOnrampResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.SetupOnrampResponse) + mistyswap.MistyswapOnramp.SetupOnrampResponseOrBuilder { + // Construct using mistyswap.MistyswapOnramp.SetupOnrampResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOnramp.OnrampResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + /** + *
+       */ Unique ID derived from the onramp request (set if result code is Ok)
+       * 
+ * + * bytes onramp_id = 2; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return instance.getOnrampId(); + } + /** + *
+       */ Unique ID derived from the onramp request (set if result code is Ok)
+       * 
+ * + * bytes onramp_id = 2; + * @param value The onrampId to set. + * @return This builder for chaining. + */ + public Builder setOnrampId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOnrampId(value); + return this; + } + /** + *
+       */ Unique ID derived from the onramp request (set if result code is Ok)
+       * 
+ * + * bytes onramp_id = 2; + * @return This builder for chaining. + */ + public Builder clearOnrampId() { + copyOnWrite(); + instance.clearOnrampId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.SetupOnrampResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.SetupOnrampResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + "onrampId_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.SetupOnrampResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.SetupOnrampResponse) + private static final mistyswap.MistyswapOnramp.SetupOnrampResponse DEFAULT_INSTANCE; + static { + SetupOnrampResponse defaultInstance = new SetupOnrampResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + SetupOnrampResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.SetupOnrampResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ForgetOnrampRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.ForgetOnrampRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Unique ID of the onramp to forget.
+     * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + com.google.protobuf.ByteString getOnrampId(); + } + /** + *
+   */ A request to forget an onramp.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.ForgetOnrampRequest} + */ + public static final class ForgetOnrampRequest extends + com.google.protobuf.GeneratedMessageLite< + ForgetOnrampRequest, ForgetOnrampRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.ForgetOnrampRequest) + ForgetOnrampRequestOrBuilder { + private ForgetOnrampRequest() { + onrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int ONRAMP_ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString onrampId_; + /** + *
+     */ Unique ID of the onramp to forget.
+     * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return onrampId_; + } + /** + *
+     */ Unique ID of the onramp to forget.
+     * 
+ * + * bytes onramp_id = 1; + * @param value The onrampId to set. + */ + private void setOnrampId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + onrampId_ = value; + } + /** + *
+     */ Unique ID of the onramp to forget.
+     * 
+ * + * bytes onramp_id = 1; + */ + private void clearOnrampId() { + + onrampId_ = getDefaultInstance().getOnrampId(); + } + + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.ForgetOnrampRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A request to forget an onramp.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.ForgetOnrampRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.ForgetOnrampRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.ForgetOnrampRequest) + mistyswap.MistyswapOnramp.ForgetOnrampRequestOrBuilder { + // Construct using mistyswap.MistyswapOnramp.ForgetOnrampRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Unique ID of the onramp to forget.
+       * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return instance.getOnrampId(); + } + /** + *
+       */ Unique ID of the onramp to forget.
+       * 
+ * + * bytes onramp_id = 1; + * @param value The onrampId to set. + * @return This builder for chaining. + */ + public Builder setOnrampId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOnrampId(value); + return this; + } + /** + *
+       */ Unique ID of the onramp to forget.
+       * 
+ * + * bytes onramp_id = 1; + * @return This builder for chaining. + */ + public Builder clearOnrampId() { + copyOnWrite(); + instance.clearOnrampId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.ForgetOnrampRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.ForgetOnrampRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "onrampId_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.ForgetOnrampRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.ForgetOnrampRequest) + private static final mistyswap.MistyswapOnramp.ForgetOnrampRequest DEFAULT_INSTANCE; + static { + ForgetOnrampRequest defaultInstance = new ForgetOnrampRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ForgetOnrampRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.ForgetOnrampRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface ForgetOnrampResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.ForgetOnrampResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOnramp.OnrampResult getResult(); + } + /** + *
+   */ A response to a ForgetOnrampRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.ForgetOnrampResponse} + */ + public static final class ForgetOnrampResponse extends + com.google.protobuf.GeneratedMessageLite< + ForgetOnrampResponse, ForgetOnrampResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.ForgetOnrampResponse) + ForgetOnrampResponseOrBuilder { + private ForgetOnrampResponse() { + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOnramp.OnrampResult result_; + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return result_ == null ? mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOnramp.OnrampResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.ForgetOnrampResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A response to a ForgetOnrampRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.ForgetOnrampResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.ForgetOnrampResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.ForgetOnrampResponse) + mistyswap.MistyswapOnramp.ForgetOnrampResponseOrBuilder { + // Construct using mistyswap.MistyswapOnramp.ForgetOnrampResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOnramp.OnrampResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.ForgetOnrampResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.ForgetOnrampResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.ForgetOnrampResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.ForgetOnrampResponse) + private static final mistyswap.MistyswapOnramp.ForgetOnrampResponse DEFAULT_INSTANCE; + static { + ForgetOnrampResponse defaultInstance = new ForgetOnrampResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + ForgetOnrampResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.ForgetOnrampResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface OnrampOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.Onramp) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ The original onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + * @return Whether the params field is set. + */ + boolean hasParams(); + /** + *
+     */ The original onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + * @return The params. + */ + mistyswap.MistyswapOnramp.OnrampParams getParams(); + + /** + *
+     */ Current state of the onramp.
+     * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + *
+     */ Current state of the onramp.
+     * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @return The state. + */ + mistyswap.MistyswapOnramp.OnrampState getState(); + + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The stateDetails. + */ + java.lang.String getStateDetails(); + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The bytes for stateDetails. + */ + com.google.protobuf.ByteString + getStateDetailsBytes(); + + /** + *
+     */ The Mixin withdrawal address as a JSON blob.
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The mixinWithdrawalAddressJson. + */ + java.lang.String getMixinWithdrawalAddressJson(); + /** + *
+     */ The Mixin withdrawal address as a JSON blob.
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The bytes for mixinWithdrawalAddressJson. + */ + com.google.protobuf.ByteString + getMixinWithdrawalAddressJsonBytes(); + + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + * @return Whether the ongoingSwap field is set. + */ + boolean hasOngoingSwap(); + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + * @return The ongoingSwap. + */ + mistyswap.MistyswapCommon.OngoingSwap getOngoingSwap(); + + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The ongoingWithdrawalJson. + */ + java.lang.String getOngoingWithdrawalJson(); + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The bytes for ongoingWithdrawalJson. + */ + com.google.protobuf.ByteString + getOngoingWithdrawalJsonBytes(); + + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + int getBalancesCount(); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + boolean containsBalances( + java.lang.String key); + /** + * Use {@link #getBalancesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getBalances(); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + java.util.Map + getBalancesMap(); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + + /* nullable */ +java.lang.String getBalancesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + + java.lang.String getBalancesOrThrow( + java.lang.String key); + } + /** + *
+   */ Details about a previously-initiated onramp.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.Onramp} + */ + public static final class Onramp extends + com.google.protobuf.GeneratedMessageLite< + Onramp, Onramp.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.Onramp) + OnrampOrBuilder { + private Onramp() { + stateDetails_ = ""; + mixinWithdrawalAddressJson_ = ""; + ongoingWithdrawalJson_ = ""; + } + public static final int PARAMS_FIELD_NUMBER = 1; + private mistyswap.MistyswapOnramp.OnrampParams params_; + /** + *
+     */ The original onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + @java.lang.Override + public boolean hasParams() { + return params_ != null; + } + /** + *
+     */ The original onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampParams getParams() { + return params_ == null ? mistyswap.MistyswapOnramp.OnrampParams.getDefaultInstance() : params_; + } + /** + *
+     */ The original onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + private void setParams(mistyswap.MistyswapOnramp.OnrampParams value) { + value.getClass(); + params_ = value; + + } + /** + *
+     */ The original onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeParams(mistyswap.MistyswapOnramp.OnrampParams value) { + value.getClass(); + if (params_ != null && + params_ != mistyswap.MistyswapOnramp.OnrampParams.getDefaultInstance()) { + params_ = + mistyswap.MistyswapOnramp.OnrampParams.newBuilder(params_).mergeFrom(value).buildPartial(); + } else { + params_ = value; + } + + } + /** + *
+     */ The original onramp parameters.
+     * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + private void clearParams() { params_ = null; + + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_; + /** + *
+     */ Current state of the onramp.
+     * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + *
+     */ Current state of the onramp.
+     * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @return The state. + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampState getState() { + mistyswap.MistyswapOnramp.OnrampState result = mistyswap.MistyswapOnramp.OnrampState.forNumber(state_); + return result == null ? mistyswap.MistyswapOnramp.OnrampState.UNRECOGNIZED : result; + } + /** + *
+     */ Current state of the onramp.
+     * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @param value The enum numeric value on the wire for state to set. + */ + private void setStateValue(int value) { + state_ = value; + } + /** + *
+     */ Current state of the onramp.
+     * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @param value The state to set. + */ + private void setState(mistyswap.MistyswapOnramp.OnrampState value) { + state_ = value.getNumber(); + + } + /** + *
+     */ Current state of the onramp.
+     * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + */ + private void clearState() { + + state_ = 0; + } + + public static final int STATE_DETAILS_FIELD_NUMBER = 3; + private java.lang.String stateDetails_; + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The stateDetails. + */ + @java.lang.Override + public java.lang.String getStateDetails() { + return stateDetails_; + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @return The bytes for stateDetails. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStateDetailsBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(stateDetails_); + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @param value The stateDetails to set. + */ + private void setStateDetails( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + stateDetails_ = value; + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + */ + private void clearStateDetails() { + + stateDetails_ = getDefaultInstance().getStateDetails(); + } + /** + *
+     */ String details, if any, about the current state.
+     * 
+ * + * string state_details = 3; + * @param value The bytes for stateDetails to set. + */ + private void setStateDetailsBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + stateDetails_ = value.toStringUtf8(); + + } + + public static final int MIXIN_WITHDRAWAL_ADDRESS_JSON_FIELD_NUMBER = 4; + private java.lang.String mixinWithdrawalAddressJson_; + /** + *
+     */ The Mixin withdrawal address as a JSON blob.
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The mixinWithdrawalAddressJson. + */ + @java.lang.Override + public java.lang.String getMixinWithdrawalAddressJson() { + return mixinWithdrawalAddressJson_; + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob.
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The bytes for mixinWithdrawalAddressJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinWithdrawalAddressJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(mixinWithdrawalAddressJson_); + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob.
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The mixinWithdrawalAddressJson to set. + */ + private void setMixinWithdrawalAddressJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + mixinWithdrawalAddressJson_ = value; + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob.
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + */ + private void clearMixinWithdrawalAddressJson() { + + mixinWithdrawalAddressJson_ = getDefaultInstance().getMixinWithdrawalAddressJson(); + } + /** + *
+     */ The Mixin withdrawal address as a JSON blob.
+     * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The bytes for mixinWithdrawalAddressJson to set. + */ + private void setMixinWithdrawalAddressJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + mixinWithdrawalAddressJson_ = value.toStringUtf8(); + + } + + public static final int ONGOING_SWAP_FIELD_NUMBER = 5; + private mistyswap.MistyswapCommon.OngoingSwap ongoingSwap_; + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public boolean hasOngoingSwap() { + return ongoingSwap_ != null; + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public mistyswap.MistyswapCommon.OngoingSwap getOngoingSwap() { + return ongoingSwap_ == null ? mistyswap.MistyswapCommon.OngoingSwap.getDefaultInstance() : ongoingSwap_; + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + private void setOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + value.getClass(); + ongoingSwap_ = value; + + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + value.getClass(); + if (ongoingSwap_ != null && + ongoingSwap_ != mistyswap.MistyswapCommon.OngoingSwap.getDefaultInstance()) { + ongoingSwap_ = + mistyswap.MistyswapCommon.OngoingSwap.newBuilder(ongoingSwap_).mergeFrom(value).buildPartial(); + } else { + ongoingSwap_ = value; + } + + } + /** + *
+     */ Ongoing swap info, if any.
+     * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + private void clearOngoingSwap() { ongoingSwap_ = null; + + } + + public static final int ONGOING_WITHDRAWAL_JSON_FIELD_NUMBER = 6; + private java.lang.String ongoingWithdrawalJson_; + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The ongoingWithdrawalJson. + */ + @java.lang.Override + public java.lang.String getOngoingWithdrawalJson() { + return ongoingWithdrawalJson_; + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The bytes for ongoingWithdrawalJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOngoingWithdrawalJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(ongoingWithdrawalJson_); + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The ongoingWithdrawalJson to set. + */ + private void setOngoingWithdrawalJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + ongoingWithdrawalJson_ = value; + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + */ + private void clearOngoingWithdrawalJson() { + + ongoingWithdrawalJson_ = getDefaultInstance().getOngoingWithdrawalJson(); + } + /** + *
+     */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+     * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The bytes for ongoingWithdrawalJson to set. + */ + private void setOngoingWithdrawalJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + ongoingWithdrawalJson_ = value.toStringUtf8(); + + } + + public static final int BALANCES_FIELD_NUMBER = 7; + private static final class BalancesDefaultEntryHolder { + static final com.google.protobuf.MapEntryLite< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntryLite + .newDefaultInstance( + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapFieldLite< + java.lang.String, java.lang.String> balances_ = + com.google.protobuf.MapFieldLite.emptyMapField(); + private com.google.protobuf.MapFieldLite + internalGetBalances() { + return balances_; + } + private com.google.protobuf.MapFieldLite + internalGetMutableBalances() { + if (!balances_.isMutable()) { + balances_ = balances_.mutableCopy(); + } + return balances_; + } + @java.lang.Override + + public int getBalancesCount() { + return internalGetBalances().size(); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public boolean containsBalances( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + return internalGetBalances().containsKey(key); + } + /** + * Use {@link #getBalancesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBalances() { + return getBalancesMap(); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public java.util.Map getBalancesMap() { + return java.util.Collections.unmodifiableMap( + internalGetBalances()); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public /* nullable */ +java.lang.String getBalancesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + internalGetBalances(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public java.lang.String getBalancesOrThrow( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + internalGetBalances(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+     */ Balances (map of Mixin asset UUID to balance as a decimal number).
+     * 
+ * + * map<string, string> balances = 7; + */ + private java.util.Map + getMutableBalancesMap() { + return internalGetMutableBalances(); + } + + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.Onramp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.Onramp parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.Onramp parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.Onramp prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Details about a previously-initiated onramp.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.Onramp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.Onramp, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.Onramp) + mistyswap.MistyswapOnramp.OnrampOrBuilder { + // Construct using mistyswap.MistyswapOnramp.Onramp.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ The original onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + @java.lang.Override + public boolean hasParams() { + return instance.hasParams(); + } + /** + *
+       */ The original onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampParams getParams() { + return instance.getParams(); + } + /** + *
+       */ The original onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + public Builder setParams(mistyswap.MistyswapOnramp.OnrampParams value) { + copyOnWrite(); + instance.setParams(value); + return this; + } + /** + *
+       */ The original onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + public Builder setParams( + mistyswap.MistyswapOnramp.OnrampParams.Builder builderForValue) { + copyOnWrite(); + instance.setParams(builderForValue.build()); + return this; + } + /** + *
+       */ The original onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + public Builder mergeParams(mistyswap.MistyswapOnramp.OnrampParams value) { + copyOnWrite(); + instance.mergeParams(value); + return this; + } + /** + *
+       */ The original onramp parameters.
+       * 
+ * + * .mistyswap_onramp.OnrampParams params = 1; + */ + public Builder clearParams() { copyOnWrite(); + instance.clearParams(); + return this; + } + + /** + *
+       */ Current state of the onramp.
+       * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return instance.getStateValue(); + } + /** + *
+       */ Current state of the onramp.
+       * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + copyOnWrite(); + instance.setStateValue(value); + return this; + } + /** + *
+       */ Current state of the onramp.
+       * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @return The state. + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampState getState() { + return instance.getState(); + } + /** + *
+       */ Current state of the onramp.
+       * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setState(mistyswap.MistyswapOnramp.OnrampState value) { + copyOnWrite(); + instance.setState(value); + return this; + } + /** + *
+       */ Current state of the onramp.
+       * 
+ * + * .mistyswap_onramp.OnrampState state = 2; + * @return This builder for chaining. + */ + public Builder clearState() { + copyOnWrite(); + instance.clearState(); + return this; + } + + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @return The stateDetails. + */ + @java.lang.Override + public java.lang.String getStateDetails() { + return instance.getStateDetails(); + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @return The bytes for stateDetails. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStateDetailsBytes() { + return instance.getStateDetailsBytes(); + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @param value The stateDetails to set. + * @return This builder for chaining. + */ + public Builder setStateDetails( + java.lang.String value) { + copyOnWrite(); + instance.setStateDetails(value); + return this; + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @return This builder for chaining. + */ + public Builder clearStateDetails() { + copyOnWrite(); + instance.clearStateDetails(); + return this; + } + /** + *
+       */ String details, if any, about the current state.
+       * 
+ * + * string state_details = 3; + * @param value The bytes for stateDetails to set. + * @return This builder for chaining. + */ + public Builder setStateDetailsBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setStateDetailsBytes(value); + return this; + } + + /** + *
+       */ The Mixin withdrawal address as a JSON blob.
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The mixinWithdrawalAddressJson. + */ + @java.lang.Override + public java.lang.String getMixinWithdrawalAddressJson() { + return instance.getMixinWithdrawalAddressJson(); + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob.
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return The bytes for mixinWithdrawalAddressJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMixinWithdrawalAddressJsonBytes() { + return instance.getMixinWithdrawalAddressJsonBytes(); + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob.
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The mixinWithdrawalAddressJson to set. + * @return This builder for chaining. + */ + public Builder setMixinWithdrawalAddressJson( + java.lang.String value) { + copyOnWrite(); + instance.setMixinWithdrawalAddressJson(value); + return this; + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob.
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @return This builder for chaining. + */ + public Builder clearMixinWithdrawalAddressJson() { + copyOnWrite(); + instance.clearMixinWithdrawalAddressJson(); + return this; + } + /** + *
+       */ The Mixin withdrawal address as a JSON blob.
+       * 
+ * + * string mixin_withdrawal_address_json = 4; + * @param value The bytes for mixinWithdrawalAddressJson to set. + * @return This builder for chaining. + */ + public Builder setMixinWithdrawalAddressJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setMixinWithdrawalAddressJsonBytes(value); + return this; + } + + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public boolean hasOngoingSwap() { + return instance.hasOngoingSwap(); + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + @java.lang.Override + public mistyswap.MistyswapCommon.OngoingSwap getOngoingSwap() { + return instance.getOngoingSwap(); + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder setOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + copyOnWrite(); + instance.setOngoingSwap(value); + return this; + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder setOngoingSwap( + mistyswap.MistyswapCommon.OngoingSwap.Builder builderForValue) { + copyOnWrite(); + instance.setOngoingSwap(builderForValue.build()); + return this; + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder mergeOngoingSwap(mistyswap.MistyswapCommon.OngoingSwap value) { + copyOnWrite(); + instance.mergeOngoingSwap(value); + return this; + } + /** + *
+       */ Ongoing swap info, if any.
+       * 
+ * + * .mistyswap_common.OngoingSwap ongoing_swap = 5; + */ + public Builder clearOngoingSwap() { copyOnWrite(); + instance.clearOngoingSwap(); + return this; + } + + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The ongoingWithdrawalJson. + */ + @java.lang.Override + public java.lang.String getOngoingWithdrawalJson() { + return instance.getOngoingWithdrawalJson(); + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @return The bytes for ongoingWithdrawalJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOngoingWithdrawalJsonBytes() { + return instance.getOngoingWithdrawalJsonBytes(); + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The ongoingWithdrawalJson to set. + * @return This builder for chaining. + */ + public Builder setOngoingWithdrawalJson( + java.lang.String value) { + copyOnWrite(); + instance.setOngoingWithdrawalJson(value); + return this; + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @return This builder for chaining. + */ + public Builder clearOngoingWithdrawalJson() { + copyOnWrite(); + instance.clearOngoingWithdrawalJson(); + return this; + } + /** + *
+       */ Ongoing withdrawal info, if any. This is a Mixin snapshot JSON blob.
+       * 
+ * + * string ongoing_withdrawal_json = 6; + * @param value The bytes for ongoingWithdrawalJson to set. + * @return This builder for chaining. + */ + public Builder setOngoingWithdrawalJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOngoingWithdrawalJsonBytes(value); + return this; + } + + @java.lang.Override + + public int getBalancesCount() { + return instance.getBalancesMap().size(); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public boolean containsBalances( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + return instance.getBalancesMap().containsKey(key); + } + + public Builder clearBalances() { + copyOnWrite(); + instance.getMutableBalancesMap().clear(); + return this; + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + + public Builder removeBalances( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + copyOnWrite(); + instance.getMutableBalancesMap().remove(key); + return this; + } + /** + * Use {@link #getBalancesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBalances() { + return getBalancesMap(); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + public java.util.Map getBalancesMap() { + return java.util.Collections.unmodifiableMap( + instance.getBalancesMap()); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public /* nullable */ +java.lang.String getBalancesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + instance.getBalancesMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + @java.lang.Override + + public java.lang.String getBalancesOrThrow( + java.lang.String key) { + java.lang.Class keyClass = key.getClass(); + java.util.Map map = + instance.getBalancesMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + public Builder putBalances( + java.lang.String key, + java.lang.String value) { + java.lang.Class keyClass = key.getClass(); + java.lang.Class valueClass = value.getClass(); + copyOnWrite(); + instance.getMutableBalancesMap().put(key, value); + return this; + } + /** + *
+       */ Balances (map of Mixin asset UUID to balance as a decimal number).
+       * 
+ * + * map<string, string> balances = 7; + */ + public Builder putAllBalances( + java.util.Map values) { + copyOnWrite(); + instance.getMutableBalancesMap().putAll(values); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.Onramp) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.Onramp(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "params_", + "state_", + "stateDetails_", + "mixinWithdrawalAddressJson_", + "ongoingSwap_", + "ongoingWithdrawalJson_", + "balances_", + BalancesDefaultEntryHolder.defaultEntry, + }; + java.lang.String info = + "\u0000\u0007\u0000\u0000\u0001\u0007\u0007\u0001\u0000\u0000\u0001\t\u0002\f\u0003" + + "\u0208\u0004\u0208\u0005\t\u0006\u0208\u00072"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.Onramp.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.Onramp) + private static final mistyswap.MistyswapOnramp.Onramp DEFAULT_INSTANCE; + static { + Onramp defaultInstance = new Onramp(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + Onramp.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.Onramp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOnrampStatusRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.GetOnrampStatusRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + com.google.protobuf.ByteString getOnrampId(); + } + /** + *
+   */ Get the status of an onramp.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampStatusRequest} + */ + public static final class GetOnrampStatusRequest extends + com.google.protobuf.GeneratedMessageLite< + GetOnrampStatusRequest, GetOnrampStatusRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.GetOnrampStatusRequest) + GetOnrampStatusRequestOrBuilder { + private GetOnrampStatusRequest() { + onrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int ONRAMP_ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString onrampId_; + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return onrampId_; + } + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + * @param value The onrampId to set. + */ + private void setOnrampId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + onrampId_ = value; + } + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + */ + private void clearOnrampId() { + + onrampId_ = getDefaultInstance().getOnrampId(); + } + + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.GetOnrampStatusRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Get the status of an onramp.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampStatusRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.GetOnrampStatusRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.GetOnrampStatusRequest) + mistyswap.MistyswapOnramp.GetOnrampStatusRequestOrBuilder { + // Construct using mistyswap.MistyswapOnramp.GetOnrampStatusRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Unique ID of the onramp to get the status of.
+       * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return instance.getOnrampId(); + } + /** + *
+       */ Unique ID of the onramp to get the status of.
+       * 
+ * + * bytes onramp_id = 1; + * @param value The onrampId to set. + * @return This builder for chaining. + */ + public Builder setOnrampId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOnrampId(value); + return this; + } + /** + *
+       */ Unique ID of the onramp to get the status of.
+       * 
+ * + * bytes onramp_id = 1; + * @return This builder for chaining. + */ + public Builder clearOnrampId() { + copyOnWrite(); + instance.clearOnrampId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.GetOnrampStatusRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.GetOnrampStatusRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "onrampId_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.GetOnrampStatusRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.GetOnrampStatusRequest) + private static final mistyswap.MistyswapOnramp.GetOnrampStatusRequest DEFAULT_INSTANCE; + static { + GetOnrampStatusRequest defaultInstance = new GetOnrampStatusRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOnrampStatusRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.GetOnrampStatusRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOnrampStatusResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.GetOnrampStatusResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOnramp.OnrampResult getResult(); + + /** + *
+     */ The onramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + * @return Whether the onramp field is set. + */ + boolean hasOnramp(); + /** + *
+     */ The onramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + * @return The onramp. + */ + mistyswap.MistyswapOnramp.Onramp getOnramp(); + } + /** + *
+   */ A response to a GetOnrampStatusRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampStatusResponse} + */ + public static final class GetOnrampStatusResponse extends + com.google.protobuf.GeneratedMessageLite< + GetOnrampStatusResponse, GetOnrampStatusResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.GetOnrampStatusResponse) + GetOnrampStatusResponseOrBuilder { + private GetOnrampStatusResponse() { + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOnramp.OnrampResult result_; + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return result_ == null ? mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOnramp.OnrampResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static final int ONRAMP_FIELD_NUMBER = 2; + private mistyswap.MistyswapOnramp.Onramp onramp_; + /** + *
+     */ The onramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + @java.lang.Override + public boolean hasOnramp() { + return onramp_ != null; + } + /** + *
+     */ The onramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.Onramp getOnramp() { + return onramp_ == null ? mistyswap.MistyswapOnramp.Onramp.getDefaultInstance() : onramp_; + } + /** + *
+     */ The onramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + private void setOnramp(mistyswap.MistyswapOnramp.Onramp value) { + value.getClass(); + onramp_ = value; + + } + /** + *
+     */ The onramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeOnramp(mistyswap.MistyswapOnramp.Onramp value) { + value.getClass(); + if (onramp_ != null && + onramp_ != mistyswap.MistyswapOnramp.Onramp.getDefaultInstance()) { + onramp_ = + mistyswap.MistyswapOnramp.Onramp.newBuilder(onramp_).mergeFrom(value).buildPartial(); + } else { + onramp_ = value; + } + + } + /** + *
+     */ The onramp status, if the result code is Ok.
+     * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + private void clearOnramp() { onramp_ = null; + + } + + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.GetOnrampStatusResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A response to a GetOnrampStatusRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampStatusResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.GetOnrampStatusResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.GetOnrampStatusResponse) + mistyswap.MistyswapOnramp.GetOnrampStatusResponseOrBuilder { + // Construct using mistyswap.MistyswapOnramp.GetOnrampStatusResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOnramp.OnrampResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + /** + *
+       */ The onramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + @java.lang.Override + public boolean hasOnramp() { + return instance.hasOnramp(); + } + /** + *
+       */ The onramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.Onramp getOnramp() { + return instance.getOnramp(); + } + /** + *
+       */ The onramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + public Builder setOnramp(mistyswap.MistyswapOnramp.Onramp value) { + copyOnWrite(); + instance.setOnramp(value); + return this; + } + /** + *
+       */ The onramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + public Builder setOnramp( + mistyswap.MistyswapOnramp.Onramp.Builder builderForValue) { + copyOnWrite(); + instance.setOnramp(builderForValue.build()); + return this; + } + /** + *
+       */ The onramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + public Builder mergeOnramp(mistyswap.MistyswapOnramp.Onramp value) { + copyOnWrite(); + instance.mergeOnramp(value); + return this; + } + /** + *
+       */ The onramp status, if the result code is Ok.
+       * 
+ * + * .mistyswap_onramp.Onramp onramp = 2; + */ + public Builder clearOnramp() { copyOnWrite(); + instance.clearOnramp(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.GetOnrampStatusResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.GetOnrampStatusResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + "onramp_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\t"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.GetOnrampStatusResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.GetOnrampStatusResponse) + private static final mistyswap.MistyswapOnramp.GetOnrampStatusResponse DEFAULT_INSTANCE; + static { + GetOnrampStatusResponse defaultInstance = new GetOnrampStatusResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOnrampStatusResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.GetOnrampStatusResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOnrampDebugInfoRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.GetOnrampDebugInfoRequest) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + com.google.protobuf.ByteString getOnrampId(); + } + /** + *
+   */ Get the state transitions of a given onramp (for debug purposes).
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampDebugInfoRequest} + */ + public static final class GetOnrampDebugInfoRequest extends + com.google.protobuf.GeneratedMessageLite< + GetOnrampDebugInfoRequest, GetOnrampDebugInfoRequest.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.GetOnrampDebugInfoRequest) + GetOnrampDebugInfoRequestOrBuilder { + private GetOnrampDebugInfoRequest() { + onrampId_ = com.google.protobuf.ByteString.EMPTY; + } + public static final int ONRAMP_ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString onrampId_; + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return onrampId_; + } + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + * @param value The onrampId to set. + */ + private void setOnrampId(com.google.protobuf.ByteString value) { + java.lang.Class valueClass = value.getClass(); + + onrampId_ = value; + } + /** + *
+     */ Unique ID of the onramp to get the status of.
+     * 
+ * + * bytes onramp_id = 1; + */ + private void clearOnrampId() { + + onrampId_ = getDefaultInstance().getOnrampId(); + } + + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ Get the state transitions of a given onramp (for debug purposes).
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampDebugInfoRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.GetOnrampDebugInfoRequest) + mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequestOrBuilder { + // Construct using mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Unique ID of the onramp to get the status of.
+       * 
+ * + * bytes onramp_id = 1; + * @return The onrampId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOnrampId() { + return instance.getOnrampId(); + } + /** + *
+       */ Unique ID of the onramp to get the status of.
+       * 
+ * + * bytes onramp_id = 1; + * @param value The onrampId to set. + * @return This builder for chaining. + */ + public Builder setOnrampId(com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setOnrampId(value); + return this; + } + /** + *
+       */ Unique ID of the onramp to get the status of.
+       * 
+ * + * bytes onramp_id = 1; + * @return This builder for chaining. + */ + public Builder clearOnrampId() { + copyOnWrite(); + instance.clearOnrampId(); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.GetOnrampDebugInfoRequest) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "onrampId_", + }; + java.lang.String info = + "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\n"; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.GetOnrampDebugInfoRequest) + private static final mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest DEFAULT_INSTANCE; + static { + GetOnrampDebugInfoRequest defaultInstance = new GetOnrampDebugInfoRequest(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOnrampDebugInfoRequest.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + public interface GetOnrampDebugInfoResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:mistyswap_onramp.GetOnrampDebugInfoResponse) + com.google.protobuf.MessageLiteOrBuilder { + + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return Whether the result field is set. + */ + boolean hasResult(); + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + * @return The result. + */ + mistyswap.MistyswapOnramp.OnrampResult getResult(); + + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The debugInfoJson. + */ + java.lang.String getDebugInfoJson(); + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The bytes for debugInfoJson. + */ + com.google.protobuf.ByteString + getDebugInfoJsonBytes(); + } + /** + *
+   */ A response to a GetOnrampDebugInfoRequest.
+   * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampDebugInfoResponse} + */ + public static final class GetOnrampDebugInfoResponse extends + com.google.protobuf.GeneratedMessageLite< + GetOnrampDebugInfoResponse, GetOnrampDebugInfoResponse.Builder> implements + // @@protoc_insertion_point(message_implements:mistyswap_onramp.GetOnrampDebugInfoResponse) + GetOnrampDebugInfoResponseOrBuilder { + private GetOnrampDebugInfoResponse() { + debugInfoJson_ = ""; + } + public static final int RESULT_FIELD_NUMBER = 1; + private mistyswap.MistyswapOnramp.OnrampResult result_; + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return result_ != null; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return result_ == null ? mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance() : result_; + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + result_ = value; + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.SuppressWarnings({"ReferenceEquality"}) + private void mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + value.getClass(); + if (result_ != null && + result_ != mistyswap.MistyswapOnramp.OnrampResult.getDefaultInstance()) { + result_ = + mistyswap.MistyswapOnramp.OnrampResult.newBuilder(result_).mergeFrom(value).buildPartial(); + } else { + result_ = value; + } + + } + /** + *
+     */ Result of the onramp request.
+     * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + private void clearResult() { result_ = null; + + } + + public static final int DEBUG_INFO_JSON_FIELD_NUMBER = 2; + private java.lang.String debugInfoJson_; + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The debugInfoJson. + */ + @java.lang.Override + public java.lang.String getDebugInfoJson() { + return debugInfoJson_; + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @return The bytes for debugInfoJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDebugInfoJsonBytes() { + return com.google.protobuf.ByteString.copyFromUtf8(debugInfoJson_); + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @param value The debugInfoJson to set. + */ + private void setDebugInfoJson( + java.lang.String value) { + java.lang.Class valueClass = value.getClass(); + + debugInfoJson_ = value; + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + */ + private void clearDebugInfoJson() { + + debugInfoJson_ = getDefaultInstance().getDebugInfoJson(); + } + /** + *
+     */ Debug info, encoded as a JSON blob.
+     * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+     * 
+ * + * string debug_info_json = 2; + * @param value The bytes for debugInfoJson to set. + */ + private void setDebugInfoJsonBytes( + com.google.protobuf.ByteString value) { + checkByteStringIsUtf8(value); + debugInfoJson_ = value.toStringUtf8(); + + } + + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, data, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input); + } + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageLite.parseFrom( + DEFAULT_INSTANCE, input, extensionRegistry); + } + + public static Builder newBuilder() { + return (Builder) DEFAULT_INSTANCE.createBuilder(); + } + public static Builder newBuilder(mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse prototype) { + return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + } + + /** + *
+     */ A response to a GetOnrampDebugInfoRequest.
+     * 
+ * + * Protobuf type {@code mistyswap_onramp.GetOnrampDebugInfoResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse, Builder> implements + // @@protoc_insertion_point(builder_implements:mistyswap_onramp.GetOnrampDebugInfoResponse) + mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponseOrBuilder { + // Construct using mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse.newBuilder() + private Builder() { + super(DEFAULT_INSTANCE); + } + + + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public boolean hasResult() { + return instance.hasResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + @java.lang.Override + public mistyswap.MistyswapOnramp.OnrampResult getResult() { + return instance.getResult(); + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.setResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder setResult( + mistyswap.MistyswapOnramp.OnrampResult.Builder builderForValue) { + copyOnWrite(); + instance.setResult(builderForValue.build()); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder mergeResult(mistyswap.MistyswapOnramp.OnrampResult value) { + copyOnWrite(); + instance.mergeResult(value); + return this; + } + /** + *
+       */ Result of the onramp request.
+       * 
+ * + * .mistyswap_onramp.OnrampResult result = 1; + */ + public Builder clearResult() { copyOnWrite(); + instance.clearResult(); + return this; + } + + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @return The debugInfoJson. + */ + @java.lang.Override + public java.lang.String getDebugInfoJson() { + return instance.getDebugInfoJson(); + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @return The bytes for debugInfoJson. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDebugInfoJsonBytes() { + return instance.getDebugInfoJsonBytes(); + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @param value The debugInfoJson to set. + * @return This builder for chaining. + */ + public Builder setDebugInfoJson( + java.lang.String value) { + copyOnWrite(); + instance.setDebugInfoJson(value); + return this; + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @return This builder for chaining. + */ + public Builder clearDebugInfoJson() { + copyOnWrite(); + instance.clearDebugInfoJson(); + return this; + } + /** + *
+       */ Debug info, encoded as a JSON blob.
+       * / The schema is defined by the OnrampDebugInfo Rust struct and serialized by serde.
+       * 
+ * + * string debug_info_json = 2; + * @param value The bytes for debugInfoJson to set. + * @return This builder for chaining. + */ + public Builder setDebugInfoJsonBytes( + com.google.protobuf.ByteString value) { + copyOnWrite(); + instance.setDebugInfoJsonBytes(value); + return this; + } + + // @@protoc_insertion_point(builder_scope:mistyswap_onramp.GetOnrampDebugInfoResponse) + } + @java.lang.Override + @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) + protected final java.lang.Object dynamicMethod( + com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, + java.lang.Object arg0, java.lang.Object arg1) { + switch (method) { + case NEW_MUTABLE_INSTANCE: { + return new mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse(); + } + case NEW_BUILDER: { + return new Builder(); + } + case BUILD_MESSAGE_INFO: { + java.lang.Object[] objects = new java.lang.Object[] { + "result_", + "debugInfoJson_", + }; + java.lang.String info = + "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + + ""; + return newMessageInfo(DEFAULT_INSTANCE, info, objects); + } + // fall through + case GET_DEFAULT_INSTANCE: { + return DEFAULT_INSTANCE; + } + case GET_PARSER: { + com.google.protobuf.Parser parser = PARSER; + if (parser == null) { + synchronized (mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse.class) { + parser = PARSER; + if (parser == null) { + parser = + new DefaultInstanceBasedParser( + DEFAULT_INSTANCE); + PARSER = parser; + } + } + } + return parser; + } + case GET_MEMOIZED_IS_INITIALIZED: { + return (byte) 1; + } + case SET_MEMOIZED_IS_INITIALIZED: { + return null; + } + } + throw new UnsupportedOperationException(); + } + + + // @@protoc_insertion_point(class_scope:mistyswap_onramp.GetOnrampDebugInfoResponse) + private static final mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse DEFAULT_INSTANCE; + static { + GetOnrampDebugInfoResponse defaultInstance = new GetOnrampDebugInfoResponse(); + // New instances are implicitly immutable so no need to make + // immutable. + DEFAULT_INSTANCE = defaultInstance; + com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( + GetOnrampDebugInfoResponse.class, defaultInstance); + } + + public static mistyswap.MistyswapOnramp.GetOnrampDebugInfoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static volatile com.google.protobuf.Parser PARSER; + + public static com.google.protobuf.Parser parser() { + return DEFAULT_INSTANCE.getParserForType(); + } + } + + + static { + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/android/src/main/java/mistyswap/MistyswapOnrampApiGrpc.java b/android/src/main/java/mistyswap/MistyswapOnrampApiGrpc.java new file mode 100644 index 0000000..9db6160 --- /dev/null +++ b/android/src/main/java/mistyswap/MistyswapOnrampApiGrpc.java @@ -0,0 +1,541 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +package mistyswap; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.55.1)", + comments = "Source: mistyswap_onramp.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class MistyswapOnrampApiGrpc { + + private MistyswapOnrampApiGrpc() {} + + public static final String SERVICE_NAME = "mistyswap_onramp.MistyswapOnrampApi"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getSetupOnrampMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetupOnramp", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSetupOnrampMethod() { + io.grpc.MethodDescriptor getSetupOnrampMethod; + if ((getSetupOnrampMethod = MistyswapOnrampApiGrpc.getSetupOnrampMethod) == null) { + synchronized (MistyswapOnrampApiGrpc.class) { + if ((getSetupOnrampMethod = MistyswapOnrampApiGrpc.getSetupOnrampMethod) == null) { + MistyswapOnrampApiGrpc.getSetupOnrampMethod = getSetupOnrampMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetupOnramp")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getSetupOnrampMethod; + } + + private static volatile io.grpc.MethodDescriptor getForgetOnrampMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ForgetOnramp", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getForgetOnrampMethod() { + io.grpc.MethodDescriptor getForgetOnrampMethod; + if ((getForgetOnrampMethod = MistyswapOnrampApiGrpc.getForgetOnrampMethod) == null) { + synchronized (MistyswapOnrampApiGrpc.class) { + if ((getForgetOnrampMethod = MistyswapOnrampApiGrpc.getForgetOnrampMethod) == null) { + MistyswapOnrampApiGrpc.getForgetOnrampMethod = getForgetOnrampMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ForgetOnramp")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getForgetOnrampMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetOnrampStatusMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOnrampStatus", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetOnrampStatusMethod() { + io.grpc.MethodDescriptor getGetOnrampStatusMethod; + if ((getGetOnrampStatusMethod = MistyswapOnrampApiGrpc.getGetOnrampStatusMethod) == null) { + synchronized (MistyswapOnrampApiGrpc.class) { + if ((getGetOnrampStatusMethod = MistyswapOnrampApiGrpc.getGetOnrampStatusMethod) == null) { + MistyswapOnrampApiGrpc.getGetOnrampStatusMethod = getGetOnrampStatusMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetOnrampStatus")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getGetOnrampStatusMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetOnrampDebugInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOnrampDebugInfo", + requestType = attest.Attest.Message.class, + responseType = attest.Attest.Message.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetOnrampDebugInfoMethod() { + io.grpc.MethodDescriptor getGetOnrampDebugInfoMethod; + if ((getGetOnrampDebugInfoMethod = MistyswapOnrampApiGrpc.getGetOnrampDebugInfoMethod) == null) { + synchronized (MistyswapOnrampApiGrpc.class) { + if ((getGetOnrampDebugInfoMethod = MistyswapOnrampApiGrpc.getGetOnrampDebugInfoMethod) == null) { + MistyswapOnrampApiGrpc.getGetOnrampDebugInfoMethod = getGetOnrampDebugInfoMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetOnrampDebugInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( + attest.Attest.Message.getDefaultInstance())) + .build(); + } + } + } + return getGetOnrampDebugInfoMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MistyswapOnrampApiStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapOnrampApiStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOnrampApiStub(channel, callOptions); + } + }; + return MistyswapOnrampApiStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MistyswapOnrampApiBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapOnrampApiBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOnrampApiBlockingStub(channel, callOptions); + } + }; + return MistyswapOnrampApiBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MistyswapOnrampApiFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MistyswapOnrampApiFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOnrampApiFutureStub(channel, callOptions); + } + }; + return MistyswapOnrampApiFutureStub.newStub(factory, channel); + } + + /** + */ + public interface AsyncService { + + /** + *
+     */ Setup onramping (or check if it is already setup).
+     * / Input should be an encrypted SetupOnrampRequest, output is an encrypted SetupOnrampResponse.
+     * 
+ */ + default void setupOnramp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetupOnrampMethod(), responseObserver); + } + + /** + *
+     */ Forget an onramp.
+     * / Input should be an encrypted ForgetOnrampRequest, output is an encrypted ForgetOnrampResponse.
+     * 
+ */ + default void forgetOnramp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getForgetOnrampMethod(), responseObserver); + } + + /** + *
+     */ Get the status of an onramp.
+     * / Input should be an encrypted GetOnrampStatusRequest, output is an encrypted GetOnrampStatusResponse.
+     * 
+ */ + default void getOnrampStatus(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetOnrampStatusMethod(), responseObserver); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOnrampDebugInfoRequest, output is an encrypted GetOnrampDebugInfoResponse.
+     * 
+ */ + default void getOnrampDebugInfo(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetOnrampDebugInfoMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service MistyswapOnrampApi. + */ + public static abstract class MistyswapOnrampApiImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return MistyswapOnrampApiGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service MistyswapOnrampApi. + */ + public static final class MistyswapOnrampApiStub + extends io.grpc.stub.AbstractAsyncStub { + private MistyswapOnrampApiStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapOnrampApiStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOnrampApiStub(channel, callOptions); + } + + /** + *
+     */ Setup onramping (or check if it is already setup).
+     * / Input should be an encrypted SetupOnrampRequest, output is an encrypted SetupOnrampResponse.
+     * 
+ */ + public void setupOnramp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetupOnrampMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     */ Forget an onramp.
+     * / Input should be an encrypted ForgetOnrampRequest, output is an encrypted ForgetOnrampResponse.
+     * 
+ */ + public void forgetOnramp(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getForgetOnrampMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     */ Get the status of an onramp.
+     * / Input should be an encrypted GetOnrampStatusRequest, output is an encrypted GetOnrampStatusResponse.
+     * 
+ */ + public void getOnrampStatus(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOnrampStatusMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOnrampDebugInfoRequest, output is an encrypted GetOnrampDebugInfoResponse.
+     * 
+ */ + public void getOnrampDebugInfo(attest.Attest.Message request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOnrampDebugInfoMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service MistyswapOnrampApi. + */ + public static final class MistyswapOnrampApiBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MistyswapOnrampApiBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapOnrampApiBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOnrampApiBlockingStub(channel, callOptions); + } + + /** + *
+     */ Setup onramping (or check if it is already setup).
+     * / Input should be an encrypted SetupOnrampRequest, output is an encrypted SetupOnrampResponse.
+     * 
+ */ + public attest.Attest.Message setupOnramp(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetupOnrampMethod(), getCallOptions(), request); + } + + /** + *
+     */ Forget an onramp.
+     * / Input should be an encrypted ForgetOnrampRequest, output is an encrypted ForgetOnrampResponse.
+     * 
+ */ + public attest.Attest.Message forgetOnramp(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getForgetOnrampMethod(), getCallOptions(), request); + } + + /** + *
+     */ Get the status of an onramp.
+     * / Input should be an encrypted GetOnrampStatusRequest, output is an encrypted GetOnrampStatusResponse.
+     * 
+ */ + public attest.Attest.Message getOnrampStatus(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOnrampStatusMethod(), getCallOptions(), request); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOnrampDebugInfoRequest, output is an encrypted GetOnrampDebugInfoResponse.
+     * 
+ */ + public attest.Attest.Message getOnrampDebugInfo(attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOnrampDebugInfoMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MistyswapOnrampApi. + */ + public static final class MistyswapOnrampApiFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MistyswapOnrampApiFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MistyswapOnrampApiFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MistyswapOnrampApiFutureStub(channel, callOptions); + } + + /** + *
+     */ Setup onramping (or check if it is already setup).
+     * / Input should be an encrypted SetupOnrampRequest, output is an encrypted SetupOnrampResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture setupOnramp( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetupOnrampMethod(), getCallOptions()), request); + } + + /** + *
+     */ Forget an onramp.
+     * / Input should be an encrypted ForgetOnrampRequest, output is an encrypted ForgetOnrampResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture forgetOnramp( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getForgetOnrampMethod(), getCallOptions()), request); + } + + /** + *
+     */ Get the status of an onramp.
+     * / Input should be an encrypted GetOnrampStatusRequest, output is an encrypted GetOnrampStatusResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getOnrampStatus( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOnrampStatusMethod(), getCallOptions()), request); + } + + /** + *
+     */ Get debug info.
+     * / Input should be an encrypted GetOnrampDebugInfoRequest, output is an encrypted GetOnrampDebugInfoResponse.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getOnrampDebugInfo( + attest.Attest.Message request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOnrampDebugInfoMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SETUP_ONRAMP = 0; + private static final int METHODID_FORGET_ONRAMP = 1; + private static final int METHODID_GET_ONRAMP_STATUS = 2; + private static final int METHODID_GET_ONRAMP_DEBUG_INFO = 3; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SETUP_ONRAMP: + serviceImpl.setupOnramp((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FORGET_ONRAMP: + serviceImpl.forgetOnramp((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ONRAMP_STATUS: + serviceImpl.getOnrampStatus((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ONRAMP_DEBUG_INFO: + serviceImpl.getOnrampDebugInfo((attest.Attest.Message) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSetupOnrampMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_SETUP_ONRAMP))) + .addMethod( + getForgetOnrampMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_FORGET_ONRAMP))) + .addMethod( + getGetOnrampStatusMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_GET_ONRAMP_STATUS))) + .addMethod( + getGetOnrampDebugInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + attest.Attest.Message, + attest.Attest.Message>( + service, METHODID_GET_ONRAMP_DEBUG_INFO))) + .build(); + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (MistyswapOnrampApiGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .addMethod(getSetupOnrampMethod()) + .addMethod(getForgetOnrampMethod()) + .addMethod(getGetOnrampStatusMethod()) + .addMethod(getGetOnrampDebugInfoMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/bin/protobuf_update.sh b/bin/protobuf_update.sh new file mode 100755 index 0000000..8c44e9e --- /dev/null +++ b/bin/protobuf_update.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +if ! command -v buf &> /dev/null +then + echo "buf could not be found. Install with:" + echo "" + echo "$ brew install bufbuild/buf/buf" + echo "" + echo "then login with" + echo "" + echo "$ buf registry login" + echo "" + echo "More information about installation can be found in the README.md" + exit +fi + +if ! which protoc &> /dev/null +then + echo "protoc could not be found. Install with:" + echo "" + echo "$ brew install protobuf" + exit +fi + +if ! which protoc-gen-dart &> /dev/null +then + echo "protoc-gen-dart could not be found. Install with:" + echo "" + echo "$ ./flutterw pub global activate protoc_plugin" + exit +fi + +PROTOC_VERSION="20.0.1" +if ! ./flutterw pub global list | grep "protoc_plugin $PROTOC_VERSION" &> /dev/null +then + echo "protoc_plugin needs to be on version $PROTOC_VERSION." + echo "please upgrade with:" + echo "" + echo "$ ./flutterw pub global activate protoc_plugin $PROTOC_VERSION" +fi + +echo "generating..." + +# only remove the files that are in source control to not mess with local env +if [ -d "lib/protobufs/generated" ]; then + git rm -r lib/protobufs/src/protobufs/generated &> /dev/null + mkdir -p lib/protobufs/src/protobufs/generated +fi + +# generate files from buf.build +buf generate buf.build/mobilecoin-inc/misty-swap + +protoc --proto_path=lib/src/protobufs/ \ + --dart_out=grpc:lib/src/protobufs/generated/ \ + lib/src/protobufs/google/protobuf/empty.proto + +# add the files back to source control +git add lib/src/protobufs/generated/ + +echo "done" diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000..9c27dd4 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - name: dart + out: lib/src/protobufs/generated + opt: grpc diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000..0fa6b67 --- /dev/null +++ b/example/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/example/.metadata b/example/.metadata new file mode 100644 index 0000000..863658e --- /dev/null +++ b/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: f18b9281c2280c2646aa3d4348715ed5bb9446c8 + channel: beta + +project_type: app diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..ee37c39 --- /dev/null +++ b/example/README.md @@ -0,0 +1,3 @@ +# mobilecoin_flutter_example + +Demonstrates how to use the mobilecoin_flutter plugin. diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/example/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/android/.gitignore b/example/android/.gitignore new file mode 100644 index 0000000..6f56801 --- /dev/null +++ b/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle new file mode 100644 index 0000000..8b88a98 --- /dev/null +++ b/example/android/app/build.gradle @@ -0,0 +1,58 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 32 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.mobilecoin.mobilecoin_flutter_example" + minSdkVersion 19 + targetSdkVersion 32 + multiDexEnabled true + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..86559a7 --- /dev/null +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..8f4ec02 --- /dev/null +++ b/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/example/android/app/src/main/java/com/mobilecoin/mobilecoin_flutter_example/MainActivity.java b/example/android/app/src/main/java/com/mobilecoin/mobilecoin_flutter_example/MainActivity.java new file mode 100644 index 0000000..881846c --- /dev/null +++ b/example/android/app/src/main/java/com/mobilecoin/mobilecoin_flutter_example/MainActivity.java @@ -0,0 +1,6 @@ +package com.mobilecoin.mobilecoin_flutter_example; + +import io.flutter.embedding.android.FlutterActivity; + +public class MainActivity extends FlutterActivity { +} diff --git a/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 0000000..752fc18 --- /dev/null +++ b/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,25 @@ +// Generated file. +// +// If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. + +package io.flutter.app; + +import android.app.Application; +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link android.app.Application}, adding multidex support. + */ +public class FlutterMultiDexApplication extends Application { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/example/android/app/src/main/res/drawable-v21/launch_background.xml b/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/example/android/app/src/main/res/drawable/launch_background.xml b/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..449a9f9 --- /dev/null +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..d74aa35 --- /dev/null +++ b/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..fa47257 --- /dev/null +++ b/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/example/android/build.gradle b/example/android/build.gradle new file mode 100644 index 0000000..f4cfbda --- /dev/null +++ b/example/android/build.gradle @@ -0,0 +1,27 @@ +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.2.2' + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/example/android/gradle.properties b/example/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..3df6b33 --- /dev/null +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle new file mode 100644 index 0000000..44e62bc --- /dev/null +++ b/example/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/example/ios/.gitignore b/example/ios/.gitignore new file mode 100644 index 0000000..151026b --- /dev/null +++ b/example/ios/.gitignore @@ -0,0 +1,33 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..ded19e2 --- /dev/null +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 10.0 + + diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/example/ios/Gemfile b/example/ios/Gemfile new file mode 100644 index 0000000..947f8ff --- /dev/null +++ b/example/ios/Gemfile @@ -0,0 +1,4 @@ +# frozen_string_literal: true +source "https://rubygems.org" +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } +gem "cocoapods" diff --git a/example/ios/Podfile b/example/ios/Podfile new file mode 100644 index 0000000..313ea4a --- /dev/null +++ b/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock new file mode 100644 index 0000000..4b046da --- /dev/null +++ b/example/ios/Podfile.lock @@ -0,0 +1,224 @@ +PODS: + - _NIODataStructures (2.40.0) + - CGRPCZlib (1.0.0) + - CNIOAtomics (2.40.0) + - CNIOBoringSSL (2.19.0) + - CNIOBoringSSLShims (2.19.0): + - CNIOBoringSSL (= 2.19.0) + - CNIODarwin (2.40.0) + - CNIOHTTPParser (2.40.0) + - CNIOLinux (2.40.0) + - CNIOWindows (2.40.0) + - Flutter (1.0.0) + - gRPC-Swift (1.0.0): + - CGRPCZlib (= 1.0.0) + - Logging (< 2.0.0, >= 1.4.0) + - SwiftNIO (< 3.0.0, >= 2.22.0) + - SwiftNIOExtras (< 2.0.0, >= 1.4.0) + - SwiftNIOHTTP2 (< 2.0.0, >= 1.16.1) + - SwiftNIOSSL (< 3.0.0, >= 2.8.0) + - SwiftNIOTransportServices (< 2.0.0, >= 1.6.0) + - SwiftProtobuf (< 2.0.0, >= 1.9.0) + - LibMobileCoin/Core (6.0.0-pre1): + - gRPC-Swift + - SwiftProtobuf (~> 1.5) + - Logging (1.4.0) + - MobileCoin/Core (6.0.0): + - gRPC-Swift (= 1.0.0) + - LibMobileCoin/Core (~> 6.0.0-pre1) + - Logging (~> 1.4) + - SwiftNIO (~> 2.40.0) + - SwiftNIOHPACK (~> 1.16.3) + - SwiftNIOHTTP1 (~> 2.40.0) + - SwiftProtobuf + - mobilecoin_flutter (0.2.1): + - Flutter + - MobileCoin/Core (~> 6.0.0) + - SwiftNIO (2.40.0): + - _NIODataStructures (= 2.40.0) + - CNIOAtomics (= 2.40.0) + - CNIODarwin (= 2.40.0) + - CNIOLinux (= 2.40.0) + - CNIOWindows (= 2.40.0) + - SwiftNIOConcurrencyHelpers (= 2.40.0) + - SwiftNIOCore (= 2.40.0) + - SwiftNIOEmbedded (= 2.40.0) + - SwiftNIOPosix (= 2.40.0) + - SwiftNIOConcurrencyHelpers (2.40.0): + - CNIOAtomics (= 2.40.0) + - SwiftNIOCore (2.40.0): + - CNIOAtomics (= 2.40.0) + - CNIOLinux (= 2.40.0) + - SwiftNIOConcurrencyHelpers (= 2.40.0) + - SwiftNIOEmbedded (2.40.0): + - _NIODataStructures (= 2.40.0) + - CNIOAtomics (= 2.40.0) + - CNIOLinux (= 2.40.0) + - SwiftNIOConcurrencyHelpers (= 2.40.0) + - SwiftNIOCore (= 2.40.0) + - SwiftNIOExtras (1.11.0): + - _NIODataStructures (< 3, >= 2.32.0) + - CNIOAtomics (< 3, >= 2.32.0) + - CNIODarwin (< 3, >= 2.32.0) + - CNIOLinux (< 3, >= 2.32.0) + - CNIOWindows (< 3, >= 2.32.0) + - SwiftNIO (< 3, >= 2.32.0) + - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) + - SwiftNIOCore (< 3, >= 2.32.0) + - SwiftNIOEmbedded (< 3, >= 2.32.0) + - SwiftNIOPosix (< 3, >= 2.32.0) + - SwiftNIOFoundationCompat (2.40.0): + - _NIODataStructures (= 2.40.0) + - CNIOAtomics (= 2.40.0) + - CNIODarwin (= 2.40.0) + - CNIOLinux (= 2.40.0) + - CNIOWindows (= 2.40.0) + - SwiftNIO (= 2.40.0) + - SwiftNIOConcurrencyHelpers (= 2.40.0) + - SwiftNIOCore (= 2.40.0) + - SwiftNIOEmbedded (= 2.40.0) + - SwiftNIOPosix (= 2.40.0) + - SwiftNIOHPACK (1.16.3): + - SwiftNIO (< 3, >= 2.18.0) + - SwiftNIOConcurrencyHelpers (< 3, >= 2.18.0) + - SwiftNIOHTTP1 (< 3, >= 2.18.0) + - SwiftNIOHTTP1 (2.40.0): + - _NIODataStructures (= 2.40.0) + - CNIOAtomics (= 2.40.0) + - CNIODarwin (= 2.40.0) + - CNIOHTTPParser (= 2.40.0) + - CNIOLinux (= 2.40.0) + - CNIOWindows (= 2.40.0) + - SwiftNIO (= 2.40.0) + - SwiftNIOConcurrencyHelpers (= 2.40.0) + - SwiftNIOCore (= 2.40.0) + - SwiftNIOEmbedded (= 2.40.0) + - SwiftNIOPosix (= 2.40.0) + - SwiftNIOHTTP2 (1.16.3): + - SwiftNIO (< 3, >= 2.18.0) + - SwiftNIOConcurrencyHelpers (< 3, >= 2.18.0) + - SwiftNIOHPACK (= 1.16.3) + - SwiftNIOHTTP1 (< 3, >= 2.18.0) + - SwiftNIOTLS (< 3, >= 2.18.0) + - SwiftNIOPosix (2.40.0): + - _NIODataStructures (= 2.40.0) + - CNIOAtomics (= 2.40.0) + - CNIODarwin (= 2.40.0) + - CNIOLinux (= 2.40.0) + - CNIOWindows (= 2.40.0) + - SwiftNIOConcurrencyHelpers (= 2.40.0) + - SwiftNIOCore (= 2.40.0) + - SwiftNIOSSL (2.19.0): + - _NIODataStructures (< 3, >= 2.32.0) + - CNIOAtomics (< 3, >= 2.32.0) + - CNIOBoringSSL (= 2.19.0) + - CNIOBoringSSLShims (= 2.19.0) + - CNIODarwin (< 3, >= 2.32.0) + - CNIOLinux (< 3, >= 2.32.0) + - CNIOWindows (< 3, >= 2.32.0) + - SwiftNIO (< 3, >= 2.32.0) + - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) + - SwiftNIOCore (< 3, >= 2.32.0) + - SwiftNIOEmbedded (< 3, >= 2.32.0) + - SwiftNIOPosix (< 3, >= 2.32.0) + - SwiftNIOTLS (< 3, >= 2.32.0) + - SwiftNIOTLS (2.40.0): + - _NIODataStructures (= 2.40.0) + - CNIOAtomics (= 2.40.0) + - CNIODarwin (= 2.40.0) + - CNIOLinux (= 2.40.0) + - CNIOWindows (= 2.40.0) + - SwiftNIO (= 2.40.0) + - SwiftNIOConcurrencyHelpers (= 2.40.0) + - SwiftNIOCore (= 2.40.0) + - SwiftNIOEmbedded (= 2.40.0) + - SwiftNIOPosix (= 2.40.0) + - SwiftNIOTransportServices (1.12.0): + - _NIODataStructures (< 3, >= 2.32.0) + - CNIOAtomics (< 3, >= 2.32.0) + - CNIODarwin (< 3, >= 2.32.0) + - CNIOLinux (< 3, >= 2.32.0) + - CNIOWindows (< 3, >= 2.32.0) + - SwiftNIO (< 3, >= 2.32.0) + - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) + - SwiftNIOCore (< 3, >= 2.32.0) + - SwiftNIOEmbedded (< 3, >= 2.32.0) + - SwiftNIOFoundationCompat (< 3, >= 2.32.0) + - SwiftNIOPosix (< 3, >= 2.32.0) + - SwiftNIOTLS (< 3, >= 2.32.0) + - SwiftProtobuf (1.25.2) + +DEPENDENCIES: + - Flutter (from `Flutter`) + - mobilecoin_flutter (from `.symlinks/plugins/mobilecoin_flutter/ios`) + +SPEC REPOS: + trunk: + - _NIODataStructures + - CGRPCZlib + - CNIOAtomics + - CNIOBoringSSL + - CNIOBoringSSLShims + - CNIODarwin + - CNIOHTTPParser + - CNIOLinux + - CNIOWindows + - gRPC-Swift + - LibMobileCoin + - Logging + - MobileCoin + - SwiftNIO + - SwiftNIOConcurrencyHelpers + - SwiftNIOCore + - SwiftNIOEmbedded + - SwiftNIOExtras + - SwiftNIOFoundationCompat + - SwiftNIOHPACK + - SwiftNIOHTTP1 + - SwiftNIOHTTP2 + - SwiftNIOPosix + - SwiftNIOSSL + - SwiftNIOTLS + - SwiftNIOTransportServices + - SwiftProtobuf + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + mobilecoin_flutter: + :path: ".symlinks/plugins/mobilecoin_flutter/ios" + +SPEC CHECKSUMS: + _NIODataStructures: 3d45d8e70a1d17a15b1dc59d102c63dbc0525ffd + CGRPCZlib: b0c9d704a12fa667f1824ffff20688f191945989 + CNIOAtomics: 8edf08644e5e6fa0f021c239be9e8beb1cd9ef18 + CNIOBoringSSL: 2c9c96c2e95f15e83fb8d26b9738d939cc39ae33 + CNIOBoringSSLShims: c5c9346e7bbd1040f4f8793a35441dda7487539a + CNIODarwin: 93850990d29f2626b05306c6c9309f9be0d74c2f + CNIOHTTPParser: 8ce395236fa1d09ac3b4f4bcfba79b849b2ac684 + CNIOLinux: 62e3505f50de558c393dc2f273dde71dcce518da + CNIOWindows: 3047f2d8165848a3936a0a755fee27c6b5ee479b + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + gRPC-Swift: 77154009a019e97f8c4bd8f2bb75fe9726801157 + LibMobileCoin: ae9535bb6a125123550fb16ab2533f2b53b91118 + Logging: beeb016c9c80cf77042d62e83495816847ef108b + MobileCoin: 3df783a5cc278a328635ea1f5c7124c5e924648d + mobilecoin_flutter: bf11d08328c42f32df7525e16c3235cc3d33d771 + SwiftNIO: 829958aab300642625091f82fc2f49cb7cf4ef24 + SwiftNIOConcurrencyHelpers: 697370136789b1074e4535eaae75cbd7f900370e + SwiftNIOCore: 473fdfe746534d7aa25766916459eeaf6f92ef49 + SwiftNIOEmbedded: ffcb5147db67d9686c8366b7f8427b36132f2c8a + SwiftNIOExtras: 481f74d6bf0b0ef699905ed66439cb019c4975c9 + SwiftNIOFoundationCompat: b9cdbea4806e4a12e9f66d9696fa3b98c4c3232b + SwiftNIOHPACK: 38e855a72ae0c5176485ddd039b3933b99daa2b7 + SwiftNIOHTTP1: ef56706550a1dc135ea69d65215b9941e643c23b + SwiftNIOHTTP2: de7eff9d32fd347338f85b86c6fd0e13c3fbd1a0 + SwiftNIOPosix: b49af4bdbecaadfadd5c93dfe28594d6722b75e4 + SwiftNIOSSL: d153c5a6fc5b2301b0519b4c4d037a9414212da6 + SwiftNIOTLS: 598af547490133e9aac52aed0c23c4a90c31dcfc + SwiftNIOTransportServices: 0b2b407819d82eb63af558c5396e33c945759503 + SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1 + +PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d + +COCOAPODS: 1.14.3 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4f15441 --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,553 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + EC056718488074A44917B2DD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E12B6BA9B537B37CA0C337B5 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0C9E663269CCEA7911E78D62 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 0DD083CC19DB7A4DD75F4165 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B5228C4DEBEDBE043D52D39F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + E12B6BA9B537B37CA0C337B5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + EC056718488074A44917B2DD /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 51397FE7979F939F20A5A2FC /* Pods */ = { + isa = PBXGroup; + children = ( + B5228C4DEBEDBE043D52D39F /* Pods-Runner.debug.xcconfig */, + 0DD083CC19DB7A4DD75F4165 /* Pods-Runner.release.xcconfig */, + 0C9E663269CCEA7911E78D62 /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 51397FE7979F939F20A5A2FC /* Pods */, + C09C612034D1B9AB3BF7603E /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + C09C612034D1B9AB3BF7603E /* Frameworks */ = { + isa = PBXGroup; + children = ( + E12B6BA9B537B37CA0C337B5 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + D5947760ACC743FEC48B22A3 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 453A2A34D15AF762A9755D9D /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 453A2A34D15AF762A9755D9D /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + D5947760ACC743FEC48B22A3 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mobilecoin.mobilecoinFlutterExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mobilecoin.mobilecoinFlutterExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.mobilecoin.mobilecoinFlutterExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..3db53b6 --- /dev/null +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9ada4725e9b0ddb1deab583e5b5102493aa332 GIT binary patch literal 10932 zcmeHN2~<R zh`|8`A_PQ1nSu(UMFx?8j8PC!!VDphaL#`F42fd#7Vlc`zIE4n%Y~eiz4y1j|NDpi z?<@|pSJ-HM`qifhf@m%MamgwK83`XpBA<+azdF#2QsT{X@z0A9Bq>~TVErigKH1~P zRX-!h-f0NJ4Mh++{D}J+K>~~rq}d%o%+4dogzXp7RxX4C>Km5XEI|PAFDmo;DFm6G zzjVoB`@qW98Yl0Kvc-9w09^PrsobmG*Eju^=3f?0o-t$U)TL1B3;sZ^!++3&bGZ!o-*6w?;oOhf z=A+Qb$scV5!RbG+&2S}BQ6YH!FKb0``VVX~T$dzzeSZ$&9=X$3)_7Z{SspSYJ!lGE z7yig_41zpQ)%5dr4ff0rh$@ky3-JLRk&DK)NEIHecf9c*?Z1bUB4%pZjQ7hD!A0r-@NF(^WKdr(LXj|=UE7?gBYGgGQV zidf2`ZT@pzXf7}!NH4q(0IMcxsUGDih(0{kRSez&z?CFA0RVXsVFw3^u=^KMtt95q z43q$b*6#uQDLoiCAF_{RFc{!H^moH_cmll#Fc^KXi{9GDl{>%+3qyfOE5;Zq|6#Hb zp^#1G+z^AXfRKaa9HK;%b3Ux~U@q?xg<2DXP%6k!3E)PA<#4$ui8eDy5|9hA5&{?v z(-;*1%(1~-NTQ`Is1_MGdQ{+i*ccd96ab$R$T3=% zw_KuNF@vI!A>>Y_2pl9L{9h1-C6H8<)J4gKI6{WzGBi<@u3P6hNsXG=bRq5c+z;Gc3VUCe;LIIFDmQAGy+=mRyF++u=drBWV8-^>0yE9N&*05XHZpPlE zxu@?8(ZNy7rm?|<+UNe0Vs6&o?l`Pt>P&WaL~M&#Eh%`rg@Mbb)J&@DA-wheQ>hRV z<(XhigZAT z>=M;URcdCaiO3d^?H<^EiEMDV+7HsTiOhoaMX%P65E<(5xMPJKxf!0u>U~uVqnPN7T!X!o@_gs3Ct1 zlZ_$5QXP4{Aj645wG_SNT&6m|O6~Tsl$q?nK*)(`{J4b=(yb^nOATtF1_aS978$x3 zx>Q@s4i3~IT*+l{@dx~Hst21fR*+5}S1@cf>&8*uLw-0^zK(+OpW?cS-YG1QBZ5q! zgTAgivzoF#`cSz&HL>Ti!!v#?36I1*l^mkrx7Y|K6L#n!-~5=d3;K<;Zqi|gpNUn_ z_^GaQDEQ*jfzh;`j&KXb66fWEk1K7vxQIMQ_#Wu_%3 z4Oeb7FJ`8I>Px;^S?)}2+4D_83gHEq>8qSQY0PVP?o)zAv3K~;R$fnwTmI-=ZLK`= zTm+0h*e+Yfr(IlH3i7gUclNH^!MU>id$Jw>O?2i0Cila#v|twub21@e{S2v}8Z13( zNDrTXZVgris|qYm<0NU(tAPouG!QF4ZNpZPkX~{tVf8xY690JqY1NVdiTtW+NqyRP zZ&;T0ikb8V{wxmFhlLTQ&?OP7 z;(z*<+?J2~z*6asSe7h`$8~Se(@t(#%?BGLVs$p``;CyvcT?7Y!{tIPva$LxCQ&4W z6v#F*);|RXvI%qnoOY&i4S*EL&h%hP3O zLsrFZhv&Hu5tF$Lx!8(hs&?!Kx5&L(fdu}UI5d*wn~A`nPUhG&Rv z2#ixiJdhSF-K2tpVL=)5UkXRuPAFrEW}7mW=uAmtVQ&pGE-&az6@#-(Te^n*lrH^m@X-ftVcwO_#7{WI)5v(?>uC9GG{lcGXYJ~Q8q zbMFl7;t+kV;|;KkBW2!P_o%Czhw&Q(nXlxK9ak&6r5t_KH8#1Mr-*0}2h8R9XNkr zto5-b7P_auqTJb(TJlmJ9xreA=6d=d)CVbYP-r4$hDn5|TIhB>SReMfh&OVLkMk-T zYf%$taLF0OqYF?V{+6Xkn>iX@TuqQ?&cN6UjC9YF&%q{Ut3zv{U2)~$>-3;Dp)*(? zg*$mu8^i=-e#acaj*T$pNowo{xiGEk$%DusaQiS!KjJH96XZ-hXv+jk%ard#fu=@Q z$AM)YWvE^{%tDfK%nD49=PI|wYu}lYVbB#a7wtN^Nml@CE@{Gv7+jo{_V?I*jkdLD zJE|jfdrmVbkfS>rN*+`#l%ZUi5_bMS<>=MBDNlpiSb_tAF|Zy`K7kcp@|d?yaTmB^ zo?(vg;B$vxS|SszusORgDg-*Uitzdi{dUV+glA~R8V(?`3GZIl^egW{a919!j#>f` znL1o_^-b`}xnU0+~KIFLQ)$Q6#ym%)(GYC`^XM*{g zv3AM5$+TtDRs%`2TyR^$(hqE7Y1b&`Jd6dS6B#hDVbJlUXcG3y*439D8MrK!2D~6gn>UD4Imctb z+IvAt0iaW73Iq$K?4}H`7wq6YkTMm`tcktXgK0lKPmh=>h+l}Y+pDtvHnG>uqBA)l zAH6BV4F}v$(o$8Gfo*PB>IuaY1*^*`OTx4|hM8jZ?B6HY;F6p4{`OcZZ(us-RVwDx zUzJrCQlp@mz1ZFiSZ*$yX3c_#h9J;yBE$2g%xjmGF4ca z&yL`nGVs!Zxsh^j6i%$a*I3ZD2SoNT`{D%mU=LKaEwbN(_J5%i-6Va?@*>=3(dQy` zOv%$_9lcy9+(t>qohkuU4r_P=R^6ME+wFu&LA9tw9RA?azGhjrVJKy&8=*qZT5Dr8g--d+S8zAyJ$1HlW3Olryt`yE zFIph~Z6oF&o64rw{>lgZISC6p^CBer9C5G6yq%?8tC+)7*d+ib^?fU!JRFxynRLEZ zj;?PwtS}Ao#9whV@KEmwQgM0TVP{hs>dg(1*DiMUOKHdQGIqa0`yZnHk9mtbPfoLx zo;^V6pKUJ!5#n`w2D&381#5#_t}AlTGEgDz$^;u;-vxDN?^#5!zN9ngytY@oTv!nc zp1Xn8uR$1Z;7vY`-<*?DfPHB;x|GUi_fI9@I9SVRv1)qETbNU_8{5U|(>Du84qP#7 z*l9Y$SgA&wGbj>R1YeT9vYjZuC@|{rajTL0f%N@>3$DFU=`lSPl=Iv;EjuGjBa$Gw zHD-;%YOE@<-!7-Mn`0WuO3oWuL6tB2cpPw~Nvuj|KM@))ixuDK`9;jGMe2d)7gHin zS<>k@!x;!TJEc#HdL#RF(`|4W+H88d4V%zlh(7#{q2d0OQX9*FW^`^_<3r$kabWAB z$9BONo5}*(%kx zOXi-yM_cmB3>inPpI~)duvZykJ@^^aWzQ=eQ&STUa}2uT@lV&WoRzkUoE`rR0)`=l zFT%f|LA9fCw>`enm$p7W^E@U7RNBtsh{_-7vVz3DtB*y#*~(L9+x9*wn8VjWw|Q~q zKFsj1Yl>;}%MG3=PY`$g$_mnyhuV&~O~u~)968$0b2!Jkd;2MtAP#ZDYw9hmK_+M$ zb3pxyYC&|CuAbtiG8HZjj?MZJBFbt`ryf+c1dXFuC z0*ZQhBzNBd*}s6K_G}(|Z_9NDV162#y%WSNe|FTDDhx)K!c(mMJh@h87@8(^YdK$&d*^WQe8Z53 z(|@MRJ$Lk-&ii74MPIs80WsOFZ(NX23oR-?As+*aq6b?~62@fSVmM-_*cb1RzZ)`5$agEiL`-E9s7{GM2?(KNPgK1(+c*|-FKoy}X(D_b#etO|YR z(BGZ)0Ntfv-7R4GHoXp?l5g#*={S1{u-QzxCGng*oWr~@X-5f~RA14b8~B+pLKvr4 zfgL|7I>jlak9>D4=(i(cqYf7#318!OSR=^`xxvI!bBlS??`xxWeg?+|>MxaIdH1U~#1tHu zB{QMR?EGRmQ_l4p6YXJ{o(hh-7Tdm>TAX380TZZZyVkqHNzjUn*_|cb?T? zt;d2s-?B#Mc>T-gvBmQZx(y_cfkXZO~{N zT6rP7SD6g~n9QJ)8F*8uHxTLCAZ{l1Y&?6v)BOJZ)=R-pY=Y=&1}jE7fQ>USS}xP#exo57uND0i*rEk@$;nLvRB@u~s^dwRf?G?_enN@$t* zbL%JO=rV(3Ju8#GqUpeE3l_Wu1lN9Y{D4uaUe`g>zlj$1ER$6S6@{m1!~V|bYkhZA z%CvrDRTkHuajMU8;&RZ&itnC~iYLW4DVkP<$}>#&(`UO>!n)Po;Mt(SY8Yb`AS9lt znbX^i?Oe9r_o=?})IHKHoQGKXsps_SE{hwrg?6dMI|^+$CeC&z@*LuF+P`7LfZ*yr+KN8B4{Nzv<`A(wyR@!|gw{zB6Ha ziwPAYh)oJ(nlqSknu(8g9N&1hu0$vFK$W#mp%>X~AU1ay+EKWcFdif{% z#4!4aoVVJ;ULmkQf!ke2}3hqxLK>eq|-d7Ly7-J9zMpT`?dxo6HdfJA|t)?qPEVBDv z{y_b?4^|YA4%WW0VZd8C(ZgQzRI5(I^)=Ub`Y#MHc@nv0w-DaJAqsbEHDWG8Ia6ju zo-iyr*sq((gEwCC&^TYBWt4_@|81?=B-?#P6NMff(*^re zYqvDuO`K@`mjm_Jd;mW_tP`3$cS?R$jR1ZN09$YO%_iBqh5ftzSpMQQtxKFU=FYmP zeY^jph+g<4>YO;U^O>-NFLn~-RqlHvnZl2yd2A{Yc1G@Ga$d+Q&(f^tnPf+Z7serIU};17+2DU_f4Z z@GaPFut27d?!YiD+QP@)T=77cR9~MK@bd~pY%X(h%L={{OIb8IQmf-!xmZkm8A0Ga zQSWONI17_ru5wpHg3jI@i9D+_Y|pCqVuHJNdHUauTD=R$JcD2K_liQisqG$(sm=k9;L* z!L?*4B~ql7uioSX$zWJ?;q-SWXRFhz2Jt4%fOHA=Bwf|RzhwqdXGr78y$J)LR7&3T zE1WWz*>GPWKZ0%|@%6=fyx)5rzUpI;bCj>3RKzNG_1w$fIFCZ&UR0(7S?g}`&Pg$M zf`SLsz8wK82Vyj7;RyKmY{a8G{2BHG%w!^T|Njr!h9TO2LaP^_f22Q1=l$QiU84ao zHe_#{S6;qrC6w~7{y(hs-?-j?lbOfgH^E=XcSgnwW*eEz{_Z<_Px$?ny*JR5%f>l)FnDQ543{x%ZCiu33$Wg!pQFfT_}?5Q|_VSlIbLC`dpoMXL}9 zHfd9&47Mo(7D231gb+kjFxZHS4-m~7WurTH&doVX2KI5sU4v(sJ1@T9eCIKPjsqSr z)C01LsCxk=72-vXmX}CQD#BD;Cthymh&~=f$Q8nn0J<}ZrusBy4PvRNE}+1ceuj8u z0mW5k8fmgeLnTbWHGwfKA3@PdZxhn|PypR&^p?weGftrtCbjF#+zk_5BJh7;0`#Wr zgDpM_;Ax{jO##IrT`Oz;MvfwGfV$zD#c2xckpcXC6oou4ML~ezCc2EtnsQTB4tWNg z?4bkf;hG7IMfhgNI(FV5Gs4|*GyMTIY0$B=_*mso9Ityq$m^S>15>-?0(zQ<8Qy<_TjHE33(?_M8oaM zyc;NxzRVK@DL6RJnX%U^xW0Gpg(lXp(!uK1v0YgHjs^ZXSQ|m#lV7ip7{`C_J2TxPmfw%h$|%acrYHt)Re^PB%O&&=~a zhS(%I#+V>J-vjIib^<+s%ludY7y^C(P8nmqn9fp!i+?vr`bziDE=bx`%2W#Xyrj|i z!XQ4v1%L`m{7KT7q+LZNB^h8Ha2e=`Wp65^0;J00)_^G=au=8Yo;1b`CV&@#=jIBo zjN^JNVfYSs)+kDdGe7`1&8!?MQYKS?DuHZf3iogk_%#9E|5S zWeHrmAo>P;ejX7mwq#*}W25m^ZI+{(Z8fI?4jM_fffY0nok=+88^|*_DwcW>mR#e+ zX$F_KMdb6sRz!~7KkyN0G(3XQ+;z3X%PZ4gh;n-%62U<*VUKNv(D&Q->Na@Xb&u5Q3`3DGf+a8O5x7c#7+R+EAYl@R5us)CIw z7sT@_y~Ao@uL#&^LIh&QceqiT^+lb0YbFZt_SHOtWA%mgPEKVNvVgCsXy{5+zl*X8 zCJe)Q@y>wH^>l4;h1l^Y*9%-23TSmE>q5nI@?mt%n;Sj4Qq`Z+ib)a*a^cJc%E9^J zB;4s+K@rARbcBLT5P=@r;IVnBMKvT*)ew*R;&8vu%?Z&S>s?8?)3*YawM0P4!q$Kv zMmKh3lgE~&w&v%wVzH3Oe=jeNT=n@Y6J6TdHWTjXfX~-=1A1Bw`EW8rn}MqeI34nh zexFeA?&C3B2(E?0{drE@DA2pu(A#ElY&6el60Rn|Qpn-FkfQ8M93AfWIr)drgDFEU zghdWK)^71EWCP(@(=c4kfH1Y(4iugD4fve6;nSUpLT%!)MUHs1!zJYy4y||C+SwQ! z)KM&$7_tyM`sljP2fz6&Z;jxRn{Wup8IOUx8D4uh&(=O zx-7$a;U><*5L^!%xRlw)vAbh;sdlR||& ze}8_8%)c2Fwy=F&H|LM+p{pZB5DKTx>Y?F1N%BlZkXf!}JeGuMZk~LPi7{cidvUGB zAJ4LVeNV%XO>LTrklB#^-;8nb;}6l;1oW&WS=Mz*Az!4cqqQzbOSFq`$Q%PfD7srM zpKgP-D_0XPTRX*hAqeq0TDkJ;5HB1%$3Np)99#16c{ zJImlNL(npL!W|Gr_kxl1GVmF5&^$^YherS7+~q$p zt}{a=*RiD2Ikv6o=IM1kgc7zqpaZ;OB)P!1zz*i3{U()Dq#jG)egvK}@uFLa`oyWZ zf~=MV)|yJn`M^$N%ul5);JuQvaU1r2wt(}J_Qgyy`qWQI`hEeRX0uC@c1(dQ2}=U$ tNIIaX+dr)NRWXcxoR{>fqI{SF_dm1Ylv~=3YHI)h002ovPDHLkV1g(pWS;;4 literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..f091b6b0bca859a3f474b03065bef75ba58a9e4c GIT binary patch literal 1588 zcmV-42Fv-0P)C1SqPt}wig>|5Crh^=oyX$BK<}M8eLU3e2hGT;=G|!_SP)7zNI6fqUMB=)y zRAZ>eDe#*r`yDAVgB_R*LB*MAc)8(b{g{9McCXW!lq7r(btRoB9!8B-#AI6JMb~YFBEvdsV)`mEQO^&#eRKx@b&x- z5lZm*!WfD8oCLzfHGz#u7sT0^VLMI1MqGxF^v+`4YYnVYgk*=kU?HsSz{v({E3lb9 z>+xILjBN)t6`=g~IBOelGQ(O990@BfXf(DRI5I$qN$0Gkz-FSc$3a+2fX$AedL4u{ z4V+5Ong(9LiGcIKW?_352sR;LtDPmPJXI{YtT=O8=76o9;*n%_m|xo!i>7$IrZ-{l z-x3`7M}qzHsPV@$v#>H-TpjDh2UE$9g6sysUREDy_R(a)>=eHw-WAyfIN z*qb!_hW>G)Tu8nSw9yn#3wFMiLcfc4pY0ek1}8(NqkBR@t4{~oC>ryc-h_ByH(Cg5 z>ao-}771+xE3um9lWAY1FeQFxowa1(!J(;Jg*wrg!=6FdRX+t_<%z&d&?|Bn){>zm zZQj(aA_HeBY&OC^jj*)N`8fa^ePOU72VpInJoI1?`ty#lvlNzs(&MZX+R%2xS~5Kh zX*|AU4QE#~SgPzOXe9>tRj>hjU@c1k5Y_mW*Jp3fI;)1&g3j|zDgC+}2Q_v%YfDax z!?umcN^n}KYQ|a$Lr+51Nf9dkkYFSjZZjkma$0KOj+;aQ&721~t7QUKx61J3(P4P1 zstI~7-wOACnWP4=8oGOwz%vNDqD8w&Q`qcNGGrbbf&0s9L0De{4{mRS?o0MU+nR_! zrvshUau0G^DeMhM_v{5BuLjb#Hh@r23lDAk8oF(C+P0rsBpv85EP>4CVMx#04MOfG z;P%vktHcXwTj~+IE(~px)3*MY77e}p#|c>TD?sMatC0Tu4iKKJ0(X8jxQY*gYtxsC z(zYC$g|@+I+kY;dg_dE>scBf&bP1Nc@Hz<3R)V`=AGkc;8CXqdi=B4l2k|g;2%#m& z*jfX^%b!A8#bI!j9-0Fi0bOXl(-c^AB9|nQaE`*)Hw+o&jS9@7&Gov#HbD~#d{twV zXd^Tr^mWLfFh$@Dr$e;PBEz4(-2q1FF0}c;~B5sA}+Q>TOoP+t>wf)V9Iy=5ruQa;z)y zI9C9*oUga6=hxw6QasLPnee@3^Rr*M{CdaL5=R41nLs(AHk_=Y+A9$2&H(B7!_pURs&8aNw7?`&Z&xY_Ye z)~D5Bog^td-^QbUtkTirdyK^mTHAOuptDflut!#^lnKqU md>ggs(5nOWAqO?umG&QVYK#ibz}*4>0000U6E9hRK9^#O7(mu>ETqrXGsduA8$)?`v2seloOCza43C{NQ$$gAOH**MCn0Q?+L7dl7qnbRdqZ8LSVp1ItDxhxD?t@5_yHg6A8yI zC*%Wgg22K|8E#!~cTNYR~@Y9KepMPrrB8cABapAFa=`H+UGhkXUZV1GnwR1*lPyZ;*K(i~2gp|@bzp8}og7e*#% zEnr|^CWdVV!-4*Y_7rFvlww2Ze+>j*!Z!pQ?2l->4q#nqRu9`ELo6RMS5=br47g_X zRw}P9a7RRYQ%2Vsd0Me{_(EggTnuN6j=-?uFS6j^u69elMypu?t>op*wBx<=Wx8?( ztpe^(fwM6jJX7M-l*k3kEpWOl_Vk3@(_w4oc}4YF4|Rt=2V^XU?#Yz`8(e?aZ@#li0n*=g^qOcVpd-Wbok=@b#Yw zqn8u9a)z>l(1kEaPYZ6hwubN6i<8QHgsu0oE) ziJ(p;Wxm>sf!K+cw>R-(^Y2_bahB+&KI9y^);#0qt}t-$C|Bo71lHi{_+lg#f%RFy z0um=e3$K3i6K{U_4K!EX?F&rExl^W|G8Z8;`5z-k}OGNZ0#WVb$WCpQu-_YsiqKP?BB# vzVHS-CTUF4Ozn5G+mq_~Qqto~ahA+K`|lyv3(-e}00000NkvXXu0mjfd`9t{ literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d0ef06e7edb86cdfe0d15b4b0d98334a86163658 GIT binary patch literal 1716 zcmds$`#;kQ7{|XelZftyR5~xW7?MLxS4^|Hw3&P7^y)@A9Fj{Xm1~_CIV^XZ%SLBn zA;!r`GqGHg=7>xrB{?psZQs88ZaedDoagm^KF{a*>G|dJWRSe^I$DNW008I^+;Kjt z>9p3GNR^I;v>5_`+91i(*G;u5|L+Bu6M=(afLjtkya#yZ175|z$pU~>2#^Z_pCZ7o z1c6UNcv2B3?; zX%qdxCXQpdKRz=#b*q0P%b&o)5ZrNZt7$fiETSK_VaY=mb4GK`#~0K#~9^ zcY!`#Af+4h?UMR-gMKOmpuYeN5P*RKF!(tb`)oe0j2BH1l?=>y#S5pMqkx6i{*=V9JF%>N8`ewGhRE(|WohnD59R^$_36{4>S zDFlPC5|k?;SPsDo87!B{6*7eqmMdU|QZ84>6)Kd9wNfh90=y=TFQay-0__>=<4pk& zYDjgIhL-jQ9o>z32K)BgAH+HxamL{ZL~ozu)Qqe@a`FpH=oQRA8=L-m-1dam(Ix2V z?du;LdMO+ooBelr^_y4{|44tmgH^2hSzPFd;U^!1p>6d|o)(-01z{i&Kj@)z-yfWQ)V#3Uo!_U}q3u`(fOs`_f^ueFii1xBNUB z6MecwJN$CqV&vhc+)b(p4NzGGEgwWNs z@*lUV6LaduZH)4_g!cE<2G6#+hJrWd5(|p1Z;YJ7ifVHv+n49btR}dq?HHDjl{m$T z!jLZcGkb&XS2OG~u%&R$(X+Z`CWec%QKt>NGYvd5g20)PU(dOn^7%@6kQb}C(%=vr z{?RP(z~C9DPnL{q^@pVw@|Vx~@3v!9dCaBtbh2EdtoNHm4kGxp>i#ct)7p|$QJs+U z-a3qtcPvhihub?wnJqEt>zC@)2suY?%-96cYCm$Q8R%-8$PZYsx3~QOLMDf(piXMm zB=<63yQk1AdOz#-qsEDX>>c)EES%$owHKue;?B3)8aRd}m~_)>SL3h2(9X;|+2#7X z+#2)NpD%qJvCQ0a-uzZLmz*ms+l*N}w)3LRQ*6>|Ub-fyptY(keUxw+)jfwF5K{L9 z|Cl_w=`!l_o><384d&?)$6Nh(GAm=4p_;{qVn#hI8lqewW7~wUlyBM-4Z|)cZr?Rh z=xZ&Ol>4(CU85ea(CZ^aO@2N18K>ftl8>2MqetAR53_JA>Fal`^)1Y--Am~UDa4th zKfCYpcXky$XSFDWBMIl(q=Mxj$iMBX=|j9P)^fDmF(5(5$|?Cx}DKEJa&XZP%OyE`*GvvYQ4PV&!g2|L^Q z?YG}tx;sY@GzMmsY`7r$P+F_YLz)(e}% zyakqFB<6|x9R#TdoP{R$>o7y(-`$$p0NxJ6?2B8tH)4^yF(WhqGZlM3=9Ibs$%U1w zWzcss*_c0=v_+^bfb`kBFsI`d;ElwiU%frgRB%qBjn@!0U2zZehBn|{%uNIKBA7n= zzE`nnwTP85{g;8AkYxA68>#muXa!G>xH22D1I*SiD~7C?7Za+9y7j1SHiuSkKK*^O zsZ==KO(Ua#?YUpXl{ViynyT#Hzk=}5X$e04O@fsMQjb}EMuPWFO0e&8(2N(29$@Vd zn1h8Yd>6z(*p^E{c(L0Lg=wVdupg!z@WG;E0k|4a%s7Up5C0c)55XVK*|x9RQeZ1J@1v9MX;>n34(i>=YE@Iur`0Vah(inE3VUFZNqf~tSz{1fz3Fsn_x4F>o(Yo;kpqvBe-sbwH(*Y zu$JOl0b83zu$JMvy<#oH^Wl>aWL*?aDwnS0iEAwC?DK@aT)GHRLhnz2WCvf3Ba;o=aY7 z2{Asu5MEjGOY4O#Ggz@@J;q*0`kd2n8I3BeNuMmYZf{}pg=jTdTCrIIYuW~luKecn z+E-pHY%ohj@uS0%^ z&(OxwPFPD$+#~`H?fMvi9geVLci(`K?Kj|w{rZ9JgthFHV+=6vMbK~0)Ea<&WY-NC zy-PnZft_k2tfeQ*SuC=nUj4H%SQ&Y$gbH4#2sT0cU0SdFs=*W*4hKGpuR1{)mV;Qf5pw4? zfiQgy0w3fC*w&Bj#{&=7033qFR*<*61B4f9K%CQvxEn&bsWJ{&winp;FP!KBj=(P6 z4Z_n4L7cS;ao2)ax?Tm|I1pH|uLpDSRVghkA_UtFFuZ0b2#>!8;>-_0ELjQSD-DRd z4im;599VHDZYtnWZGAB25W-e(2VrzEh|etsv2YoP#VbIZ{aFkwPrzJ#JvCvA*mXS& z`}Q^v9(W4GiSs}#s7BaN!WA2bniM$0J(#;MR>uIJ^uvgD3GS^%*ikdW6-!VFUU?JV zZc2)4cMsX@j z5HQ^e3BUzOdm}yC-xA%SY``k$rbfk z;CHqifhU*jfGM@DkYCecD9vl*qr58l6x<8URB=&%{!Cu3RO*MrKZ4VO}V6R0a zZw3Eg^0iKWM1dcTYZ0>N899=r6?+adUiBKPciJw}L$=1f4cs^bio&cr9baLF>6#BM z(F}EXe-`F=f_@`A7+Q&|QaZ??Txp_dB#lg!NH=t3$G8&06MFhwR=Iu*Im0s_b2B@| znW>X}sy~m#EW)&6E&!*0%}8UAS)wjt+A(io#wGI@Z2S+Ms1Cxl%YVE800007ip7{`C_J2TxPmfw%h$|%acrYHt)Re^PB%O&&=~a zhS(%I#+V>J-vjIib^<+s%ludY7y^C(P8nmqn9fp!i+?vr`bziDE=bx`%2W#Xyrj|i z!XQ4v1%L`m{7KT7q+LZNB^h8Ha2e=`Wp65^0;J00)_^G=au=8Yo;1b`CV&@#=jIBo zjN^JNVfYSs)+kDdGe7`1&8!?MQYKS?DuHZf3iogk_%#9E|5S zWeHrmAo>P;ejX7mwq#*}W25m^ZI+{(Z8fI?4jM_fffY0nok=+88^|*_DwcW>mR#e+ zX$F_KMdb6sRz!~7KkyN0G(3XQ+;z3X%PZ4gh;n-%62U<*VUKNv(D&Q->Na@Xb&u5Q3`3DGf+a8O5x7c#7+R+EAYl@R5us)CIw z7sT@_y~Ao@uL#&^LIh&QceqiT^+lb0YbFZt_SHOtWA%mgPEKVNvVgCsXy{5+zl*X8 zCJe)Q@y>wH^>l4;h1l^Y*9%-23TSmE>q5nI@?mt%n;Sj4Qq`Z+ib)a*a^cJc%E9^J zB;4s+K@rARbcBLT5P=@r;IVnBMKvT*)ew*R;&8vu%?Z&S>s?8?)3*YawM0P4!q$Kv zMmKh3lgE~&w&v%wVzH3Oe=jeNT=n@Y6J6TdHWTjXfX~-=1A1Bw`EW8rn}MqeI34nh zexFeA?&C3B2(E?0{drE@DA2pu(A#ElY&6el60Rn|Qpn-FkfQ8M93AfWIr)drgDFEU zghdWK)^71EWCP(@(=c4kfH1Y(4iugD4fve6;nSUpLT%!)MUHs1!zJYy4y||C+SwQ! z)KM&$7_tyM`sljP2fz6&Z;jxRn{Wup8IOUx8D4uh&(=O zx-7$a;U><*5L^!%xRlw)vAbh;sdlR||& ze}8_8%)c2Fwy=F&H|LM+p{pZB5DKTx>Y?F1N%BlZkXf!}JeGuMZk~LPi7{cidvUGB zAJ4LVeNV%XO>LTrklB#^-;8nb;}6l;1oW&WS=Mz*Az!4cqqQzbOSFq`$Q%PfD7srM zpKgP-D_0XPTRX*hAqeq0TDkJ;5HB1%$3Np)99#16c{ zJImlNL(npL!W|Gr_kxl1GVmF5&^$^YherS7+~q$p zt}{a=*RiD2Ikv6o=IM1kgc7zqpaZ;OB)P!1zz*i3{U()Dq#jG)egvK}@uFLa`oyWZ zf~=MV)|yJn`M^$N%ul5);JuQvaU1r2wt(}J_Qgyy`qWQI`hEeRX0uC@c1(dQ2}=U$ tNIIaX+dr)NRWXcxoR{>fqI{SF_dm1Ylv~=3YHI)h002ovPDHLkV1g(pWS;;4 literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c8f9ed8f5cee1c98386d13b17e89f719e83555b2 GIT binary patch literal 1895 zcmV-t2blPYP)FQtfgmafE#=YDCq`qUBt#QpG%*H6QHY765~R=q zZ6iudfM}q!Pz#~9JgOi8QJ|DSu?1-*(kSi1K4#~5?#|rh?sS)(-JQqX*}ciXJ56_H zdw=^s_srbAdqxlvGyrgGet#6T7_|j;95sL%MtM;q86vOxKM$f#puR)Bjv9Zvz9-di zXOTSsZkM83)E9PYBXC<$6(|>lNLVBb&&6y{NByFCp%6+^ALR@NCTse_wqvNmSWI-m z!$%KlHFH2omF!>#%1l3LTZg(s7eof$7*xB)ZQ0h?ejh?Ta9fDv59+u#MokW+1t8Zb zgHv%K(u9G^Lv`lh#f3<6!JVTL3(dCpxHbnbA;kKqQyd1~^Xe0VIaYBSWm6nsr;dFj z4;G-RyL?cYgsN1{L4ZFFNa;8)Rv0fM0C(~Tkit94 zz#~A)59?QjD&pAPSEQ)p8gP|DS{ng)j=2ux)_EzzJ773GmQ_Cic%3JJhC0t2cx>|v zJcVusIB!%F90{+}8hG3QU4KNeKmK%T>mN57NnCZ^56=0?&3@!j>a>B43pi{!u z7JyDj7`6d)qVp^R=%j>UIY6f+3`+qzIc!Y_=+uN^3BYV|o+$vGo-j-Wm<10%A=(Yk^beI{t%ld@yhKjq0iNjqN4XMGgQtbKubPM$JWBz}YA65k%dm*awtC^+f;a-x4+ddbH^7iDWGg&N0n#MW{kA|=8iMUiFYvMoDY@sPC#t$55gn6ykUTPAr`a@!(;np824>2xJthS z*ZdmT`g5-`BuJs`0LVhz+D9NNa3<=6m;cQLaF?tCv8)zcRSh66*Z|vXhG@$I%U~2l z?`Q zykI#*+rQ=z6Jm=Bui-SfpDYLA=|vzGE(dYm=OC8XM&MDo7ux4UF1~0J1+i%aCUpRe zt3L_uNyQ*cE(38Uy03H%I*)*Bh=Lb^Xj3?I^Hnbeq72(EOK^Y93CNp*uAA{5Lc=ky zx=~RKa4{iTm{_>_vSCm?$Ej=i6@=m%@VvAITnigVg{&@!7CDgs908761meDK5azA} z4?=NOH|PdvabgJ&fW2{Mo$Q0CcD8Qc84%{JPYt5EiG{MdLIAeX%T=D7NIP4%Hw}p9 zg)==!2Lbp#j{u_}hMiao9=!VSyx0gHbeCS`;q&vzeq|fs`y&^X-lso(Ls@-706qmA z7u*T5PMo_w3{se1t2`zWeO^hOvTsohG_;>J0wVqVe+n)AbQCx)yh9;w+J6?NF5Lmo zecS@ieAKL8%bVd@+-KT{yI|S}O>pYckUFs;ry9Ow$CD@ztz5K-*D$^{i(_1llhSh^ zEkL$}tsQt5>QA^;QgjgIfBDmcOgi5YDyu?t6vSnbp=1+@6D& z5MJ}B8q;bRlVoxasyhcUF1+)o`&3r0colr}QJ3hcSdLu;9;td>kf@Tcn<@9sIx&=m z;AD;SCh95=&p;$r{Xz3iWCO^MX83AGJ(yH&eTXgv|0=34#-&WAmw{)U7OU9!Wz^!7 zZ%jZFi@JR;>Mhi7S>V7wQ176|FdW2m?&`qa(ScO^CFPR80HucLHOTy%5s*HR0^8)i h0WYBP*#0Ks^FNSabJA*5${_#%002ovPDHLkV1oKhTl@e3 literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d6b8609df07bf62e5100a53a01510388bd2b22 GIT binary patch literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M+J~S@D6vJAaElETnsX4h9a5tvPhC3L@qB~bOzkL@^z0k_hS{T4PF*TDrgdXp+dzsE? z>V|VR035Pl9n5&-RePFdS{7KAr2vPOqR9=M$vXA1Yy5>w;EsF`;OK{2pkn-kpp9Pw z)r;5JfJKKaT$4qCb{TaXHjb$QA{y0EYy*+b1XI;6Ah- zw13P)xT`>~eFoJC!>{2XL(a_#upp3gaR1#5+L(Jmzp4TBnx{~WHedpJ1ch8JFk~Sw z>F+gN+i+VD?gMXwcIhn8rz`>e>J^TI3E-MW>f}6R-pL}>WMOa0k#jN+`RyUVUC;#D zg|~oS^$6%wpF{^Qr+}X>0PKcr3Fc&>Z>uv@C);pwDs@2bZWhYP!rvGx?_|q{d`t<*XEb#=aOb=N+L@CVBGqImZf&+a zCQEa3$~@#kC);pasdG=f6tuIi0PO-y&tvX%>Mv=oY3U$nD zJ#gMegnQ46pq+3r=;zmgcG+zRc9D~c>z+jo9&D+`E6$LmyFqlmCYw;-Zooma{sR@~ z)_^|YL1&&@|GXo*pivH7k!msl+$Sew3%XJnxajt0K%3M6Bd&YFNy9}tWG^aovK2eX z1aL1%7;KRDrA@eG-Wr6w+;*H_VD~qLiVI`{_;>o)k`{8xa3EJT1O_>#iy_?va0eR? zDV=N%;Zjb%Z2s$@O>w@iqt!I}tLjGk!=p`D23I}N4Be@$(|iSA zf3Ih7b<{zqpDB4WF_5X1(peKe+rASze%u8eKLn#KKXt;UZ+Adf$_TO+vTqshLLJ5c z52HucO=lrNVae5XWOLm!V@n-ObU11!b+DN<$RuU+YsrBq*lYT;?AwJpmNKniF0Q1< zJCo>Q$=v$@&y=sj6{r!Y&y&`0$-I}S!H_~pI&2H8Z1C|BX4VgZ^-! zje3-;x0PBD!M`v*J_)rL^+$<1VJhH*2Fi~aA7s&@_rUHYJ9zD=M%4AFQ`}k8OC$9s XsPq=LnkwKG00000NkvXXu0mjfhAk5^ literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d6b8609df07bf62e5100a53a01510388bd2b22 GIT binary patch literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M+J~S@D6vJAaElETnsX4h9a5tvPhC3L@qB~bOzkL@^z0k_hS{T4PF*TDrgdXp+dzsE? z>V|VR035Pl9n5&-RePFdS{7KAr2vPOqR9=M$vXA1Yy5>w;EsF`;OK{2pkn-kpp9Pw z)r;5JfJKKaT$4qCb{TaXHjb$QA{y0EYy*+b1XI;6Ah- zw13P)xT`>~eFoJC!>{2XL(a_#upp3gaR1#5+L(Jmzp4TBnx{~WHedpJ1ch8JFk~Sw z>F+gN+i+VD?gMXwcIhn8rz`>e>J^TI3E-MW>f}6R-pL}>WMOa0k#jN+`RyUVUC;#D zg|~oS^$6%wpF{^Qr+}X>0PKcr3Fc&>Z>uv@C);pwDs@2bZWhYP!rvGx?_|q{d`t<*XEb#=aOb=N+L@CVBGqImZf&+a zCQEa3$~@#kC);pasdG=f6tuIi0PO-y&tvX%>Mv=oY3U$nD zJ#gMegnQ46pq+3r=;zmgcG+zRc9D~c>z+jo9&D+`E6$LmyFqlmCYw;-Zooma{sR@~ z)_^|YL1&&@|GXo*pivH7k!msl+$Sew3%XJnxajt0K%3M6Bd&YFNy9}tWG^aovK2eX z1aL1%7;KRDrA@eG-Wr6w+;*H_VD~qLiVI`{_;>o)k`{8xa3EJT1O_>#iy_?va0eR? zDV=N%;Zjb%Z2s$@O>w@iqt!I}tLjGk!=p`D23I}N4Be@$(|iSA zf3Ih7b<{zqpDB4WF_5X1(peKe+rASze%u8eKLn#KKXt;UZ+Adf$_TO+vTqshLLJ5c z52HucO=lrNVae5XWOLm!V@n-ObU11!b+DN<$RuU+YsrBq*lYT;?AwJpmNKniF0Q1< zJCo>Q$=v$@&y=sj6{r!Y&y&`0$-I}S!H_~pI&2H8Z1C|BX4VgZ^-! zje3-;x0PBD!M`v*J_)rL^+$<1VJhH*2Fi~aA7s&@_rUHYJ9zD=M%4AFQ`}k8OC$9s XsPq=LnkwKG00000NkvXXu0mjfhAk5^ literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..75b2d164a5a98e212cca15ea7bf2ab5de5108680 GIT binary patch literal 3831 zcmVjJBgitF5mAp-i>4+KS_oR{|13AP->1TD4=w)g|)JHOx|a2Wk1Va z!k)vP$UcQ#mdj%wNQoaJ!w>jv_6&JPyutpQps?s5dmDQ>`%?Bvj>o<%kYG!YW6H-z zu`g$@mp`;qDR!51QaS}|ZToSuAGcJ7$2HF0z`ln4t!#Yg46>;vGG9N9{V@9z#}6v* zfP?}r6b{*-C*)(S>NECI_E~{QYzN5SXRmVnP<=gzP+_Sp(Aza_hKlZ{C1D&l*(7IKXxQC1Z9#6wx}YrGcn~g%;icdw>T0Rf^w0{ z$_wn1J+C0@!jCV<%Go5LA45e{5gY9PvZp8uM$=1}XDI+9m7!A95L>q>>oe0$nC->i zeexUIvq%Uk<-$>DiDb?!In)lAmtuMWxvWlk`2>4lNuhSsjAf2*2tjT`y;@d}($o)S zn(+W&hJ1p0xy@oxP%AM15->wPLp{H!k)BdBD$toBpJh+crWdsNV)qsHaqLg2_s|Ih z`8E9z{E3sA!}5aKu?T!#enD(wLw?IT?k-yWVHZ8Akz4k5(TZJN^zZgm&zM28sfTD2BYJ|Fde3Xzh;;S` z=GXTnY4Xc)8nYoz6&vF;P7{xRF-{|2Xs5>a5)@BrnQ}I(_x7Cgpx#5&Td^4Q9_FnQ zX5so*;#8-J8#c$OlA&JyPp$LKUhC~-e~Ij!L%uSMu!-VZG7Hx-L{m2DVR2i=GR(_% zCVD!4N`I)&Q5S`?P&fQZ=4#Dgt_v2-DzkT}K(9gF0L(owe-Id$Rc2qZVLqI_M_DyO z9@LC#U28_LU{;wGZ&))}0R2P4MhajKCd^K#D+JJ&JIXZ_p#@+7J9A&P<0kdRujtQ_ zOy>3=C$kgi6$0pW06KaLz!21oOryKM3ZUOWqppndxfH}QpgjEJ`j7Tzn5bk6K&@RA?vl##y z$?V~1E(!wB5rH`>3nc&@)|#<1dN2cMzzm=PGhQ|Yppne(C-Vlt450IXc`J4R0W@I7 zd1e5uW6juvO%ni(WX7BsKx3MLngO7rHO;^R5I~0^nE^9^E_eYLgiR9&KnJ)pBbfno zSVnW$0R+&6jOOsZ82}nJ126+c|%svPo;TeUku<2G7%?$oft zyaO;tVo}(W)VsTUhq^XmFi#2z%-W9a{7mXn{uzivYQ_d6b7VJG{77naW(vHt-uhnY zVN#d!JTqVh(7r-lhtXVU6o})aZbDt_;&wJVGl2FKYFBFpU-#9U)z#(A%=IVnqytR$SY-sO( z($oNE09{D^@OuYPz&w~?9>Fl5`g9u&ecFGhqX=^#fmR=we0CJw+5xna*@oHnkahk+ z9aWeE3v|An+O5%?4fA&$Fgu~H_YmqR!yIU!bFCk4!#pAj%(lI(A5n)n@Id#M)O9Yx zJU9oKy{sRAIV3=5>(s8n{8ryJ!;ho}%pn6hZKTKbqk=&m=f*UnK$zW3YQP*)pw$O* zIfLA^!-bmBl6%d_n$#tP8Zd_(XdA*z*WH|E_yILwjtI~;jK#v-6jMl^?<%Y%`gvpwv&cFb$||^v4D&V=aNy?NGo620jL3VZnA%s zH~I|qPzB~e(;p;b^gJr7Ure#7?8%F0m4vzzPy^^(q4q1OdthF}Fi*RmVZN1OwTsAP zn9CZP`FazX3^kG(KodIZ=Kty8DLTy--UKfa1$6XugS zk%6v$Kmxt6U!YMx0JQ)0qX*{CXwZZk$vEROidEc7=J-1;peNat!vS<3P-FT5po>iE z!l3R+<`#x|+_hw!HjQGV=8!q|76y8L7N8gP3$%0kfush|u0uU^?dKBaeRSBUpOZ0c z62;D&Mdn2}N}xHRFTRI?zRv=>=AjHgH}`2k4WK=#AHB)UFrR-J87GgX*x5fL^W2#d z=(%K8-oZfMO=i{aWRDg=FX}UubM4eotRDcn;OR#{3q=*?3mE3_oJ-~prjhxh%PgQT zyn)Qozaq0@o&|LEgS{Ind4Swsr;b`u185hZPOBLL<`d2%^Yp1?oL)=jnLi;Zo0ZDliTtQ^b5SmfIMe{T==zZkbvn$KTQGlbG8w}s@M3TZnde;1Am46P3juKb zl9GU&3F=q`>j!`?SyH#r@O59%@aMX^rx}Nxe<>NqpUp5=lX1ojGDIR*-D^SDuvCKF z?3$xG(gVUsBERef_YjPFl^rU9EtD{pt z0CXwpN7BN3!8>hajGaTVk-wl=9rxmfWtIhC{mheHgStLi^+Nz12a?4r(fz)?3A%at zMlvQmL<2-R)-@G1wJ0^zQK%mR=r4d{Y3fHp){nWXUL#|CqXl(+v+qDh>FkF9`eWrW zfr^D%LNfOcTNvtx0JXR35J0~Jpi2#P3Q&80w+nqNfc}&G0A~*)lGHKv=^FE+b(37|)zL;KLF>oiGfb(?&1 zV3XRu!Sw>@quKiab%g6jun#oZ%!>V#A%+lNc?q>6+VvyAn=kf_6z^(TZUa4Eelh{{ zqFX-#dY(EV@7l$NE&kv9u9BR8&Ojd#ZGJ6l8_BW}^r?DIS_rU2(XaGOK z225E@kH5Opf+CgD^{y29jD4gHbGf{1MD6ggQ&%>UG4WyPh5q_tb`{@_34B?xfSO*| zZv8!)q;^o-bz`MuxXk*G^}(6)ACb@=Lfs`Hxoh>`Y0NE8QRQ!*p|SH@{r8=%RKd4p z+#Ty^-0kb=-H-O`nAA3_6>2z(D=~Tbs(n8LHxD0`R0_ATFqp-SdY3(bZ3;VUM?J=O zKCNsxsgt@|&nKMC=*+ZqmLHhX1KHbAJs{nGVMs6~TiF%Q)P@>!koa$%oS zjXa=!5>P`vC-a}ln!uH1ooeI&v?=?v7?1n~P(wZ~0>xWxd_Aw;+}9#eULM7M8&E?Y zC-ZLhi3RoM92SXUb-5i-Lmt5_rfjE{6y^+24`y$1lywLyHO!)Boa7438K4#iLe?rh z2O~YGSgFUBH?og*6=r9rme=peP~ah`(8Zt7V)j5!V0KPFf_mebo3z95U8(up$-+EA^9dTRLq>Yl)YMBuch9%=e5B`Vnb>o zt03=kq;k2TgGe4|lGne&zJa~h(UGutjP_zr?a7~#b)@15XNA>Dj(m=gg2Q5V4-$)D|Q9}R#002ovPDHLkV1o7DH3k3x literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..c4df70d39da7941ef3f6dcb7f06a192d8dcb308d GIT binary patch literal 1888 zcmV-m2cP(fP)x~L`~4d)Rspd&<9kFh{hn*KP1LP0~$;u(LfAu zp%fx&qLBcRHx$G|3q(bv@+b;o0*D|jwD-Q9uQR(l*ST}s+uPgQ-MeFwZ#GS?b332? z&Tk$&_miXn3IGq)AmQ)3sisq{raD4(k*bHvpCe-TdWq^NRTEVM)i9xbgQ&ccnUVx* zEY%vS%gDcSg=!tuIK8$Th2_((_h^+7;R|G{n06&O2#6%LK`a}n?h_fL18btz<@lFG za}xS}u?#DBMB> zw^b($1Z)`9G?eP95EKi&$eOy@K%h;ryrR3la%;>|o*>CgB(s>dDcNOXg}CK9SPmD? zmr-s{0wRmxUnbDrYfRvnZ@d z6johZ2sMX{YkGSKWd}m|@V7`Degt-43=2M?+jR%8{(H$&MLLmS;-|JxnX2pnz;el1jsvqQz}pGSF<`mqEXRQ5sC4#BbwnB_4` zc5bFE-Gb#JV3tox9fp-vVEN{(tOCpRse`S+@)?%pz+zVJXSooTrNCUg`R6`hxwb{) zC@{O6MKY8tfZ5@!yy=p5Y|#+myRL=^{tc(6YgAnkg3I(Cd!r5l;|;l-MQ8B`;*SCE z{u)uP^C$lOPM z5d~UhKhRRmvv{LIa^|oavk1$QiEApSrP@~Jjbg`<*dW4TO?4qG%a%sTPUFz(QtW5( zM)lA+5)0TvH~aBaOAs|}?u2FO;yc-CZ1gNM1dAxJ?%m?YsGR`}-xk2*dxC}r5j$d* zE!#Vtbo69h>V4V`BL%_&$} z+oJAo@jQ^Tk`;%xw-4G>hhb&)B?##U+(6Fi7nno`C<|#PVA%$Y{}N-?(Gc$1%tr4Pc}}hm~yY#fTOe!@v9s-ik$dX~|ygArPhByaXn8 zpI^FUjNWMsTFKTP3X7m?UK)3m zp6rI^_zxRYrx6_QmhoWoDR`fp4R7gu6;gdO)!KexaoO2D88F9x#TM1(9Bn7g;|?|o z)~$n&Lh#hCP6_LOPD>a)NmhW})LADx2kq=X7}7wYRj-0?dXr&bHaRWCfSqvzFa=sn z-8^gSyn-RmH=BZ{AJZ~!8n5621GbUJV7Qvs%JNv&$%Q17s_X%s-41vAPfIR>;x0Wlqr5?09S>x#%Qkt>?(&XjFRY}*L6BeQ3 z<6XEBh^S7>AbwGm@XP{RkeEKj6@_o%oV?hDuUpUJ+r#JZO?!IUc;r0R?>mi)*ZpQ) z#((dn=A#i_&EQn|hd)N$#A*fjBFuiHcYvo?@y1 z5|fV=a^a~d!c-%ZbMNqkMKiSzM{Yq=7_c&1H!mXk60Uv32dV;vMg&-kQ)Q{+PFtwc zj|-uQ;b^gts??J*9VxxOro}W~Q9j4Em|zSRv)(WSO9$F$s=Ydu%Q+5DOid~lwk&we zY%W(Z@ofdwPHncEZzZgmqS|!gTj3wQq9rxQy+^eNYKr1mj&?tm@wkO*9@UtnRMG>c aR{jt9+;fr}hV%pg00001^@s67{VYS000c7NklQEG_j zup^)eW&WUIApqy$=APz8jE@awGp)!bsTjDbrJO`$x^ZR^dr;>)LW>{ zs70vpsD38v)19rI=GNk1b(0?Js9~rjsQsu*K;@SD40RB-3^gKU-MYC7G!Bw{fZsqp zih4iIi;Hr_xZ033Iu{sQxLS=}yBXgLMn40d++>aQ0#%8D1EbGZp7+ z5=mK?t31BkVYbGOxE9`i748x`YgCMwL$qMsChbSGSE1`p{nSmadR zcQ#R)(?!~dmtD0+D2!K zR9%!Xp1oOJzm(vbLvT^$IKp@+W2=-}qTzTgVtQ!#Y7Gxz}stUIm<1;oBQ^Sh2X{F4ibaOOx;5ZGSNK z0maF^@(UtV$=p6DXLgRURwF95C=|U8?osGhgOED*b z7woJ_PWXBD>V-NjQAm{~T%sjyJ{5tn2f{G%?J!KRSrrGvQ1(^`YLA5B!~eycY(e5_ z*%aa{at13SxC(=7JT7$IQF~R3sy`Nn%EMv!$-8ZEAryB*yB1k&stni)=)8-ODo41g zkJu~roIgAih94tb=YsL%iH5@^b~kU9M-=aqgXIrbtxMpFy5mekFm#edF9z7RQ6V}R zBIhbXs~pMzt0VWy1Fi$^fh+1xxLDoK09&5&MJl(q#THjPm(0=z2H2Yfm^a&E)V+a5 zbi>08u;bJsDRUKR9(INSc7XyuWv(JsD+BB*0hS)FO&l&7MdViuur@-<-EHw>kHRGY zqoT}3fDv2-m{NhBG8X}+rgOEZ;amh*DqN?jEfQdqxdj08`Sr=C-KmT)qU1 z+9Cl)a1mgXxhQiHVB}l`m;-RpmKy?0*|yl?FXvJkFxuu!fKlcmz$kN(a}i*saM3nr z0!;a~_%Xqy24IxA2rz<+08=B-Q|2PT)O4;EaxP^6qixOv7-cRh?*T?zZU`{nIM-at zTKYWr9rJ=tppQ9I#Z#mLgINVB!pO-^FOcvFw6NhV0gztuO?g ztoA*C-52Q-Z-P#xB4HAY3KQVd%dz1S4PA3vHp0aa=zAO?FCt zC_GaTyVBg2F!bBr3U@Zy2iJgIAt>1sf$JWA9kh{;L+P*HfUBX1Zy{4MgNbDfBV_ly z!y#+753arsZUt@366jIC0klaC@ckuk!qu=pAyf7&QmiBUT^L1&tOHzsK)4n|pmrVT zs2($4=?s~VejTFHbFdDOwG;_58LkIj1Fh@{glkO#F1>a==ymJS$z;gdedT1zPx4Kj ztjS`y_C}%af-RtpehdQDt3a<=W5C4$)9W@QAse;WUry$WYmr51ml9lkeunUrE`-3e zmq1SgSOPNEE-Mf+AGJ$g0M;3@w!$Ej;hMh=v=I+Lpz^n%Pg^MgwyqOkNyu2c^of)C z1~ALor3}}+RiF*K4+4{(1%1j3pif1>sv0r^mTZ?5Jd-It!tfPfiG_p$AY*Vfak%FG z4z#;wLtw&E&?}w+eKG^=#jF7HQzr8rV0mY<1YAJ_uGz~$E13p?F^fPSzXSn$8UcI$ z8er9{5w5iv0qf8%70zV71T1IBB1N}R5Kp%NO0=5wJalZt8;xYp;b{1K) zHY>2wW-`Sl{=NpR%iu3(u6l&)rc%%cSA#aV7WCowfbFR4wcc{LQZv~o1u_`}EJA3>ki`?9CKYTA!rhO)if*zRdd}Kn zEPfYbhoVE~!FI_2YbC5qAj1kq;xP6%J8+?2PAs?`V3}nyFVD#sV3+uP`pi}{$l9U^ zSz}_M9f7RgnnRhaoIJgT8us!1aB&4!*vYF07Hp&}L zCRlop0oK4DL@ISz{2_BPlezc;xj2|I z23RlDNpi9LgTG_#(w%cMaS)%N`e>~1&a3<{Xy}>?WbF>OOLuO+j&hc^YohQ$4F&ze z+hwnro1puQjnKm;vFG~o>`kCeUIlkA-2tI?WBKCFLMBY=J{hpSsQ=PDtU$=duS_hq zHpymHt^uuV1q@uc4bFb{MdG*|VoW@15Osrqt2@8ll0qO=j*uOXn{M0UJX#SUztui9FN4)K3{9!y8PC-AHHvpVTU;x|-7P+taAtyglk#rjlH2 z5Gq8ik}BPaGiM{#Woyg;*&N9R2{J0V+WGB69cEtH7F?U~Kbi6ksi*`CFXsi931q7Y zGO82?whBhN%w1iDetv%~wM*Y;E^)@Vl?VDj-f*RX>{;o_=$fU!&KAXbuadYZ46Zbg z&6jMF=49$uL^73y;;N5jaHYv)BTyfh&`qVLYn?`o6BCA_z-0niZz=qPG!vonK3MW_ zo$V96zM!+kJRs{P-5-rQVse0VBH*n6A58)4uc&gfHMa{gIhV2fGf{st>E8sKyP-$8zp~wJX^A*@DI&-;8>gANXZj zU)R+Y)PB?=)a|Kj>8NXEu^S_h^7R`~Q&7*Kn!xyvzVv&^>?^iu;S~R2e-2fJx-oUb cX)(b1KSk$MOV07*qoM6N<$f&6$jw%VRuvdN2+38CZWny1cRtlsl+0_KtW)EU14Ei(F!UtWuj4IK+3{sK@>rh zs1Z;=(DD&U6+tlyL?UnHVN^&g6QhFi2#HS+*qz;(>63G(`|jRtW|nz$Pv7qTovP!^ zP_jES{mr@O-02w%!^a?^1ZP!_KmQiz0L~jZ=W@Qt`8wzOoclQsAS<5YdH;a(4bGLE zk8s}1If(PSIgVi!XE!5kA?~z*sobvNyohr;=Q_@h2@$6Flyej3J)D-6YfheRGl`HEcPk|~huT_2-U?PfL=4BPV)f1o!%rQ!NMt_MYw-5bUSwQ9Z&zC>u zOrl~UJglJNa%f50Ok}?WB{on`Ci`p^Y!xBA?m@rcJXLxtrE0FhRF3d*ir>yzO|BD$ z3V}HpFcCh6bTzY}Nt_(W%QYd3NG)jJ4<`F<1Od) zfQblTdC&h2lCz`>y?>|9o2CdvC8qZeIZt%jN;B7Hdn2l*k4M4MFEtq`q_#5?}c$b$pf_3y{Y!cRDafZBEj-*OD|gz#PBDeu3QoueOesLzB+O zxjf2wvf6Wwz>@AiOo2mO4=TkAV+g~%_n&R;)l#!cBxjuoD$aS-`IIJv7cdX%2{WT7 zOm%5rs(wqyPE^k5SIpUZ!&Lq4<~%{*>_Hu$2|~Xa;iX*tz8~G6O3uFOS?+)tWtdi| zV2b#;zRN!m@H&jd=!$7YY6_}|=!IU@=SjvGDFtL;aCtw06U;-v^0%k0FOyESt z1Wv$={b_H&8FiRV?MrzoHWd>%v6KTRU;-v^Miiz+@q`(BoT!+<37CKhoKb)|8!+RG z6BQFU^@fRW;s8!mOf2QViKQGk0TVER6EG1`#;Nm39Do^PoT!+<37AD!%oJe86(=et zZ~|sLzU>V-qYiU6V8$0GmU7_K8|Fd0B?+9Un1BhKAz#V~Fk^`mJtlCX#{^8^M8!me z8Yg;8-~>!e<-iG;h*0B1kBKm}hItVGY6WnjVpgnTTAC$rqQ^v)4KvOtpY|sIj@WYg zyw##ZZ5AC2IKNC;^hwg9BPk0wLStlmBr;E|$5GoAo$&Ui_;S9WY62n3)i49|T%C#i017z3J=$RF|KyZWnci*@lW4 z=AKhNN6+m`Q!V3Ye68|8y@%=am>YD0nG99M)NWc20%)gwO!96j7muR}Fr&54SxKP2 zP30S~lt=a*qDlbu3+Av57=9v&vr<6g0&`!8E2fq>I|EJGKs}t|{h7+KT@)LfIV-3K zK)r_fr2?}FFyn*MYoLC>oV-J~eavL2ho4a4^r{E-8m2hi>~hA?_vIG4a*KT;2eyl1 zh_hUvUJpNCFwBvRq5BI*srSle>c6%n`#VNsyC|MGa{(P&08p=C9+WUw9Hl<1o9T4M zdD=_C0F7#o8A_bRR?sFNmU0R6tW`ElnF8p53IdHo#S9(JoZCz}fHwJ6F<&?qrpVqE zte|m%89JQD+XwaPU#%#lVs-@-OL);|MdfINd6!XwP2h(eyafTUsoRkA%&@fe?9m@jw-v(yTTiV2(*fthQH9}SqmsRPVnwwbV$1E(_lkmo&S zF-truCU914_$jpqjr(>Ha4HkM4YMT>m~NosUu&UZ>zirfHo%N6PPs9^_o$WqPA0#5 z%tG>qFCL+b*0s?sZ;Sht0nE7Kl>OVXy=gjWxxK;OJ3yGd7-pZf7JYNcZo2*1SF`u6 zHJyRRxGw9mDlOiXqVMsNe#WX`fC`vrtjSQ%KmLcl(lC>ZOQzG^%iql2w-f_K@r?OE zwCICifM#L-HJyc7Gm>Ern?+Sk3&|Khmu4(~3qa$(m6Ub^U0E5RHq49za|XklN#?kP zl;EstdW?(_4D>kwjWy2f!LM)y?F94kyU3`W!6+AyId-89v}sXJpuic^NLL7GJItl~ zsiuB98AI-(#Mnm|=A-R6&2fwJ0JVSY#Q>&3$zFh|@;#%0qeF=j5Ajq@4i0tIIW z&}sk$&fGwoJpe&u-JeGLi^r?dO`m=y(QO{@h zQqAC7$rvz&5+mo3IqE?h=a~6m>%r5Quapvzq;{y~p zJpyXOBgD9VrW7@#p6l7O?o3feml(DtSL>D^R) zZUY%T2b0-vBAFN7VB;M88!~HuOXi4KcI6aRQ&h|XQ0A?m%j2=l1f0cGP}h(oVfJ`N zz#PpmFC*ieab)zJK<4?^k=g%OjPnkANzbAbmGZHoVRk*mTfm75s_cWVa`l*f$B@xu z5E*?&@seIo#*Y~1rBm!7sF9~~u6Wrj5oICUOuz}CS)jdNIznfzCA(stJ(7$c^e5wN z?lt>eYgbA!kvAR7zYSD&*r1$b|(@;9dcZ^67R0 zXAXJKa|5Sdmj!g578Nwt6d$sXuc&MWezA0Whd`94$h{{?1IwXP4)Tx4obDK%xoFZ_Z zjjHJ_P@R_e5blG@yEjnaJb`l;s%Lb2&=8$&Ct-fV`E^4CUs)=jTk!I}2d&n!f@)bm z@ z_4Dc86+3l2*p|~;o-Sb~oXb_RuLmoifDU^&Te$*FevycC0*nE3Xws8gsWp|Rj2>SM zns)qcYj?^2sd8?N!_w~4v+f-HCF|a$TNZDoNl$I1Uq87euoNgKb6&r26TNrfkUa@o zfdiFA@p{K&mH3b8i!lcoz)V{n8Q@g(vR4ns4r6w;K z>1~ecQR0-<^J|Ndg5fvVUM9g;lbu-){#ghGw(fg>L zh)T5Ljb%lWE;V9L!;Cqk>AV1(rULYF07ZBJbGb9qbSoLAd;in9{)95YqX$J43-dY7YU*k~vrM25 zxh5_IqO0LYZW%oxQ5HOzmk4x{atE*vipUk}sh88$b2tn?!ujEHn`tQLe&vo}nMb&{ zio`xzZ&GG6&ZyN3jnaQy#iVqXE9VT(3tWY$n-)uWDQ|tc{`?fq2F`oQ{;d3aWPg4Hp-(iE{ry>MIPWL> iW8Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/Runner/Base.lproj/Main.storyboard b/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist new file mode 100644 index 0000000..2d49a58 --- /dev/null +++ b/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + mobilecoin_flutter_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/example/ios/Runner/Runner-Bridging-Header.h b/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/example/lib/main.dart b/example/lib/main.dart new file mode 100644 index 0000000..a944f55 --- /dev/null +++ b/example/lib/main.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'dart:async'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatefulWidget { + const MyApp({Key? key}) : super(key: key); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + String _platformVersion = 'Unknown'; + + @override + void initState() { + super.initState(); + initPlatformState(); + } + + // Platform messages are asynchronous, so we initialize in an async method. + Future initPlatformState() async { + String platformVersion = '1.0'; + // // Platform messages may fail, so we use a try/catch PlatformException. + // // We also handle the message potentially returning null. + // try { + // platformVersion = + // await MobilecoinFlutter.platformVersion ?? 'Unknown platform version'; + // } on PlatformException { + // platformVersion = 'Failed to get platform version.'; + // } + + // If the widget was removed from the tree while the asynchronous platform + // message was in flight, we want to discard the reply rather than calling + // setState to update our non-existent appearance. + if (!mounted) return; + + setState(() { + _platformVersion = platformVersion; + }); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Plugin example app'), + ), + body: Center( + child: Text('Running on: $_platformVersion\n'), + ), + ), + ); + } +} diff --git a/example/pubspec.lock b/example/pubspec.lock new file mode 100644 index 0000000..bcf76da --- /dev/null +++ b/example/pubspec.lock @@ -0,0 +1,332 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" + url: "https://pub.dev" + source: hosted + version: "3.3.7" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" + source: hosted + version: "3.0.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + decimal: + dependency: transitive + description: + name: decimal + sha256: "24a261d5d5c87e86c7651c417a5dbdf8bcd7080dd592533910e8d0505a279f21" + url: "https://pub.dev" + source: hosted + version: "2.3.3" + equatable: + dependency: transitive + description: + name: equatable + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" + source: hosted + version: "2.0.5" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 + url: "https://pub.dev" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: af7c3a3edf9d0de2e1e0a77e994fae0a581c525fa7012af4fa0d4a52ed9484da + url: "https://pub.dev" + source: hosted + version: "1.4.1" + grpc: + dependency: transitive + description: + name: grpc + sha256: "220ffb2218288f4e7dea487242e08b9c6277596d9b6f3f10ba50be96771a032d" + url: "https://pub.dev" + source: hosted + version: "3.2.3" + http: + dependency: transitive + description: + name: http + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + http2: + dependency: transitive + description: + name: http2 + sha256: "38db0c4aa9f1cd238a5d2e86aa0cc7cc91c77e0c6c94ba64bbe85e4ff732a952" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + lints: + dependency: transitive + description: + name: lints + sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + url: "https://pub.dev" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" + source: hosted + version: "0.12.16" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + meta: + dependency: transitive + description: + name: meta + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" + source: hosted + version: "1.10.0" + mobilecoin_flutter: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "0.0.1" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" + protobuf: + dependency: transitive + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + rational: + dependency: transitive + description: + name: rational + sha256: ba58e9e18df9abde280e8b10051e4bce85091e41e8e7e411b6cde2e738d357cf + url: "https://pub.dev" + source: hosted + version: "2.2.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" + source: hosted + version: "0.6.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" +sdks: + dart: ">=3.2.0-194.0.dev <4.0.0" + flutter: ">=1.20.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml new file mode 100644 index 0000000..c254bc9 --- /dev/null +++ b/example/pubspec.yaml @@ -0,0 +1,86 @@ +name: mobilecoin_flutter_example +description: Demonstrates how to use the mobilecoin_flutter plugin. + +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: ">=2.12.0 <3.0.0" + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + mobilecoin_flutter: + # When depending on this package from a real application you should use: + # mobilecoin_flutter: ^x.y.z + # See https://dart.dev/tools/pub/dependencies#version-constraints + # The example app is bundled with the plugin so we use a path dependency on + # the parent directory to use the current plugin's version. + path: ../ + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^1.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +mobilecoin: + path: ../ +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..0c88507 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,38 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ios/Classes/FFiClientConfig.swift b/ios/Classes/FFiClientConfig.swift new file mode 100644 index 0000000..1b25b8f --- /dev/null +++ b/ios/Classes/FFiClientConfig.swift @@ -0,0 +1,192 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct ClientConfig { + let id = UUID() + var fogView: [ServiceMrEnclave] = [] + var fogLedger: [ServiceMrEnclave] = [] + var fogReport: [ServiceMrEnclave] = [] + var consensus: [ServiceMrEnclave] = [] + var mistyswap: [ServiceMrEnclave] = [] + + public static func create() -> Int { + var client = ClientConfig() + let hash: Int = client.hashValue + ObjectStorage.addObject(client, forKey: hash) + return hash + } + + public mutating func addServiceConfig( + fogViewMrEnclave: String, + fogLedgerMrEnclave: String, + fogReportMrEnclave: String, + consensusMrEnclave: String, + hardeningAdvisories: [String], + configAdvisories: [String] = [], + mistyswapMrEnclave: String? = nil + ) { + self.fogView.append( + ServiceMrEnclave( + mrEnclave: fogViewMrEnclave, + hardeningAdvisories: hardeningAdvisories, + configAdvisories: configAdvisories + ) + ) + + self.fogLedger.append( + ServiceMrEnclave( + mrEnclave: fogLedgerMrEnclave, + hardeningAdvisories: hardeningAdvisories, + configAdvisories: configAdvisories + ) + ) + + self.fogReport.append( + ServiceMrEnclave( + mrEnclave: fogReportMrEnclave, + hardeningAdvisories: hardeningAdvisories, + configAdvisories: configAdvisories + ) + ) + + self.consensus.append( + ServiceMrEnclave( + mrEnclave: consensusMrEnclave, + hardeningAdvisories: hardeningAdvisories, + configAdvisories: configAdvisories + ) + ) + + if let mistyswapMrEnclave = mistyswapMrEnclave { + self.mistyswap.append( + ServiceMrEnclave( + mrEnclave: mistyswapMrEnclave, + hardeningAdvisories: hardeningAdvisories, + configAdvisories: configAdvisories + ) + ) + } + } + + public func save() { + ObjectStorage.addObject(self, forKey: self.hashValue) + } + + var consensusMrEnclaves: [Attestation.MrEnclave] { + compactMapToAttestations(service: consensus) + } + + var fogViewMrEnclaves: [Attestation.MrEnclave] { + compactMapToAttestations(service: fogView) + } + + var fogLedgerMrEnclaves: [Attestation.MrEnclave] { + compactMapToAttestations(service: fogLedger) + } + + var fogReportMrEnclaves: [Attestation.MrEnclave] { + compactMapToAttestations(service: fogReport) + } + + var mistyswapMrEnclaves: [Attestation.MrEnclave] { + compactMapToAttestations(service: mistyswap) + } + + private func compactMapToAttestations(service: [ServiceMrEnclave]) -> [Attestation.MrEnclave] { + service.compactMap({ serviceMrEnclave in + guard + let mrEnclave = HexEncoding.data(fromHexEncodedString: serviceMrEnclave.mrEnclave) + else { + return nil + } + + let configAdvisories = serviceMrEnclave.configAdvisories + let hardeningAdvisories = serviceMrEnclave.hardeningAdvisories + return try? Attestation.MrEnclave.make( + mrEnclave: mrEnclave, + allowedConfigAdvisories: configAdvisories, + allowedHardeningAdvisories: hardeningAdvisories + ).get() + }) + } +} + +extension ClientConfig: Hashable { + static func == (lhs: ClientConfig, rhs: ClientConfig) -> Bool { + return lhs.id == rhs.id + } + + func hash(into hasher: inout Hasher) { + hasher.combine(id) + } +} + +extension ClientConfig: CustomStringConvertible { + var description: String { + """ + fogView: \(fogView.count) + fogLedger: \(fogLedger.count) + fogReport: \(fogReport.count) + consensus: \(consensus.count) + mistyswap: \(mistyswap.count) + """ + } +} + +struct ServiceMrEnclave { + var mrEnclave: String + var hardeningAdvisories: [String] = [] + var configAdvisories: [String] = [] +} + + +struct FfiClientConfig { + static var fogViewMrEnclaveKey = "fogViewMrEnclave" + static var fogLedgerMrEnclaveKey = "fogLedgerMrEnclave" + static var fogReportMrEnclaveKey = "fogReportMrEnclave" + static var consensusMrEnclaveKey = "consensusMrEnclave" + static var mistyswapMrEnclaveKey = "mistyswapMrEnclave" + static var hardeningAdvisoriesKey = "hardeningAdvisories" + + struct Create: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + let hash: Int = ClientConfig.create() + result(hash) + } + } + + struct AddServiceConfig: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard + let clientConfigId = args["clientConfigId"] as? Int, + var clientConfig = ObjectStorage.objectForKey(clientConfigId) as? ClientConfig, + let fogViewMrEnclave = args["fogViewMrEnclave"] as? String, + let fogLedgerMrEnclave = args["fogLedgerMrEnclave"] as? String, + let fogReportMrEnclave = args["fogReportMrEnclave"] as? String, + let consensusMrEnclave = args["consensusMrEnclave"] as? String, + let hardeningAdvisoriesString = args["hardeningAdvisories"] as? String + else { + result(FlutterError(code: "NATIVE", message: "AddServiceConfig", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let hardeningAdvisories = hardeningAdvisoriesString.split(separator: ",").map({ + String($0) + }) + + clientConfig.addServiceConfig( + fogViewMrEnclave: fogViewMrEnclave, + fogLedgerMrEnclave: fogLedgerMrEnclave, + fogReportMrEnclave: fogReportMrEnclave, + consensusMrEnclave: consensusMrEnclave, + hardeningAdvisories: hardeningAdvisories, + mistyswapMrEnclave: (args["mistyswapMrEnclave"] as? String) + ) + + clientConfig.save() + result(clientConfig.hashValue) + } + } +} diff --git a/ios/Classes/FFiMobileCoinClient.swift b/ios/Classes/FFiMobileCoinClient.swift new file mode 100644 index 0000000..052f7b5 --- /dev/null +++ b/ios/Classes/FFiMobileCoinClient.swift @@ -0,0 +1,657 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiMobileCoinClient { + + struct Create: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard + let accountKeyId = args["accountKey"] as? Int, + let fogUrl = args["fogUrl"] as? String, + let consensusUrl = args["consensusUrl"] as? String, + let clientConfigId = args["clientConfigId"] as? Int, + let clientConfig = ObjectStorage.objectForKey(clientConfigId) as? ClientConfig, + let accountKey = ObjectStorage.objectForKey(accountKeyId) as? AccountKey + else { + result(FlutterError(code: "NATIVE", message: "Create", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let consensusMrEnclave = clientConfig.consensusMrEnclaves + let fogViewMrEnclave = clientConfig.fogViewMrEnclaves + let fogReportMrEnclave = clientConfig.fogReportMrEnclaves + let fogLedgerMrEnclave = clientConfig.fogLedgerMrEnclaves + let mistyswapMrEnclave = clientConfig.mistyswapMrEnclaves + + // Ensure one or more valid MrEnclaves for each service thats required + guard + consensusMrEnclave.count > 0, + fogViewMrEnclave.count > 0, + fogReportMrEnclave.count > 0, + fogLedgerMrEnclave.count > 0 + else { + result(FlutterError(code: "NATIVE", message: "Create", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let consensusAttestation = Attestation(mrEnclaves: consensusMrEnclave) + let fogViewAttestation = Attestation(mrEnclaves: fogViewMrEnclave) + let fogReportAttestation = Attestation(mrEnclaves: fogReportMrEnclave) + let fogLedgerAttestation = Attestation(mrEnclaves: fogLedgerMrEnclave) + let mistyswapAttestation = Attestation(mrEnclaves: mistyswapMrEnclave) + + let client: MobileCoinClient = try { + let transportProtocol = TransportProtocol.grpc + + guard let mistyswapUrl = args["mistyswapUrl"] as? String + else { + return try MobileCoinClient.make( + accountKey: accountKey, + config: MobileCoinClient.Config.make( + consensusUrl: consensusUrl, + consensusAttestation: consensusAttestation, + fogUrl: fogUrl, + fogViewAttestation: fogViewAttestation, + fogKeyImageAttestation: fogLedgerAttestation, + fogMerkleProofAttestation: fogLedgerAttestation, + fogReportAttestation: fogReportAttestation, + transportProtocol: transportProtocol + ).get() + ).get() + } + return try MobileCoinClient.make( + accountKey: accountKey, + config: MobileCoinClient.Config.make( + consensusUrl: consensusUrl, + consensusAttestation: consensusAttestation, + fogUrl: fogUrl, + fogViewAttestation: fogViewAttestation, + fogKeyImageAttestation: fogLedgerAttestation, + fogMerkleProofAttestation: fogLedgerAttestation, + fogReportAttestation: fogReportAttestation, + mistyswapUrl: mistyswapUrl, + mistyswapAttestation: mistyswapAttestation, + transportProtocol: transportProtocol + ).get() + ).get() + }() + + let hash: Int = ObjectIdentifier(client).hashValue + ObjectStorage.addObject(client, forKey: hash) + result(hash) + } + } + + struct SetAuthorization: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let clientId: Int = args["id"] as? Int, + let username = args["username"] as? String, + let password = args["password"] as? String, + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "SetAuthorization", details: "parsing arguments")) + throw PluginError.invalidArguments + } + client.setFogBasicAuthorization(username: username, password: password) + client.setConsensusBasicAuthorization(username: username, password: password) + result(0) + } + }; + + struct RequiresDefragmentation: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let clientId: Int = args["id"] as? Int, + let toSendAmountString = args["amount"] as? String, + let toSendAmount = UInt64(toSendAmountString), + let toSendTokenIdString = args["tokenId"] as? String, + let toSendTokenIdUInt = UInt64(toSendTokenIdString), + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "RequiresDefragmentation", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let toSendTokenId = TokenId(toSendTokenIdUInt) + let amount = Amount(toSendAmount, in: toSendTokenId) + + client.requiresDefragmentation(toSendAmount: amount) { (requiresDefragResult: Result) in + switch requiresDefragResult { + case .success(let requiresDefragmentation): + DispatchQueue.main.async { + result(requiresDefragmentation) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "RequiresDefragmentation.requiresDefragmentation")) + } + } + } + } + + struct EstimateTotalFee: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let clientId: Int = args["id"] as? Int, + let toSendAmountString = args["amount"] as? String, + let toSendAmount = UInt64(toSendAmountString), + let toSendTokenIdString = args["tokenId"] as? String, + let toSendTokenIdUInt = UInt64(toSendTokenIdString), + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "EstimateTotalFee", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let toSendTokenId = TokenId(toSendTokenIdUInt) + let amount = Amount(toSendAmount, in: toSendTokenId) + + client.estimateTotalFee(toSendAmount: amount) { (estimateTotalFeeResult: Result) in + switch estimateTotalFeeResult { + case .success(let feeValue): + DispatchQueue.main.async { + result("\(feeValue)") + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "EstimateTotalFee.estimation")) + } + } + } + } + + struct GetTransferableAmount: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let clientId: Int = args["id"] as? Int, + let tokenIdString = args["tokenId"] as? String, + let tokenIdUInt = UInt64(tokenIdString), + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "getTransferableAmount", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let tokenId = TokenId(tokenIdUInt) + client.amountTransferable(tokenId: tokenId) { (amountTransferableResult: Result) in + switch amountTransferableResult { + case .success(let amount): + DispatchQueue.main.async { + result("\(amount)") + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "amountTransferable")) + } + } + } + } + + struct DefragmentAccount: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let clientId: Int = args["id"] as? Int, + let toSendAmountString = args["amount"] as? String, + let toSendAmount = UInt64(toSendAmountString), + let toSendTokenIdString = args["tokenId"] as? String, + let toSendTokenIdUInt = UInt64(toSendTokenIdString), + let rngSeedData: FlutterStandardTypedData = args["rngSeed"] as? FlutterStandardTypedData, + let shouldWriteRTHMemos = args["shouldWriteRTHMemos"] as? Bool, + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "DefragmentAccount", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let toSendTokenId = TokenId(toSendTokenIdUInt) + let amount = Amount(toSendAmount, in: toSendTokenId) + let rngSeed = RngSeed(rngSeedData.data) ?? RngSeed() + + client.prepareDefragmentationStepTransactions( + toSendAmount: amount, + recoverableMemo: shouldWriteRTHMemos, + rngSeed: rngSeed) + { (preperationResult: Result<[Transaction], DefragTransactionPreparationError>) in + switch preperationResult { + case .success(let stepTransactions): + client.submitDefragStepTransactions( + transactions: stepTransactions + ) { (defragResult: Result<[UInt64], SubmitTransactionError>) in + switch defragResult { + case .success(let blockIndexes): + DispatchQueue.main.async { + result(blockIndexes) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "DefragAccount.prepareDefragmentationStepTransactions")) + } + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "DefragAccount.prepareDefragmentationStepTransactions")) + } + } + } + } + + struct GetBalance: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let clientId: Int = args["id"] as? Int, + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "GetBalance", details: "parsing arguments")) + throw PluginError.invalidArguments + } + client.updateBalances { (balanceResult: Result) in + switch balanceResult { + case .success(let balances): + var resultJson: [String: Any] = [:] + for tokenId in balances.tokenIds { + let balance = balances.balances[tokenId] + resultJson[String(tokenId.value)] = String(balance?.amount() ?? 0) + } + let resultData = try! JSONSerialization.data(withJSONObject: resultJson, options: []) + let resultString = String(data: resultData, encoding: String.Encoding.ascii)! + + DispatchQueue.main.async { + result(resultString) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "GetBalance.updateBalance")) + } + } + } + } + + struct Contact: PublicAddressProvider, Hashable { + let name: String + let username: String + let publicAddress: PublicAddress + } + + struct GetAccountActivity: Command { + func assembleContacts(serializedPublicAddresses: [FlutterStandardTypedData]) -> Set { + var contacts = Set(); + + for serializedPublicAddress in serializedPublicAddresses { + guard let addressAsString: String = String(bytes: serializedPublicAddress.data, encoding: .utf8) else { continue } + guard case .publicAddress(let address) = Base58Coder.decode(addressAsString) else { continue } + + contacts.insert(Contact(name: "", username: "", publicAddress: address)) + } + + return contacts + } + + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let clientId: Int = args["id"] as? Int, + let publicAddresses = args["serializedPublicAddresses"] as? [FlutterStandardTypedData], + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "GetAccountActivity", details: "parsing arguments")) + throw PluginError.invalidArguments + } + let contacts = assembleContacts(serializedPublicAddresses: publicAddresses) + client.updateBalances { (balanceResult: Result) in + do { + switch balanceResult { + case .success(let balances): + var resultJson: [String: Any] = [:] + let activityDispatchGroup = DispatchGroup() + for tokenId in balances.tokenIds { + let activity = client.accountActivity(for: tokenId) + let txOuts = activity.txOuts + var jsonObject: [String: Any] = [:] + + let balance: UInt64 = balances.balances[tokenId]?.amount() ?? 0 + jsonObject["balance"] = String(balance) + jsonObject["blockCount"] = String(activity.blockCount) + activityDispatchGroup.enter() + client.amountTransferable(tokenId: tokenId) { (amountTransferableResult: Result) in + switch amountTransferableResult { + case .success(let amount): + jsonObject["transferableAmount"] = String(amount) + print ("transferableAmount = \(amount)") + case .failure(let error): + switch error { + case .feeExceedsBalance: + jsonObject["transferableAmount"] = String("0") + print ("transferableAmount = \(0)") + default: + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "amountTransferable")) + } + } + activityDispatchGroup.leave() + } + let recoveredTransactions = MobileCoinClient.recoverTransactions(txOuts, contacts: contacts) + + var jsonTxOuts:[[String: Any]] = [] + for transaction in recoveredTransactions { + let txOut = transaction.txOut + var jsonTxOut: [String: Any] = [:] + jsonTxOut["value"] = String(txOut.value) + jsonTxOut["receivedDate"] = txOut.receivedBlock.timestamp?.millisecondsSince1970 + jsonTxOut["publicKey"] = txOut.publicKey.base64EncodedString() + jsonTxOut["receivedBlock"] = String(txOut.receivedBlock.index) + jsonTxOut["keyImage"] = txOut.keyImage.base64EncodedString() + jsonTxOut["sharedSecret"] = txOut.sharedSecret.base64EncodedString() + + if let memo = transaction.memo { + jsonTxOut["theirAddressHashHex"] = memo.addressHashHex + + // Encode memo as JSON == [String:Any] + if let encoded = memo.toDictionary() { + jsonTxOut["memo"] = encoded + } + } + + // Unauthenticated memo's can be used w/o a matching contact/public-address + if let unauthenticatedMemo = transaction.unauthenticatedMemo, + let encoded = unauthenticatedMemo.toDictionary() { + // Encode memo as JSON == [String:Any] + // Will overwrite if already set which is ok for now. + jsonTxOut["memo"] = encoded + } + + + if txOut.spentBlock != nil { + jsonTxOut["spentBlock"] = String(txOut.spentBlock!.index) + + // spentBlockTimestamp is null when checking a spent TxOut before Fog Ledger knows it is spent + if (txOut.spentBlock!.timestamp != nil) { + jsonTxOut["spentDate"] = txOut.spentBlock!.timestamp?.millisecondsSince1970 + } + } + jsonTxOuts.append(jsonTxOut) + } + activityDispatchGroup.wait() + jsonObject["txOuts"] = jsonTxOuts + resultJson[String(tokenId.value)] = jsonObject + } + let jsonData = try JSONSerialization.data(withJSONObject: resultJson, options: []) + let jsonString = String(data: jsonData, encoding: String.Encoding.ascii)! + DispatchQueue.main.async { + result(jsonString) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "GetAccountActivity.serialize")) + } + } catch let error { + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "GetAccountActivity.updateBalance")) + } + } + } + } + + struct CheckTransactionStatus: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let mobileClientId: Int = args["id"] as? Int, + let receiptId: Int = args["receiptId"] as? Int else { + result(FlutterError(code: "NATIVE", message: "CheckTransactionStatus", details: "parsing arguments")) + throw PluginError.invalidArguments + } + guard let mobileCoinClient: MobileCoinClient = ObjectStorage.objectForKey(mobileClientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "CheckTransactionStatus", details: "retrieve client")) + throw PluginError.invalidArguments + } + + guard let transaction: Transaction = ObjectStorage.objectForKey(receiptId) as? Transaction else { + result(FlutterError(code: "NATIVE", message: "CheckTransactionStatus", details: "deserializing transaction")) + throw PluginError.invalidArguments + } + + mobileCoinClient.updateBalances { (balanceResult: Result) in + // more race condition testing will need to be done before changing this to `txOutStatus` + mobileCoinClient.status(of: transaction) { (statusResult: Result) in + switch statusResult { + case .success(let status): + switch status { + case .unknown: + result(0) + case .accepted(block: _): + result(1) + case .failed: + result(2) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "CheckTransactionStatus.updateBalance")) + } + } + } + } + } + + struct CreatePendingTransaction: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let mobileClientId: Int = args["id"] as? Int, + let recipientId: Int = args["recipient"] as? Int, + let feeString: String = args["fee"] as? String, + let rngSeed: FlutterStandardTypedData = args["rngSeed"] as? FlutterStandardTypedData, + let fee = UInt64(feeString), + let tokenIdString = args["tokenId"] as? String, + let tokenId = UInt64(tokenIdString), + let amountString: String = args["amount"] as? String, + let parsedAmount = UInt64(amountString) else { + result(FlutterError(code: "NATIVE", message: "CreatePendingTransaction", details: "parsing arguments")) + throw PluginError.invalidArguments + } + let amount = Amount(parsedAmount, in: TokenId(tokenId)) + let rng = MobileCoinChaCha20Rng(seed: rngSeed.data) + let memoType: MemoType = { + guard + let paymentRequestIdString = args["paymentRequestId"] as? String, + let paymentRequest = UInt64(paymentRequestIdString) + else { + return MemoType.recoverable + } + return MemoType.recoverablePaymentRequest(id: paymentRequest) + }() + + guard let recipient: PublicAddress = ObjectStorage.objectForKey(recipientId) as? PublicAddress, + let mobileCoinClient: MobileCoinClient = ObjectStorage.objectForKey(mobileClientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "CreatePendingTransaction", details: "retrieve client")) + throw PluginError.invalidArguments + } + mobileCoinClient.prepareTransaction(to: recipient, memoType: memoType, amount: amount, fee: fee, rng: rng) { + (pendingTx: Result) in + switch pendingTx { + case .success(let (pending)): + var returnPayload: [String: Any] = [:] + + returnPayload["transaction"] = FlutterStandardTypedData(bytes: pending.transaction.serializedData) + + let payloadTxOutPublicKey = pending.payloadTxOutContext.txOutPublicKey + let payloadTxOutSharedSecret = pending.payloadTxOutContext.sharedSecretBytes + let changeTxOutPublicKey = pending.changeTxOutContext.txOutPublicKey + let changeTxOutSharedSecret = pending.changeTxOutContext.sharedSecretBytes + + returnPayload["payloadTxOutPublicKey"] = payloadTxOutPublicKey.base64EncodedString() + returnPayload["payloadTxOutSharedSecret"] = payloadTxOutSharedSecret.base64EncodedString() + returnPayload["changeTxOutPublicKey"] = changeTxOutPublicKey.base64EncodedString() + returnPayload["changeTxOutSharedSecret"] = changeTxOutSharedSecret.base64EncodedString() + + result(returnPayload) + case .failure(let e): + result(FlutterError(code: "NATIVE", message: e.localizedDescription, details: "CreatePendingTransaction.prepareTransaction")) + } + } + } + } + + struct SendFunds: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let mobileClientId: Int = args["id"] as? Int, + let serializedTransaction: FlutterStandardTypedData = args["transaction"] as? FlutterStandardTypedData else { + result(FlutterError(code: "NATIVE", message: "SendFunds", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + guard let mobileCoinClient: MobileCoinClient = ObjectStorage.objectForKey(mobileClientId) as? MobileCoinClient else { + result(FlutterError(code: "NATIVE", message: "SendFunds", details: "retrieve client")) + throw PluginError.invalidArguments + } + + guard let transaction: Transaction = Transaction.init(serializedData: Data(serializedTransaction.data)) else { + result(FlutterError(code: "NATIVE", message: "SendFunds", details: "deserializing transaction")) + throw PluginError.invalidArguments + } + + let receiptId = transaction.hashValue + + ObjectStorage.addObject(transaction, forKey: receiptId); + + mobileCoinClient.submitTransaction(transaction: transaction) { (txResult: Result<(UInt64), SubmitTransactionError>) in + var jsonObject: [String: Any] = [:] + do { + switch txResult { + case .success(let blockIndex): + jsonObject["status"] = "OK" + jsonObject["blockIndex"] = blockIndex + jsonObject["receiptId"] = receiptId + case .failure(let error): + switch error.submissionError { + case .connectionError: + jsonObject["status"] = "CONNECTION_ERROR" + case .missingMemo: + jsonObject["status"] = "MISSING_MEMO" + case .feeError: + jsonObject["status"] = "FEE_ERROR" + case .invalidTransaction: + jsonObject["status"] = "INVALID_TRANSACTION" + case .tombstoneBlockTooFar: + jsonObject["status"] = "TOMBSTONE_BLOCK_TOO_FAR" + case .inputsAlreadySpent: + jsonObject["status"] = "INPUT_ALREADY_SPENT" + case .outputAlreadyExists(_): + jsonObject["status"] = "OUTPUT_ALREADY_EXISTS" + } + + jsonObject["blockIndex"] = error.consensusBlockCount + } + + let jsonData = try JSONSerialization.data(withJSONObject: jsonObject, options: []) + let jsonString = String(data: jsonData, encoding: String.Encoding.ascii)! + result(jsonString) + } catch let error { + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "SendFunds.json")) + } + } + } + } +} + +// From https://stackoverflow.com/a/40135192/1411004 +extension Date { + var millisecondsSince1970:Int64 { + Int64((self.timeIntervalSince1970 * 1000.0).rounded()) + } + + init(milliseconds:Int64) { + self = Date(timeIntervalSince1970: TimeInterval(milliseconds) / 1000) + } +} + +extension RecoveredMemo { + var addressHashHex: String { + switch self { + case let .senderWithPaymentRequest(memo): + return memo.addressHashHex + case let .senderWithPaymentIntent(memo): + return memo.addressHashHex + case let .sender(memo): + return memo.addressHashHex + case let .destinationWithPaymentRequest(memo): + return memo.addressHashHex + case let .destinationWithPaymentIntent(memo): + return memo.addressHashHex + case let .destination(memo): + return memo.addressHashHex + } + } +} + +extension RecoveredMemo { + func toDictionary() -> [String: Any]? { + let encoder = DictionaryEncoder() + let dictionary: Any = { + switch self { + case .sender(let memo): + return try? encoder.encode(memo) + case .senderWithPaymentRequest(let memo): + return try? encoder.encode(memo) + case .senderWithPaymentIntent(let memo): + return try? encoder.encode(memo) + case .destination(let memo): + return try? encoder.encode(memo) + case .destinationWithPaymentRequest(let memo): + return try? encoder.encode(memo) + case .destinationWithPaymentIntent(let memo): + return try? encoder.encode(memo) + } + }() + + return dictionary as? [String: Any] + } +} + +extension UnauthenticatedSenderMemo { + func toDictionary() -> [String: Any]? { + let encoder = DictionaryEncoder() + let dictionary: Any = { + switch self { + case .sender(let memo): + return try? encoder.encode(memo) + case .senderWithPaymentRequest(let memo): + return try? encoder.encode(memo) + case .senderWithPaymentIntent(let memo): + return try? encoder.encode(memo) + } + }() + + return dictionary as? [String: Any] + } +} + +class DictionaryEncoder { + private let jsonEncoder = JSONEncoder() + + /// Encodes given Encodable value into an array or dictionary + func encode(_ value: T) throws -> Any where T: Encodable { + let jsonData = try jsonEncoder.encode(value) + return try JSONSerialization.jsonObject(with: jsonData, options: .allowFragments) + } +} + +class DictionaryDecoder { + private let jsonDecoder = JSONDecoder() + + /// Decodes given Decodable type from given array or dictionary + func decode(_ type: T.Type, from json: Any) throws -> T where T: Decodable { + let jsonData = try JSONSerialization.data(withJSONObject: json, options: []) + return try jsonDecoder.decode(type, from: jsonData) + } +} + +public enum HexEncoding { + static func data(fromHexEncodedString hexEncodedString: String) -> Data? { + guard hexEncodedString.count.isMultiple(of: 2) else { return nil } + let byteStrings = hexEncodedString.chunked(maxLength: 2) + + let bytes = byteStrings.compactMap { UInt8($0, radix: 16) } + guard byteStrings.count == bytes.count else { return nil } + + return Data(bytes) + } + + private static let hexCharacters = Array("0123456789abcdef") + + static func hexEncodedString(fromData data: Data) -> String { + data.reduce(into: "") { result, byte in + result.append(Self.hexCharacters[Int(byte / 0x10)]) + result.append(Self.hexCharacters[Int(byte % 0x10)]) + } + } +} + +extension Collection { + func chunked(maxLength: Int) -> [SubSequence] { + var chunks: [SubSequence] = [] + var nextIndex = startIndex + while true { + let startIndex = nextIndex + _ = formIndex(&nextIndex, offsetBy: maxLength, limitedBy: endIndex) + guard distance(from: startIndex, to: endIndex) > 0 else { + break + } + chunks.append(self[startIndex ..< Swift.min(nextIndex, self.endIndex)]) + } + return chunks + } +} diff --git a/ios/Classes/FfiAccountKey.swift b/ios/Classes/FfiAccountKey.swift new file mode 100644 index 0000000..517e2d9 --- /dev/null +++ b/ios/Classes/FfiAccountKey.swift @@ -0,0 +1,39 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiAccountKey { + struct FromBip39Entropy: Command { + func execute(args: [String: Any], result: @escaping FlutterResult) throws { + guard let entropy = args["bip39Entropy"] as? FlutterStandardTypedData, + let fogReportUri: String = args["fogReportUri"] as? String, + let fogAuthoritySpki = args["fogAuthoritySpki"] as? FlutterStandardTypedData, + let reportId: String = args["reportId"] as? String else { + throw PluginError.invalidArguments + } + let accountKey = AccountKey.make(entropy: entropy.data, fogReportUrl: fogReportUri, fogReportId: reportId, fogAuthoritySpki: fogAuthoritySpki.data, accountIndex: 0) + switch accountKey { + case .success(let accountKey): + let hash = accountKey.hashValue + ObjectStorage.addObject(accountKey, forKey: hash) + result(hash) + case .failure(let error): + throw error + } + } + } + struct GetPublicAddress: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let addressId: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + let accountKey: AccountKey = ObjectStorage.objectForKey(addressId) as! AccountKey + let publicAddress: PublicAddress = accountKey.publicAddress + let hashCode = publicAddress.hashValue + ObjectStorage.addObject(publicAddress, forKey: hashCode) + result(hashCode) + } + } +} + diff --git a/ios/Classes/FfiCryptoBox.swift b/ios/Classes/FfiCryptoBox.swift new file mode 100644 index 0000000..e28d60b --- /dev/null +++ b/ios/Classes/FfiCryptoBox.swift @@ -0,0 +1,47 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiCryptoBox { + struct encrypt: Command { + func execute(args: [String: Any], result: @escaping FlutterResult) throws { + guard let data = args["data"] as? FlutterStandardTypedData, + let publicKeyId = args["publicKeyId"] as? Int else { + throw PluginError.invalidArguments + } + let publicKey: WrappedRistrettoPublic = ObjectStorage.objectForKey(publicKeyId) as! WrappedRistrettoPublic + let ciphertextResult = DefaultCryptoBox.encrypt( + plaintext: data.data, + publicKey: publicKey + ) + switch ciphertextResult { + case .success(let ciphertext): + result(ciphertext) + case .failure(let error): + throw error + } + } + } + + struct decrypt: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let ciphertext = args["data"] as? FlutterStandardTypedData, + let privateKeyId = args["privateKeyId"] as? Int else { + throw PluginError.invalidArguments + } + let privateKey: WrappedRistrettoPrivate = ObjectStorage.objectForKey(privateKeyId) as! WrappedRistrettoPrivate + let plaintextResult = try DefaultCryptoBox.decrypt( + ciphertext: ciphertext.data, + privateKey: privateKey + ) + switch plaintextResult { + case .success(let plaintext): + result(plaintext) + case .failure(let error): + throw error + } + } + } +} + diff --git a/ios/Classes/FfiMistySwap.swift b/ios/Classes/FfiMistySwap.swift new file mode 100644 index 0000000..5b23bf8 --- /dev/null +++ b/ios/Classes/FfiMistySwap.swift @@ -0,0 +1,112 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin +import LibMobileCoin + +struct FfiMistyswap { + struct InitiateOfframp: Command { + func execute(args: [String: Any], result: @escaping FlutterResult) throws { + guard + let bytes = args["initiateOfframpRequestBytes"] as? FlutterStandardTypedData, + let proto = try? MistyswapOfframp_InitiateOfframpRequest.init(serializedData: bytes.data), + let clientId: Int = args["mobileCoinClientId"] as? Int, + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient + else { + result(FlutterError(code: "NATIVE", message: "InitiateOfframp", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let mixinCredentialsJSON = proto.mixinCredentialsJson + let srcAssetID = proto.params.srcAssetID + let srcExpectedAmount = proto.params.srcExpectedAmount + let dstAssetID = proto.params.dstAssetID + let dstAddress = proto.params.dstAddress + let dstAddressTag = proto.params.dstAddressTag + let minDstReceivedAmount = proto.params.minDstReceivedAmount + let maxFeeAmountInDstTokens = proto.params.maxFeeAmountInDstTokens + + client.initiateOfframp( + mixinCredentialsJSON: mixinCredentialsJSON, + srcAssetID: srcAssetID, + srcExpectedAmount: srcExpectedAmount, + dstAssetID: dstAssetID, + dstAddress: dstAddress, + dstAddressTag: dstAddressTag, + minDstReceivedAmount: minDstReceivedAmount, + maxFeeAmountInDstTokens: maxFeeAmountInDstTokens + ) { (clientResult: Result) in + + switch clientResult { + case .success(let response): + DispatchQueue.main.async { + result(response) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "Mistyswap.initiateOfframp")) + } + } + } + } + + struct GetOfframpStatus: Command { + func execute(args: [String: Any], result: @escaping FlutterResult) throws { + guard + let bytes = args["getOfframpStatusRequestBytes"] as? FlutterStandardTypedData, + let proto = try? MistyswapOfframp_GetOfframpStatusRequest.init(serializedData: bytes.data), + let clientId: Int = args["mobileCoinClientId"] as? Int, + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient + else { + result(FlutterError(code: "NATIVE", message: "GetOfframpID", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let offrampID = proto.offrampID + + client.getOfframpStatus( + offrampID: offrampID + ) { (clientResult: Result) in + + switch clientResult { + case .success(let response): + DispatchQueue.main.async { + result(response) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "Mistyswap.getOfframpStatus")) + } + } + } + } + + struct ForgetOfframp: Command { + func execute(args: [String: Any], result: @escaping FlutterResult) throws { + guard + let bytes = args["forgetOfframpRequestBytes"] as? FlutterStandardTypedData, + let proto = try? MistyswapOfframp_ForgetOfframpRequest.init(serializedData: bytes.data), + let clientId: Int = args["mobileCoinClientId"] as? Int, + let client = ObjectStorage.objectForKey(clientId) as? MobileCoinClient + else { + result(FlutterError(code: "NATIVE", message: "ForgetOfframp", details: "parsing arguments")) + throw PluginError.invalidArguments + } + + let offrampID = proto.offrampID + + client.forgetOfframp( + offrampID: offrampID + ) { (clientResult: Result) in + + switch clientResult { + case .success(let response): + DispatchQueue.main.async { + result(response) + } + case .failure(let error): + result(FlutterError(code: "NATIVE", message: error.localizedDescription, details: "Mistyswap.forgetOfframpStatus")) + } + } + } + } +} + diff --git a/ios/Classes/FfiMnemonic.swift b/ios/Classes/FfiMnemonic.swift new file mode 100644 index 0000000..7bb1893 --- /dev/null +++ b/ios/Classes/FfiMnemonic.swift @@ -0,0 +1,40 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiMnemonic { + struct FromBip39Entropy: Command { + func execute(args: [String: Any], result: @escaping FlutterResult) throws { + let entropy = args["bip39Entropy"] as! FlutterStandardTypedData; + let mnemonicPhrase = Mnemonic.mnemonic(fromEntropy: entropy.data) + switch mnemonicPhrase { + case .success(let mnemonicPhrase): + result(mnemonicPhrase) + case .failure(let error): + throw error + } + } + } + + struct ToBip39Entropy: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + let mnemonicPhrase = args["mnemonicPhrase"] as! String; + let entropy = Mnemonic.entropy(fromMnemonic: mnemonicPhrase) + switch entropy { + case .success(let entropy): + result(entropy) + case .failure(let error): + throw error + } + } + } + + struct AllWords: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + result(Mnemonic.allWords.joined(separator: ",")) + } + } + +} + diff --git a/ios/Classes/FfiPaymentRequest.swift b/ios/Classes/FfiPaymentRequest.swift new file mode 100644 index 0000000..4aae496 --- /dev/null +++ b/ios/Classes/FfiPaymentRequest.swift @@ -0,0 +1,70 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiPaymentRequest { + + struct Create: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let publicAddressId: Int = args["publicAddressId"] as? Int, + let tokenIdString = args["tokenId"] as? String, + let tokenID = UInt64(tokenIdString), + let publicAddress = ObjectStorage.objectForKey(publicAddressId) as? PublicAddress else { + throw PluginError.invalidArguments + } + let memo: String? = args["memo"] as? String + let amount: String? = args["amount"] as? String + let value: UInt64? = amount != nil ? UInt64(amount!) : nil + let paymentRequest = PaymentRequest(publicAddress: publicAddress, value:value, memo: memo, tokenID: tokenID); + let hashCode = paymentRequest.hashValue + ObjectStorage.addObject(paymentRequest, forKey: hashCode) + result(hashCode) + } + } + + struct GetMemo: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let paymentRequestId: Int = args["id"] as? Int, + let paymentRequest = ObjectStorage.objectForKey(paymentRequestId) as? PaymentRequest else { + throw PluginError.invalidArguments + } + result(paymentRequest.memo) + } + } + + struct GetValue: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let paymentRequestId: Int = args["id"] as? Int, + let paymentRequest = ObjectStorage.objectForKey(paymentRequestId) as? PaymentRequest else { + throw PluginError.invalidArguments + } + result(String(paymentRequest.value ?? 0)) + } + } + + struct GetTokenId: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let paymentRequestId: Int = args["id"] as? Int, + let paymentRequest = ObjectStorage.objectForKey(paymentRequestId) as? PaymentRequest else { + throw PluginError.invalidArguments + } + result(String(paymentRequest.tokenID)) + } + } + + struct GetPublicAddress: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let paymentRequestId: Int = args["id"] as? Int, + let paymentRequest = ObjectStorage.objectForKey(paymentRequestId) as? PaymentRequest else { + throw PluginError.invalidArguments + } + let hashCode = paymentRequest.publicAddress.hashValue + if (ObjectStorage.objectForKey(hashCode) == nil) { + ObjectStorage.addObject(paymentRequest.publicAddress, forKey: hashCode) + } + result(hashCode) + } + } +} + diff --git a/ios/Classes/FfiPrintableWrapper.swift b/ios/Classes/FfiPrintableWrapper.swift new file mode 100644 index 0000000..2011914 --- /dev/null +++ b/ios/Classes/FfiPrintableWrapper.swift @@ -0,0 +1,154 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiPrintableWrapper{ + struct FromB58String: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let b58String: String = args["b58String"] as? String else { + throw PluginError.invalidArguments + } + let decoded = Base58Coder.decode(b58String) + switch decoded { + case .publicAddress(let publicAddress): + let hashCode: Int = publicAddress.hashValue + ObjectStorage.addObject(publicAddress, forKey: hashCode) + result(hashCode) + break; + case .transferPayload(let transferPayload): + let hashCode: Int = transferPayload.hashValue + ObjectStorage.addObject(transferPayload, forKey: hashCode) + result(hashCode) + break; + case .paymentRequest(let paymentRequest): + let hashCode: Int = paymentRequest.hashValue + ObjectStorage.addObject(paymentRequest, forKey: hashCode) + result(hashCode) + break; + default: + throw PluginError.unimplemented + } + } + } + struct ToB58String: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int, + let obj = ObjectStorage.objectForKey(id) else { + throw PluginError.invalidArguments + } + if let publicAddress = obj as? PublicAddress { + let b58String = Base58Coder.encode(publicAddress) + result(b58String) + } else if let transferPayload = obj as? TransferPayload { + let b58String = Base58Coder.encode(transferPayload) + result(b58String) + } else if let paymentRequest = obj as? PaymentRequest { + let b58String = Base58Coder.encode(paymentRequest) + result(b58String) + } else { + throw PluginError.unimplemented + } + } + } + struct FromPublicAddress: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + if let id: Int = args["id"] as? Int { + result(id) + } else { + throw PluginError.invalidArguments + } + + } + } + struct HasPublicAddress: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + if let _ = ObjectStorage.objectForKey(id) as? PublicAddress { + result(true) + } else { + result(false) + } + } + } + struct GetPublicAddress: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + if let _ = ObjectStorage.objectForKey(id) as? PublicAddress { + result(id) + } else { + throw PluginError.notFound + } + } + } + struct FromTransferPayload: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + result(id) + } + } + struct HasTransferPayload: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + if let _ = ObjectStorage.objectForKey(id) as? TransferPayload { + result(true) + } else { + result(false) + } + } + } + struct GetTransferPayload: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + if let _ = ObjectStorage.objectForKey(id) as? TransferPayload { + result(id) + } else { + throw PluginError.notFound + } + } + } + struct FromPaymentRequest: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + result(id) + } + } + struct HasPaymentRequest: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + if let _ = ObjectStorage.objectForKey(id) as? PaymentRequest { + result(true) + } else { + result(false) + } + } + } + struct GetPaymentRequest: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let id: Int = args["id"] as? Int else { + throw PluginError.invalidArguments + } + if let _ = ObjectStorage.objectForKey(id) as? PaymentRequest { + result(id) + } else { + throw PluginError.notFound + } + } + } +} + + diff --git a/ios/Classes/FfiTransferPayload.swift b/ios/Classes/FfiTransferPayload.swift new file mode 100644 index 0000000..6c4be55 --- /dev/null +++ b/ios/Classes/FfiTransferPayload.swift @@ -0,0 +1,38 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiTransferPayload { + + struct GetBip39Entropy: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let payloadId: Int = args["id"] as? Int, + let transferPayload = ObjectStorage.objectForKey(payloadId) as? TransferPayload else { + throw PluginError.invalidArguments + } + result(transferPayload.bip39) + } + } + + struct GetMemo: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let payloadId: Int = args["id"] as? Int, + let transferPayload = ObjectStorage.objectForKey(payloadId) as? TransferPayload else { + throw PluginError.invalidArguments + } + result(transferPayload.memo) + } + } + + struct GetPublicKey: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let payloadId: Int = args["id"] as? Int, + let transferPayload = ObjectStorage.objectForKey(payloadId) as? TransferPayload else { + throw PluginError.invalidArguments + } + let hashCode = transferPayload.hashValue + result(hashCode) + } + } +} diff --git a/ios/Classes/MobileCoinFlutterPlugin.h b/ios/Classes/MobileCoinFlutterPlugin.h new file mode 100644 index 0000000..bdec877 --- /dev/null +++ b/ios/Classes/MobileCoinFlutterPlugin.h @@ -0,0 +1,6 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +#import + +@interface MobileCoinFlutterPlugin : NSObject +@end diff --git a/ios/Classes/MobileCoinFlutterPlugin.m b/ios/Classes/MobileCoinFlutterPlugin.m new file mode 100644 index 0000000..38e047b --- /dev/null +++ b/ios/Classes/MobileCoinFlutterPlugin.m @@ -0,0 +1,17 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +#import "MobileCoinFlutterPlugin.h" +#if __has_include() +#import +#else +// Support project import fallback if the generated compatibility header +// is not copied when this plugin is created as a library. +// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 +#import "mobilecoin_flutter-Swift.h" +#endif + +@implementation MobileCoinFlutterPlugin ++ (void)registerWithRegistrar:(NSObject*)registrar { + [SwiftMobileCoinPlugin registerWithRegistrar:registrar]; +} +@end diff --git a/ios/Classes/PublicAddress.swift b/ios/Classes/PublicAddress.swift new file mode 100644 index 0000000..dee9264 --- /dev/null +++ b/ios/Classes/PublicAddress.swift @@ -0,0 +1,41 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiPublicAddress { + struct FromBytes: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let serializedBytes = args["serializedBytes"] as? FlutterStandardTypedData else { + throw PluginError.invalidArguments + } + if let publicAddress: PublicAddress = PublicAddress(serializedData: serializedBytes.data) { + let hashCode: Int = publicAddress.hashValue + ObjectStorage.addObject(publicAddress, forKey: hashCode) + result(hashCode) + } else { + result(FlutterError(code: "NATIVE", message: "Unable to create a PublicAddress from the provided data", details: nil)) + } + } + } + struct ToByteArray: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let addressId: Int = args["id"] as? Int, + let publicAddress: PublicAddress = ObjectStorage.objectForKey(addressId) as? PublicAddress else { + throw PluginError.invalidArguments + } + result(publicAddress.serializedData) + } + } + struct GetAddressHash: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let addressId: Int = args["id"] as? Int, + let publicAddress: PublicAddress = ObjectStorage.objectForKey(addressId) as? PublicAddress else { + throw PluginError.invalidArguments + } + result(publicAddress.addressHash) + } + } +} + + diff --git a/ios/Classes/RistrettoPrivate.swift b/ios/Classes/RistrettoPrivate.swift new file mode 100644 index 0000000..85aee93 --- /dev/null +++ b/ios/Classes/RistrettoPrivate.swift @@ -0,0 +1,32 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiRistrettoPrivate { + struct FromBytes: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let serializedBytes = args["serializedBytes"] as? FlutterStandardTypedData else { + throw PluginError.invalidArguments + } + if let privateKey: WrappedRistrettoPrivate = WrappedRistrettoPrivate(serializedBytes.data) { + let hashCode: Int = privateKey.hashValue + ObjectStorage.addObject(privateKey, forKey: hashCode) + result(hashCode) + } else { + result(FlutterError(code: "NATIVE", message: "Unable to create a WrappedRistrettoPrivate from the provided data", details: nil)) + } + } + } + struct ToByteArray: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let addressId: Int = args["id"] as? Int, + let privateKey: WrappedRistrettoPrivate = ObjectStorage.objectForKey(addressId) as? WrappedRistrettoPrivate else { + throw PluginError.invalidArguments + } + result(privateKey.data) + } + } +} + + diff --git a/ios/Classes/RistrettoPublic.swift b/ios/Classes/RistrettoPublic.swift new file mode 100644 index 0000000..eb0a5c4 --- /dev/null +++ b/ios/Classes/RistrettoPublic.swift @@ -0,0 +1,32 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Foundation +import MobileCoin + +struct FfiRistrettoPublic { + struct FromBytes: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let serializedBytes = args["serializedBytes"] as? FlutterStandardTypedData else { + throw PluginError.invalidArguments + } + if let privateKey: WrappedRistrettoPublic = WrappedRistrettoPublic(serializedBytes.data) { + let hashCode: Int = privateKey.hashValue + ObjectStorage.addObject(privateKey, forKey: hashCode) + result(hashCode) + } else { + result(FlutterError(code: "NATIVE", message: "Unable to create a WrappedRistrettoPublic from the provided data", details: nil)) + } + } + } + struct ToByteArray: Command { + func execute(args: [String : Any], result: @escaping FlutterResult) throws { + guard let addressId: Int = args["id"] as? Int, + let privateKey: WrappedRistrettoPublic = ObjectStorage.objectForKey(addressId) as? WrappedRistrettoPublic else { + throw PluginError.invalidArguments + } + result(privateKey.data) + } + } +} + + diff --git a/ios/Classes/SwiftMobileCoinPlugin.swift b/ios/Classes/SwiftMobileCoinPlugin.swift new file mode 100644 index 0000000..20cb85e --- /dev/null +++ b/ios/Classes/SwiftMobileCoinPlugin.swift @@ -0,0 +1,169 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import Flutter +import UIKit +import MobileCoin + +enum PluginError: Error { + case invalidArguments + case invalidCall + case notFound + case unimplemented +} + +protocol Command { + func execute(args: [String: Any], result: @escaping FlutterResult) throws +} + +class CommandFactory { + class func commandForCall(_ method: String) throws -> Command { + switch method { + case "AccountKey#fromBip39Entropy": + return FfiAccountKey.FromBip39Entropy() + case "AccountKey#getPublicAddress": + return FfiAccountKey.GetPublicAddress() + case "ClientConfig#create": + return FfiClientConfig.Create() + case "ClientConfig#addServiceConfig": + return FfiClientConfig.AddServiceConfig() + + case "AttestedMistySwapClient#initiateOfframp": + return FfiMistyswap.InitiateOfframp(); + case "AttestedMistySwapClient#getOfframpStatus": + return FfiMistyswap.GetOfframpStatus(); + case "AttestedMistySwapClient#forgetOfframp": + return FfiMistyswap.ForgetOfframp(); + + case "MobileCoinClient#create": + return FfiMobileCoinClient.Create() + case "MobileCoinClient#requiresDefragmentation": + return FfiMobileCoinClient.RequiresDefragmentation() + case "MobileCoinClient#estimateTotalFee": + return FfiMobileCoinClient.EstimateTotalFee() + case "MobileCoinClient#defragmentAccount": + return FfiMobileCoinClient.DefragmentAccount() + case "MobileCoinClient#getBalance": + return FfiMobileCoinClient.GetBalance() + case "MobileCoinClient#getAccountActivity": + return FfiMobileCoinClient.GetAccountActivity() + case "MobileCoinClient#setAuthorization": + return FfiMobileCoinClient.SetAuthorization() + case "MobileCoinClient#createPendingTransaction": + return FfiMobileCoinClient.CreatePendingTransaction() + case "MobileCoinClient#sendFunds": + return FfiMobileCoinClient.SendFunds() + case "MobileCoinClient#checkTransactionStatus": + return FfiMobileCoinClient.CheckTransactionStatus() + case "MobileCoinClient#getTransferableAmount": + return FfiMobileCoinClient.GetTransferableAmount(); + + case "RistrettoPublic#fromBytes": + return FfiRistrettoPublic.FromBytes() + case "RistrettoPublic#toByteArray": + return FfiRistrettoPublic.ToByteArray() + + case "RistrettoPrivate#fromBytes": + return FfiRistrettoPrivate.FromBytes() + case "RistrettoPrivate#toByteArray": + return FfiRistrettoPrivate.ToByteArray() + + case "PublicAddress#fromBytes": + return FfiPublicAddress.FromBytes() + case "PublicAddress#toByteArray": + return FfiPublicAddress.ToByteArray() + case "PublicAddress#getAddressHash": + return FfiPublicAddress.GetAddressHash() + case "PrintableWrapper#toB58String": + return FfiPrintableWrapper.ToB58String() + case "PrintableWrapper#fromB58String": + return FfiPrintableWrapper.FromB58String() + case "PrintableWrapper#fromPublicAddress": + return FfiPrintableWrapper.FromPublicAddress() + case "PrintableWrapper#getPublicAddress": + return FfiPrintableWrapper.GetPublicAddress() + case "PrintableWrapper#hasPublicAddress": + return FfiPrintableWrapper.HasPublicAddress() + case "PrintableWrapper#fromTransferPayload": + return FfiPrintableWrapper.FromTransferPayload() + case "PrintableWrapper#getTransferPayload": + return FfiPrintableWrapper.GetTransferPayload() + case "PrintableWrapper#hasTransferPayload": + return FfiPrintableWrapper.HasTransferPayload() + case "PrintableWrapper#fromPaymentRequest": + return FfiPrintableWrapper.FromPaymentRequest() + case "PrintableWrapper#getPaymentRequest": + return FfiPrintableWrapper.GetPaymentRequest() + case "PrintableWrapper#hasPaymentRequest": + return FfiPrintableWrapper.HasPaymentRequest() + case "TransferPayload#getBip39Entropy": + return FfiTransferPayload.GetBip39Entropy() + case "TransferPayload#getMemo": + return FfiTransferPayload.GetMemo() + case "TransferPayload#getPublicKey": + return FfiTransferPayload.GetPublicKey() + case "PaymentRequest#create": + return FfiPaymentRequest.Create() + case "PaymentRequest#getMemo": + return FfiPaymentRequest.GetMemo() + case "PaymentRequest#getValue": + return FfiPaymentRequest.GetValue() + case "PaymentRequest#getTokenId": + return FfiPaymentRequest.GetTokenId() + case "PaymentRequest#getPublicAddress": + return FfiPaymentRequest.GetPublicAddress() + case "Mnemonic#fromBip39Entropy": + return FfiMnemonic.FromBip39Entropy() + case "Mnemonic#toBip39Entropy": + return FfiMnemonic.ToBip39Entropy() + case "Mnemonic#allWords": + return FfiMnemonic.AllWords() + case "CryptoBox#encrypt": + return FfiCryptoBox.encrypt() + case "CryptoBox#decrypt": + return FfiCryptoBox.decrypt() + default: + throw PluginError.invalidCall + } + } +} + +struct ObjectStorage { + private static var managedObjects = [Int: Any]() + private static let lockQueue = DispatchQueue(label: "com.mobilecoin.plugin", attributes: .concurrent) + + static func objectForKey(_ key: Int) -> Any? { + return lockQueue.sync { + managedObjects[key] + } + } + + static func addObject(_ obj: Any, forKey key: Int) { + lockQueue.sync(flags: .barrier) { + managedObjects[key] = obj + } + } +} + +public class SwiftMobileCoinPlugin: NSObject, FlutterPlugin { + + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "mobilecoin_flutter", binaryMessenger: registrar.messenger()) + let instance = SwiftMobileCoinPlugin() + registrar.addMethodCallDelegate(instance, channel: channel) + } + + private func executeNativeMethodCall(_ call: FlutterMethodCall, result: @escaping FlutterResult) throws { + let args = call.arguments as! [String: Any] + let command = try CommandFactory.commandForCall(call.method) + try command.execute(args: args, result: result) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + do { + try executeNativeMethodCall(call, result:result) + } catch { + result(FlutterError.init(code:"NATIVE", message:error.localizedDescription, details: nil)) + } + } +} + diff --git a/ios/mobilecoin_flutter.podspec b/ios/mobilecoin_flutter.podspec new file mode 100644 index 0000000..70b7b22 --- /dev/null +++ b/ios/mobilecoin_flutter.podspec @@ -0,0 +1,27 @@ +# Copyright (c) 2021-2024 MobileCoin. All rights reserved. +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint mobilecoin.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'mobilecoin_flutter' + s.version = '0.2.1' + s.summary = 'A new flutter plugin project.' + s.description = <<-DESC +A new flutter plugin project. + DESC + s.homepage = 'http://mobilecoin.com' + s.license = { :file => '../LICENSE' } + s.author = { 'MobileCoin' => 'hello@mobilecoin.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'Flutter' + + s.dependency 'MobileCoin/Core', '~> 6.0.0' + s.platform = :ios, '11.0' + + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386', 'EXCLUDED_ARCHS[sdk=iphoneos*]' => 'armv7' } + s.swift_version = '5.0' +end + diff --git a/lib/mobilecoin_flutter.dart b/lib/mobilecoin_flutter.dart new file mode 100644 index 0000000..e3a914a --- /dev/null +++ b/lib/mobilecoin_flutter.dart @@ -0,0 +1,41 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +export 'package:mobilecoin_flutter/src/account_key.dart'; +export 'package:mobilecoin_flutter/src/attestation/client_config.dart'; +export 'package:mobilecoin_flutter/src/attestation/service_config.dart'; +export 'package:mobilecoin_flutter/src/mobilecoin_client.dart'; +export 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +export 'package:mobilecoin_flutter/src/printable_wrapper.dart'; +export 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_common.pb.dart' + show GetInfoResponse; +export 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_offramp.pb.dart' + show + InitiateOfframpRequest, + InitiateOfframpResponse, + OfframpResult, + OfframpResultCode, + OfframpState, + Offramp, + ForgetOfframpRequest, + ForgetOfframpResponse, + GetOfframpStatusRequest, + GetOfframpStatusResponse, + GetOfframpDebugInfoRequest, + GetOfframpDebugInfoResponse; +export 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_offramp.pbenum.dart' + show OfframpResultCode; +export 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_offramp.pbgrpc.dart' + show OfframpParams; +export 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_onramp.pb.dart' + show + SetupOnrampRequest, + SetupOnrampResponse, + ForgetOnrampRequest, + ForgetOnrampResponse, + GetOnrampStatusRequest, + GetOnrampStatusResponse, + GetOnrampDebugInfoRequest, + GetOnrampDebugInfoResponse; +export 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_onramp.pbenum.dart' + show OnrampResultCode, OnrampState; +export 'package:mobilecoin_flutter/src/public_address.dart'; diff --git a/lib/src/account_key.dart b/lib/src/account_key.dart new file mode 100644 index 0000000..f151838 --- /dev/null +++ b/lib/src/account_key.dart @@ -0,0 +1,54 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'dart:typed_data'; + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; +import 'package:mobilecoin_flutter/src/public_address.dart'; + +class AccountKey extends PlatformObject { + PublicAddress? _publicAddress; + Uint8List bip39Entropy; + Uint8List fogAuthoritySpki; + String fogReportUri; + String reportId; + + AccountKey( + int objectId, + this.bip39Entropy, + this.fogReportUri, + this.fogAuthoritySpki, + this.reportId, + ) : super(id: objectId); + + static Future fromBip39Entropy( + Uint8List entropy, + String fogReportUri, { + required Uint8List fogAuthoritySpki, + required String reportId, + }) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .getAccountKeyFromBip39Entropy( + entropy: entropy, + fogReportUri: fogReportUri, + fogAuthoritySpki: fogAuthoritySpki, + reportId: reportId, + ); + return AccountKey( + objectId, + entropy, + fogReportUri, + fogAuthoritySpki, + reportId, + ); + } + + Future getPublicAddress() async { + if (null == _publicAddress) { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .getAccountKeyPublicAddress(accountKeyId: id); + _publicAddress = PublicAddress(objectId); + } + return _publicAddress!; + } +} diff --git a/lib/src/attestation/client_config.dart b/lib/src/attestation/client_config.dart new file mode 100644 index 0000000..cfa42a6 --- /dev/null +++ b/lib/src/attestation/client_config.dart @@ -0,0 +1,23 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:mobilecoin_flutter/src/attestation/service_config.dart'; +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; + +class ClientConfig extends PlatformObject { + ClientConfig(int objectId) : super(id: objectId); + static Future fromServiceConfigs( + List configs, + ) async { + final objectId = + await MobileCoinFlutterPluginChannelApi.instance.createClientConfig(); + for (final config in configs) { + await MobileCoinFlutterPluginChannelApi.instance.addServiceConfig( + objectId, + config, + ); + } + + return ClientConfig(objectId); + } +} diff --git a/lib/src/attestation/service_config.dart b/lib/src/attestation/service_config.dart new file mode 100644 index 0000000..72bf821 --- /dev/null +++ b/lib/src/attestation/service_config.dart @@ -0,0 +1,70 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:equatable/equatable.dart'; +import 'package:meta/meta.dart'; + +@immutable +class ServiceConfig extends Equatable { + const ServiceConfig({ + required this.fogViewMrEnclave, + required this.fogLedgerMrEnclave, + required this.fogReportMrEnclave, + required this.consensusMrEnclave, + required this.hardeningAdvisories, + this.mistyswapMrEnclave, + }); + final String fogViewMrEnclave; + final String fogLedgerMrEnclave; + final String fogReportMrEnclave; + final String consensusMrEnclave; + final String? mistyswapMrEnclave; + final List hardeningAdvisories; + + static const String fogViewMrEnclaveKey = 'fogViewMrEnclave'; + static const String fogLedgerMrEnclaveKey = 'fogLedgerMrEnclave'; + static const String fogReportMrEnclaveKey = 'fogReportMrEnclave'; + static const String consensusMrEnclaveKey = 'consensusMrEnclave'; + static const String mistyswapMrEnclaveKey = 'mistyswapMrEnclave'; + static const String hardeningAdvisoriesKey = 'hardeningAdvisories'; + + static ServiceConfig fromJson(Map json) { + return ServiceConfig( + fogViewMrEnclave: json[fogViewMrEnclaveKey] as String, + fogLedgerMrEnclave: json[fogLedgerMrEnclaveKey] as String, + fogReportMrEnclave: json[fogReportMrEnclaveKey] as String, + consensusMrEnclave: json[consensusMrEnclaveKey] as String, + hardeningAdvisories: json[hardeningAdvisoriesKey] as List, + mistyswapMrEnclave: json[mistyswapMrEnclaveKey] as String?, + ); + } + + Map get toJson { + if (mistyswapMrEnclave != null) { + return { + fogViewMrEnclaveKey: fogViewMrEnclave, + fogLedgerMrEnclaveKey: fogLedgerMrEnclave, + fogReportMrEnclaveKey: fogReportMrEnclave, + consensusMrEnclaveKey: consensusMrEnclave, + hardeningAdvisoriesKey: hardeningAdvisories, + mistyswapMrEnclaveKey: mistyswapMrEnclave, + }; + } else { + return { + fogViewMrEnclaveKey: fogViewMrEnclave, + fogLedgerMrEnclaveKey: fogLedgerMrEnclave, + fogReportMrEnclaveKey: fogReportMrEnclave, + consensusMrEnclaveKey: consensusMrEnclave, + hardeningAdvisoriesKey: hardeningAdvisories, + }; + } + } + + @override + List get props => [ + fogViewMrEnclave, + fogLedgerMrEnclave, + fogReportMrEnclave, + consensusMrEnclave, + mistyswapMrEnclave, + ]; +} diff --git a/lib/src/crypto_box.dart b/lib/src/crypto_box.dart new file mode 100644 index 0000000..417167d --- /dev/null +++ b/lib/src/crypto_box.dart @@ -0,0 +1,32 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'dart:typed_data'; + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; +import 'package:mobilecoin_flutter/src/ristretto_private.dart'; +import 'package:mobilecoin_flutter/src/ristretto_public.dart'; + +class CryptoBox extends PlatformObject { + CryptoBox(int objectId) : super(id: objectId); + + static Future encrypt({ + required RistrettoPublic publicKey, + required Uint8List data, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance.cryptoBoxEncrypt( + publicKey: publicKey, + data: data, + ); + } + + static Future decrypt({ + required RistrettoPrivate privateKey, + required Uint8List data, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance.cryptoBoxDecrypt( + privateKey: privateKey, + data: data, + ); + } +} diff --git a/lib/src/mobilecoin_client.dart b/lib/src/mobilecoin_client.dart new file mode 100644 index 0000000..681581b --- /dev/null +++ b/lib/src/mobilecoin_client.dart @@ -0,0 +1,202 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'dart:async'; +import 'dart:typed_data'; + +import 'package:mobilecoin_flutter/src/account_key.dart'; +import 'package:mobilecoin_flutter/src/attestation/client_config.dart'; +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; +import 'package:mobilecoin_flutter/src/public_address.dart'; +import 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_offramp.pb.dart'; + +class MobileCoinFlutterClient extends PlatformObject { + final AccountKey accountKey; + + MobileCoinFlutterClient(this.accountKey, int objectId) : super(id: objectId); + + static Future create( + AccountKey accountKey, + String fogUrl, + String consensusUrl, + bool useTestNet, + ClientConfig attestClientConfig, [ + String? mistyswapUrl, + ]) async { + final objectId = + await MobileCoinFlutterPluginChannelApi.instance.createMobileCoinClient( + accountKey: accountKey, + fogUrl: fogUrl, + consensusUrl: consensusUrl, + useTestNet: useTestNet, + attestClientConfig: attestClientConfig, + mistyswapUrl: mistyswapUrl, + ); + return MobileCoinFlutterClient(accountKey, objectId); + } + + Future> createPendingTransaction( + PublicAddress recipient, + BigInt amount, + BigInt fee, + BigInt tokenId, + String rngSeed, + BigInt paymentRequestId, + ) async { + return await MobileCoinFlutterPluginChannelApi.instance + .createPendingTransaction( + mobileClientId: id, + recipientId: recipient.id, + fee: fee, + amount: amount, + tokenId: tokenId, + rngSeed: rngSeed, + paymentRequestId: paymentRequestId, + ); + } + + Future sendFunds(Uint8List serializedTransaction) async { + return await MobileCoinFlutterPluginChannelApi.instance.sendFunds( + mobileClientId: id, + serializedTransaction: serializedTransaction, + ); + } + + Future checkTransactionStatus(int receiptId) async { + final result = + await MobileCoinFlutterPluginChannelApi.instance.checkTransactionStatus( + mobileClientId: id, + receiptId: receiptId, + ); + return result; + } + + Future getBalance() async { + return await MobileCoinFlutterPluginChannelApi.instance + .getBalance(mobileCoinClientId: id); + } + + /// Gets activity associated with the current client as a JSON string. + /// + /// [serializedKnownPublicAddresses] used for reading RTH memos. + /// When supplied, it returns hashed public addresses of a transaction's + /// opposite party, which mitigates strangers looking up addresses that + /// they don't have the hash of. + /// The best way to supply it is with [PublicAddress.toByteArray]. + /// Because of the async nature of that call, the consumer will likely + /// want to cache those serialized addresses. + Future getAccountActivity( + List serializedKnownPublicAddresses, + ) async { + return await MobileCoinFlutterPluginChannelApi.instance.getAccountActivity( + mobileCoinClientId: id, + serializedKnownPublicAddresses: serializedKnownPublicAddresses, + ); + } + + /// Set the basic HTTP authorization username and password for future requests. + Future setAuthorization({ + required String username, + required String password, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance.setAuthorization( + mobileClientId: id, + username: username, + password: password, + ); + } + + /// Returns whether or not MobileCoin client can send a specified amount + /// without account defragmentation + Future requiresDefragmentation(BigInt tokenId, BigInt amount) async { + return await MobileCoinFlutterPluginChannelApi.instance + .accountRequiresDefragmentation( + mobileCoinClientId: id, + amount: amount, + tokenId: tokenId, + ); + } + + /// Defragments the user's account. + /// + /// An account needs to be defragmented when an account balance consists + /// of multiple coins and there are no big enough coins to successfully + /// send the transaction. + /// If the account is too fragmented, it might be necessary to defragment + /// the account more than once. However, wallet fragmentation is a + /// rare occurrence since there is an internal mechanism to defragment + /// the account during other operations. + /// + /// `shouldWriteRTHMemos` writes sender and destination memos for a defrag + /// transaction if true. + Future defragmentAccount({ + required BigInt tokenId, + required BigInt amount, + bool? shouldWriteRTHMemos = true, + String? rngSeed, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance.defragmentAccount( + mobileCoinClientId: id, + amount: amount, + tokenId: tokenId, + shouldWriteRTHMemos: shouldWriteRTHMemos!, + rngSeed: rngSeed, + ); + } + + /// Estimates the minimum fee required to send a transaction with the + /// specified amount. Includes defragmentation fees. + Future estimateTotalFee({ + required BigInt tokenId, + required BigInt amount, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance.estimateTotalFee( + mobileCoinClientId: id, + amount: amount, + tokenId: tokenId, + ); + } + + /// Calculate the total transferable amount excluding all the required + /// fees for such transfer. + Future getTransferableAmount({required BigInt tokenId}) { + return MobileCoinFlutterPluginChannelApi.instance + .getTransferableAmount(mobileCoinClientId: id, tokenId: tokenId); + } + + /// Initiates a Mistyswap offramp request + /// + Future attestedMistySwapClientInitiateOfframp({ + required InitiateOfframpRequest request, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance + .attestedMistySwapClientInitiateOfframp( + mobileCoinClientId: id, + initiateOfframpRequest: request, + ); + } + + /// Gets status for a Mistyswap offramp request + /// + Future attestedMistySwapClientGetOfframpStatus({ + required GetOfframpStatusRequest request, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance + .attestedMistySwapClientGetOfframpStatus( + mobileCoinClientId: id, + getOfframpStatusRequest: request, + ); + } + + /// Forgets a Mistyswap offramp request + /// + Future attestedMistySwapClientForgetOfframp({ + required ForgetOfframpRequest forgetOfframpRequest, + }) async { + return await MobileCoinFlutterPluginChannelApi.instance + .attestedMistySwapClientForgetOfframp( + mobileCoinClientId: id, + forgetOfframpRequest: forgetOfframpRequest, + ); + } +} diff --git a/lib/src/mobilecoin_flutter_plugin_channel_api.dart b/lib/src/mobilecoin_flutter_plugin_channel_api.dart new file mode 100644 index 0000000..6d00dbc --- /dev/null +++ b/lib/src/mobilecoin_flutter_plugin_channel_api.dart @@ -0,0 +1,776 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; +import 'package:mobilecoin_flutter/src/account_key.dart'; +import 'package:mobilecoin_flutter/src/attestation/client_config.dart'; +import 'package:mobilecoin_flutter/src/attestation/service_config.dart'; +import 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_common.pb.dart'; +import 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_offramp.pb.dart'; +import 'package:mobilecoin_flutter/src/protobufs/generated/mistyswap_onramp.pb.dart'; +import 'package:mobilecoin_flutter/src/public_address.dart'; +import 'package:mobilecoin_flutter/src/ristretto_private.dart'; +import 'package:mobilecoin_flutter/src/ristretto_public.dart'; + +class MobileCoinFlutterPluginChannelApi { + static const MethodChannel _methodChannel = + MethodChannel('mobilecoin_flutter'); + + static MobileCoinFlutterPluginChannelApi get instance { + _instance ??= MobileCoinFlutterPluginChannelApi(_methodChannel); + return _instance!; + } + + static MobileCoinFlutterPluginChannelApi? _instance; + + @visibleForTesting + MobileCoinFlutterPluginChannelApi(this._channel); + + final MethodChannel _channel; + + Future createMobileCoinClient({ + required AccountKey accountKey, + required String fogUrl, + required String consensusUrl, + required bool useTestNet, + required ClientConfig attestClientConfig, + String? mistyswapUrl, + }) async { + final Map params = { + 'accountKey': accountKey.id, + 'fogUrl': fogUrl, + 'consensusUrl': consensusUrl, + 'mistyswapUrl': mistyswapUrl, + 'useTestNet': useTestNet, + 'clientConfigId': attestClientConfig.id + }; + return await _channel.invokeMethod("MobileCoinClient#create", params); + } + + Future getBalance({required int mobileCoinClientId}) async { + final Map params = { + 'id': mobileCoinClientId, + }; + String balance = + await _channel.invokeMethod("MobileCoinClient#getBalance", params); + return balance; + } + + Future getAccountActivity({ + required int mobileCoinClientId, + required List serializedKnownPublicAddresses, + }) async { + final Map params = { + 'id': mobileCoinClientId, + 'serializedPublicAddresses': serializedKnownPublicAddresses, + }; + String json = await _channel.invokeMethod( + "MobileCoinClient#getAccountActivity", + params, + ); + return json; + } + + Future> createPendingTransaction({ + required int mobileClientId, + required int recipientId, + required BigInt fee, + required BigInt amount, + required BigInt tokenId, + required String rngSeed, + BigInt? paymentRequestId, + }) async { + if (rngSeed.codeUnits.length != 32) { + throw Exception( + '''Invalid rngSeed $rngSeed. Byte length must be 32, but received ${rngSeed.codeUnits.length}''', + ); + } + + final Map params = { + 'id': mobileClientId, + 'recipient': recipientId, + 'fee': fee.toString(), + 'amount': amount.toString(), + 'tokenId': tokenId.toString(), + 'rngSeed': Uint8List.fromList(rngSeed.codeUnits), + 'paymentRequestId': paymentRequestId?.toString(), + }; + final result = await _channel.invokeMethod( + "MobileCoinClient#createPendingTransaction", + params, + ); + return Map.from(result as Map); + } + + Future sendFunds({ + required int mobileClientId, + required Uint8List serializedTransaction, + }) async { + final Map params = { + 'id': mobileClientId, + 'transaction': serializedTransaction, + }; + final json = + await _channel.invokeMethod("MobileCoinClient#sendFunds", params); + return json; + } + + Future checkTransactionStatus({ + required int mobileClientId, + required int receiptId, + }) async { + final Map params = { + 'id': mobileClientId, + 'receiptId': receiptId, + }; + + return await _channel.invokeMethod( + "MobileCoinClient#checkTransactionStatus", + params, + ); + } + + ///Set the basic HTTP authorization username and password for future requests + Future setAuthorization({ + required int mobileClientId, + required String username, + required String password, + }) async { + final Map params = { + 'id': mobileClientId, + 'username': username, + 'password': password, + }; + return await _channel.invokeMethod( + "MobileCoinClient#setAuthorization", + params, + ); + } + + Future getAccountKeyFromBip39Entropy({ + required Uint8List entropy, + required String fogReportUri, + required String reportId, + required Uint8List fogAuthoritySpki, + }) async { + final Map params = { + 'bip39Entropy': entropy, + 'fogReportUri': fogReportUri, + 'fogAuthoritySpki': fogAuthoritySpki, + 'reportId': reportId, + }; + return await _channel.invokeMethod("AccountKey#fromBip39Entropy", params); + } + + Future getAccountKeyPublicAddress({required int accountKeyId}) async { + final Map params = { + 'id': accountKeyId, + }; + return await _channel.invokeMethod("AccountKey#getPublicAddress", params); + } + + Future printableWrapperFromB58String({ + required String b58String, + }) async { + final Map params = { + 'b58String': b58String, + }; + return await _channel.invokeMethod( + "PrintableWrapper#fromB58String", + params, + ); + } + + Future printableWrapperToB58String({ + required int printableWrapperId, + }) async { + final Map params = { + 'id': printableWrapperId, + }; + return await _channel.invokeMethod("PrintableWrapper#toB58String", params); + } + + Future printableWrapperHasPublicAddress({ + required int printableWrapperId, + }) async { + final Map params = { + 'id': printableWrapperId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#hasPublicAddress", + params, + ); + } + + Future printableWrapperGetPublicAddress({ + required int printableWrapperId, + }) async { + final Map params = { + 'id': printableWrapperId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#getPublicAddress", + params, + ); + } + + Future printableWrapperFromPublicAddress({ + required int publicAddressId, + }) async { + final Map params = { + 'id': publicAddressId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#fromPublicAddress", + params, + ); + } + + Future printableWrapperHasTransferPayload({ + required int printableWrapperId, + }) async { + final Map params = { + 'id': printableWrapperId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#hasTransferPayload", + params, + ); + } + + Future printableWrapperGetTransferPayload({ + required int printableWrapperId, + }) async { + final Map params = { + 'id': printableWrapperId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#getTransferPayload", + params, + ); + } + + Future printableWrapperFromPaymentRequest({ + required int paymentRequestId, + }) async { + final Map params = { + 'id': paymentRequestId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#fromPaymentRequest", + params, + ); + } + + Future printableWrapperHasPaymentRequest({ + required int printableWrapperId, + }) async { + final Map params = { + 'id': printableWrapperId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#hasPaymentRequest", + params, + ); + } + + Future printableWrapperGetPaymentRequest({ + required int printableWrapperId, + }) async { + final Map params = { + 'id': printableWrapperId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#getPaymentRequest", + params, + ); + } + + Future printableWrapperFromTransferPayload({ + required int transferPayloadId, + }) async { + final Map params = { + 'id': transferPayloadId, + }; + return await _channel.invokeMethod( + "PrintableWrapper#fromTransferPayload", + params, + ); + } + + Future publicAddressFromBytes({ + required Uint8List publicAddress, + }) async { + final Map params = { + 'serializedBytes': publicAddress, + }; + return await _channel.invokeMethod("PublicAddress#fromBytes", params); + } + + Future publicAddressToByteArray({ + required int publicAddressId, + }) async { + final Map params = { + 'id': publicAddressId, + }; + final List serializedBytes = + await _channel.invokeMethod("PublicAddress#toByteArray", params); + return Uint8List.fromList(serializedBytes); + } + + Future publicAddressGetAddressHash({ + required int publicAddressId, + }) async { + final Map params = { + 'id': publicAddressId, + }; + final List serializedBytes = + await _channel.invokeMethod("PublicAddress#getAddressHash", params); + return Uint8List.fromList(serializedBytes); + } + + Future transferPayloadGetBip39Entropy({ + required int transferPayloadId, + }) async { + final Map params = { + 'id': transferPayloadId, + }; + final List entropy = + await _channel.invokeMethod("TransferPayload#getBip39Entropy", params); + return Uint8List.fromList(entropy); + } + + Future transferPayloadGetMemo({ + required int transferPayloadId, + }) async { + final Map params = { + 'id': transferPayloadId, + }; + return await _channel.invokeMethod("TransferPayload#getMemo", params); + } + + Future transferPayloadGetPublicKey({ + required int transferPayloadId, + }) async { + final Map params = { + 'id': transferPayloadId, + }; + return await _channel.invokeMethod("TransferPayload#getPublicKey", params); + } + + Future paymentRequestCreate({ + required PublicAddress publicAddress, + required BigInt tokenId, + String? memo, + BigInt? amount, + }) async { + final Map params = { + 'publicAddressId': publicAddress.id, + 'memo': memo, + 'amount': amount?.toString(), + 'tokenId': tokenId.toString(), + }; + return await _channel.invokeMethod("PaymentRequest#create", params); + } + + Future paymentRequestGetMemo({ + required int paymentRequestId, + }) async { + final Map params = { + 'id': paymentRequestId, + }; + return await _channel.invokeMethod("PaymentRequest#getMemo", params); + } + + Future paymentRequestGetValue({ + required int paymentRequestId, + }) async { + final Map params = { + 'id': paymentRequestId, + }; + String valueString = + await _channel.invokeMethod("PaymentRequest#getValue", params); + return BigInt.parse(valueString); + } + + Future paymentRequestGetTokenId({ + required int paymentRequestId, + }) async { + final Map params = { + 'id': paymentRequestId, + }; + String tokenIdString = + await _channel.invokeMethod("PaymentRequest#getTokenId", params); + return BigInt.parse(tokenIdString); + } + + Future paymentRequestGetPublicAddress({ + required int paymentRequestId, + }) async { + final Map params = { + 'id': paymentRequestId, + }; + return await _channel.invokeMethod( + "PaymentRequest#getPublicAddress", + params, + ); + } + + Future mnemonicFromBip39Entropy(Uint8List entropy) async { + final Map params = { + 'bip39Entropy': entropy, + }; + return await _channel.invokeMethod( + "Mnemonic#fromBip39Entropy", + params, + ); + } + + Future mnemonicToBip39Entropy(String mnemonicPhrase) async { + final Map params = { + 'mnemonicPhrase': mnemonicPhrase, + }; + final entropy = await _channel.invokeMethod( + 'Mnemonic#toBip39Entropy', + params, + ); + return Uint8List.fromList(entropy); + } + + Future mnemonicAllWords() async { + final Map params = {}; + return await _channel.invokeMethod( + 'Mnemonic#allWords', + params, + ); + } + + Future createClientConfig() async { + final Map params = {}; + return await _channel.invokeMethod( + "ClientConfig#create", + params, + ); + } + + Future addServiceConfig( + int clientConfigId, + ServiceConfig serviceConfig, + ) async { + final Map params = { + 'clientConfigId': clientConfigId, + ServiceConfig.fogViewMrEnclaveKey: serviceConfig.fogViewMrEnclave, + ServiceConfig.fogLedgerMrEnclaveKey: serviceConfig.fogLedgerMrEnclave, + ServiceConfig.fogReportMrEnclaveKey: serviceConfig.fogReportMrEnclave, + ServiceConfig.consensusMrEnclaveKey: serviceConfig.consensusMrEnclave, + ServiceConfig.mistyswapMrEnclaveKey: serviceConfig.mistyswapMrEnclave, + ServiceConfig.hardeningAdvisoriesKey: + serviceConfig.hardeningAdvisories.join(','), + }; + await _channel.invokeMethod( + "ClientConfig#addServiceConfig", + params, + ); + } + + Future cryptoBoxEncrypt({ + required RistrettoPublic publicKey, + required Uint8List data, + }) async { + final Map params = { + 'publicKeyId': publicKey.id, + 'data': data, + }; + return await _channel.invokeMethod( + 'CryptoBox#encrypt', + params, + ); + } + + Future cryptoBoxDecrypt({ + required RistrettoPrivate privateKey, + required Uint8List data, + }) async { + final Map params = { + 'privateKeyId': privateKey.id, + 'data': data, + }; + return await _channel.invokeMethod( + 'CryptoBox#decrypt', + params, + ); + } + + Future accountRequiresDefragmentation({ + required int mobileCoinClientId, + required BigInt tokenId, + required BigInt amount, + }) async { + final Map params = { + 'id': mobileCoinClientId, + 'amount': amount.toString(), + 'tokenId': tokenId.toString(), + }; + return await _channel.invokeMethod( + "MobileCoinClient#requiresDefragmentation", + params, + ); + } + + Future defragmentAccount({ + required int mobileCoinClientId, + required BigInt tokenId, + required BigInt amount, + required bool shouldWriteRTHMemos, + String? rngSeed, + }) async { + final Map params = { + 'id': mobileCoinClientId, + 'amount': amount.toString(), + 'tokenId': tokenId.toString(), + 'shouldWriteRTHMemos': shouldWriteRTHMemos, + 'rngSeed': (null != rngSeed) + ? Uint8List.fromList( + rngSeed.codeUnits, + ) + : Uint8List.fromList(List.empty()), + }; + return await _channel.invokeMethod( + "MobileCoinClient#defragmentAccount", + params, + ); + } + + Future estimateTotalFee({ + required int mobileCoinClientId, + required BigInt tokenId, + required BigInt amount, + }) async { + final Map params = { + 'id': mobileCoinClientId, + 'amount': amount.toString(), + 'tokenId': tokenId.toString(), + }; + return BigInt.parse( + await _channel.invokeMethod( + "MobileCoinClient#estimateTotalFee", + params, + ), + ); + } + + Future getTransferableAmount({ + required int mobileCoinClientId, + required BigInt tokenId, + }) async { + final Map params = { + 'id': mobileCoinClientId, + 'tokenId': tokenId.toString(), + }; + return BigInt.parse( + await _channel.invokeMethod( + "MobileCoinClient#getTransferableAmount", + params, + ), + ); + } + + Future ristrettoPublicFromBytes({ + required Uint8List publicKeyBytes, + }) async { + final Map params = { + 'serializedBytes': publicKeyBytes, + }; + return await _channel.invokeMethod("RistrettoPublic#fromBytes", params); + } + + Future ristrettoPublicToByteArray({ + required int ristrettoPublicId, + }) async { + final Map params = { + 'id': ristrettoPublicId, + }; + final List serializedBytes = + await _channel.invokeMethod("RistrettoPublic#toByteArray", params); + return Uint8List.fromList(serializedBytes); + } + + Future ristrettoPrivateFromBytes({ + required Uint8List privateKeyBytes, + }) async { + final Map params = { + 'serializedBytes': privateKeyBytes, + }; + return await _channel.invokeMethod("RistrettoPrivate#fromBytes", params); + } + + Future ristrettoPrivateToByteArray({ + required int ristrettoPrivateId, + }) async { + final Map params = { + 'id': ristrettoPrivateId, + }; + final List serializedBytes = + await _channel.invokeMethod("RistrettoPrivate#toByteArray", params); + return Uint8List.fromList(serializedBytes); + } + + Future createTxOutPublicKey({ + required int txOutPrivateKeyId, + required int recipientSpendPublicKeyId, + }) async { + final Map params = { + 'txOutPrivateKeyId': txOutPrivateKeyId, + 'recipientSpendPublicKeyId': recipientSpendPublicKeyId, + }; + return await _channel.invokeMethod( + "OnetimeKeys#createTxOutPublicKey", + params, + ); + } + + Future attestedMistySwapClientInitiateOfframp({ + required int mobileCoinClientId, + required InitiateOfframpRequest initiateOfframpRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'initiateOfframpRequestBytes': initiateOfframpRequest.writeToBuffer(), + }; + return InitiateOfframpResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#initiateOfframp", + params, + ), + ); + } + + Future attestedMistySwapClientForgetOfframp({ + required int mobileCoinClientId, + required ForgetOfframpRequest forgetOfframpRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'forgetOfframpRequestBytes': forgetOfframpRequest.writeToBuffer(), + }; + return ForgetOfframpResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#forgetOfframp", + params, + ), + ); + } + + Future attestedMistySwapClientGetOfframpStatus({ + required int mobileCoinClientId, + required GetOfframpStatusRequest getOfframpStatusRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'getOfframpStatusRequestBytes': getOfframpStatusRequest.writeToBuffer(), + }; + return GetOfframpStatusResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#getOfframpStatus", + params, + ), + ); + } + + Future + attestedMistySwapClientGetOfframpDebugInfo({ + required int mobileCoinClientId, + required GetOfframpDebugInfoRequest getOfframpDebugInfoRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'getOfframpDebugInfoRequestBytes': + getOfframpDebugInfoRequest.writeToBuffer(), + }; + return GetOfframpDebugInfoResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#getOfframpDebugInfo", + params, + ), + ); + } + + Future attestedMistySwapClientSetupOnramp({ + required int mobileCoinClientId, + required SetupOnrampRequest setupOnrampRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'setupOnrampRequestBytes': setupOnrampRequest.writeToBuffer(), + }; + return SetupOnrampResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#setupOnramp", + params, + ), + ); + } + + Future attestedMistySwapClientForgetOnramp({ + required int mobileCoinClientId, + required ForgetOnrampRequest forgetOnrampRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'forgetOnrampRequestBytes': forgetOnrampRequest.writeToBuffer(), + }; + return ForgetOnrampResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#forgetOnramp", + params, + ), + ); + } + + Future attestedMistySwapClientGetOnrampStatus({ + required int mobileCoinClientId, + required GetOnrampStatusRequest getOnrampStatusRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'getOnrampStatusRequestBytes': getOnrampStatusRequest.writeToBuffer(), + }; + return GetOnrampStatusResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#getOnrampStatus", + params, + ), + ); + } + + Future attestedMistySwapClientGetOnrampDebugInfo({ + required int mobileCoinClientId, + required GetOnrampDebugInfoRequest getOnrampDebugInfoRequest, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + 'getOnrampDebugInfoRequestBytes': + getOnrampDebugInfoRequest.writeToBuffer(), + }; + return GetOnrampDebugInfoResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#getOnrampDebugInfo", + params, + ), + ); + } + + Future attestedMistySwapClientGetInfo({ + required int mobileCoinClientId, + }) async { + final Map params = { + 'mobileCoinClientId': mobileCoinClientId, + }; + return GetInfoResponse.fromBuffer( + await _channel.invokeMethod( + "AttestedMistySwapClient#getInfoResponse", + params, + ), + ); + } +} diff --git a/lib/src/onetime_keys.dart b/lib/src/onetime_keys.dart new file mode 100644 index 0000000..6c52211 --- /dev/null +++ b/lib/src/onetime_keys.dart @@ -0,0 +1,22 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; +import 'package:mobilecoin_flutter/src/ristretto_private.dart'; +import 'package:mobilecoin_flutter/src/ristretto_public.dart'; + +class OnetimeKeys extends PlatformObject { + OnetimeKeys(int objectId) : super(id: objectId); + + static Future createTxOutPublicKey({ + required RistrettoPrivate txOutPrivateKey, + required RistrettoPublic recipientSpendPublicKey, + }) async { + final objectId = + await MobileCoinFlutterPluginChannelApi.instance.createTxOutPublicKey( + txOutPrivateKeyId: txOutPrivateKey.id, + recipientSpendPublicKeyId: recipientSpendPublicKey.id, + ); + return RistrettoPublic(objectId); + } +} diff --git a/lib/src/payment_request.dart b/lib/src/payment_request.dart new file mode 100644 index 0000000..07caf71 --- /dev/null +++ b/lib/src/payment_request.dart @@ -0,0 +1,46 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; +import 'package:mobilecoin_flutter/src/public_address.dart'; + +class PaymentRequest extends PlatformObject { + PaymentRequest(int objectId) : super(id: objectId); + + static Future fromPublicAddress({ + required PublicAddress publicAddress, + required BigInt tokenId, + String? memo, + BigInt? amount, + }) async { + final objectId = + await MobileCoinFlutterPluginChannelApi.instance.paymentRequestCreate( + publicAddress: publicAddress, + memo: memo, + amount: amount, + tokenId: tokenId, + ); + return PaymentRequest(objectId); + } + + Future getPublicAddress() async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .paymentRequestGetPublicAddress(paymentRequestId: id); + return PublicAddress(objectId); + } + + Future getValue() async { + return await MobileCoinFlutterPluginChannelApi.instance + .paymentRequestGetValue(paymentRequestId: id); + } + + Future getMemo() async { + return await MobileCoinFlutterPluginChannelApi.instance + .paymentRequestGetMemo(paymentRequestId: id); + } + + Future getTokenId() async { + return await MobileCoinFlutterPluginChannelApi.instance + .paymentRequestGetTokenId(paymentRequestId: id); + } +} diff --git a/lib/src/picomob.dart b/lib/src/picomob.dart new file mode 100644 index 0000000..b3e22fe --- /dev/null +++ b/lib/src/picomob.dart @@ -0,0 +1,85 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:decimal/decimal.dart'; +import 'package:flutter/foundation.dart'; + +/// Indivisible units of MOB coins. +@immutable +class PicoMob { + /// [PicoMob] from a coin fraction, e.g., 243.1543 + PicoMob.fromMobFraction(double coins) : _picoMobs = BigInt.from(coins * 1e12); + + /// [PicoMob] from a coin fraction as a [String], e.g., "243.1543" + PicoMob.fromMobFractionString(String coins) + : _picoMobs = BigInt.parse( + (Decimal.parse(coins) * Decimal.parse('1e12')).toString(), + ); + + /// [PicoMob] from a pico count value, i.e., the smallest unit of MOB. + /// + /// 1 pico MOB = 0.000_000_000_001 MOB + PicoMob.fromPicoInt(int picoMobs) : _picoMobs = BigInt.from(picoMobs); + + /// [PicoMob] with value of 0 + PicoMob.zero() : _picoMobs = BigInt.from(0); + + /// [PicoMob] from a pico count value represented as a [BigInt]. + /// + /// 1 pico MOB = 0.000_000_000_001 MOB + const PicoMob.fromPicoBigInt(this._picoMobs); + + final BigInt _picoMobs; + + /// Add [other] [PicoMob] to this [PicoMob] and returns the result. + PicoMob operator +(PicoMob other) { + return PicoMob.fromPicoBigInt(_picoMobs + other._picoMobs); + } + + /// Subtracts [other] [PicoMob] from this [PicoMob] and returns the result. + PicoMob operator -(PicoMob other) { + return PicoMob.fromPicoBigInt(_picoMobs - other._picoMobs); + } + + /// Multiplies [_picoMobs] by [other] and returns the result. + PicoMob operator *(PicoMob other) { + return PicoMob.fromPicoBigInt(_picoMobs * other._picoMobs); + } + + /// Compares [_picoMobs] by [other] and returns true if [_picoMobs] is greater + bool operator >(PicoMob other) { + return _picoMobs > other._picoMobs; + } + + /// Compares [_picoMobs] by [other] and returns true if [other] is greater + bool operator <(PicoMob other) { + return _picoMobs < other._picoMobs; + } + + /// Returns the number of pico MOBs as a [BigInt]. + BigInt picoCountAsBigInt() => _picoMobs; + + /// Returns the number of pico MOBs as a [String]. + String picoCountAsString() => _picoMobs.toString(); + + /// Returns the fractional number of MOB as a [double]. + double mobFractionAsDouble() => _picoMobs.toDouble() / 1e12; + + /// Returns the fractional number of MOB as a [String]. + String mobFractionAsString() => (_picoMobs.toDouble() / 1e12).toString(); + + /// Returns the negated value + PicoMob get negated => this * PicoMob.fromPicoBigInt(BigInt.from(-1)); + + @override + String toString() => _picoMobs.toString(); + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PicoMob && + runtimeType == other.runtimeType && + _picoMobs == other._picoMobs; + + @override + int get hashCode => _picoMobs.hashCode; +} diff --git a/lib/src/platform_object.dart b/lib/src/platform_object.dart new file mode 100644 index 0000000..3686815 --- /dev/null +++ b/lib/src/platform_object.dart @@ -0,0 +1,10 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +/// Represents a platform-side object, e.g., Android or iOS object, within +/// Flutter code. +abstract class PlatformObject { + PlatformObject({required this.id}); + + /// The hashcode of this object on the platform side, e.g., Android or iOS. + final int id; +} diff --git a/lib/src/printable_wrapper.dart b/lib/src/printable_wrapper.dart new file mode 100644 index 0000000..a28418f --- /dev/null +++ b/lib/src/printable_wrapper.dart @@ -0,0 +1,83 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/payment_request.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; +import 'package:mobilecoin_flutter/src/public_address.dart'; +import 'package:mobilecoin_flutter/src/transfer_payload.dart'; + +class PrintableWrapper extends PlatformObject { + PrintableWrapper(int objectId) : super(id: objectId); + + static Future fromB58String(String b58String) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperFromB58String(b58String: b58String); + return PrintableWrapper(objectId); + } + + Future toB58String() async { + return await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperToB58String(printableWrapperId: id); + } + + static Future fromPublicAddress( + PublicAddress publicAddress, + ) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperFromPublicAddress(publicAddressId: publicAddress.id); + return PrintableWrapper(objectId); + } + + Future hasPublicAddress() async { + return await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperHasPublicAddress(printableWrapperId: id); + } + + Future getPublicAddress() async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperGetPublicAddress(printableWrapperId: id); + return PublicAddress(objectId); + } + + static Future fromTransferPayload( + TransferPayload transferPayload, + ) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperFromTransferPayload( + transferPayloadId: transferPayload.id, + ); + return PrintableWrapper(objectId); + } + + Future hasTransferPayload() async { + return await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperHasTransferPayload(printableWrapperId: id); + } + + Future getTransferPayload() async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperGetTransferPayload(printableWrapperId: id); + return TransferPayload(objectId); + } + + static Future fromPaymentRequest( + PaymentRequest paymentRequest, + ) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperFromPaymentRequest( + paymentRequestId: paymentRequest.id, + ); + return PrintableWrapper(objectId); + } + + Future hasPaymentRequest() async { + return await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperHasPaymentRequest(printableWrapperId: id); + } + + Future getPaymentRequest() async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .printableWrapperGetPaymentRequest(printableWrapperId: id); + return PaymentRequest(objectId); + } +} diff --git a/lib/src/protobufs/generated/attest.pb.dart b/lib/src/protobufs/generated/attest.pb.dart new file mode 100644 index 0000000..b253298 --- /dev/null +++ b/lib/src/protobufs/generated/attest.pb.dart @@ -0,0 +1,133 @@ +/// +// Generated code. Do not modify. +// source: attest.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +class AuthMessage extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AuthMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'attest'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + AuthMessage._() : super(); + factory AuthMessage({ + $core.List<$core.int>? data, + }) { + final _result = create(); + if (data != null) { + _result.data = data; + } + return _result; + } + factory AuthMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory AuthMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + AuthMessage clone() => AuthMessage()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + AuthMessage copyWith(void Function(AuthMessage) updates) => super.copyWith((message) => updates(message as AuthMessage)) as AuthMessage; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static AuthMessage create() => AuthMessage._(); + AuthMessage createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static AuthMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AuthMessage? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get data => $_getN(0); + @$pb.TagNumber(1) + set data($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasData() => $_has(0); + @$pb.TagNumber(1) + void clearData() => clearField(1); +} + +class Message extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Message', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'attest'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'aad', $pb.PbFieldType.OY) + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'channelId', $pb.PbFieldType.OY) + ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + Message._() : super(); + factory Message({ + $core.List<$core.int>? aad, + $core.List<$core.int>? channelId, + $core.List<$core.int>? data, + }) { + final _result = create(); + if (aad != null) { + _result.aad = aad; + } + if (channelId != null) { + _result.channelId = channelId; + } + if (data != null) { + _result.data = data; + } + return _result; + } + factory Message.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Message.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Message clone() => Message()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Message copyWith(void Function(Message) updates) => super.copyWith((message) => updates(message as Message)) as Message; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Message create() => Message._(); + Message createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Message getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Message? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get aad => $_getN(0); + @$pb.TagNumber(1) + set aad($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasAad() => $_has(0); + @$pb.TagNumber(1) + void clearAad() => clearField(1); + + @$pb.TagNumber(2) + $core.List<$core.int> get channelId => $_getN(1); + @$pb.TagNumber(2) + set channelId($core.List<$core.int> v) { $_setBytes(1, v); } + @$pb.TagNumber(2) + $core.bool hasChannelId() => $_has(1); + @$pb.TagNumber(2) + void clearChannelId() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$core.int> get data => $_getN(2); + @$pb.TagNumber(3) + set data($core.List<$core.int> v) { $_setBytes(2, v); } + @$pb.TagNumber(3) + $core.bool hasData() => $_has(2); + @$pb.TagNumber(3) + void clearData() => clearField(3); +} + diff --git a/lib/src/protobufs/generated/attest.pbenum.dart b/lib/src/protobufs/generated/attest.pbenum.dart new file mode 100644 index 0000000..938d495 --- /dev/null +++ b/lib/src/protobufs/generated/attest.pbenum.dart @@ -0,0 +1,7 @@ +/// +// Generated code. Do not modify. +// source: attest.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + diff --git a/lib/src/protobufs/generated/attest.pbgrpc.dart b/lib/src/protobufs/generated/attest.pbgrpc.dart new file mode 100644 index 0000000..4ff4624 --- /dev/null +++ b/lib/src/protobufs/generated/attest.pbgrpc.dart @@ -0,0 +1,53 @@ +/// +// Generated code. Do not modify. +// source: attest.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:async' as $async; + +import 'dart:core' as $core; + +import 'package:grpc/service_api.dart' as $grpc; +import 'attest.pb.dart' as $0; +export 'attest.pb.dart'; + +class AttestedApiClient extends $grpc.Client { + static final _$auth = $grpc.ClientMethod<$0.AuthMessage, $0.AuthMessage>( + '/attest.AttestedApi/Auth', + ($0.AuthMessage value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.AuthMessage.fromBuffer(value)); + + AttestedApiClient($grpc.ClientChannel channel, + {$grpc.CallOptions? options, + $core.Iterable<$grpc.ClientInterceptor>? interceptors}) + : super(channel, options: options, interceptors: interceptors); + + $grpc.ResponseFuture<$0.AuthMessage> auth($0.AuthMessage request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$auth, request, options: options); + } +} + +abstract class AttestedApiServiceBase extends $grpc.Service { + $core.String get $name => 'attest.AttestedApi'; + + AttestedApiServiceBase() { + $addMethod($grpc.ServiceMethod<$0.AuthMessage, $0.AuthMessage>( + 'Auth', + auth_Pre, + false, + false, + ($core.List<$core.int> value) => $0.AuthMessage.fromBuffer(value), + ($0.AuthMessage value) => value.writeToBuffer())); + } + + $async.Future<$0.AuthMessage> auth_Pre( + $grpc.ServiceCall call, $async.Future<$0.AuthMessage> request) async { + return auth(call, await request); + } + + $async.Future<$0.AuthMessage> auth( + $grpc.ServiceCall call, $0.AuthMessage request); +} diff --git a/lib/src/protobufs/generated/attest.pbjson.dart b/lib/src/protobufs/generated/attest.pbjson.dart new file mode 100644 index 0000000..080b560 --- /dev/null +++ b/lib/src/protobufs/generated/attest.pbjson.dart @@ -0,0 +1,32 @@ +/// +// Generated code. Do not modify. +// source: attest.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use authMessageDescriptor instead') +const AuthMessage$json = const { + '1': 'AuthMessage', + '2': const [ + const {'1': 'data', '3': 1, '4': 1, '5': 12, '10': 'data'}, + ], +}; + +/// Descriptor for `AuthMessage`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List authMessageDescriptor = $convert.base64Decode('CgtBdXRoTWVzc2FnZRISCgRkYXRhGAEgASgMUgRkYXRh'); +@$core.Deprecated('Use messageDescriptor instead') +const Message$json = const { + '1': 'Message', + '2': const [ + const {'1': 'aad', '3': 1, '4': 1, '5': 12, '10': 'aad'}, + const {'1': 'channel_id', '3': 2, '4': 1, '5': 12, '10': 'channelId'}, + const {'1': 'data', '3': 3, '4': 1, '5': 12, '10': 'data'}, + ], +}; + +/// Descriptor for `Message`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List messageDescriptor = $convert.base64Decode('CgdNZXNzYWdlEhAKA2FhZBgBIAEoDFIDYWFkEh0KCmNoYW5uZWxfaWQYAiABKAxSCWNoYW5uZWxJZBISCgRkYXRhGAMgASgMUgRkYXRh'); diff --git a/lib/src/protobufs/generated/google/protobuf/empty.pb.dart b/lib/src/protobufs/generated/google/protobuf/empty.pb.dart new file mode 100644 index 0000000..035bd33 --- /dev/null +++ b/lib/src/protobufs/generated/google/protobuf/empty.pb.dart @@ -0,0 +1,40 @@ +/// +// Generated code. Do not modify. +// source: google/protobuf/empty.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +class Empty extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Empty', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'google.protobuf'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + Empty._() : super(); + factory Empty() => create(); + factory Empty.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Empty.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Empty clone() => Empty()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Empty copyWith(void Function(Empty) updates) => super.copyWith((message) => updates(message as Empty)) as Empty; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Empty create() => Empty._(); + Empty createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Empty getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Empty? _defaultInstance; +} + diff --git a/lib/src/protobufs/generated/google/protobuf/empty.pbenum.dart b/lib/src/protobufs/generated/google/protobuf/empty.pbenum.dart new file mode 100644 index 0000000..6184f2c --- /dev/null +++ b/lib/src/protobufs/generated/google/protobuf/empty.pbenum.dart @@ -0,0 +1,7 @@ +/// +// Generated code. Do not modify. +// source: google/protobuf/empty.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + diff --git a/lib/src/protobufs/generated/google/protobuf/empty.pbjson.dart b/lib/src/protobufs/generated/google/protobuf/empty.pbjson.dart new file mode 100644 index 0000000..41cdcb0 --- /dev/null +++ b/lib/src/protobufs/generated/google/protobuf/empty.pbjson.dart @@ -0,0 +1,17 @@ +/// +// Generated code. Do not modify. +// source: google/protobuf/empty.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use emptyDescriptor instead') +const Empty$json = const { + '1': 'Empty', +}; + +/// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List emptyDescriptor = $convert.base64Decode('CgVFbXB0eQ=='); diff --git a/lib/src/protobufs/generated/mistyswap_common.pb.dart b/lib/src/protobufs/generated/mistyswap_common.pb.dart new file mode 100644 index 0000000..f3b0e99 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_common.pb.dart @@ -0,0 +1,306 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_common.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:fixnum/fixnum.dart' as $fixnum; +import 'package:protobuf/protobuf.dart' as $pb; + +class OngoingSwap extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OngoingSwap', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_common'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'traceId') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'followId') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'srcAssetId') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'srcAmount') + ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstAssetId') + ..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstAmountMin') + ..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'routeHashIds') + ..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'transferJson') + ..aOS(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'preSwapSrcBalance') + ..aOS(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'preSwapDstBalance') + ..hasRequiredFields = false + ; + + OngoingSwap._() : super(); + factory OngoingSwap({ + $core.String? traceId, + $core.String? followId, + $core.String? srcAssetId, + $core.String? srcAmount, + $core.String? dstAssetId, + $core.String? dstAmountMin, + $core.String? routeHashIds, + $core.String? transferJson, + $core.String? preSwapSrcBalance, + $core.String? preSwapDstBalance, + }) { + final _result = create(); + if (traceId != null) { + _result.traceId = traceId; + } + if (followId != null) { + _result.followId = followId; + } + if (srcAssetId != null) { + _result.srcAssetId = srcAssetId; + } + if (srcAmount != null) { + _result.srcAmount = srcAmount; + } + if (dstAssetId != null) { + _result.dstAssetId = dstAssetId; + } + if (dstAmountMin != null) { + _result.dstAmountMin = dstAmountMin; + } + if (routeHashIds != null) { + _result.routeHashIds = routeHashIds; + } + if (transferJson != null) { + _result.transferJson = transferJson; + } + if (preSwapSrcBalance != null) { + _result.preSwapSrcBalance = preSwapSrcBalance; + } + if (preSwapDstBalance != null) { + _result.preSwapDstBalance = preSwapDstBalance; + } + return _result; + } + factory OngoingSwap.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory OngoingSwap.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + OngoingSwap clone() => OngoingSwap()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + OngoingSwap copyWith(void Function(OngoingSwap) updates) => super.copyWith((message) => updates(message as OngoingSwap)) as OngoingSwap; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static OngoingSwap create() => OngoingSwap._(); + OngoingSwap createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static OngoingSwap getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static OngoingSwap? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get traceId => $_getSZ(0); + @$pb.TagNumber(1) + set traceId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasTraceId() => $_has(0); + @$pb.TagNumber(1) + void clearTraceId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get followId => $_getSZ(1); + @$pb.TagNumber(2) + set followId($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasFollowId() => $_has(1); + @$pb.TagNumber(2) + void clearFollowId() => clearField(2); + + @$pb.TagNumber(3) + $core.String get srcAssetId => $_getSZ(2); + @$pb.TagNumber(3) + set srcAssetId($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasSrcAssetId() => $_has(2); + @$pb.TagNumber(3) + void clearSrcAssetId() => clearField(3); + + @$pb.TagNumber(4) + $core.String get srcAmount => $_getSZ(3); + @$pb.TagNumber(4) + set srcAmount($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasSrcAmount() => $_has(3); + @$pb.TagNumber(4) + void clearSrcAmount() => clearField(4); + + @$pb.TagNumber(5) + $core.String get dstAssetId => $_getSZ(4); + @$pb.TagNumber(5) + set dstAssetId($core.String v) { $_setString(4, v); } + @$pb.TagNumber(5) + $core.bool hasDstAssetId() => $_has(4); + @$pb.TagNumber(5) + void clearDstAssetId() => clearField(5); + + @$pb.TagNumber(6) + $core.String get dstAmountMin => $_getSZ(5); + @$pb.TagNumber(6) + set dstAmountMin($core.String v) { $_setString(5, v); } + @$pb.TagNumber(6) + $core.bool hasDstAmountMin() => $_has(5); + @$pb.TagNumber(6) + void clearDstAmountMin() => clearField(6); + + @$pb.TagNumber(7) + $core.String get routeHashIds => $_getSZ(6); + @$pb.TagNumber(7) + set routeHashIds($core.String v) { $_setString(6, v); } + @$pb.TagNumber(7) + $core.bool hasRouteHashIds() => $_has(6); + @$pb.TagNumber(7) + void clearRouteHashIds() => clearField(7); + + @$pb.TagNumber(8) + $core.String get transferJson => $_getSZ(7); + @$pb.TagNumber(8) + set transferJson($core.String v) { $_setString(7, v); } + @$pb.TagNumber(8) + $core.bool hasTransferJson() => $_has(7); + @$pb.TagNumber(8) + void clearTransferJson() => clearField(8); + + @$pb.TagNumber(9) + $core.String get preSwapSrcBalance => $_getSZ(8); + @$pb.TagNumber(9) + set preSwapSrcBalance($core.String v) { $_setString(8, v); } + @$pb.TagNumber(9) + $core.bool hasPreSwapSrcBalance() => $_has(8); + @$pb.TagNumber(9) + void clearPreSwapSrcBalance() => clearField(9); + + @$pb.TagNumber(10) + $core.String get preSwapDstBalance => $_getSZ(9); + @$pb.TagNumber(10) + set preSwapDstBalance($core.String v) { $_setString(9, v); } + @$pb.TagNumber(10) + $core.bool hasPreSwapDstBalance() => $_has(9); + @$pb.TagNumber(10) + void clearPreSwapDstBalance() => clearField(10); +} + +class GetInfoResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetInfoResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_common'), createEmptyInstance: create) + ..a<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxConcurrentOfframps', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxConcurrentOnramps', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'currentOfframps', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'currentOnramps', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..pPS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offrampAllowedSrcAssetIds') + ..pPS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offrampAllowedDstAssetIds') + ..pPS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onrampAllowedSrcAssetIds') + ..pPS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onrampAllowedDstAssetIds') + ..hasRequiredFields = false + ; + + GetInfoResponse._() : super(); + factory GetInfoResponse({ + $fixnum.Int64? maxConcurrentOfframps, + $fixnum.Int64? maxConcurrentOnramps, + $fixnum.Int64? currentOfframps, + $fixnum.Int64? currentOnramps, + $core.Iterable<$core.String>? offrampAllowedSrcAssetIds, + $core.Iterable<$core.String>? offrampAllowedDstAssetIds, + $core.Iterable<$core.String>? onrampAllowedSrcAssetIds, + $core.Iterable<$core.String>? onrampAllowedDstAssetIds, + }) { + final _result = create(); + if (maxConcurrentOfframps != null) { + _result.maxConcurrentOfframps = maxConcurrentOfframps; + } + if (maxConcurrentOnramps != null) { + _result.maxConcurrentOnramps = maxConcurrentOnramps; + } + if (currentOfframps != null) { + _result.currentOfframps = currentOfframps; + } + if (currentOnramps != null) { + _result.currentOnramps = currentOnramps; + } + if (offrampAllowedSrcAssetIds != null) { + _result.offrampAllowedSrcAssetIds.addAll(offrampAllowedSrcAssetIds); + } + if (offrampAllowedDstAssetIds != null) { + _result.offrampAllowedDstAssetIds.addAll(offrampAllowedDstAssetIds); + } + if (onrampAllowedSrcAssetIds != null) { + _result.onrampAllowedSrcAssetIds.addAll(onrampAllowedSrcAssetIds); + } + if (onrampAllowedDstAssetIds != null) { + _result.onrampAllowedDstAssetIds.addAll(onrampAllowedDstAssetIds); + } + return _result; + } + factory GetInfoResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetInfoResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetInfoResponse clone() => GetInfoResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetInfoResponse copyWith(void Function(GetInfoResponse) updates) => super.copyWith((message) => updates(message as GetInfoResponse)) as GetInfoResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetInfoResponse create() => GetInfoResponse._(); + GetInfoResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetInfoResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetInfoResponse? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get maxConcurrentOfframps => $_getI64(0); + @$pb.TagNumber(1) + set maxConcurrentOfframps($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasMaxConcurrentOfframps() => $_has(0); + @$pb.TagNumber(1) + void clearMaxConcurrentOfframps() => clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get maxConcurrentOnramps => $_getI64(1); + @$pb.TagNumber(2) + set maxConcurrentOnramps($fixnum.Int64 v) { $_setInt64(1, v); } + @$pb.TagNumber(2) + $core.bool hasMaxConcurrentOnramps() => $_has(1); + @$pb.TagNumber(2) + void clearMaxConcurrentOnramps() => clearField(2); + + @$pb.TagNumber(3) + $fixnum.Int64 get currentOfframps => $_getI64(2); + @$pb.TagNumber(3) + set currentOfframps($fixnum.Int64 v) { $_setInt64(2, v); } + @$pb.TagNumber(3) + $core.bool hasCurrentOfframps() => $_has(2); + @$pb.TagNumber(3) + void clearCurrentOfframps() => clearField(3); + + @$pb.TagNumber(4) + $fixnum.Int64 get currentOnramps => $_getI64(3); + @$pb.TagNumber(4) + set currentOnramps($fixnum.Int64 v) { $_setInt64(3, v); } + @$pb.TagNumber(4) + $core.bool hasCurrentOnramps() => $_has(3); + @$pb.TagNumber(4) + void clearCurrentOnramps() => clearField(4); + + @$pb.TagNumber(5) + $core.List<$core.String> get offrampAllowedSrcAssetIds => $_getList(4); + + @$pb.TagNumber(6) + $core.List<$core.String> get offrampAllowedDstAssetIds => $_getList(5); + + @$pb.TagNumber(7) + $core.List<$core.String> get onrampAllowedSrcAssetIds => $_getList(6); + + @$pb.TagNumber(8) + $core.List<$core.String> get onrampAllowedDstAssetIds => $_getList(7); +} + diff --git a/lib/src/protobufs/generated/mistyswap_common.pbenum.dart b/lib/src/protobufs/generated/mistyswap_common.pbenum.dart new file mode 100644 index 0000000..739315e --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_common.pbenum.dart @@ -0,0 +1,7 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_common.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + diff --git a/lib/src/protobufs/generated/mistyswap_common.pbgrpc.dart b/lib/src/protobufs/generated/mistyswap_common.pbgrpc.dart new file mode 100644 index 0000000..9893a7d --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_common.pbgrpc.dart @@ -0,0 +1,54 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_common.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:async' as $async; + +import 'dart:core' as $core; + +import 'package:grpc/service_api.dart' as $grpc; +import 'google/protobuf/empty.pb.dart' as $1; +import 'mistyswap_common.pb.dart' as $2; +export 'mistyswap_common.pb.dart'; + +class MistyswapCommonApiClient extends $grpc.Client { + static final _$getInfo = $grpc.ClientMethod<$1.Empty, $2.GetInfoResponse>( + '/mistyswap_common.MistyswapCommonApi/GetInfo', + ($1.Empty value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $2.GetInfoResponse.fromBuffer(value)); + + MistyswapCommonApiClient($grpc.ClientChannel channel, + {$grpc.CallOptions? options, + $core.Iterable<$grpc.ClientInterceptor>? interceptors}) + : super(channel, options: options, interceptors: interceptors); + + $grpc.ResponseFuture<$2.GetInfoResponse> getInfo($1.Empty request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getInfo, request, options: options); + } +} + +abstract class MistyswapCommonApiServiceBase extends $grpc.Service { + $core.String get $name => 'mistyswap_common.MistyswapCommonApi'; + + MistyswapCommonApiServiceBase() { + $addMethod($grpc.ServiceMethod<$1.Empty, $2.GetInfoResponse>( + 'GetInfo', + getInfo_Pre, + false, + false, + ($core.List<$core.int> value) => $1.Empty.fromBuffer(value), + ($2.GetInfoResponse value) => value.writeToBuffer())); + } + + $async.Future<$2.GetInfoResponse> getInfo_Pre( + $grpc.ServiceCall call, $async.Future<$1.Empty> request) async { + return getInfo(call, await request); + } + + $async.Future<$2.GetInfoResponse> getInfo( + $grpc.ServiceCall call, $1.Empty request); +} diff --git a/lib/src/protobufs/generated/mistyswap_common.pbjson.dart b/lib/src/protobufs/generated/mistyswap_common.pbjson.dart new file mode 100644 index 0000000..e9ce722 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_common.pbjson.dart @@ -0,0 +1,46 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_common.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use ongoingSwapDescriptor instead') +const OngoingSwap$json = const { + '1': 'OngoingSwap', + '2': const [ + const {'1': 'trace_id', '3': 1, '4': 1, '5': 9, '10': 'traceId'}, + const {'1': 'follow_id', '3': 2, '4': 1, '5': 9, '10': 'followId'}, + const {'1': 'src_asset_id', '3': 3, '4': 1, '5': 9, '10': 'srcAssetId'}, + const {'1': 'src_amount', '3': 4, '4': 1, '5': 9, '10': 'srcAmount'}, + const {'1': 'dst_asset_id', '3': 5, '4': 1, '5': 9, '10': 'dstAssetId'}, + const {'1': 'dst_amount_min', '3': 6, '4': 1, '5': 9, '10': 'dstAmountMin'}, + const {'1': 'route_hash_ids', '3': 7, '4': 1, '5': 9, '10': 'routeHashIds'}, + const {'1': 'transfer_json', '3': 8, '4': 1, '5': 9, '10': 'transferJson'}, + const {'1': 'pre_swap_src_balance', '3': 9, '4': 1, '5': 9, '10': 'preSwapSrcBalance'}, + const {'1': 'pre_swap_dst_balance', '3': 10, '4': 1, '5': 9, '10': 'preSwapDstBalance'}, + ], +}; + +/// Descriptor for `OngoingSwap`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List ongoingSwapDescriptor = $convert.base64Decode('CgtPbmdvaW5nU3dhcBIZCgh0cmFjZV9pZBgBIAEoCVIHdHJhY2VJZBIbCglmb2xsb3dfaWQYAiABKAlSCGZvbGxvd0lkEiAKDHNyY19hc3NldF9pZBgDIAEoCVIKc3JjQXNzZXRJZBIdCgpzcmNfYW1vdW50GAQgASgJUglzcmNBbW91bnQSIAoMZHN0X2Fzc2V0X2lkGAUgASgJUgpkc3RBc3NldElkEiQKDmRzdF9hbW91bnRfbWluGAYgASgJUgxkc3RBbW91bnRNaW4SJAoOcm91dGVfaGFzaF9pZHMYByABKAlSDHJvdXRlSGFzaElkcxIjCg10cmFuc2Zlcl9qc29uGAggASgJUgx0cmFuc2Zlckpzb24SLwoUcHJlX3N3YXBfc3JjX2JhbGFuY2UYCSABKAlSEXByZVN3YXBTcmNCYWxhbmNlEi8KFHByZV9zd2FwX2RzdF9iYWxhbmNlGAogASgJUhFwcmVTd2FwRHN0QmFsYW5jZQ=='); +@$core.Deprecated('Use getInfoResponseDescriptor instead') +const GetInfoResponse$json = const { + '1': 'GetInfoResponse', + '2': const [ + const {'1': 'max_concurrent_offramps', '3': 1, '4': 1, '5': 4, '10': 'maxConcurrentOfframps'}, + const {'1': 'max_concurrent_onramps', '3': 2, '4': 1, '5': 4, '10': 'maxConcurrentOnramps'}, + const {'1': 'current_offramps', '3': 3, '4': 1, '5': 4, '10': 'currentOfframps'}, + const {'1': 'current_onramps', '3': 4, '4': 1, '5': 4, '10': 'currentOnramps'}, + const {'1': 'offramp_allowed_src_asset_ids', '3': 5, '4': 3, '5': 9, '10': 'offrampAllowedSrcAssetIds'}, + const {'1': 'offramp_allowed_dst_asset_ids', '3': 6, '4': 3, '5': 9, '10': 'offrampAllowedDstAssetIds'}, + const {'1': 'onramp_allowed_src_asset_ids', '3': 7, '4': 3, '5': 9, '10': 'onrampAllowedSrcAssetIds'}, + const {'1': 'onramp_allowed_dst_asset_ids', '3': 8, '4': 3, '5': 9, '10': 'onrampAllowedDstAssetIds'}, + ], +}; + +/// Descriptor for `GetInfoResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getInfoResponseDescriptor = $convert.base64Decode('Cg9HZXRJbmZvUmVzcG9uc2USNgoXbWF4X2NvbmN1cnJlbnRfb2ZmcmFtcHMYASABKARSFW1heENvbmN1cnJlbnRPZmZyYW1wcxI0ChZtYXhfY29uY3VycmVudF9vbnJhbXBzGAIgASgEUhRtYXhDb25jdXJyZW50T25yYW1wcxIpChBjdXJyZW50X29mZnJhbXBzGAMgASgEUg9jdXJyZW50T2ZmcmFtcHMSJwoPY3VycmVudF9vbnJhbXBzGAQgASgEUg5jdXJyZW50T25yYW1wcxJACh1vZmZyYW1wX2FsbG93ZWRfc3JjX2Fzc2V0X2lkcxgFIAMoCVIZb2ZmcmFtcEFsbG93ZWRTcmNBc3NldElkcxJACh1vZmZyYW1wX2FsbG93ZWRfZHN0X2Fzc2V0X2lkcxgGIAMoCVIZb2ZmcmFtcEFsbG93ZWREc3RBc3NldElkcxI+ChxvbnJhbXBfYWxsb3dlZF9zcmNfYXNzZXRfaWRzGAcgAygJUhhvbnJhbXBBbGxvd2VkU3JjQXNzZXRJZHMSPgocb25yYW1wX2FsbG93ZWRfZHN0X2Fzc2V0X2lkcxgIIAMoCVIYb25yYW1wQWxsb3dlZERzdEFzc2V0SWRz'); diff --git a/lib/src/protobufs/generated/mistyswap_offramp.pb.dart b/lib/src/protobufs/generated/mistyswap_offramp.pb.dart new file mode 100644 index 0000000..ed43522 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_offramp.pb.dart @@ -0,0 +1,810 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_offramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'mistyswap_common.pb.dart' as $2; + +import 'mistyswap_offramp.pbenum.dart'; + +export 'mistyswap_offramp.pbenum.dart'; + +class OfframpResult extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OfframpResult', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'code', $pb.PbFieldType.OE, defaultOrMaker: OfframpResultCode.ORC_INVALID, valueOf: OfframpResultCode.valueOf, enumValues: OfframpResultCode.values) + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'message') + ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + OfframpResult._() : super(); + factory OfframpResult({ + OfframpResultCode? code, + $core.String? message, + $core.List<$core.int>? offrampId, + }) { + final _result = create(); + if (code != null) { + _result.code = code; + } + if (message != null) { + _result.message = message; + } + if (offrampId != null) { + _result.offrampId = offrampId; + } + return _result; + } + factory OfframpResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory OfframpResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + OfframpResult clone() => OfframpResult()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + OfframpResult copyWith(void Function(OfframpResult) updates) => super.copyWith((message) => updates(message as OfframpResult)) as OfframpResult; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static OfframpResult create() => OfframpResult._(); + OfframpResult createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static OfframpResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static OfframpResult? _defaultInstance; + + @$pb.TagNumber(1) + OfframpResultCode get code => $_getN(0); + @$pb.TagNumber(1) + set code(OfframpResultCode v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasCode() => $_has(0); + @$pb.TagNumber(1) + void clearCode() => clearField(1); + + @$pb.TagNumber(2) + $core.String get message => $_getSZ(1); + @$pb.TagNumber(2) + set message($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasMessage() => $_has(1); + @$pb.TagNumber(2) + void clearMessage() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$core.int> get offrampId => $_getN(2); + @$pb.TagNumber(3) + set offrampId($core.List<$core.int> v) { $_setBytes(2, v); } + @$pb.TagNumber(3) + $core.bool hasOfframpId() => $_has(2); + @$pb.TagNumber(3) + void clearOfframpId() => clearField(3); +} + +class OfframpParams extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OfframpParams', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'srcAssetId') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'srcExpectedAmount') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstAssetId') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstAddress') + ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstAddressTag') + ..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'minDstReceivedAmount') + ..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'maxFeeAmountInDstTokens') + ..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'feeTokenSwapMultiplier') + ..hasRequiredFields = false + ; + + OfframpParams._() : super(); + factory OfframpParams({ + $core.String? srcAssetId, + $core.String? srcExpectedAmount, + $core.String? dstAssetId, + $core.String? dstAddress, + $core.String? dstAddressTag, + $core.String? minDstReceivedAmount, + $core.String? maxFeeAmountInDstTokens, + $core.String? feeTokenSwapMultiplier, + }) { + final _result = create(); + if (srcAssetId != null) { + _result.srcAssetId = srcAssetId; + } + if (srcExpectedAmount != null) { + _result.srcExpectedAmount = srcExpectedAmount; + } + if (dstAssetId != null) { + _result.dstAssetId = dstAssetId; + } + if (dstAddress != null) { + _result.dstAddress = dstAddress; + } + if (dstAddressTag != null) { + _result.dstAddressTag = dstAddressTag; + } + if (minDstReceivedAmount != null) { + _result.minDstReceivedAmount = minDstReceivedAmount; + } + if (maxFeeAmountInDstTokens != null) { + _result.maxFeeAmountInDstTokens = maxFeeAmountInDstTokens; + } + if (feeTokenSwapMultiplier != null) { + _result.feeTokenSwapMultiplier = feeTokenSwapMultiplier; + } + return _result; + } + factory OfframpParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory OfframpParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + OfframpParams clone() => OfframpParams()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + OfframpParams copyWith(void Function(OfframpParams) updates) => super.copyWith((message) => updates(message as OfframpParams)) as OfframpParams; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static OfframpParams create() => OfframpParams._(); + OfframpParams createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static OfframpParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static OfframpParams? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get srcAssetId => $_getSZ(0); + @$pb.TagNumber(1) + set srcAssetId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasSrcAssetId() => $_has(0); + @$pb.TagNumber(1) + void clearSrcAssetId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get srcExpectedAmount => $_getSZ(1); + @$pb.TagNumber(2) + set srcExpectedAmount($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasSrcExpectedAmount() => $_has(1); + @$pb.TagNumber(2) + void clearSrcExpectedAmount() => clearField(2); + + @$pb.TagNumber(3) + $core.String get dstAssetId => $_getSZ(2); + @$pb.TagNumber(3) + set dstAssetId($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasDstAssetId() => $_has(2); + @$pb.TagNumber(3) + void clearDstAssetId() => clearField(3); + + @$pb.TagNumber(4) + $core.String get dstAddress => $_getSZ(3); + @$pb.TagNumber(4) + set dstAddress($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasDstAddress() => $_has(3); + @$pb.TagNumber(4) + void clearDstAddress() => clearField(4); + + @$pb.TagNumber(5) + $core.String get dstAddressTag => $_getSZ(4); + @$pb.TagNumber(5) + set dstAddressTag($core.String v) { $_setString(4, v); } + @$pb.TagNumber(5) + $core.bool hasDstAddressTag() => $_has(4); + @$pb.TagNumber(5) + void clearDstAddressTag() => clearField(5); + + @$pb.TagNumber(6) + $core.String get minDstReceivedAmount => $_getSZ(5); + @$pb.TagNumber(6) + set minDstReceivedAmount($core.String v) { $_setString(5, v); } + @$pb.TagNumber(6) + $core.bool hasMinDstReceivedAmount() => $_has(5); + @$pb.TagNumber(6) + void clearMinDstReceivedAmount() => clearField(6); + + @$pb.TagNumber(7) + $core.String get maxFeeAmountInDstTokens => $_getSZ(6); + @$pb.TagNumber(7) + set maxFeeAmountInDstTokens($core.String v) { $_setString(6, v); } + @$pb.TagNumber(7) + $core.bool hasMaxFeeAmountInDstTokens() => $_has(6); + @$pb.TagNumber(7) + void clearMaxFeeAmountInDstTokens() => clearField(7); + + @$pb.TagNumber(8) + $core.String get feeTokenSwapMultiplier => $_getSZ(7); + @$pb.TagNumber(8) + set feeTokenSwapMultiplier($core.String v) { $_setString(7, v); } + @$pb.TagNumber(8) + $core.bool hasFeeTokenSwapMultiplier() => $_has(7); + @$pb.TagNumber(8) + void clearFeeTokenSwapMultiplier() => clearField(8); +} + +class InitiateOfframpRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'InitiateOfframpRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mixinCredentialsJson') + ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'params', subBuilder: OfframpParams.create) + ..hasRequiredFields = false + ; + + InitiateOfframpRequest._() : super(); + factory InitiateOfframpRequest({ + $core.String? mixinCredentialsJson, + OfframpParams? params, + }) { + final _result = create(); + if (mixinCredentialsJson != null) { + _result.mixinCredentialsJson = mixinCredentialsJson; + } + if (params != null) { + _result.params = params; + } + return _result; + } + factory InitiateOfframpRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory InitiateOfframpRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + InitiateOfframpRequest clone() => InitiateOfframpRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + InitiateOfframpRequest copyWith(void Function(InitiateOfframpRequest) updates) => super.copyWith((message) => updates(message as InitiateOfframpRequest)) as InitiateOfframpRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static InitiateOfframpRequest create() => InitiateOfframpRequest._(); + InitiateOfframpRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static InitiateOfframpRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static InitiateOfframpRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get mixinCredentialsJson => $_getSZ(0); + @$pb.TagNumber(1) + set mixinCredentialsJson($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasMixinCredentialsJson() => $_has(0); + @$pb.TagNumber(1) + void clearMixinCredentialsJson() => clearField(1); + + @$pb.TagNumber(2) + OfframpParams get params => $_getN(1); + @$pb.TagNumber(2) + set params(OfframpParams v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasParams() => $_has(1); + @$pb.TagNumber(2) + void clearParams() => clearField(2); + @$pb.TagNumber(2) + OfframpParams ensureParams() => $_ensure(1); +} + +class InitiateOfframpResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'InitiateOfframpResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OfframpResult.create) + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + InitiateOfframpResponse._() : super(); + factory InitiateOfframpResponse({ + OfframpResult? result, + $core.List<$core.int>? offrampId, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + if (offrampId != null) { + _result.offrampId = offrampId; + } + return _result; + } + factory InitiateOfframpResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory InitiateOfframpResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + InitiateOfframpResponse clone() => InitiateOfframpResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + InitiateOfframpResponse copyWith(void Function(InitiateOfframpResponse) updates) => super.copyWith((message) => updates(message as InitiateOfframpResponse)) as InitiateOfframpResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static InitiateOfframpResponse create() => InitiateOfframpResponse._(); + InitiateOfframpResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static InitiateOfframpResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static InitiateOfframpResponse? _defaultInstance; + + @$pb.TagNumber(1) + OfframpResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OfframpResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OfframpResult ensureResult() => $_ensure(0); + + @$pb.TagNumber(2) + $core.List<$core.int> get offrampId => $_getN(1); + @$pb.TagNumber(2) + set offrampId($core.List<$core.int> v) { $_setBytes(1, v); } + @$pb.TagNumber(2) + $core.bool hasOfframpId() => $_has(1); + @$pb.TagNumber(2) + void clearOfframpId() => clearField(2); +} + +class ForgetOfframpRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ForgetOfframpRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + ForgetOfframpRequest._() : super(); + factory ForgetOfframpRequest({ + $core.List<$core.int>? offrampId, + }) { + final _result = create(); + if (offrampId != null) { + _result.offrampId = offrampId; + } + return _result; + } + factory ForgetOfframpRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ForgetOfframpRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ForgetOfframpRequest clone() => ForgetOfframpRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ForgetOfframpRequest copyWith(void Function(ForgetOfframpRequest) updates) => super.copyWith((message) => updates(message as ForgetOfframpRequest)) as ForgetOfframpRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ForgetOfframpRequest create() => ForgetOfframpRequest._(); + ForgetOfframpRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ForgetOfframpRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ForgetOfframpRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get offrampId => $_getN(0); + @$pb.TagNumber(1) + set offrampId($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasOfframpId() => $_has(0); + @$pb.TagNumber(1) + void clearOfframpId() => clearField(1); +} + +class ForgetOfframpResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ForgetOfframpResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OfframpResult.create) + ..hasRequiredFields = false + ; + + ForgetOfframpResponse._() : super(); + factory ForgetOfframpResponse({ + OfframpResult? result, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + return _result; + } + factory ForgetOfframpResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ForgetOfframpResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ForgetOfframpResponse clone() => ForgetOfframpResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ForgetOfframpResponse copyWith(void Function(ForgetOfframpResponse) updates) => super.copyWith((message) => updates(message as ForgetOfframpResponse)) as ForgetOfframpResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ForgetOfframpResponse create() => ForgetOfframpResponse._(); + ForgetOfframpResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ForgetOfframpResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ForgetOfframpResponse? _defaultInstance; + + @$pb.TagNumber(1) + OfframpResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OfframpResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OfframpResult ensureResult() => $_ensure(0); +} + +class Offramp extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Offramp', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'params', subBuilder: OfframpParams.create) + ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'state', $pb.PbFieldType.OE, defaultOrMaker: OfframpState.OS_INVALID, valueOf: OfframpState.valueOf, enumValues: OfframpState.values) + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'stateDetails') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mixinWithdrawalAddressJson') + ..aOM<$2.OngoingSwap>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ongoingSwap', subBuilder: $2.OngoingSwap.create) + ..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ongoingWithdrawalJson') + ..m<$core.String, $core.String>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'balances', entryClassName: 'Offramp.BalancesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS, packageName: const $pb.PackageName('mistyswap_offramp')) + ..hasRequiredFields = false + ; + + Offramp._() : super(); + factory Offramp({ + OfframpParams? params, + OfframpState? state, + $core.String? stateDetails, + $core.String? mixinWithdrawalAddressJson, + $2.OngoingSwap? ongoingSwap, + $core.String? ongoingWithdrawalJson, + $core.Map<$core.String, $core.String>? balances, + }) { + final _result = create(); + if (params != null) { + _result.params = params; + } + if (state != null) { + _result.state = state; + } + if (stateDetails != null) { + _result.stateDetails = stateDetails; + } + if (mixinWithdrawalAddressJson != null) { + _result.mixinWithdrawalAddressJson = mixinWithdrawalAddressJson; + } + if (ongoingSwap != null) { + _result.ongoingSwap = ongoingSwap; + } + if (ongoingWithdrawalJson != null) { + _result.ongoingWithdrawalJson = ongoingWithdrawalJson; + } + if (balances != null) { + _result.balances.addAll(balances); + } + return _result; + } + factory Offramp.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Offramp.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Offramp clone() => Offramp()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Offramp copyWith(void Function(Offramp) updates) => super.copyWith((message) => updates(message as Offramp)) as Offramp; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Offramp create() => Offramp._(); + Offramp createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Offramp getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Offramp? _defaultInstance; + + @$pb.TagNumber(1) + OfframpParams get params => $_getN(0); + @$pb.TagNumber(1) + set params(OfframpParams v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasParams() => $_has(0); + @$pb.TagNumber(1) + void clearParams() => clearField(1); + @$pb.TagNumber(1) + OfframpParams ensureParams() => $_ensure(0); + + @$pb.TagNumber(2) + OfframpState get state => $_getN(1); + @$pb.TagNumber(2) + set state(OfframpState v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasState() => $_has(1); + @$pb.TagNumber(2) + void clearState() => clearField(2); + + @$pb.TagNumber(3) + $core.String get stateDetails => $_getSZ(2); + @$pb.TagNumber(3) + set stateDetails($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasStateDetails() => $_has(2); + @$pb.TagNumber(3) + void clearStateDetails() => clearField(3); + + @$pb.TagNumber(4) + $core.String get mixinWithdrawalAddressJson => $_getSZ(3); + @$pb.TagNumber(4) + set mixinWithdrawalAddressJson($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasMixinWithdrawalAddressJson() => $_has(3); + @$pb.TagNumber(4) + void clearMixinWithdrawalAddressJson() => clearField(4); + + @$pb.TagNumber(5) + $2.OngoingSwap get ongoingSwap => $_getN(4); + @$pb.TagNumber(5) + set ongoingSwap($2.OngoingSwap v) { setField(5, v); } + @$pb.TagNumber(5) + $core.bool hasOngoingSwap() => $_has(4); + @$pb.TagNumber(5) + void clearOngoingSwap() => clearField(5); + @$pb.TagNumber(5) + $2.OngoingSwap ensureOngoingSwap() => $_ensure(4); + + @$pb.TagNumber(6) + $core.String get ongoingWithdrawalJson => $_getSZ(5); + @$pb.TagNumber(6) + set ongoingWithdrawalJson($core.String v) { $_setString(5, v); } + @$pb.TagNumber(6) + $core.bool hasOngoingWithdrawalJson() => $_has(5); + @$pb.TagNumber(6) + void clearOngoingWithdrawalJson() => clearField(6); + + @$pb.TagNumber(7) + $core.Map<$core.String, $core.String> get balances => $_getMap(6); +} + +class GetOfframpStatusRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOfframpStatusRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + GetOfframpStatusRequest._() : super(); + factory GetOfframpStatusRequest({ + $core.List<$core.int>? offrampId, + }) { + final _result = create(); + if (offrampId != null) { + _result.offrampId = offrampId; + } + return _result; + } + factory GetOfframpStatusRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOfframpStatusRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOfframpStatusRequest clone() => GetOfframpStatusRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOfframpStatusRequest copyWith(void Function(GetOfframpStatusRequest) updates) => super.copyWith((message) => updates(message as GetOfframpStatusRequest)) as GetOfframpStatusRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOfframpStatusRequest create() => GetOfframpStatusRequest._(); + GetOfframpStatusRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOfframpStatusRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOfframpStatusRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get offrampId => $_getN(0); + @$pb.TagNumber(1) + set offrampId($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasOfframpId() => $_has(0); + @$pb.TagNumber(1) + void clearOfframpId() => clearField(1); +} + +class GetOfframpStatusResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOfframpStatusResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OfframpResult.create) + ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offramp', subBuilder: Offramp.create) + ..hasRequiredFields = false + ; + + GetOfframpStatusResponse._() : super(); + factory GetOfframpStatusResponse({ + OfframpResult? result, + Offramp? offramp, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + if (offramp != null) { + _result.offramp = offramp; + } + return _result; + } + factory GetOfframpStatusResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOfframpStatusResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOfframpStatusResponse clone() => GetOfframpStatusResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOfframpStatusResponse copyWith(void Function(GetOfframpStatusResponse) updates) => super.copyWith((message) => updates(message as GetOfframpStatusResponse)) as GetOfframpStatusResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOfframpStatusResponse create() => GetOfframpStatusResponse._(); + GetOfframpStatusResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOfframpStatusResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOfframpStatusResponse? _defaultInstance; + + @$pb.TagNumber(1) + OfframpResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OfframpResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OfframpResult ensureResult() => $_ensure(0); + + @$pb.TagNumber(2) + Offramp get offramp => $_getN(1); + @$pb.TagNumber(2) + set offramp(Offramp v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasOfframp() => $_has(1); + @$pb.TagNumber(2) + void clearOfframp() => clearField(2); + @$pb.TagNumber(2) + Offramp ensureOfframp() => $_ensure(1); +} + +class GetOfframpDebugInfoRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOfframpDebugInfoRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'offrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + GetOfframpDebugInfoRequest._() : super(); + factory GetOfframpDebugInfoRequest({ + $core.List<$core.int>? offrampId, + }) { + final _result = create(); + if (offrampId != null) { + _result.offrampId = offrampId; + } + return _result; + } + factory GetOfframpDebugInfoRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOfframpDebugInfoRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOfframpDebugInfoRequest clone() => GetOfframpDebugInfoRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOfframpDebugInfoRequest copyWith(void Function(GetOfframpDebugInfoRequest) updates) => super.copyWith((message) => updates(message as GetOfframpDebugInfoRequest)) as GetOfframpDebugInfoRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOfframpDebugInfoRequest create() => GetOfframpDebugInfoRequest._(); + GetOfframpDebugInfoRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOfframpDebugInfoRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOfframpDebugInfoRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get offrampId => $_getN(0); + @$pb.TagNumber(1) + set offrampId($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasOfframpId() => $_has(0); + @$pb.TagNumber(1) + void clearOfframpId() => clearField(1); +} + +class GetOfframpDebugInfoResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOfframpDebugInfoResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_offramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OfframpResult.create) + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'debugInfoJson') + ..hasRequiredFields = false + ; + + GetOfframpDebugInfoResponse._() : super(); + factory GetOfframpDebugInfoResponse({ + OfframpResult? result, + $core.String? debugInfoJson, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + if (debugInfoJson != null) { + _result.debugInfoJson = debugInfoJson; + } + return _result; + } + factory GetOfframpDebugInfoResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOfframpDebugInfoResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOfframpDebugInfoResponse clone() => GetOfframpDebugInfoResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOfframpDebugInfoResponse copyWith(void Function(GetOfframpDebugInfoResponse) updates) => super.copyWith((message) => updates(message as GetOfframpDebugInfoResponse)) as GetOfframpDebugInfoResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOfframpDebugInfoResponse create() => GetOfframpDebugInfoResponse._(); + GetOfframpDebugInfoResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOfframpDebugInfoResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOfframpDebugInfoResponse? _defaultInstance; + + @$pb.TagNumber(1) + OfframpResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OfframpResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OfframpResult ensureResult() => $_ensure(0); + + @$pb.TagNumber(2) + $core.String get debugInfoJson => $_getSZ(1); + @$pb.TagNumber(2) + set debugInfoJson($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasDebugInfoJson() => $_has(1); + @$pb.TagNumber(2) + void clearDebugInfoJson() => clearField(2); +} + diff --git a/lib/src/protobufs/generated/mistyswap_offramp.pbenum.dart b/lib/src/protobufs/generated/mistyswap_offramp.pbenum.dart new file mode 100644 index 0000000..cfa53d3 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_offramp.pbenum.dart @@ -0,0 +1,79 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_offramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +// ignore_for_file: UNDEFINED_SHOWN_NAME +import 'dart:core' as $core; +import 'package:protobuf/protobuf.dart' as $pb; + +class OfframpResultCode extends $pb.ProtobufEnum { + static const OfframpResultCode ORC_INVALID = OfframpResultCode._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID'); + static const OfframpResultCode ORC_OK = OfframpResultCode._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_OK'); + static const OfframpResultCode ORC_TOO_MANY_OFFRAMPS = OfframpResultCode._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_TOO_MANY_OFFRAMPS'); + static const OfframpResultCode ORC_MIXIN_CREDENTIALS_JSON = OfframpResultCode._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_MIXIN_CREDENTIALS_JSON'); + static const OfframpResultCode ORC_OFFRAMP_ALREADY_IN_PROGRESS = OfframpResultCode._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_OFFRAMP_ALREADY_IN_PROGRESS'); + static const OfframpResultCode ORC_MIXIN = OfframpResultCode._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_MIXIN'); + static const OfframpResultCode ORC_INVALID_SRC_ASSET_ID = OfframpResultCode._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_SRC_ASSET_ID'); + static const OfframpResultCode ORC_INVALID_DST_ASSET_ID = OfframpResultCode._(7, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_DST_ASSET_ID'); + static const OfframpResultCode ORC_OFFRAMP_ID_NOT_FOUND = OfframpResultCode._(8, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_OFFRAMP_ID_NOT_FOUND'); + static const OfframpResultCode ORC_INVALID_SRC_EXPECTED_AMOUNT = OfframpResultCode._(9, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_SRC_EXPECTED_AMOUNT'); + static const OfframpResultCode ORC_INVALID_MIN_DST_RECEIVED_AMOUNT = OfframpResultCode._(10, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_MIN_DST_RECEIVED_AMOUNT'); + static const OfframpResultCode ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS = OfframpResultCode._(11, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS'); + static const OfframpResultCode ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER = OfframpResultCode._(12, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER'); + + static const $core.List values = [ + ORC_INVALID, + ORC_OK, + ORC_TOO_MANY_OFFRAMPS, + ORC_MIXIN_CREDENTIALS_JSON, + ORC_OFFRAMP_ALREADY_IN_PROGRESS, + ORC_MIXIN, + ORC_INVALID_SRC_ASSET_ID, + ORC_INVALID_DST_ASSET_ID, + ORC_OFFRAMP_ID_NOT_FOUND, + ORC_INVALID_SRC_EXPECTED_AMOUNT, + ORC_INVALID_MIN_DST_RECEIVED_AMOUNT, + ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS, + ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER, + ]; + + static final $core.Map<$core.int, OfframpResultCode> _byValue = $pb.ProtobufEnum.initByValue(values); + static OfframpResultCode? valueOf($core.int value) => _byValue[value]; + + const OfframpResultCode._($core.int v, $core.String n) : super(v, n); +} + +class OfframpState extends $pb.ProtobufEnum { + static const OfframpState OS_INVALID = OfframpState._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_INVALID'); + static const OfframpState OS_NOT_STARTED = OfframpState._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_NOT_STARTED'); + static const OfframpState OS_POLLING = OfframpState._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_POLLING'); + static const OfframpState OS_WAITING = OfframpState._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_WAITING'); + static const OfframpState OS_INVALID_WITHDRAWAL_ADDRESS = OfframpState._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_INVALID_WITHDRAWAL_ADDRESS'); + static const OfframpState OS_INTERMITTENT_ERROR = OfframpState._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_INTERMITTENT_ERROR'); + static const OfframpState OS_BLOCKED_ON_SWAP = OfframpState._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_BLOCKED_ON_SWAP'); + static const OfframpState OS_BLOCKED_ON_WITHDRAWAL = OfframpState._(7, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_BLOCKED_ON_WITHDRAWAL'); + static const OfframpState OS_WITHDRAWAL_COMPLETED = OfframpState._(8, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_WITHDRAWAL_COMPLETED'); + static const OfframpState OS_UNRECOVERABLE_ERROR = OfframpState._(9, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_UNRECOVERABLE_ERROR'); + + static const $core.List values = [ + OS_INVALID, + OS_NOT_STARTED, + OS_POLLING, + OS_WAITING, + OS_INVALID_WITHDRAWAL_ADDRESS, + OS_INTERMITTENT_ERROR, + OS_BLOCKED_ON_SWAP, + OS_BLOCKED_ON_WITHDRAWAL, + OS_WITHDRAWAL_COMPLETED, + OS_UNRECOVERABLE_ERROR, + ]; + + static final $core.Map<$core.int, OfframpState> _byValue = $pb.ProtobufEnum.initByValue(values); + static OfframpState? valueOf($core.int value) => _byValue[value]; + + const OfframpState._($core.int v, $core.String n) : super(v, n); +} + diff --git a/lib/src/protobufs/generated/mistyswap_offramp.pbgrpc.dart b/lib/src/protobufs/generated/mistyswap_offramp.pbgrpc.dart new file mode 100644 index 0000000..41dd404 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_offramp.pbgrpc.dart @@ -0,0 +1,123 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_offramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:async' as $async; + +import 'dart:core' as $core; + +import 'package:grpc/service_api.dart' as $grpc; +import 'attest.pb.dart' as $0; +export 'mistyswap_offramp.pb.dart'; + +class MistyswapOfframpApiClient extends $grpc.Client { + static final _$initiateOfframp = $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_offramp.MistyswapOfframpApi/InitiateOfframp', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + static final _$forgetOfframp = $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_offramp.MistyswapOfframpApi/ForgetOfframp', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + static final _$getOfframpStatus = $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_offramp.MistyswapOfframpApi/GetOfframpStatus', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + static final _$getOfframpDebugInfo = + $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_offramp.MistyswapOfframpApi/GetOfframpDebugInfo', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + + MistyswapOfframpApiClient($grpc.ClientChannel channel, + {$grpc.CallOptions? options, + $core.Iterable<$grpc.ClientInterceptor>? interceptors}) + : super(channel, options: options, interceptors: interceptors); + + $grpc.ResponseFuture<$0.Message> initiateOfframp($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$initiateOfframp, request, options: options); + } + + $grpc.ResponseFuture<$0.Message> forgetOfframp($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$forgetOfframp, request, options: options); + } + + $grpc.ResponseFuture<$0.Message> getOfframpStatus($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getOfframpStatus, request, options: options); + } + + $grpc.ResponseFuture<$0.Message> getOfframpDebugInfo($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getOfframpDebugInfo, request, options: options); + } +} + +abstract class MistyswapOfframpApiServiceBase extends $grpc.Service { + $core.String get $name => 'mistyswap_offramp.MistyswapOfframpApi'; + + MistyswapOfframpApiServiceBase() { + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'InitiateOfframp', + initiateOfframp_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'ForgetOfframp', + forgetOfframp_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'GetOfframpStatus', + getOfframpStatus_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'GetOfframpDebugInfo', + getOfframpDebugInfo_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + } + + $async.Future<$0.Message> initiateOfframp_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return initiateOfframp(call, await request); + } + + $async.Future<$0.Message> forgetOfframp_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return forgetOfframp(call, await request); + } + + $async.Future<$0.Message> getOfframpStatus_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return getOfframpStatus(call, await request); + } + + $async.Future<$0.Message> getOfframpDebugInfo_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return getOfframpDebugInfo(call, await request); + } + + $async.Future<$0.Message> initiateOfframp( + $grpc.ServiceCall call, $0.Message request); + $async.Future<$0.Message> forgetOfframp( + $grpc.ServiceCall call, $0.Message request); + $async.Future<$0.Message> getOfframpStatus( + $grpc.ServiceCall call, $0.Message request); + $async.Future<$0.Message> getOfframpDebugInfo( + $grpc.ServiceCall call, $0.Message request); +} diff --git a/lib/src/protobufs/generated/mistyswap_offramp.pbjson.dart b/lib/src/protobufs/generated/mistyswap_offramp.pbjson.dart new file mode 100644 index 0000000..1c8a65d --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_offramp.pbjson.dart @@ -0,0 +1,191 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_offramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use offrampResultCodeDescriptor instead') +const OfframpResultCode$json = const { + '1': 'OfframpResultCode', + '2': const [ + const {'1': 'ORC_INVALID', '2': 0}, + const {'1': 'ORC_OK', '2': 1}, + const {'1': 'ORC_TOO_MANY_OFFRAMPS', '2': 2}, + const {'1': 'ORC_MIXIN_CREDENTIALS_JSON', '2': 3}, + const {'1': 'ORC_OFFRAMP_ALREADY_IN_PROGRESS', '2': 4}, + const {'1': 'ORC_MIXIN', '2': 5}, + const {'1': 'ORC_INVALID_SRC_ASSET_ID', '2': 6}, + const {'1': 'ORC_INVALID_DST_ASSET_ID', '2': 7}, + const {'1': 'ORC_OFFRAMP_ID_NOT_FOUND', '2': 8}, + const {'1': 'ORC_INVALID_SRC_EXPECTED_AMOUNT', '2': 9}, + const {'1': 'ORC_INVALID_MIN_DST_RECEIVED_AMOUNT', '2': 10}, + const {'1': 'ORC_INVALID_MAX_FEE_AMOUNT_IN_DST_TOKENS', '2': 11}, + const {'1': 'ORC_INVALID_FEE_TOKEN_SWAP_MULTIPLIER', '2': 12}, + ], +}; + +/// Descriptor for `OfframpResultCode`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List offrampResultCodeDescriptor = $convert.base64Decode('ChFPZmZyYW1wUmVzdWx0Q29kZRIPCgtPUkNfSU5WQUxJRBAAEgoKBk9SQ19PSxABEhkKFU9SQ19UT09fTUFOWV9PRkZSQU1QUxACEh4KGk9SQ19NSVhJTl9DUkVERU5USUFMU19KU09OEAMSIwofT1JDX09GRlJBTVBfQUxSRUFEWV9JTl9QUk9HUkVTUxAEEg0KCU9SQ19NSVhJThAFEhwKGE9SQ19JTlZBTElEX1NSQ19BU1NFVF9JRBAGEhwKGE9SQ19JTlZBTElEX0RTVF9BU1NFVF9JRBAHEhwKGE9SQ19PRkZSQU1QX0lEX05PVF9GT1VORBAIEiMKH09SQ19JTlZBTElEX1NSQ19FWFBFQ1RFRF9BTU9VTlQQCRInCiNPUkNfSU5WQUxJRF9NSU5fRFNUX1JFQ0VJVkVEX0FNT1VOVBAKEiwKKE9SQ19JTlZBTElEX01BWF9GRUVfQU1PVU5UX0lOX0RTVF9UT0tFTlMQCxIpCiVPUkNfSU5WQUxJRF9GRUVfVE9LRU5fU1dBUF9NVUxUSVBMSUVSEAw='); +@$core.Deprecated('Use offrampStateDescriptor instead') +const OfframpState$json = const { + '1': 'OfframpState', + '2': const [ + const {'1': 'OS_INVALID', '2': 0}, + const {'1': 'OS_NOT_STARTED', '2': 1}, + const {'1': 'OS_POLLING', '2': 2}, + const {'1': 'OS_WAITING', '2': 3}, + const {'1': 'OS_INVALID_WITHDRAWAL_ADDRESS', '2': 4}, + const {'1': 'OS_INTERMITTENT_ERROR', '2': 5}, + const {'1': 'OS_BLOCKED_ON_SWAP', '2': 6}, + const {'1': 'OS_BLOCKED_ON_WITHDRAWAL', '2': 7}, + const {'1': 'OS_WITHDRAWAL_COMPLETED', '2': 8}, + const {'1': 'OS_UNRECOVERABLE_ERROR', '2': 9}, + ], +}; + +/// Descriptor for `OfframpState`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List offrampStateDescriptor = $convert.base64Decode('CgxPZmZyYW1wU3RhdGUSDgoKT1NfSU5WQUxJRBAAEhIKDk9TX05PVF9TVEFSVEVEEAESDgoKT1NfUE9MTElORxACEg4KCk9TX1dBSVRJTkcQAxIhCh1PU19JTlZBTElEX1dJVEhEUkFXQUxfQUREUkVTUxAEEhkKFU9TX0lOVEVSTUlUVEVOVF9FUlJPUhAFEhYKEk9TX0JMT0NLRURfT05fU1dBUBAGEhwKGE9TX0JMT0NLRURfT05fV0lUSERSQVdBTBAHEhsKF09TX1dJVEhEUkFXQUxfQ09NUExFVEVEEAgSGgoWT1NfVU5SRUNPVkVSQUJMRV9FUlJPUhAJ'); +@$core.Deprecated('Use offrampResultDescriptor instead') +const OfframpResult$json = const { + '1': 'OfframpResult', + '2': const [ + const {'1': 'code', '3': 1, '4': 1, '5': 14, '6': '.mistyswap_offramp.OfframpResultCode', '10': 'code'}, + const {'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'}, + const {'1': 'offramp_id', '3': 3, '4': 1, '5': 12, '10': 'offrampId'}, + ], +}; + +/// Descriptor for `OfframpResult`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List offrampResultDescriptor = $convert.base64Decode('Cg1PZmZyYW1wUmVzdWx0EjgKBGNvZGUYASABKA4yJC5taXN0eXN3YXBfb2ZmcmFtcC5PZmZyYW1wUmVzdWx0Q29kZVIEY29kZRIYCgdtZXNzYWdlGAIgASgJUgdtZXNzYWdlEh0KCm9mZnJhbXBfaWQYAyABKAxSCW9mZnJhbXBJZA=='); +@$core.Deprecated('Use offrampParamsDescriptor instead') +const OfframpParams$json = const { + '1': 'OfframpParams', + '2': const [ + const {'1': 'src_asset_id', '3': 1, '4': 1, '5': 9, '10': 'srcAssetId'}, + const {'1': 'src_expected_amount', '3': 2, '4': 1, '5': 9, '10': 'srcExpectedAmount'}, + const {'1': 'dst_asset_id', '3': 3, '4': 1, '5': 9, '10': 'dstAssetId'}, + const {'1': 'dst_address', '3': 4, '4': 1, '5': 9, '10': 'dstAddress'}, + const {'1': 'dst_address_tag', '3': 5, '4': 1, '5': 9, '10': 'dstAddressTag'}, + const {'1': 'min_dst_received_amount', '3': 6, '4': 1, '5': 9, '10': 'minDstReceivedAmount'}, + const {'1': 'max_fee_amount_in_dst_tokens', '3': 7, '4': 1, '5': 9, '10': 'maxFeeAmountInDstTokens'}, + const {'1': 'fee_token_swap_multiplier', '3': 8, '4': 1, '5': 9, '10': 'feeTokenSwapMultiplier'}, + ], +}; + +/// Descriptor for `OfframpParams`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List offrampParamsDescriptor = $convert.base64Decode('Cg1PZmZyYW1wUGFyYW1zEiAKDHNyY19hc3NldF9pZBgBIAEoCVIKc3JjQXNzZXRJZBIuChNzcmNfZXhwZWN0ZWRfYW1vdW50GAIgASgJUhFzcmNFeHBlY3RlZEFtb3VudBIgCgxkc3RfYXNzZXRfaWQYAyABKAlSCmRzdEFzc2V0SWQSHwoLZHN0X2FkZHJlc3MYBCABKAlSCmRzdEFkZHJlc3MSJgoPZHN0X2FkZHJlc3NfdGFnGAUgASgJUg1kc3RBZGRyZXNzVGFnEjUKF21pbl9kc3RfcmVjZWl2ZWRfYW1vdW50GAYgASgJUhRtaW5Ec3RSZWNlaXZlZEFtb3VudBI9ChxtYXhfZmVlX2Ftb3VudF9pbl9kc3RfdG9rZW5zGAcgASgJUhdtYXhGZWVBbW91bnRJbkRzdFRva2VucxI5ChlmZWVfdG9rZW5fc3dhcF9tdWx0aXBsaWVyGAggASgJUhZmZWVUb2tlblN3YXBNdWx0aXBsaWVy'); +@$core.Deprecated('Use initiateOfframpRequestDescriptor instead') +const InitiateOfframpRequest$json = const { + '1': 'InitiateOfframpRequest', + '2': const [ + const {'1': 'mixin_credentials_json', '3': 1, '4': 1, '5': 9, '10': 'mixinCredentialsJson'}, + const {'1': 'params', '3': 2, '4': 1, '5': 11, '6': '.mistyswap_offramp.OfframpParams', '10': 'params'}, + ], +}; + +/// Descriptor for `InitiateOfframpRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List initiateOfframpRequestDescriptor = $convert.base64Decode('ChZJbml0aWF0ZU9mZnJhbXBSZXF1ZXN0EjQKFm1peGluX2NyZWRlbnRpYWxzX2pzb24YASABKAlSFG1peGluQ3JlZGVudGlhbHNKc29uEjgKBnBhcmFtcxgCIAEoCzIgLm1pc3R5c3dhcF9vZmZyYW1wLk9mZnJhbXBQYXJhbXNSBnBhcmFtcw=='); +@$core.Deprecated('Use initiateOfframpResponseDescriptor instead') +const InitiateOfframpResponse$json = const { + '1': 'InitiateOfframpResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_offramp.OfframpResult', '10': 'result'}, + const {'1': 'offramp_id', '3': 2, '4': 1, '5': 12, '10': 'offrampId'}, + ], +}; + +/// Descriptor for `InitiateOfframpResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List initiateOfframpResponseDescriptor = $convert.base64Decode('ChdJbml0aWF0ZU9mZnJhbXBSZXNwb25zZRI4CgZyZXN1bHQYASABKAsyIC5taXN0eXN3YXBfb2ZmcmFtcC5PZmZyYW1wUmVzdWx0UgZyZXN1bHQSHQoKb2ZmcmFtcF9pZBgCIAEoDFIJb2ZmcmFtcElk'); +@$core.Deprecated('Use forgetOfframpRequestDescriptor instead') +const ForgetOfframpRequest$json = const { + '1': 'ForgetOfframpRequest', + '2': const [ + const {'1': 'offramp_id', '3': 1, '4': 1, '5': 12, '10': 'offrampId'}, + ], +}; + +/// Descriptor for `ForgetOfframpRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List forgetOfframpRequestDescriptor = $convert.base64Decode('ChRGb3JnZXRPZmZyYW1wUmVxdWVzdBIdCgpvZmZyYW1wX2lkGAEgASgMUglvZmZyYW1wSWQ='); +@$core.Deprecated('Use forgetOfframpResponseDescriptor instead') +const ForgetOfframpResponse$json = const { + '1': 'ForgetOfframpResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_offramp.OfframpResult', '10': 'result'}, + ], +}; + +/// Descriptor for `ForgetOfframpResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List forgetOfframpResponseDescriptor = $convert.base64Decode('ChVGb3JnZXRPZmZyYW1wUmVzcG9uc2USOAoGcmVzdWx0GAEgASgLMiAubWlzdHlzd2FwX29mZnJhbXAuT2ZmcmFtcFJlc3VsdFIGcmVzdWx0'); +@$core.Deprecated('Use offrampDescriptor instead') +const Offramp$json = const { + '1': 'Offramp', + '2': const [ + const {'1': 'params', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_offramp.OfframpParams', '10': 'params'}, + const {'1': 'state', '3': 2, '4': 1, '5': 14, '6': '.mistyswap_offramp.OfframpState', '10': 'state'}, + const {'1': 'state_details', '3': 3, '4': 1, '5': 9, '10': 'stateDetails'}, + const {'1': 'mixin_withdrawal_address_json', '3': 4, '4': 1, '5': 9, '10': 'mixinWithdrawalAddressJson'}, + const {'1': 'ongoing_swap', '3': 5, '4': 1, '5': 11, '6': '.mistyswap_common.OngoingSwap', '10': 'ongoingSwap'}, + const {'1': 'ongoing_withdrawal_json', '3': 6, '4': 1, '5': 9, '10': 'ongoingWithdrawalJson'}, + const {'1': 'balances', '3': 7, '4': 3, '5': 11, '6': '.mistyswap_offramp.Offramp.BalancesEntry', '10': 'balances'}, + ], + '3': const [Offramp_BalancesEntry$json], +}; + +@$core.Deprecated('Use offrampDescriptor instead') +const Offramp_BalancesEntry$json = const { + '1': 'BalancesEntry', + '2': const [ + const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, + ], + '7': const {'7': true}, +}; + +/// Descriptor for `Offramp`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List offrampDescriptor = $convert.base64Decode('CgdPZmZyYW1wEjgKBnBhcmFtcxgBIAEoCzIgLm1pc3R5c3dhcF9vZmZyYW1wLk9mZnJhbXBQYXJhbXNSBnBhcmFtcxI1CgVzdGF0ZRgCIAEoDjIfLm1pc3R5c3dhcF9vZmZyYW1wLk9mZnJhbXBTdGF0ZVIFc3RhdGUSIwoNc3RhdGVfZGV0YWlscxgDIAEoCVIMc3RhdGVEZXRhaWxzEkEKHW1peGluX3dpdGhkcmF3YWxfYWRkcmVzc19qc29uGAQgASgJUhptaXhpbldpdGhkcmF3YWxBZGRyZXNzSnNvbhJACgxvbmdvaW5nX3N3YXAYBSABKAsyHS5taXN0eXN3YXBfY29tbW9uLk9uZ29pbmdTd2FwUgtvbmdvaW5nU3dhcBI2ChdvbmdvaW5nX3dpdGhkcmF3YWxfanNvbhgGIAEoCVIVb25nb2luZ1dpdGhkcmF3YWxKc29uEkQKCGJhbGFuY2VzGAcgAygLMigubWlzdHlzd2FwX29mZnJhbXAuT2ZmcmFtcC5CYWxhbmNlc0VudHJ5UghiYWxhbmNlcxo7Cg1CYWxhbmNlc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgJUgV2YWx1ZToCOAE='); +@$core.Deprecated('Use getOfframpStatusRequestDescriptor instead') +const GetOfframpStatusRequest$json = const { + '1': 'GetOfframpStatusRequest', + '2': const [ + const {'1': 'offramp_id', '3': 1, '4': 1, '5': 12, '10': 'offrampId'}, + ], +}; + +/// Descriptor for `GetOfframpStatusRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOfframpStatusRequestDescriptor = $convert.base64Decode('ChdHZXRPZmZyYW1wU3RhdHVzUmVxdWVzdBIdCgpvZmZyYW1wX2lkGAEgASgMUglvZmZyYW1wSWQ='); +@$core.Deprecated('Use getOfframpStatusResponseDescriptor instead') +const GetOfframpStatusResponse$json = const { + '1': 'GetOfframpStatusResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_offramp.OfframpResult', '10': 'result'}, + const {'1': 'offramp', '3': 2, '4': 1, '5': 11, '6': '.mistyswap_offramp.Offramp', '10': 'offramp'}, + ], +}; + +/// Descriptor for `GetOfframpStatusResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOfframpStatusResponseDescriptor = $convert.base64Decode('ChhHZXRPZmZyYW1wU3RhdHVzUmVzcG9uc2USOAoGcmVzdWx0GAEgASgLMiAubWlzdHlzd2FwX29mZnJhbXAuT2ZmcmFtcFJlc3VsdFIGcmVzdWx0EjQKB29mZnJhbXAYAiABKAsyGi5taXN0eXN3YXBfb2ZmcmFtcC5PZmZyYW1wUgdvZmZyYW1w'); +@$core.Deprecated('Use getOfframpDebugInfoRequestDescriptor instead') +const GetOfframpDebugInfoRequest$json = const { + '1': 'GetOfframpDebugInfoRequest', + '2': const [ + const {'1': 'offramp_id', '3': 1, '4': 1, '5': 12, '10': 'offrampId'}, + ], +}; + +/// Descriptor for `GetOfframpDebugInfoRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOfframpDebugInfoRequestDescriptor = $convert.base64Decode('ChpHZXRPZmZyYW1wRGVidWdJbmZvUmVxdWVzdBIdCgpvZmZyYW1wX2lkGAEgASgMUglvZmZyYW1wSWQ='); +@$core.Deprecated('Use getOfframpDebugInfoResponseDescriptor instead') +const GetOfframpDebugInfoResponse$json = const { + '1': 'GetOfframpDebugInfoResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_offramp.OfframpResult', '10': 'result'}, + const {'1': 'debug_info_json', '3': 2, '4': 1, '5': 9, '10': 'debugInfoJson'}, + ], +}; + +/// Descriptor for `GetOfframpDebugInfoResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOfframpDebugInfoResponseDescriptor = $convert.base64Decode('ChtHZXRPZmZyYW1wRGVidWdJbmZvUmVzcG9uc2USOAoGcmVzdWx0GAEgASgLMiAubWlzdHlzd2FwX29mZnJhbXAuT2ZmcmFtcFJlc3VsdFIGcmVzdWx0EiYKD2RlYnVnX2luZm9fanNvbhgCIAEoCVINZGVidWdJbmZvSnNvbg=='); diff --git a/lib/src/protobufs/generated/mistyswap_onramp.pb.dart b/lib/src/protobufs/generated/mistyswap_onramp.pb.dart new file mode 100644 index 0000000..6041b30 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_onramp.pb.dart @@ -0,0 +1,762 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_onramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'mistyswap_common.pb.dart' as $2; + +import 'mistyswap_onramp.pbenum.dart'; + +export 'mistyswap_onramp.pbenum.dart'; + +class OnrampResult extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OnrampResult', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'code', $pb.PbFieldType.OE, defaultOrMaker: OnrampResultCode.ORC_INVALID, valueOf: OnrampResultCode.valueOf, enumValues: OnrampResultCode.values) + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'message') + ..a<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onrampId', $pb.PbFieldType.OY) + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'assetId') + ..hasRequiredFields = false + ; + + OnrampResult._() : super(); + factory OnrampResult({ + OnrampResultCode? code, + $core.String? message, + $core.List<$core.int>? onrampId, + $core.String? assetId, + }) { + final _result = create(); + if (code != null) { + _result.code = code; + } + if (message != null) { + _result.message = message; + } + if (onrampId != null) { + _result.onrampId = onrampId; + } + if (assetId != null) { + _result.assetId = assetId; + } + return _result; + } + factory OnrampResult.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory OnrampResult.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + OnrampResult clone() => OnrampResult()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + OnrampResult copyWith(void Function(OnrampResult) updates) => super.copyWith((message) => updates(message as OnrampResult)) as OnrampResult; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static OnrampResult create() => OnrampResult._(); + OnrampResult createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static OnrampResult getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static OnrampResult? _defaultInstance; + + @$pb.TagNumber(1) + OnrampResultCode get code => $_getN(0); + @$pb.TagNumber(1) + set code(OnrampResultCode v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasCode() => $_has(0); + @$pb.TagNumber(1) + void clearCode() => clearField(1); + + @$pb.TagNumber(2) + $core.String get message => $_getSZ(1); + @$pb.TagNumber(2) + set message($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasMessage() => $_has(1); + @$pb.TagNumber(2) + void clearMessage() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$core.int> get onrampId => $_getN(2); + @$pb.TagNumber(3) + set onrampId($core.List<$core.int> v) { $_setBytes(2, v); } + @$pb.TagNumber(3) + $core.bool hasOnrampId() => $_has(2); + @$pb.TagNumber(3) + void clearOnrampId() => clearField(3); + + @$pb.TagNumber(4) + $core.String get assetId => $_getSZ(3); + @$pb.TagNumber(4) + set assetId($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasAssetId() => $_has(3); + @$pb.TagNumber(4) + void clearAssetId() => clearField(4); +} + +class OnrampParams extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OnrampParams', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstAssetId') + ..m<$core.String, $core.String>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'srcAssetIdToMinSwapRate', entryClassName: 'OnrampParams.SrcAssetIdToMinSwapRateEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS, packageName: const $pb.PackageName('mistyswap_onramp')) + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dstAddress') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'minWithdrawalAmount') + ..hasRequiredFields = false + ; + + OnrampParams._() : super(); + factory OnrampParams({ + $core.String? dstAssetId, + $core.Map<$core.String, $core.String>? srcAssetIdToMinSwapRate, + $core.String? dstAddress, + $core.String? minWithdrawalAmount, + }) { + final _result = create(); + if (dstAssetId != null) { + _result.dstAssetId = dstAssetId; + } + if (srcAssetIdToMinSwapRate != null) { + _result.srcAssetIdToMinSwapRate.addAll(srcAssetIdToMinSwapRate); + } + if (dstAddress != null) { + _result.dstAddress = dstAddress; + } + if (minWithdrawalAmount != null) { + _result.minWithdrawalAmount = minWithdrawalAmount; + } + return _result; + } + factory OnrampParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory OnrampParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + OnrampParams clone() => OnrampParams()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + OnrampParams copyWith(void Function(OnrampParams) updates) => super.copyWith((message) => updates(message as OnrampParams)) as OnrampParams; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static OnrampParams create() => OnrampParams._(); + OnrampParams createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static OnrampParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static OnrampParams? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get dstAssetId => $_getSZ(0); + @$pb.TagNumber(1) + set dstAssetId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasDstAssetId() => $_has(0); + @$pb.TagNumber(1) + void clearDstAssetId() => clearField(1); + + @$pb.TagNumber(2) + $core.Map<$core.String, $core.String> get srcAssetIdToMinSwapRate => $_getMap(1); + + @$pb.TagNumber(3) + $core.String get dstAddress => $_getSZ(2); + @$pb.TagNumber(3) + set dstAddress($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasDstAddress() => $_has(2); + @$pb.TagNumber(3) + void clearDstAddress() => clearField(3); + + @$pb.TagNumber(4) + $core.String get minWithdrawalAmount => $_getSZ(3); + @$pb.TagNumber(4) + set minWithdrawalAmount($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasMinWithdrawalAmount() => $_has(3); + @$pb.TagNumber(4) + void clearMinWithdrawalAmount() => clearField(4); +} + +class SetupOnrampRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SetupOnrampRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mixinCredentialsJson') + ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'params', subBuilder: OnrampParams.create) + ..hasRequiredFields = false + ; + + SetupOnrampRequest._() : super(); + factory SetupOnrampRequest({ + $core.String? mixinCredentialsJson, + OnrampParams? params, + }) { + final _result = create(); + if (mixinCredentialsJson != null) { + _result.mixinCredentialsJson = mixinCredentialsJson; + } + if (params != null) { + _result.params = params; + } + return _result; + } + factory SetupOnrampRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SetupOnrampRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SetupOnrampRequest clone() => SetupOnrampRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SetupOnrampRequest copyWith(void Function(SetupOnrampRequest) updates) => super.copyWith((message) => updates(message as SetupOnrampRequest)) as SetupOnrampRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static SetupOnrampRequest create() => SetupOnrampRequest._(); + SetupOnrampRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SetupOnrampRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SetupOnrampRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get mixinCredentialsJson => $_getSZ(0); + @$pb.TagNumber(1) + set mixinCredentialsJson($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasMixinCredentialsJson() => $_has(0); + @$pb.TagNumber(1) + void clearMixinCredentialsJson() => clearField(1); + + @$pb.TagNumber(2) + OnrampParams get params => $_getN(1); + @$pb.TagNumber(2) + set params(OnrampParams v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasParams() => $_has(1); + @$pb.TagNumber(2) + void clearParams() => clearField(2); + @$pb.TagNumber(2) + OnrampParams ensureParams() => $_ensure(1); +} + +class SetupOnrampResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SetupOnrampResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OnrampResult.create) + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + SetupOnrampResponse._() : super(); + factory SetupOnrampResponse({ + OnrampResult? result, + $core.List<$core.int>? onrampId, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + if (onrampId != null) { + _result.onrampId = onrampId; + } + return _result; + } + factory SetupOnrampResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SetupOnrampResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SetupOnrampResponse clone() => SetupOnrampResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SetupOnrampResponse copyWith(void Function(SetupOnrampResponse) updates) => super.copyWith((message) => updates(message as SetupOnrampResponse)) as SetupOnrampResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static SetupOnrampResponse create() => SetupOnrampResponse._(); + SetupOnrampResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static SetupOnrampResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SetupOnrampResponse? _defaultInstance; + + @$pb.TagNumber(1) + OnrampResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OnrampResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OnrampResult ensureResult() => $_ensure(0); + + @$pb.TagNumber(2) + $core.List<$core.int> get onrampId => $_getN(1); + @$pb.TagNumber(2) + set onrampId($core.List<$core.int> v) { $_setBytes(1, v); } + @$pb.TagNumber(2) + $core.bool hasOnrampId() => $_has(1); + @$pb.TagNumber(2) + void clearOnrampId() => clearField(2); +} + +class ForgetOnrampRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ForgetOnrampRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + ForgetOnrampRequest._() : super(); + factory ForgetOnrampRequest({ + $core.List<$core.int>? onrampId, + }) { + final _result = create(); + if (onrampId != null) { + _result.onrampId = onrampId; + } + return _result; + } + factory ForgetOnrampRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ForgetOnrampRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ForgetOnrampRequest clone() => ForgetOnrampRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ForgetOnrampRequest copyWith(void Function(ForgetOnrampRequest) updates) => super.copyWith((message) => updates(message as ForgetOnrampRequest)) as ForgetOnrampRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ForgetOnrampRequest create() => ForgetOnrampRequest._(); + ForgetOnrampRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ForgetOnrampRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ForgetOnrampRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get onrampId => $_getN(0); + @$pb.TagNumber(1) + set onrampId($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasOnrampId() => $_has(0); + @$pb.TagNumber(1) + void clearOnrampId() => clearField(1); +} + +class ForgetOnrampResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ForgetOnrampResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OnrampResult.create) + ..hasRequiredFields = false + ; + + ForgetOnrampResponse._() : super(); + factory ForgetOnrampResponse({ + OnrampResult? result, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + return _result; + } + factory ForgetOnrampResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ForgetOnrampResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ForgetOnrampResponse clone() => ForgetOnrampResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ForgetOnrampResponse copyWith(void Function(ForgetOnrampResponse) updates) => super.copyWith((message) => updates(message as ForgetOnrampResponse)) as ForgetOnrampResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ForgetOnrampResponse create() => ForgetOnrampResponse._(); + ForgetOnrampResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ForgetOnrampResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ForgetOnrampResponse? _defaultInstance; + + @$pb.TagNumber(1) + OnrampResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OnrampResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OnrampResult ensureResult() => $_ensure(0); +} + +class Onramp extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Onramp', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'params', subBuilder: OnrampParams.create) + ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'state', $pb.PbFieldType.OE, defaultOrMaker: OnrampState.OS_INVALID, valueOf: OnrampState.valueOf, enumValues: OnrampState.values) + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'stateDetails') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'mixinWithdrawalAddressJson') + ..aOM<$2.OngoingSwap>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ongoingSwap', subBuilder: $2.OngoingSwap.create) + ..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ongoingWithdrawalJson') + ..m<$core.String, $core.String>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'balances', entryClassName: 'Onramp.BalancesEntry', keyFieldType: $pb.PbFieldType.OS, valueFieldType: $pb.PbFieldType.OS, packageName: const $pb.PackageName('mistyswap_onramp')) + ..hasRequiredFields = false + ; + + Onramp._() : super(); + factory Onramp({ + OnrampParams? params, + OnrampState? state, + $core.String? stateDetails, + $core.String? mixinWithdrawalAddressJson, + $2.OngoingSwap? ongoingSwap, + $core.String? ongoingWithdrawalJson, + $core.Map<$core.String, $core.String>? balances, + }) { + final _result = create(); + if (params != null) { + _result.params = params; + } + if (state != null) { + _result.state = state; + } + if (stateDetails != null) { + _result.stateDetails = stateDetails; + } + if (mixinWithdrawalAddressJson != null) { + _result.mixinWithdrawalAddressJson = mixinWithdrawalAddressJson; + } + if (ongoingSwap != null) { + _result.ongoingSwap = ongoingSwap; + } + if (ongoingWithdrawalJson != null) { + _result.ongoingWithdrawalJson = ongoingWithdrawalJson; + } + if (balances != null) { + _result.balances.addAll(balances); + } + return _result; + } + factory Onramp.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Onramp.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Onramp clone() => Onramp()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Onramp copyWith(void Function(Onramp) updates) => super.copyWith((message) => updates(message as Onramp)) as Onramp; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Onramp create() => Onramp._(); + Onramp createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Onramp getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Onramp? _defaultInstance; + + @$pb.TagNumber(1) + OnrampParams get params => $_getN(0); + @$pb.TagNumber(1) + set params(OnrampParams v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasParams() => $_has(0); + @$pb.TagNumber(1) + void clearParams() => clearField(1); + @$pb.TagNumber(1) + OnrampParams ensureParams() => $_ensure(0); + + @$pb.TagNumber(2) + OnrampState get state => $_getN(1); + @$pb.TagNumber(2) + set state(OnrampState v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasState() => $_has(1); + @$pb.TagNumber(2) + void clearState() => clearField(2); + + @$pb.TagNumber(3) + $core.String get stateDetails => $_getSZ(2); + @$pb.TagNumber(3) + set stateDetails($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasStateDetails() => $_has(2); + @$pb.TagNumber(3) + void clearStateDetails() => clearField(3); + + @$pb.TagNumber(4) + $core.String get mixinWithdrawalAddressJson => $_getSZ(3); + @$pb.TagNumber(4) + set mixinWithdrawalAddressJson($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasMixinWithdrawalAddressJson() => $_has(3); + @$pb.TagNumber(4) + void clearMixinWithdrawalAddressJson() => clearField(4); + + @$pb.TagNumber(5) + $2.OngoingSwap get ongoingSwap => $_getN(4); + @$pb.TagNumber(5) + set ongoingSwap($2.OngoingSwap v) { setField(5, v); } + @$pb.TagNumber(5) + $core.bool hasOngoingSwap() => $_has(4); + @$pb.TagNumber(5) + void clearOngoingSwap() => clearField(5); + @$pb.TagNumber(5) + $2.OngoingSwap ensureOngoingSwap() => $_ensure(4); + + @$pb.TagNumber(6) + $core.String get ongoingWithdrawalJson => $_getSZ(5); + @$pb.TagNumber(6) + set ongoingWithdrawalJson($core.String v) { $_setString(5, v); } + @$pb.TagNumber(6) + $core.bool hasOngoingWithdrawalJson() => $_has(5); + @$pb.TagNumber(6) + void clearOngoingWithdrawalJson() => clearField(6); + + @$pb.TagNumber(7) + $core.Map<$core.String, $core.String> get balances => $_getMap(6); +} + +class GetOnrampStatusRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOnrampStatusRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + GetOnrampStatusRequest._() : super(); + factory GetOnrampStatusRequest({ + $core.List<$core.int>? onrampId, + }) { + final _result = create(); + if (onrampId != null) { + _result.onrampId = onrampId; + } + return _result; + } + factory GetOnrampStatusRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOnrampStatusRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOnrampStatusRequest clone() => GetOnrampStatusRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOnrampStatusRequest copyWith(void Function(GetOnrampStatusRequest) updates) => super.copyWith((message) => updates(message as GetOnrampStatusRequest)) as GetOnrampStatusRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOnrampStatusRequest create() => GetOnrampStatusRequest._(); + GetOnrampStatusRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOnrampStatusRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOnrampStatusRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get onrampId => $_getN(0); + @$pb.TagNumber(1) + set onrampId($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasOnrampId() => $_has(0); + @$pb.TagNumber(1) + void clearOnrampId() => clearField(1); +} + +class GetOnrampStatusResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOnrampStatusResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OnrampResult.create) + ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onramp', subBuilder: Onramp.create) + ..hasRequiredFields = false + ; + + GetOnrampStatusResponse._() : super(); + factory GetOnrampStatusResponse({ + OnrampResult? result, + Onramp? onramp, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + if (onramp != null) { + _result.onramp = onramp; + } + return _result; + } + factory GetOnrampStatusResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOnrampStatusResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOnrampStatusResponse clone() => GetOnrampStatusResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOnrampStatusResponse copyWith(void Function(GetOnrampStatusResponse) updates) => super.copyWith((message) => updates(message as GetOnrampStatusResponse)) as GetOnrampStatusResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOnrampStatusResponse create() => GetOnrampStatusResponse._(); + GetOnrampStatusResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOnrampStatusResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOnrampStatusResponse? _defaultInstance; + + @$pb.TagNumber(1) + OnrampResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OnrampResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OnrampResult ensureResult() => $_ensure(0); + + @$pb.TagNumber(2) + Onramp get onramp => $_getN(1); + @$pb.TagNumber(2) + set onramp(Onramp v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasOnramp() => $_has(1); + @$pb.TagNumber(2) + void clearOnramp() => clearField(2); + @$pb.TagNumber(2) + Onramp ensureOnramp() => $_ensure(1); +} + +class GetOnrampDebugInfoRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOnrampDebugInfoRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'onrampId', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + GetOnrampDebugInfoRequest._() : super(); + factory GetOnrampDebugInfoRequest({ + $core.List<$core.int>? onrampId, + }) { + final _result = create(); + if (onrampId != null) { + _result.onrampId = onrampId; + } + return _result; + } + factory GetOnrampDebugInfoRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOnrampDebugInfoRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOnrampDebugInfoRequest clone() => GetOnrampDebugInfoRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOnrampDebugInfoRequest copyWith(void Function(GetOnrampDebugInfoRequest) updates) => super.copyWith((message) => updates(message as GetOnrampDebugInfoRequest)) as GetOnrampDebugInfoRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOnrampDebugInfoRequest create() => GetOnrampDebugInfoRequest._(); + GetOnrampDebugInfoRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOnrampDebugInfoRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOnrampDebugInfoRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get onrampId => $_getN(0); + @$pb.TagNumber(1) + set onrampId($core.List<$core.int> v) { $_setBytes(0, v); } + @$pb.TagNumber(1) + $core.bool hasOnrampId() => $_has(0); + @$pb.TagNumber(1) + void clearOnrampId() => clearField(1); +} + +class GetOnrampDebugInfoResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOnrampDebugInfoResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'mistyswap_onramp'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'result', subBuilder: OnrampResult.create) + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'debugInfoJson') + ..hasRequiredFields = false + ; + + GetOnrampDebugInfoResponse._() : super(); + factory GetOnrampDebugInfoResponse({ + OnrampResult? result, + $core.String? debugInfoJson, + }) { + final _result = create(); + if (result != null) { + _result.result = result; + } + if (debugInfoJson != null) { + _result.debugInfoJson = debugInfoJson; + } + return _result; + } + factory GetOnrampDebugInfoResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOnrampDebugInfoResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOnrampDebugInfoResponse clone() => GetOnrampDebugInfoResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOnrampDebugInfoResponse copyWith(void Function(GetOnrampDebugInfoResponse) updates) => super.copyWith((message) => updates(message as GetOnrampDebugInfoResponse)) as GetOnrampDebugInfoResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOnrampDebugInfoResponse create() => GetOnrampDebugInfoResponse._(); + GetOnrampDebugInfoResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOnrampDebugInfoResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOnrampDebugInfoResponse? _defaultInstance; + + @$pb.TagNumber(1) + OnrampResult get result => $_getN(0); + @$pb.TagNumber(1) + set result(OnrampResult v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasResult() => $_has(0); + @$pb.TagNumber(1) + void clearResult() => clearField(1); + @$pb.TagNumber(1) + OnrampResult ensureResult() => $_ensure(0); + + @$pb.TagNumber(2) + $core.String get debugInfoJson => $_getSZ(1); + @$pb.TagNumber(2) + set debugInfoJson($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasDebugInfoJson() => $_has(1); + @$pb.TagNumber(2) + void clearDebugInfoJson() => clearField(2); +} + diff --git a/lib/src/protobufs/generated/mistyswap_onramp.pbenum.dart b/lib/src/protobufs/generated/mistyswap_onramp.pbenum.dart new file mode 100644 index 0000000..f73cf33 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_onramp.pbenum.dart @@ -0,0 +1,71 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_onramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +// ignore_for_file: UNDEFINED_SHOWN_NAME +import 'dart:core' as $core; +import 'package:protobuf/protobuf.dart' as $pb; + +class OnrampResultCode extends $pb.ProtobufEnum { + static const OnrampResultCode ORC_INVALID = OnrampResultCode._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID'); + static const OnrampResultCode ORC_OK = OnrampResultCode._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_OK'); + static const OnrampResultCode ORC_TOO_MANY_ONRAMPS = OnrampResultCode._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_TOO_MANY_ONRAMPS'); + static const OnrampResultCode ORC_MIXIN_CREDENTIALS_JSON = OnrampResultCode._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_MIXIN_CREDENTIALS_JSON'); + static const OnrampResultCode ORC_CREDENTIALS_ALREADY_IN_USE = OnrampResultCode._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_CREDENTIALS_ALREADY_IN_USE'); + static const OnrampResultCode ORC_MIXIN = OnrampResultCode._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_MIXIN'); + static const OnrampResultCode ORC_ONRAMP_NOT_FOUND = OnrampResultCode._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_ONRAMP_NOT_FOUND'); + static const OnrampResultCode ORC_INVALID_SRC_ASSET_ID = OnrampResultCode._(7, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_SRC_ASSET_ID'); + static const OnrampResultCode ORC_INVALID_DST_ASSET_ID = OnrampResultCode._(8, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_DST_ASSET_ID'); + static const OnrampResultCode ORC_INVALID_WITHDRAWAL_ADDRESS = OnrampResultCode._(9, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_WITHDRAWAL_ADDRESS'); + static const OnrampResultCode ORC_INVALID_MIN_WITHDRAWAL_AMOUNT = OnrampResultCode._(10, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_MIN_WITHDRAWAL_AMOUNT'); + static const OnrampResultCode ORC_INVALID_MIN_SWAP_RATE = OnrampResultCode._(11, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ORC_INVALID_MIN_SWAP_RATE'); + + static const $core.List values = [ + ORC_INVALID, + ORC_OK, + ORC_TOO_MANY_ONRAMPS, + ORC_MIXIN_CREDENTIALS_JSON, + ORC_CREDENTIALS_ALREADY_IN_USE, + ORC_MIXIN, + ORC_ONRAMP_NOT_FOUND, + ORC_INVALID_SRC_ASSET_ID, + ORC_INVALID_DST_ASSET_ID, + ORC_INVALID_WITHDRAWAL_ADDRESS, + ORC_INVALID_MIN_WITHDRAWAL_AMOUNT, + ORC_INVALID_MIN_SWAP_RATE, + ]; + + static final $core.Map<$core.int, OnrampResultCode> _byValue = $pb.ProtobufEnum.initByValue(values); + static OnrampResultCode? valueOf($core.int value) => _byValue[value]; + + const OnrampResultCode._($core.int v, $core.String n) : super(v, n); +} + +class OnrampState extends $pb.ProtobufEnum { + static const OnrampState OS_INVALID = OnrampState._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_INVALID'); + static const OnrampState OS_NOT_STARTED = OnrampState._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_NOT_STARTED'); + static const OnrampState OS_POLLING = OnrampState._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_POLLING'); + static const OnrampState OS_WAITING = OnrampState._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_WAITING'); + static const OnrampState OS_INTERMITTENT_ERROR = OnrampState._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_INTERMITTENT_ERROR'); + static const OnrampState OS_BLOCKED_ON_SWAP = OnrampState._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_BLOCKED_ON_SWAP'); + static const OnrampState OS_BLOCKED_ON_WITHDRAWAL = OnrampState._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OS_BLOCKED_ON_WITHDRAWAL'); + + static const $core.List values = [ + OS_INVALID, + OS_NOT_STARTED, + OS_POLLING, + OS_WAITING, + OS_INTERMITTENT_ERROR, + OS_BLOCKED_ON_SWAP, + OS_BLOCKED_ON_WITHDRAWAL, + ]; + + static final $core.Map<$core.int, OnrampState> _byValue = $pb.ProtobufEnum.initByValue(values); + static OnrampState? valueOf($core.int value) => _byValue[value]; + + const OnrampState._($core.int v, $core.String n) : super(v, n); +} + diff --git a/lib/src/protobufs/generated/mistyswap_onramp.pbgrpc.dart b/lib/src/protobufs/generated/mistyswap_onramp.pbgrpc.dart new file mode 100644 index 0000000..3ab034b --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_onramp.pbgrpc.dart @@ -0,0 +1,123 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_onramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:async' as $async; + +import 'dart:core' as $core; + +import 'package:grpc/service_api.dart' as $grpc; +import 'attest.pb.dart' as $0; +export 'mistyswap_onramp.pb.dart'; + +class MistyswapOnrampApiClient extends $grpc.Client { + static final _$setupOnramp = $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_onramp.MistyswapOnrampApi/SetupOnramp', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + static final _$forgetOnramp = $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_onramp.MistyswapOnrampApi/ForgetOnramp', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + static final _$getOnrampStatus = $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_onramp.MistyswapOnrampApi/GetOnrampStatus', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + static final _$getOnrampDebugInfo = + $grpc.ClientMethod<$0.Message, $0.Message>( + '/mistyswap_onramp.MistyswapOnrampApi/GetOnrampDebugInfo', + ($0.Message value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.Message.fromBuffer(value)); + + MistyswapOnrampApiClient($grpc.ClientChannel channel, + {$grpc.CallOptions? options, + $core.Iterable<$grpc.ClientInterceptor>? interceptors}) + : super(channel, options: options, interceptors: interceptors); + + $grpc.ResponseFuture<$0.Message> setupOnramp($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$setupOnramp, request, options: options); + } + + $grpc.ResponseFuture<$0.Message> forgetOnramp($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$forgetOnramp, request, options: options); + } + + $grpc.ResponseFuture<$0.Message> getOnrampStatus($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getOnrampStatus, request, options: options); + } + + $grpc.ResponseFuture<$0.Message> getOnrampDebugInfo($0.Message request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getOnrampDebugInfo, request, options: options); + } +} + +abstract class MistyswapOnrampApiServiceBase extends $grpc.Service { + $core.String get $name => 'mistyswap_onramp.MistyswapOnrampApi'; + + MistyswapOnrampApiServiceBase() { + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'SetupOnramp', + setupOnramp_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'ForgetOnramp', + forgetOnramp_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'GetOnrampStatus', + getOnrampStatus_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.Message, $0.Message>( + 'GetOnrampDebugInfo', + getOnrampDebugInfo_Pre, + false, + false, + ($core.List<$core.int> value) => $0.Message.fromBuffer(value), + ($0.Message value) => value.writeToBuffer())); + } + + $async.Future<$0.Message> setupOnramp_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return setupOnramp(call, await request); + } + + $async.Future<$0.Message> forgetOnramp_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return forgetOnramp(call, await request); + } + + $async.Future<$0.Message> getOnrampStatus_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return getOnrampStatus(call, await request); + } + + $async.Future<$0.Message> getOnrampDebugInfo_Pre( + $grpc.ServiceCall call, $async.Future<$0.Message> request) async { + return getOnrampDebugInfo(call, await request); + } + + $async.Future<$0.Message> setupOnramp( + $grpc.ServiceCall call, $0.Message request); + $async.Future<$0.Message> forgetOnramp( + $grpc.ServiceCall call, $0.Message request); + $async.Future<$0.Message> getOnrampStatus( + $grpc.ServiceCall call, $0.Message request); + $async.Future<$0.Message> getOnrampDebugInfo( + $grpc.ServiceCall call, $0.Message request); +} diff --git a/lib/src/protobufs/generated/mistyswap_onramp.pbjson.dart b/lib/src/protobufs/generated/mistyswap_onramp.pbjson.dart new file mode 100644 index 0000000..b71d364 --- /dev/null +++ b/lib/src/protobufs/generated/mistyswap_onramp.pbjson.dart @@ -0,0 +1,195 @@ +/// +// Generated code. Do not modify. +// source: mistyswap_onramp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use onrampResultCodeDescriptor instead') +const OnrampResultCode$json = const { + '1': 'OnrampResultCode', + '2': const [ + const {'1': 'ORC_INVALID', '2': 0}, + const {'1': 'ORC_OK', '2': 1}, + const {'1': 'ORC_TOO_MANY_ONRAMPS', '2': 2}, + const {'1': 'ORC_MIXIN_CREDENTIALS_JSON', '2': 3}, + const {'1': 'ORC_CREDENTIALS_ALREADY_IN_USE', '2': 4}, + const {'1': 'ORC_MIXIN', '2': 5}, + const {'1': 'ORC_ONRAMP_NOT_FOUND', '2': 6}, + const {'1': 'ORC_INVALID_SRC_ASSET_ID', '2': 7}, + const {'1': 'ORC_INVALID_DST_ASSET_ID', '2': 8}, + const {'1': 'ORC_INVALID_WITHDRAWAL_ADDRESS', '2': 9}, + const {'1': 'ORC_INVALID_MIN_WITHDRAWAL_AMOUNT', '2': 10}, + const {'1': 'ORC_INVALID_MIN_SWAP_RATE', '2': 11}, + ], +}; + +/// Descriptor for `OnrampResultCode`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List onrampResultCodeDescriptor = $convert.base64Decode('ChBPbnJhbXBSZXN1bHRDb2RlEg8KC09SQ19JTlZBTElEEAASCgoGT1JDX09LEAESGAoUT1JDX1RPT19NQU5ZX09OUkFNUFMQAhIeChpPUkNfTUlYSU5fQ1JFREVOVElBTFNfSlNPThADEiIKHk9SQ19DUkVERU5USUFMU19BTFJFQURZX0lOX1VTRRAEEg0KCU9SQ19NSVhJThAFEhgKFE9SQ19PTlJBTVBfTk9UX0ZPVU5EEAYSHAoYT1JDX0lOVkFMSURfU1JDX0FTU0VUX0lEEAcSHAoYT1JDX0lOVkFMSURfRFNUX0FTU0VUX0lEEAgSIgoeT1JDX0lOVkFMSURfV0lUSERSQVdBTF9BRERSRVNTEAkSJQohT1JDX0lOVkFMSURfTUlOX1dJVEhEUkFXQUxfQU1PVU5UEAoSHQoZT1JDX0lOVkFMSURfTUlOX1NXQVBfUkFURRAL'); +@$core.Deprecated('Use onrampStateDescriptor instead') +const OnrampState$json = const { + '1': 'OnrampState', + '2': const [ + const {'1': 'OS_INVALID', '2': 0}, + const {'1': 'OS_NOT_STARTED', '2': 1}, + const {'1': 'OS_POLLING', '2': 2}, + const {'1': 'OS_WAITING', '2': 3}, + const {'1': 'OS_INTERMITTENT_ERROR', '2': 4}, + const {'1': 'OS_BLOCKED_ON_SWAP', '2': 5}, + const {'1': 'OS_BLOCKED_ON_WITHDRAWAL', '2': 6}, + ], +}; + +/// Descriptor for `OnrampState`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List onrampStateDescriptor = $convert.base64Decode('CgtPbnJhbXBTdGF0ZRIOCgpPU19JTlZBTElEEAASEgoOT1NfTk9UX1NUQVJURUQQARIOCgpPU19QT0xMSU5HEAISDgoKT1NfV0FJVElORxADEhkKFU9TX0lOVEVSTUlUVEVOVF9FUlJPUhAEEhYKEk9TX0JMT0NLRURfT05fU1dBUBAFEhwKGE9TX0JMT0NLRURfT05fV0lUSERSQVdBTBAG'); +@$core.Deprecated('Use onrampResultDescriptor instead') +const OnrampResult$json = const { + '1': 'OnrampResult', + '2': const [ + const {'1': 'code', '3': 1, '4': 1, '5': 14, '6': '.mistyswap_onramp.OnrampResultCode', '10': 'code'}, + const {'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'}, + const {'1': 'onramp_id', '3': 3, '4': 1, '5': 12, '10': 'onrampId'}, + const {'1': 'asset_id', '3': 4, '4': 1, '5': 9, '10': 'assetId'}, + ], +}; + +/// Descriptor for `OnrampResult`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List onrampResultDescriptor = $convert.base64Decode('CgxPbnJhbXBSZXN1bHQSNgoEY29kZRgBIAEoDjIiLm1pc3R5c3dhcF9vbnJhbXAuT25yYW1wUmVzdWx0Q29kZVIEY29kZRIYCgdtZXNzYWdlGAIgASgJUgdtZXNzYWdlEhsKCW9ucmFtcF9pZBgDIAEoDFIIb25yYW1wSWQSGQoIYXNzZXRfaWQYBCABKAlSB2Fzc2V0SWQ='); +@$core.Deprecated('Use onrampParamsDescriptor instead') +const OnrampParams$json = const { + '1': 'OnrampParams', + '2': const [ + const {'1': 'dst_asset_id', '3': 1, '4': 1, '5': 9, '10': 'dstAssetId'}, + const {'1': 'src_asset_id_to_min_swap_rate', '3': 2, '4': 3, '5': 11, '6': '.mistyswap_onramp.OnrampParams.SrcAssetIdToMinSwapRateEntry', '10': 'srcAssetIdToMinSwapRate'}, + const {'1': 'dst_address', '3': 3, '4': 1, '5': 9, '10': 'dstAddress'}, + const {'1': 'min_withdrawal_amount', '3': 4, '4': 1, '5': 9, '10': 'minWithdrawalAmount'}, + ], + '3': const [OnrampParams_SrcAssetIdToMinSwapRateEntry$json], +}; + +@$core.Deprecated('Use onrampParamsDescriptor instead') +const OnrampParams_SrcAssetIdToMinSwapRateEntry$json = const { + '1': 'SrcAssetIdToMinSwapRateEntry', + '2': const [ + const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, + ], + '7': const {'7': true}, +}; + +/// Descriptor for `OnrampParams`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List onrampParamsDescriptor = $convert.base64Decode('CgxPbnJhbXBQYXJhbXMSIAoMZHN0X2Fzc2V0X2lkGAEgASgJUgpkc3RBc3NldElkEnsKHXNyY19hc3NldF9pZF90b19taW5fc3dhcF9yYXRlGAIgAygLMjsubWlzdHlzd2FwX29ucmFtcC5PbnJhbXBQYXJhbXMuU3JjQXNzZXRJZFRvTWluU3dhcFJhdGVFbnRyeVIXc3JjQXNzZXRJZFRvTWluU3dhcFJhdGUSHwoLZHN0X2FkZHJlc3MYAyABKAlSCmRzdEFkZHJlc3MSMgoVbWluX3dpdGhkcmF3YWxfYW1vdW50GAQgASgJUhNtaW5XaXRoZHJhd2FsQW1vdW50GkoKHFNyY0Fzc2V0SWRUb01pblN3YXBSYXRlRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiABKAlSBXZhbHVlOgI4AQ=='); +@$core.Deprecated('Use setupOnrampRequestDescriptor instead') +const SetupOnrampRequest$json = const { + '1': 'SetupOnrampRequest', + '2': const [ + const {'1': 'mixin_credentials_json', '3': 1, '4': 1, '5': 9, '10': 'mixinCredentialsJson'}, + const {'1': 'params', '3': 2, '4': 1, '5': 11, '6': '.mistyswap_onramp.OnrampParams', '10': 'params'}, + ], +}; + +/// Descriptor for `SetupOnrampRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List setupOnrampRequestDescriptor = $convert.base64Decode('ChJTZXR1cE9ucmFtcFJlcXVlc3QSNAoWbWl4aW5fY3JlZGVudGlhbHNfanNvbhgBIAEoCVIUbWl4aW5DcmVkZW50aWFsc0pzb24SNgoGcGFyYW1zGAIgASgLMh4ubWlzdHlzd2FwX29ucmFtcC5PbnJhbXBQYXJhbXNSBnBhcmFtcw=='); +@$core.Deprecated('Use setupOnrampResponseDescriptor instead') +const SetupOnrampResponse$json = const { + '1': 'SetupOnrampResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_onramp.OnrampResult', '10': 'result'}, + const {'1': 'onramp_id', '3': 2, '4': 1, '5': 12, '10': 'onrampId'}, + ], +}; + +/// Descriptor for `SetupOnrampResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List setupOnrampResponseDescriptor = $convert.base64Decode('ChNTZXR1cE9ucmFtcFJlc3BvbnNlEjYKBnJlc3VsdBgBIAEoCzIeLm1pc3R5c3dhcF9vbnJhbXAuT25yYW1wUmVzdWx0UgZyZXN1bHQSGwoJb25yYW1wX2lkGAIgASgMUghvbnJhbXBJZA=='); +@$core.Deprecated('Use forgetOnrampRequestDescriptor instead') +const ForgetOnrampRequest$json = const { + '1': 'ForgetOnrampRequest', + '2': const [ + const {'1': 'onramp_id', '3': 1, '4': 1, '5': 12, '10': 'onrampId'}, + ], +}; + +/// Descriptor for `ForgetOnrampRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List forgetOnrampRequestDescriptor = $convert.base64Decode('ChNGb3JnZXRPbnJhbXBSZXF1ZXN0EhsKCW9ucmFtcF9pZBgBIAEoDFIIb25yYW1wSWQ='); +@$core.Deprecated('Use forgetOnrampResponseDescriptor instead') +const ForgetOnrampResponse$json = const { + '1': 'ForgetOnrampResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_onramp.OnrampResult', '10': 'result'}, + ], +}; + +/// Descriptor for `ForgetOnrampResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List forgetOnrampResponseDescriptor = $convert.base64Decode('ChRGb3JnZXRPbnJhbXBSZXNwb25zZRI2CgZyZXN1bHQYASABKAsyHi5taXN0eXN3YXBfb25yYW1wLk9ucmFtcFJlc3VsdFIGcmVzdWx0'); +@$core.Deprecated('Use onrampDescriptor instead') +const Onramp$json = const { + '1': 'Onramp', + '2': const [ + const {'1': 'params', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_onramp.OnrampParams', '10': 'params'}, + const {'1': 'state', '3': 2, '4': 1, '5': 14, '6': '.mistyswap_onramp.OnrampState', '10': 'state'}, + const {'1': 'state_details', '3': 3, '4': 1, '5': 9, '10': 'stateDetails'}, + const {'1': 'mixin_withdrawal_address_json', '3': 4, '4': 1, '5': 9, '10': 'mixinWithdrawalAddressJson'}, + const {'1': 'ongoing_swap', '3': 5, '4': 1, '5': 11, '6': '.mistyswap_common.OngoingSwap', '10': 'ongoingSwap'}, + const {'1': 'ongoing_withdrawal_json', '3': 6, '4': 1, '5': 9, '10': 'ongoingWithdrawalJson'}, + const {'1': 'balances', '3': 7, '4': 3, '5': 11, '6': '.mistyswap_onramp.Onramp.BalancesEntry', '10': 'balances'}, + ], + '3': const [Onramp_BalancesEntry$json], +}; + +@$core.Deprecated('Use onrampDescriptor instead') +const Onramp_BalancesEntry$json = const { + '1': 'BalancesEntry', + '2': const [ + const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, + ], + '7': const {'7': true}, +}; + +/// Descriptor for `Onramp`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List onrampDescriptor = $convert.base64Decode('CgZPbnJhbXASNgoGcGFyYW1zGAEgASgLMh4ubWlzdHlzd2FwX29ucmFtcC5PbnJhbXBQYXJhbXNSBnBhcmFtcxIzCgVzdGF0ZRgCIAEoDjIdLm1pc3R5c3dhcF9vbnJhbXAuT25yYW1wU3RhdGVSBXN0YXRlEiMKDXN0YXRlX2RldGFpbHMYAyABKAlSDHN0YXRlRGV0YWlscxJBCh1taXhpbl93aXRoZHJhd2FsX2FkZHJlc3NfanNvbhgEIAEoCVIabWl4aW5XaXRoZHJhd2FsQWRkcmVzc0pzb24SQAoMb25nb2luZ19zd2FwGAUgASgLMh0ubWlzdHlzd2FwX2NvbW1vbi5PbmdvaW5nU3dhcFILb25nb2luZ1N3YXASNgoXb25nb2luZ193aXRoZHJhd2FsX2pzb24YBiABKAlSFW9uZ29pbmdXaXRoZHJhd2FsSnNvbhJCCghiYWxhbmNlcxgHIAMoCzImLm1pc3R5c3dhcF9vbnJhbXAuT25yYW1wLkJhbGFuY2VzRW50cnlSCGJhbGFuY2VzGjsKDUJhbGFuY2VzRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiABKAlSBXZhbHVlOgI4AQ=='); +@$core.Deprecated('Use getOnrampStatusRequestDescriptor instead') +const GetOnrampStatusRequest$json = const { + '1': 'GetOnrampStatusRequest', + '2': const [ + const {'1': 'onramp_id', '3': 1, '4': 1, '5': 12, '10': 'onrampId'}, + ], +}; + +/// Descriptor for `GetOnrampStatusRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOnrampStatusRequestDescriptor = $convert.base64Decode('ChZHZXRPbnJhbXBTdGF0dXNSZXF1ZXN0EhsKCW9ucmFtcF9pZBgBIAEoDFIIb25yYW1wSWQ='); +@$core.Deprecated('Use getOnrampStatusResponseDescriptor instead') +const GetOnrampStatusResponse$json = const { + '1': 'GetOnrampStatusResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_onramp.OnrampResult', '10': 'result'}, + const {'1': 'onramp', '3': 2, '4': 1, '5': 11, '6': '.mistyswap_onramp.Onramp', '10': 'onramp'}, + ], +}; + +/// Descriptor for `GetOnrampStatusResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOnrampStatusResponseDescriptor = $convert.base64Decode('ChdHZXRPbnJhbXBTdGF0dXNSZXNwb25zZRI2CgZyZXN1bHQYASABKAsyHi5taXN0eXN3YXBfb25yYW1wLk9ucmFtcFJlc3VsdFIGcmVzdWx0EjAKBm9ucmFtcBgCIAEoCzIYLm1pc3R5c3dhcF9vbnJhbXAuT25yYW1wUgZvbnJhbXA='); +@$core.Deprecated('Use getOnrampDebugInfoRequestDescriptor instead') +const GetOnrampDebugInfoRequest$json = const { + '1': 'GetOnrampDebugInfoRequest', + '2': const [ + const {'1': 'onramp_id', '3': 1, '4': 1, '5': 12, '10': 'onrampId'}, + ], +}; + +/// Descriptor for `GetOnrampDebugInfoRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOnrampDebugInfoRequestDescriptor = $convert.base64Decode('ChlHZXRPbnJhbXBEZWJ1Z0luZm9SZXF1ZXN0EhsKCW9ucmFtcF9pZBgBIAEoDFIIb25yYW1wSWQ='); +@$core.Deprecated('Use getOnrampDebugInfoResponseDescriptor instead') +const GetOnrampDebugInfoResponse$json = const { + '1': 'GetOnrampDebugInfoResponse', + '2': const [ + const {'1': 'result', '3': 1, '4': 1, '5': 11, '6': '.mistyswap_onramp.OnrampResult', '10': 'result'}, + const {'1': 'debug_info_json', '3': 2, '4': 1, '5': 9, '10': 'debugInfoJson'}, + ], +}; + +/// Descriptor for `GetOnrampDebugInfoResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOnrampDebugInfoResponseDescriptor = $convert.base64Decode('ChpHZXRPbnJhbXBEZWJ1Z0luZm9SZXNwb25zZRI2CgZyZXN1bHQYASABKAsyHi5taXN0eXN3YXBfb25yYW1wLk9ucmFtcFJlc3VsdFIGcmVzdWx0EiYKD2RlYnVnX2luZm9fanNvbhgCIAEoCVINZGVidWdJbmZvSnNvbg=='); diff --git a/lib/src/protobufs/google/protobuf/empty.proto b/lib/src/protobufs/google/protobuf/empty.proto new file mode 100644 index 0000000..b87c89d --- /dev/null +++ b/lib/src/protobufs/google/protobuf/empty.proto @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} diff --git a/lib/src/public_address.dart b/lib/src/public_address.dart new file mode 100644 index 0000000..8962348 --- /dev/null +++ b/lib/src/public_address.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'dart:typed_data'; + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; + +class PublicAddress extends PlatformObject { + PublicAddress(int objectId) : super(id: objectId); + + static Future fromBytes(Uint8List serializedBytes) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .publicAddressFromBytes(publicAddress: serializedBytes); + return PublicAddress(objectId); + } + + Future toByteArray() async { + return await MobileCoinFlutterPluginChannelApi.instance + .publicAddressToByteArray(publicAddressId: id); + } + + Future getAddressHash() async { + return await MobileCoinFlutterPluginChannelApi.instance + .publicAddressGetAddressHash(publicAddressId: id); + } +} diff --git a/lib/src/ristretto_private.dart b/lib/src/ristretto_private.dart new file mode 100644 index 0000000..f7a4a21 --- /dev/null +++ b/lib/src/ristretto_private.dart @@ -0,0 +1,21 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'dart:typed_data'; + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; + +class RistrettoPrivate extends PlatformObject { + RistrettoPrivate(int objectId) : super(id: objectId); + + static Future fromBytes(Uint8List serializedBytes) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .ristrettoPrivateFromBytes(privateKeyBytes: serializedBytes); + return RistrettoPrivate(objectId); + } + + Future toByteArray() async { + return await MobileCoinFlutterPluginChannelApi.instance + .ristrettoPrivateToByteArray(ristrettoPrivateId: id); + } +} diff --git a/lib/src/ristretto_public.dart b/lib/src/ristretto_public.dart new file mode 100644 index 0000000..f55493d --- /dev/null +++ b/lib/src/ristretto_public.dart @@ -0,0 +1,21 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'dart:typed_data'; + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; + +class RistrettoPublic extends PlatformObject { + RistrettoPublic(int objectId) : super(id: objectId); + + static Future fromBytes(Uint8List serializedBytes) async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .ristrettoPublicFromBytes(publicKeyBytes: serializedBytes); + return RistrettoPublic(objectId); + } + + Future toByteArray() async { + return await MobileCoinFlutterPluginChannelApi.instance + .ristrettoPublicToByteArray(ristrettoPublicId: id); + } +} diff --git a/lib/src/transfer_payload.dart b/lib/src/transfer_payload.dart new file mode 100644 index 0000000..535f16a --- /dev/null +++ b/lib/src/transfer_payload.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'dart:typed_data'; + +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; +import 'package:mobilecoin_flutter/src/platform_object.dart'; +import 'package:mobilecoin_flutter/src/ristretto_public.dart'; + +class TransferPayload extends PlatformObject { + TransferPayload(int objectId) : super(id: objectId); + + Future getBip39Entropy() async { + return await MobileCoinFlutterPluginChannelApi.instance + .transferPayloadGetBip39Entropy(transferPayloadId: id); + } + + Future getMemo() async { + return await MobileCoinFlutterPluginChannelApi.instance + .transferPayloadGetMemo(transferPayloadId: id); + } + + Future getPublicKey() async { + final objectId = await MobileCoinFlutterPluginChannelApi.instance + .transferPayloadGetPublicKey(transferPayloadId: id); + return RistrettoPublic(objectId); + } +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..c21e591 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,317 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" + url: "https://pub.dev" + source: hosted + version: "3.3.7" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: "direct main" + description: + name: crypto + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" + source: hosted + version: "3.0.2" + decimal: + dependency: "direct main" + description: + name: decimal + sha256: eece91944f523657c75a3a008a90ec7f7eb3986191153a78570c7d0ac8ef3d01 + url: "https://pub.dev" + source: hosted + version: "2.3.2" + equatable: + dependency: "direct main" + description: + name: equatable + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" + source: hosted + version: "2.0.5" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 + url: "https://pub.dev" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: af7c3a3edf9d0de2e1e0a77e994fae0a581c525fa7012af4fa0d4a52ed9484da + url: "https://pub.dev" + source: hosted + version: "1.4.1" + grpc: + dependency: "direct main" + description: + name: grpc + sha256: "220ffb2218288f4e7dea487242e08b9c6277596d9b6f3f10ba50be96771a032d" + url: "https://pub.dev" + source: hosted + version: "3.2.3" + http: + dependency: transitive + description: + name: http + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + http2: + dependency: transitive + description: + name: http2 + sha256: "38db0c4aa9f1cd238a5d2e86aa0cc7cc91c77e0c6c94ba64bbe85e4ff732a952" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + lints: + dependency: transitive + description: + name: lints + sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + url: "https://pub.dev" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" + source: hosted + version: "0.12.16" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + meta: + dependency: transitive + description: + name: meta + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" + source: hosted + version: "1.10.0" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" + protobuf: + dependency: "direct main" + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + rational: + dependency: transitive + description: + name: rational + sha256: ba58e9e18df9abde280e8b10051e4bce85091e41e8e7e411b6cde2e738d357cf + url: "https://pub.dev" + source: hosted + version: "2.2.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" + source: hosted + version: "0.6.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" +sdks: + dart: ">=3.2.0-194.0.dev <4.0.0" + flutter: ">=1.20.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..90a5585 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,70 @@ +name: mobilecoin_flutter +description: Flutter plugin providing Dart bindings for MobileCoin-Swift and android-sdk. +version: 0.0.1 +homepage: + +environment: + sdk: ">=3.0.0 <4.0.0" + flutter: ">=1.20.0" + +dependencies: + crypto: ^3.0.1 + decimal: + equatable: ^2.0.5 + flutter: + sdk: flutter + protobuf: + grpc: + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.4 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + # This section identifies this Flutter project as a plugin project. + # The 'pluginClass' and Android 'package' identifiers should not ordinarily + # be modified. They are used by the tooling to maintain consistency when + # adding or updating assets for this project. + plugin: + platforms: + android: + package: com.mobilecoin.mobilecoin_flutter + pluginClass: MobileCoinFlutterPlugin + ios: + pluginClass: MobileCoinFlutterPlugin + + # To add assets to your plugin package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your plugin package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/test/attestation_config_test.dart b/test/attestation_config_test.dart new file mode 100644 index 0000000..11ef1f2 --- /dev/null +++ b/test/attestation_config_test.dart @@ -0,0 +1,42 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:mobilecoin_flutter/src/attestation/service_config.dart'; + +void main() { + const fogViewMrEnclave = '1'; + const fogLedgerMrEnclave = '2'; + const fogReportMrEnclave = '3'; + const consensusMrEnclave = '4'; + const hardeningAdvisories = ['INTEL-SA-SOMETHING']; + + const fogViewMrEnclave2 = 'a'; + const fogLedgerMrEnclave2 = 'b'; + const fogReportMrEnclave2 = 'c'; + const consensusMrEnclave2 = 'd'; + const hardeningAdvisories2 = ['INTEL-SA-SOMETHING', 'MORE-OF-THE-SAME']; + + group('Service Config', () { + test('verify json encoding/decoding', () { + const originalConfig = ServiceConfig( + fogViewMrEnclave: fogViewMrEnclave, + fogLedgerMrEnclave: fogLedgerMrEnclave, + fogReportMrEnclave: fogReportMrEnclave, + consensusMrEnclave: consensusMrEnclave, + hardeningAdvisories: hardeningAdvisories, + ); + const secondConfig = ServiceConfig( + fogViewMrEnclave: fogViewMrEnclave2, + fogLedgerMrEnclave: fogLedgerMrEnclave2, + fogReportMrEnclave: fogReportMrEnclave2, + consensusMrEnclave: consensusMrEnclave2, + hardeningAdvisories: hardeningAdvisories2, + ); + + final configJson = originalConfig.toJson; + final restoredConfig = ServiceConfig.fromJson(configJson); + expect(restoredConfig, originalConfig); + expect(originalConfig, isNot(secondConfig)); + }); + }); +} diff --git a/test/mobilecoin_flutter_test.dart b/test/mobilecoin_flutter_test.dart new file mode 100644 index 0000000..07412d7 --- /dev/null +++ b/test/mobilecoin_flutter_test.dart @@ -0,0 +1,20 @@ +// Copyright (c) 2021-2024 MobileCoin. All rights reserved. + +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mobilecoin_flutter/src/mobilecoin_flutter_plugin_channel_api.dart'; + +void main() { + const MethodChannel channel = MethodChannel('mobilecoin_flutter'); + + TestWidgetsFlutterBinding.ensureInitialized(); + + setUp(() { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, (_) async => '42'); + }); + + test("constructs channel api", () async { + expect(MobileCoinFlutterPluginChannelApi.instance, isNotNull); + }); +}