From c28b8c8d90256a749bba4ab9222531f5d0e526c2 Mon Sep 17 00:00:00 2001 From: Praveen Perera Date: Thu, 28 Nov 2024 10:23:07 -0600 Subject: [PATCH] Turn all xcode Groups into folders --- ios/Cove.xcodeproj/project.pbxproj | 515 +- {rust/ios => ios}/Cove/Cove.swift | 14644 +++++++++------- .../ColdWallet/QrCodeImportScreen.swift | 0 .../Container/NewHotWalletContainer.swift | 0 .../Container/NewWalletContainer.swift | 0 .../HotWallet/HotWalletCreateScreen.swift | 0 .../HotWallet/HotWalletImportScreen.swift | 0 .../HotWallet/HotWalletSelectScreen.swift | 0 .../HotWallet/VerifyWordsScreen.swift | 0 .../NewWalletFlow/NewWalletSelectScreen.swift | 0 .../NewWalletFlow/NfcHelpView.swift | 0 .../PendingWalletViewModel.swift | 0 .../ChooseWalletTypeView.swift | 0 .../SelectedWalletFlow}/ReceiveView.swift | 0 .../SecretWordsScreen.swift | 0 .../SelectedWalletContainer.swift | 78 + .../SelectedWalletScreen.swift | 173 +- .../ConfirmationIndicatorView.swift | 0 .../TransactionDetails/HeaderIcon.swift | 0 .../ReceivedDetailsExpandedView.swift | 0 .../SentDetailsExpandedView.swift | 0 .../TransactionDetailsView.swift | 0 .../TransactionsDetailScreen.swift | 0 .../TransactionsCardView.swift | 0 .../WalletBalanceHeaderView.swift | 4 +- .../Common/SendFlowAccountSection.swift | 0 .../Common/SendFlowDetailsSheetView.swift | 0 .../SendFlow/Common/SendFlowDetailsView.swift | 0 .../SendFlow/Common/SendFlowHeaderView.swift | 0 .../ConfirmScreen/SwipeToSendView.swift | 0 .../SendFlow/SendFlowConfirmScreen.swift | 0 .../SendFlow/SendFlowHardwareScreen.swift | 0 .../SendFlowBbqrExport.swift | 0 .../SendFlow/SendFlowSetAmountPresenter.swift | 0 .../SendFlow/SendFlowSetAmountScreen.swift | 0 .../SendFlow/SendRouteContainer.swift | 0 .../SetAmountScreen/AddressTextEditor.swift | 0 .../SetAmountScreen/EnterAddressView.swift | 0 .../SetAmountScreen/EnterAmountView.swift | 0 .../SetAmountScreen/QrCodeAddressView.swift | 0 .../SendFlowSelectFeeRateView.swift | 0 ios/Cove/RouteView.swift | 12 +- scripts/build-ios.sh | 4 +- 43 files changed, 8731 insertions(+), 6699 deletions(-) rename {rust/ios => ios}/Cove/Cove.swift (65%) rename ios/Cove/{ => Flows}/NewWalletFlow/ColdWallet/QrCodeImportScreen.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/Container/NewHotWalletContainer.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/Container/NewWalletContainer.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/HotWallet/HotWalletCreateScreen.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/HotWallet/HotWalletImportScreen.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/HotWallet/HotWalletSelectScreen.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/HotWallet/VerifyWordsScreen.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/NewWalletSelectScreen.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/NfcHelpView.swift (100%) rename ios/Cove/{ => Flows}/NewWalletFlow/PendingWalletViewModel.swift (100%) rename ios/Cove/{SelectedWalletScreen => Flows/SelectedWalletFlow}/ChooseWalletTypeView.swift (100%) rename ios/Cove/{SelectedWalletScreen => Flows/SelectedWalletFlow}/ReceiveView.swift (100%) rename ios/Cove/{ => Flows/SelectedWalletFlow}/SecretWordsScreen.swift (100%) create mode 100644 ios/Cove/Flows/SelectedWalletFlow/SelectedWalletContainer.swift rename ios/Cove/{HomeScreens => Flows/SelectedWalletFlow}/SelectedWalletScreen.swift (58%) rename ios/Cove/{ => Flows/SelectedWalletFlow}/TransactionDetails/ConfirmationIndicatorView.swift (100%) rename ios/Cove/{ => Flows/SelectedWalletFlow}/TransactionDetails/HeaderIcon.swift (100%) rename ios/Cove/{ => Flows/SelectedWalletFlow}/TransactionDetails/ReceivedDetailsExpandedView.swift (100%) rename ios/Cove/{ => Flows/SelectedWalletFlow}/TransactionDetails/SentDetailsExpandedView.swift (100%) rename ios/Cove/{ => Flows/SelectedWalletFlow}/TransactionDetails/TransactionDetailsView.swift (100%) rename ios/Cove/{ => Flows/SelectedWalletFlow/TransactionDetails}/TransactionsDetailScreen.swift (100%) rename ios/Cove/{SelectedWalletScreen => Flows/SelectedWalletFlow}/TransactionsCardView.swift (100%) rename ios/Cove/{SelectedWalletScreen => Flows/SelectedWalletFlow}/WalletBalanceHeaderView.swift (99%) rename ios/Cove/{ => Flows}/SendFlow/Common/SendFlowAccountSection.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/Common/SendFlowDetailsSheetView.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/Common/SendFlowDetailsView.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/Common/SendFlowHeaderView.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/ConfirmScreen/SwipeToSendView.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SendFlowConfirmScreen.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SendFlowHardwareScreen.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SendFlowHardwareScreen/SendFlowBbqrExport.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SendFlowSetAmountPresenter.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SendFlowSetAmountScreen.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SendRouteContainer.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SetAmountScreen/AddressTextEditor.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SetAmountScreen/EnterAddressView.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SetAmountScreen/EnterAmountView.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SetAmountScreen/QrCodeAddressView.swift (100%) rename ios/Cove/{ => Flows}/SendFlow/SetAmountScreen/SendFlowSelectFeeRateView.swift (100%) diff --git a/ios/Cove.xcodeproj/project.pbxproj b/ios/Cove.xcodeproj/project.pbxproj index 79b22020..5f74aee4 100644 --- a/ios/Cove.xcodeproj/project.pbxproj +++ b/ios/Cove.xcodeproj/project.pbxproj @@ -7,98 +7,11 @@ objects = { /* Begin PBXBuildFile section */ - 09890D7BB033D5000D5EFA66 /* Balance+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9EF236DBA6E27BF588A0776 /* Balance+Ext.swift */; }; - 0995B2382B1A8AA3208B6097 /* WalletViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC34AC5B6A6EF5288E8B34DC /* WalletViewModel.swift */; }; - 1333E89ACE42F5331C4B7AEB /* SelectedWalletScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845A3FB37C6A830D7647EE31 /* SelectedWalletScreen.swift */; }; - 1BE5607DDD79FE6FA8A6B6F0 /* ImportWalletViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2E5F01EEF26233C1161C /* ImportWalletViewModel.swift */; }; - 1C025A7627543FBFC072E0D1 /* VerifyWordsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AAF284B6AD61F220F881B4C /* VerifyWordsScreen.swift */; }; - 1F185905CB256BB39BA87EE1 /* NewHotWalletContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8328372CD79EE1B21B23EAF6 /* NewHotWalletContainer.swift */; }; - 2344E4672757BE424B888B58 /* HotWalletImportScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA07C73C0BFF66882684293F /* HotWalletImportScreen.swift */; }; - 240A3B1A16A45C43F8991A9E /* NodeSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C9A8B89D7E04B547A9B2083 /* NodeSelectionView.swift */; }; - 2C3000E623FFF7A92EB7F02D /* ColorSchemeSelection+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19224F788C8E6EEDE418212E /* ColorSchemeSelection+Ext.swift */; }; - 382288EEB9734474498ED7EE /* KeyboardObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F6A06235CFE0DBA125358F3 /* KeyboardObserver.swift */; }; - 4998F4A296FA2217EC2BD80F /* WalletSettingsSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80049549984BDDA80E72D91C /* WalletSettingsSheet.swift */; }; - 4B7D31B349728B3C573472DD /* Network+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5398BBCAD30C0F26920CC75C /* Network+Ext.swift */; }; - 52AEF2D14ADE7D9CDF81C276 /* RouteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B6032F09EA34DFDCB18090A /* RouteView.swift */; }; - 69455D17216AD109B6EE2F25 /* WalletMetadata+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA9163511856992204BBC8EC /* WalletMetadata+Ext.swift */; }; - 6B2189B893A545A2F4E3107E /* WalletColor+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D722195526284FA0FD24DDE /* WalletColor+Ext.swift */; }; - 9BEA921FB93FC209CF7A8CA2 /* NewWalletContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBAE8286BEC382061EF00299 /* NewWalletContainer.swift */; }; - AC07617D2C31A527007B4540 /* GlassCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC07617C2C31A527007B4540 /* GlassCard.swift */; }; - AC07617F2C31BAA9007B4540 /* ListWalletsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC07617E2C31BAA9007B4540 /* ListWalletsScreen.swift */; }; - AC0761812C32E3BA007B4540 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC0761802C32E3BA007B4540 /* SidebarView.swift */; }; - AC08E3EE2CF3B40E00DF307D /* NFCWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC08E3ED2CF3B40A00DF307D /* NFCWriter.swift */; }; - AC08E3F52CF3E24F00DF307D /* PSBTFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC08E3F42CF3E24F00DF307D /* PSBTFile.swift */; }; - AC08E3F72CF3E7CF00DF307D /* QrCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC08E3F62CF3E7CF00DF307D /* QrCodeView.swift */; }; - AC08E3FD2CF4AD1A00DF307D /* AlertBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC08E3FC2CF4AD1700DF307D /* AlertBuilder.swift */; }; - AC1290312C4EE8A500E72ECF /* Result+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1290302C4EE8A500E72ECF /* Result+Ext.swift */; }; - AC1290332C4EF4EA00E72ECF /* MiddlePopupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1290322C4EF4EA00E72ECF /* MiddlePopupView.swift */; }; - AC2822F92CDD59E700C403E0 /* Address+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2822F82CDD59E000C403E0 /* Address+Ext.swift */; }; - AC286C0B2CF6E0DB00C6F47E /* FileReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC286C0A2CF6E0D700C6F47E /* FileReader.swift */; }; - AC2B13532CA1EC1000C5C708 /* TaggedItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2B13522CA1EC0200C5C708 /* TaggedItem.swift */; }; - AC2B13582CA1F49A00C5C708 /* ScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2B13562CA1F49A00C5C708 /* ScannerViewController.swift */; }; - AC2B13592CA1F49A00C5C708 /* AVCaptureDevice+bestForBuiltInCamera.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2B13542CA1F49A00C5C708 /* AVCaptureDevice+bestForBuiltInCamera.swift */; }; - AC2B135A2CA1F49A00C5C708 /* CodeScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2B13552CA1F49A00C5C708 /* CodeScanner.swift */; }; - AC2D59252C5B213500B67277 /* TransactionsCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC2D59242C5B213500B67277 /* TransactionsCardView.swift */; }; - AC45C4A32C991C1F002C5AEB /* ConfirmationIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC45C4A22C991C1F002C5AEB /* ConfirmationIndicatorView.swift */; }; - AC45C4A52C991F3C002C5AEB /* Format.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC45C4A42C991F3C002C5AEB /* Format.swift */; }; - AC49121B2C77B8A100ED8ED7 /* SecretWordsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC49121A2C77B8A100ED8ED7 /* SecretWordsScreen.swift */; }; - AC59770A2C6987BA004A0C44 /* Transaction+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5977092C6987BA004A0C44 /* Transaction+Ext.swift */; }; - AC5F3CDB2C99E96000469EBA /* SentDetailsExpandedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5F3CDA2C99E96000469EBA /* SentDetailsExpandedView.swift */; }; - AC5F3CDD2C99E99800469EBA /* HeaderIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5F3CDC2C99E99800469EBA /* HeaderIcon.swift */; }; - AC5F3CDF2C99EB9D00469EBA /* ReceivedDetailsExpandedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5F3CDE2C99EB9D00469EBA /* ReceivedDetailsExpandedView.swift */; }; - AC5F3CE12C99EBD600469EBA /* TransactionDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5F3CE02C99EBD600469EBA /* TransactionDetailsView.swift */; }; - AC5F3CE52C9A188300469EBA /* FfiColorScheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5F3CE42C9A188300469EBA /* FfiColorScheme.swift */; }; - AC61B8F82C7D223A001B649A /* MakeIdentifiable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC61B8F72C7D223A001B649A /* MakeIdentifiable.swift */; }; - AC61B8FA2C7E6976001B649A /* TransactionsDetailScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC61B8F92C7E6976001B649A /* TransactionsDetailScreen.swift */; }; - AC6F4CD92CC554FE008D26C0 /* ChooseWalletTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC6F4CD82CC554F1008D26C0 /* ChooseWalletTypeView.swift */; }; - AC6F4CDB2CC55981008D26C0 /* General+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC6F4CDA2CC55974008D26C0 /* General+Ext.swift */; }; - AC6F4CE32CC6BC30008D26C0 /* LoadAndResetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC6F4CE22CC6BC24008D26C0 /* LoadAndResetView.swift */; }; - AC6F4CE52CC6F56F008D26C0 /* NfcHelpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC6F4CE42CC6F569008D26C0 /* NfcHelpView.swift */; }; - AC6F511C2CA205EE00D4D27A /* StringOrData+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC6F511B2CA205E900D4D27A /* StringOrData+Ext.swift */; }; - AC6F511E2CA36C7600D4D27A /* BinaryDecoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC6F511D2CA36C7100D4D27A /* BinaryDecoder.swift */; }; - AC739D502CA09573006B5FF1 /* QrCodeImportScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC739D4F2CA09573006B5FF1 /* QrCodeImportScreen.swift */; }; - AC73B5952CCEFC5A0003F537 /* QrCodeScanView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC73B5942CCEFC4C0003F537 /* QrCodeScanView.swift */; }; - AC73B5972CCF289A0003F537 /* AppAlertState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC73B5962CCF28960003F537 /* AppAlertState.swift */; }; - AC73B5992CCF2D6F0003F537 /* AppSheetState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC73B5982CCF2D6C0003F537 /* AppSheetState.swift */; }; - AC73B5A12CD154BE0003F537 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC73B5A02CD154BA0003F537 /* Constants.swift */; }; - AC757CBB2C6D277400F3F41C /* ReceiveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC757CBA2C6D277400F3F41C /* ReceiveView.swift */; }; - AC7DAC9A2C5ACA2800F9DDDB /* String+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC7DAC992C5ACA2800F9DDDB /* String+Ext.swift */; }; - AC8189542C4023F0004DCDF5 /* CustomCompletionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC8189532C4023F0004DCDF5 /* CustomCompletionView.swift */; }; - AC8459BF2CA5DF4800A3083F /* ScannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC8459BE2CA5DF4800A3083F /* ScannerView.swift */; }; - AC8459C12CA5ED7E00A3083F /* NFCReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC8459C02CA5ED7700A3083F /* NFCReader.swift */; }; - AC8C1FAC2C4D5D6600158283 /* NodeSelection+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC8C1FAB2C4D5D6600158283 /* NodeSelection+Ext.swift */; }; AC8C1FB22C4E9E3800158283 /* ActivityIndicatorView in Frameworks */ = {isa = PBXBuildFile; productRef = AC8C1FB12C4E9E3800158283 /* ActivityIndicatorView */; }; - AC93DAE32C4572C3002E5AF2 /* NumberOfWords+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC93DAE22C4572C3002E5AF2 /* NumberOfWords+Ext.swift */; }; - AC97D1EC2C287D4F00873092 /* CommonButtonStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC97D1EB2C287D4F00873092 /* CommonButtonStyles.swift */; }; AC9AB5792C34956C00BAE3BE /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC9AB5782C34956C00BAE3BE /* Logger.swift */; }; - AC9FBEBD2C3F5C78005CB37A /* SettingsScreen2.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC9FBEBC2C3F5C78005CB37A /* SettingsScreen2.swift */; }; - ACA4CBEC2C2328BE0008F63E /* Security.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACA4CBEB2C2328BE0008F63E /* Security.swift */; }; ACA4CBEF2C2365430008F63E /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = ACA4CBEE2C2365430008F63E /* KeychainSwift */; }; - ACB17FBD2C5ABDD20079A96A /* WalletBalanceHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACB17FBC2C5ABDD20079A96A /* WalletBalanceHeaderView.swift */; }; - ACC1CD5A2C6D415400C7AD89 /* FloaterPopupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC1CD592C6D415400C7AD89 /* FloaterPopupView.swift */; }; ACC1CD5D2C6D481400C7AD89 /* MijickPopupView in Frameworks */ = {isa = PBXBuildFile; productRef = ACC1CD5C2C6D481400C7AD89 /* MijickPopupView */; }; - ACC1CD602C6D4F2C00C7AD89 /* MiddlePopup.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC1CD5F2C6D4F2C00C7AD89 /* MiddlePopup.swift */; }; - ACC1CD622C6D5ABC00C7AD89 /* FloaterPopup.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC1CD612C6D5ABC00C7AD89 /* FloaterPopup.swift */; }; - ACC3016A2C20C9D4006790DF /* Routes+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC301692C20C9D4006790DF /* Routes+Ext.swift */; }; - ACC301742C211281006790DF /* HotWalletSelectScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC301732C211281006790DF /* HotWalletSelectScreen.swift */; }; - ACC3017A2C221450006790DF /* PendingWalletViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC301792C221450006790DF /* PendingWalletViewModel.swift */; }; ACC4D39A2C2CA6AD008E32A0 /* Cove.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = D000B2EF2C0F7BAA00E32143 /* Cove.xcframework */; }; - ACCAAAAD2C29CABC00FA642E /* Trait+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACCAAAAC2C29CABC00FA642E /* Trait+Ext.swift */; }; - ACCB02CC2C9747AA00FB2EDF /* TransactionCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACCB02CB2C9747AA00FB2EDF /* TransactionCapsule.swift */; }; - ACCB02CE2C97572100FB2EDF /* AsyncView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACCB02CD2C97572100FB2EDF /* AsyncView.swift */; }; - ACCD58D42C5A89FC00CF06F9 /* AsyncPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACCD58D32C5A89FC00CF06F9 /* AsyncPreview.swift */; }; - ACF44D0D2C26131A008C5034 /* Color+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACF44D0C2C26131A008C5034 /* Color+Ext.swift */; }; - ACF44D122C2642DD008C5034 /* SunsetWave.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACF44D112C2642DD008C5034 /* SunsetWave.swift */; }; - ACF44D142C2857E9008C5034 /* FixedGlassCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACF44D132C2857E9008C5034 /* FixedGlassCard.swift */; }; - ACF479F82C59D785008A9362 /* WeakReconciler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACF479F72C59D785008A9362 /* WeakReconciler.swift */; }; - AD998F28BCDE0FFFCEF64986 /* SettingsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3073277B96EFD103FFE756E8 /* SettingsScreen.swift */; }; - D000B2F22C0F7BB100E32143 /* Cove.swift in Sources */ = {isa = PBXBuildFile; fileRef = D000B2F12C0F7BB100E32143 /* Cove.swift */; }; - D0245F502C0F7B4E0042B447 /* CoveApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0245F4F2C0F7B4E0042B447 /* CoveApp.swift */; }; - D0245F542C0F7B500042B447 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D0245F532C0F7B500042B447 /* Assets.xcassets */; }; - D0245F572C0F7B500042B447 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D0245F562C0F7B500042B447 /* Preview Assets.xcassets */; }; - D0BE2EBE2C1614150055FCBE /* MainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BE2EBD2C1614150055FCBE /* MainViewModel.swift */; }; - D6C648A0942CE7443B0D52D3 /* NewWalletSelectScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = B69A8CC9BCD8F42D62F06C0B /* NewWalletSelectScreen.swift */; }; - E205EBB1A70E784E13268A5C /* HotWalletCreateScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF2839E08E408CA31CABF08B /* HotWalletCreateScreen.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -115,104 +28,24 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 048B2E5F01EEF26233C1161C /* ImportWalletViewModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ImportWalletViewModel.swift; sourceTree = ""; }; - 19224F788C8E6EEDE418212E /* ColorSchemeSelection+Ext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "ColorSchemeSelection+Ext.swift"; sourceTree = ""; }; - 2B6032F09EA34DFDCB18090A /* RouteView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = RouteView.swift; sourceTree = ""; }; - 3073277B96EFD103FFE756E8 /* SettingsScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SettingsScreen.swift; sourceTree = ""; }; - 3AAF284B6AD61F220F881B4C /* VerifyWordsScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = VerifyWordsScreen.swift; sourceTree = ""; }; - 4F6A06235CFE0DBA125358F3 /* KeyboardObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = KeyboardObserver.swift; sourceTree = ""; }; - 5398BBCAD30C0F26920CC75C /* Network+Ext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "Network+Ext.swift"; sourceTree = ""; }; - 5D722195526284FA0FD24DDE /* WalletColor+Ext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "WalletColor+Ext.swift"; sourceTree = ""; }; - 80049549984BDDA80E72D91C /* WalletSettingsSheet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletSettingsSheet.swift; sourceTree = ""; }; - 8328372CD79EE1B21B23EAF6 /* NewHotWalletContainer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NewHotWalletContainer.swift; sourceTree = ""; }; - 845A3FB37C6A830D7647EE31 /* SelectedWalletScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SelectedWalletScreen.swift; sourceTree = ""; }; - 8C9A8B89D7E04B547A9B2083 /* NodeSelectionView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NodeSelectionView.swift; sourceTree = ""; }; - AA9163511856992204BBC8EC /* WalletMetadata+Ext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "WalletMetadata+Ext.swift"; sourceTree = ""; }; - AC07617C2C31A527007B4540 /* GlassCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlassCard.swift; sourceTree = ""; }; - AC07617E2C31BAA9007B4540 /* ListWalletsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListWalletsScreen.swift; sourceTree = ""; }; - AC0761802C32E3BA007B4540 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = ""; }; - AC08E3ED2CF3B40A00DF307D /* NFCWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFCWriter.swift; sourceTree = ""; }; - AC08E3F42CF3E24F00DF307D /* PSBTFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PSBTFile.swift; sourceTree = ""; }; - AC08E3F62CF3E7CF00DF307D /* QrCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QrCodeView.swift; sourceTree = ""; }; - AC08E3FC2CF4AD1700DF307D /* AlertBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertBuilder.swift; sourceTree = ""; }; - AC1290302C4EE8A500E72ECF /* Result+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Result+Ext.swift"; sourceTree = ""; }; - AC1290322C4EF4EA00E72ECF /* MiddlePopupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MiddlePopupView.swift; sourceTree = ""; }; - AC2822F82CDD59E000C403E0 /* Address+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Address+Ext.swift"; sourceTree = ""; }; - AC286C0A2CF6E0D700C6F47E /* FileReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileReader.swift; sourceTree = ""; }; - AC2B13522CA1EC0200C5C708 /* TaggedItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaggedItem.swift; sourceTree = ""; }; - AC2B13542CA1F49A00C5C708 /* AVCaptureDevice+bestForBuiltInCamera.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AVCaptureDevice+bestForBuiltInCamera.swift"; sourceTree = ""; }; - AC2B13552CA1F49A00C5C708 /* CodeScanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeScanner.swift; sourceTree = ""; }; - AC2B13562CA1F49A00C5C708 /* ScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerViewController.swift; sourceTree = ""; }; - AC2D59242C5B213500B67277 /* TransactionsCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsCardView.swift; sourceTree = ""; }; - AC34AC5B6A6EF5288E8B34DC /* WalletViewModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = WalletViewModel.swift; sourceTree = ""; }; - AC45C4A22C991C1F002C5AEB /* ConfirmationIndicatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmationIndicatorView.swift; sourceTree = ""; }; - AC45C4A42C991F3C002C5AEB /* Format.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Format.swift; sourceTree = ""; }; - AC49121A2C77B8A100ED8ED7 /* SecretWordsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecretWordsScreen.swift; sourceTree = ""; }; - AC5977092C6987BA004A0C44 /* Transaction+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Transaction+Ext.swift"; sourceTree = ""; }; - AC5F3CDA2C99E96000469EBA /* SentDetailsExpandedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentDetailsExpandedView.swift; sourceTree = ""; }; - AC5F3CDC2C99E99800469EBA /* HeaderIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderIcon.swift; sourceTree = ""; }; - AC5F3CDE2C99EB9D00469EBA /* ReceivedDetailsExpandedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceivedDetailsExpandedView.swift; sourceTree = ""; }; - AC5F3CE02C99EBD600469EBA /* TransactionDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionDetailsView.swift; sourceTree = ""; }; - AC5F3CE42C9A188300469EBA /* FfiColorScheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FfiColorScheme.swift; sourceTree = ""; }; - AC61B8F72C7D223A001B649A /* MakeIdentifiable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MakeIdentifiable.swift; sourceTree = ""; }; - AC61B8F92C7E6976001B649A /* TransactionsDetailScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsDetailScreen.swift; sourceTree = ""; }; - AC6F4CD82CC554F1008D26C0 /* ChooseWalletTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChooseWalletTypeView.swift; sourceTree = ""; }; - AC6F4CDA2CC55974008D26C0 /* General+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "General+Ext.swift"; sourceTree = ""; }; - AC6F4CE22CC6BC24008D26C0 /* LoadAndResetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadAndResetView.swift; sourceTree = ""; }; - AC6F4CE42CC6F569008D26C0 /* NfcHelpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NfcHelpView.swift; sourceTree = ""; }; - AC6F511B2CA205E900D4D27A /* StringOrData+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StringOrData+Ext.swift"; sourceTree = ""; }; - AC6F511D2CA36C7100D4D27A /* BinaryDecoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BinaryDecoder.swift; sourceTree = ""; }; - AC739D4F2CA09573006B5FF1 /* QrCodeImportScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QrCodeImportScreen.swift; sourceTree = ""; }; - AC739D542CA09AD6006B5FF1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - AC73B5942CCEFC4C0003F537 /* QrCodeScanView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QrCodeScanView.swift; sourceTree = ""; }; - AC73B5962CCF28960003F537 /* AppAlertState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppAlertState.swift; sourceTree = ""; }; - AC73B5982CCF2D6C0003F537 /* AppSheetState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSheetState.swift; sourceTree = ""; }; - AC73B5A02CD154BA0003F537 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; - AC757CBA2C6D277400F3F41C /* ReceiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceiveView.swift; sourceTree = ""; }; - AC7DAC992C5ACA2800F9DDDB /* String+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Ext.swift"; sourceTree = ""; }; - AC8189532C4023F0004DCDF5 /* CustomCompletionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCompletionView.swift; sourceTree = ""; }; - AC8459BE2CA5DF4800A3083F /* ScannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerView.swift; sourceTree = ""; }; - AC8459C02CA5ED7700A3083F /* NFCReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NFCReader.swift; sourceTree = ""; }; - AC8459C22CA5F13A00A3083F /* Cove.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Cove.entitlements; sourceTree = ""; }; - AC8C1FAB2C4D5D6600158283 /* NodeSelection+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NodeSelection+Ext.swift"; sourceTree = ""; }; - AC93DAE22C4572C3002E5AF2 /* NumberOfWords+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NumberOfWords+Ext.swift"; sourceTree = ""; }; - AC97D1EB2C287D4F00873092 /* CommonButtonStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonButtonStyles.swift; sourceTree = ""; }; AC9AB5782C34956C00BAE3BE /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = ""; }; - AC9FBEBC2C3F5C78005CB37A /* SettingsScreen2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScreen2.swift; sourceTree = ""; }; - ACA4CBEB2C2328BE0008F63E /* Security.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Security.swift; sourceTree = ""; }; - ACB17FBC2C5ABDD20079A96A /* WalletBalanceHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletBalanceHeaderView.swift; sourceTree = ""; }; - ACC1CD592C6D415400C7AD89 /* FloaterPopupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloaterPopupView.swift; sourceTree = ""; }; - ACC1CD5F2C6D4F2C00C7AD89 /* MiddlePopup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MiddlePopup.swift; sourceTree = ""; }; - ACC1CD612C6D5ABC00C7AD89 /* FloaterPopup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FloaterPopup.swift; sourceTree = ""; }; - ACC301692C20C9D4006790DF /* Routes+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Routes+Ext.swift"; sourceTree = ""; }; - ACC301732C211281006790DF /* HotWalletSelectScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HotWalletSelectScreen.swift; sourceTree = ""; }; - ACC301792C221450006790DF /* PendingWalletViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PendingWalletViewModel.swift; sourceTree = ""; }; - ACCAAAAC2C29CABC00FA642E /* Trait+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Trait+Ext.swift"; sourceTree = ""; }; - ACCB02CB2C9747AA00FB2EDF /* TransactionCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionCapsule.swift; sourceTree = ""; }; - ACCB02CD2C97572100FB2EDF /* AsyncView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncView.swift; sourceTree = ""; }; - ACCD58D32C5A89FC00CF06F9 /* AsyncPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncPreview.swift; sourceTree = ""; }; - ACF44D0C2C26131A008C5034 /* Color+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Ext.swift"; sourceTree = ""; }; - ACF44D112C2642DD008C5034 /* SunsetWave.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SunsetWave.swift; sourceTree = ""; }; - ACF44D132C2857E9008C5034 /* FixedGlassCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FixedGlassCard.swift; sourceTree = ""; }; - ACF479F72C59D785008A9362 /* WeakReconciler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeakReconciler.swift; sourceTree = ""; }; - AF2839E08E408CA31CABF08B /* HotWalletCreateScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HotWalletCreateScreen.swift; sourceTree = ""; }; - B69A8CC9BCD8F42D62F06C0B /* NewWalletSelectScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NewWalletSelectScreen.swift; sourceTree = ""; }; - C9EF236DBA6E27BF588A0776 /* Balance+Ext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "Balance+Ext.swift"; sourceTree = ""; }; - CA07C73C0BFF66882684293F /* HotWalletImportScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HotWalletImportScreen.swift; sourceTree = ""; }; - CBAE8286BEC382061EF00299 /* NewWalletContainer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NewWalletContainer.swift; sourceTree = ""; }; D000B2EF2C0F7BAA00E32143 /* Cove.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Cove.xcframework; path = ../rust/ios/Cove.xcframework; sourceTree = ""; }; - D000B2F12C0F7BB100E32143 /* Cove.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Cove.swift; path = ../../rust/ios/Cove/Cove.swift; sourceTree = ""; }; D0245F4C2C0F7B4E0042B447 /* Cove.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Cove.app; sourceTree = BUILT_PRODUCTS_DIR; }; - D0245F4F2C0F7B4E0042B447 /* CoveApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoveApp.swift; sourceTree = ""; }; - D0245F532C0F7B500042B447 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - D0245F562C0F7B500042B447 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - D0BE2EBD2C1614150055FCBE /* MainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewModel.swift; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + AC8CF6662CF8C7D300F02F5C /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = D0245F4B2C0F7B4E0042B447 /* Cove */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + /* Begin PBXFileSystemSynchronizedRootGroup section */ - AC08E3F02CF3C2BA00DF307D /* ViewModifier */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = ViewModifier; sourceTree = ""; }; - AC73B59A2CD14EDD0003F537 /* SendFlow */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = SendFlow; sourceTree = ""; }; - ACD1857A2CEED1AA003601DC /* Icons */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Icons; sourceTree = ""; }; + AC8CF6022CF8C7D300F02F5C /* Cove */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (AC8CF6662CF8C7D300F02F5C /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Cove; sourceTree = ""; }; + AC8CF66C2CF8C86600F02F5C /* CodeScanner */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = CodeScanner; sourceTree = ""; }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -230,182 +63,13 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - AC2B13572CA1F49A00C5C708 /* CodeScanner */ = { - isa = PBXGroup; - children = ( - AC6F511D2CA36C7100D4D27A /* BinaryDecoder.swift */, - AC2B13542CA1F49A00C5C708 /* AVCaptureDevice+bestForBuiltInCamera.swift */, - AC8459BE2CA5DF4800A3083F /* ScannerView.swift */, - AC2B13552CA1F49A00C5C708 /* CodeScanner.swift */, - AC2B13562CA1F49A00C5C708 /* ScannerViewController.swift */, - ); - path = CodeScanner; - sourceTree = ""; - }; - AC43435F2C6AF7B400105C03 /* Container */ = { - isa = PBXGroup; - children = ( - CBAE8286BEC382061EF00299 /* NewWalletContainer.swift */, - 8328372CD79EE1B21B23EAF6 /* NewHotWalletContainer.swift */, - ); - path = Container; - sourceTree = ""; - }; - AC4343602C6AF80000105C03 /* HomeScreens */ = { - isa = PBXGroup; - children = ( - AC07617E2C31BAA9007B4540 /* ListWalletsScreen.swift */, - 3073277B96EFD103FFE756E8 /* SettingsScreen.swift */, - 845A3FB37C6A830D7647EE31 /* SelectedWalletScreen.swift */, - ); - path = HomeScreens; - sourceTree = ""; - }; - AC4343612C6AF87B00105C03 /* SettingsScreen */ = { - isa = PBXGroup; - children = ( - 8C9A8B89D7E04B547A9B2083 /* NodeSelectionView.swift */, - ); - path = SettingsScreen; - sourceTree = ""; - }; - AC4343622C6AF8B900105C03 /* Views */ = { - isa = PBXGroup; - children = ( - AC1290322C4EF4EA00E72ECF /* MiddlePopupView.swift */, - AC0761802C32E3BA007B4540 /* SidebarView.swift */, - AC8189532C4023F0004DCDF5 /* CustomCompletionView.swift */, - AC9FBEBC2C3F5C78005CB37A /* SettingsScreen2.swift */, - ACC1CD592C6D415400C7AD89 /* FloaterPopupView.swift */, - ACCB02CB2C9747AA00FB2EDF /* TransactionCapsule.swift */, - ACCB02CD2C97572100FB2EDF /* AsyncView.swift */, - ); - path = Views; - sourceTree = ""; - }; - AC45C4A12C991BFA002C5AEB /* TransactionDetails */ = { - isa = PBXGroup; - children = ( - AC45C4A22C991C1F002C5AEB /* ConfirmationIndicatorView.swift */, - AC5F3CDA2C99E96000469EBA /* SentDetailsExpandedView.swift */, - AC5F3CDC2C99E99800469EBA /* HeaderIcon.swift */, - AC5F3CDE2C99EB9D00469EBA /* ReceivedDetailsExpandedView.swift */, - AC5F3CE02C99EBD600469EBA /* TransactionDetailsView.swift */, - ); - path = TransactionDetails; - sourceTree = ""; - }; - AC739D4D2CA08F84006B5FF1 /* ColdWallet */ = { - isa = PBXGroup; - children = ( - AC739D4F2CA09573006B5FF1 /* QrCodeImportScreen.swift */, - ); - path = ColdWallet; - sourceTree = ""; - }; - AC97D1ED2C287FCE00873092 /* Styles */ = { - isa = PBXGroup; - children = ( - AC97D1EB2C287D4F00873092 /* CommonButtonStyles.swift */, - ); - path = Styles; - sourceTree = ""; - }; - ACB17FBB2C5ABD6C0079A96A /* SelectedWalletScreen */ = { - isa = PBXGroup; - children = ( - AC6F4CD82CC554F1008D26C0 /* ChooseWalletTypeView.swift */, - ACB17FBC2C5ABDD20079A96A /* WalletBalanceHeaderView.swift */, - AC2D59242C5B213500B67277 /* TransactionsCardView.swift */, - AC757CBA2C6D277400F3F41C /* ReceiveView.swift */, - ); - path = SelectedWalletScreen; - sourceTree = ""; - }; - ACC1CD5E2C6D4F0500C7AD89 /* Popups */ = { - isa = PBXGroup; - children = ( - ACC1CD5F2C6D4F2C00C7AD89 /* MiddlePopup.swift */, - ACC1CD612C6D5ABC00C7AD89 /* FloaterPopup.swift */, - ); - path = Popups; - sourceTree = ""; - }; - ACC301662C20C11D006790DF /* Extention */ = { - isa = PBXGroup; - children = ( - AC2822F82CDD59E000C403E0 /* Address+Ext.swift */, - AC6F4CDA2CC55974008D26C0 /* General+Ext.swift */, - ACC301692C20C9D4006790DF /* Routes+Ext.swift */, - ACF44D0C2C26131A008C5034 /* Color+Ext.swift */, - ACCAAAAC2C29CABC00FA642E /* Trait+Ext.swift */, - 4F6A06235CFE0DBA125358F3 /* KeyboardObserver.swift */, - 5D722195526284FA0FD24DDE /* WalletColor+Ext.swift */, - 5398BBCAD30C0F26920CC75C /* Network+Ext.swift */, - 19224F788C8E6EEDE418212E /* ColorSchemeSelection+Ext.swift */, - AC93DAE22C4572C3002E5AF2 /* NumberOfWords+Ext.swift */, - AC8C1FAB2C4D5D6600158283 /* NodeSelection+Ext.swift */, - AC1290302C4EE8A500E72ECF /* Result+Ext.swift */, - C9EF236DBA6E27BF588A0776 /* Balance+Ext.swift */, - AC7DAC992C5ACA2800F9DDDB /* String+Ext.swift */, - AC6F511B2CA205E900D4D27A /* StringOrData+Ext.swift */, - AC5977092C6987BA004A0C44 /* Transaction+Ext.swift */, - AA9163511856992204BBC8EC /* WalletMetadata+Ext.swift */, - ); - path = Extention; - sourceTree = ""; - }; - ACC3016B2C21095A006790DF /* NewWalletFlow */ = { - isa = PBXGroup; - children = ( - AC739D4D2CA08F84006B5FF1 /* ColdWallet */, - AC43435F2C6AF7B400105C03 /* Container */, - ACC301722C21126C006790DF /* HotWallet */, - ACC301792C221450006790DF /* PendingWalletViewModel.swift */, - B69A8CC9BCD8F42D62F06C0B /* NewWalletSelectScreen.swift */, - AC6F4CE42CC6F569008D26C0 /* NfcHelpView.swift */, - ); - path = NewWalletFlow; - sourceTree = ""; - }; - ACC301722C21126C006790DF /* HotWallet */ = { - isa = PBXGroup; - children = ( - ACC301732C211281006790DF /* HotWalletSelectScreen.swift */, - AF2839E08E408CA31CABF08B /* HotWalletCreateScreen.swift */, - CA07C73C0BFF66882684293F /* HotWalletImportScreen.swift */, - 3AAF284B6AD61F220F881B4C /* VerifyWordsScreen.swift */, - ); - path = HotWallet; - sourceTree = ""; - }; - ACF44D102C2642BA008C5034 /* Components */ = { - isa = PBXGroup; - children = ( - ACF44D112C2642DD008C5034 /* SunsetWave.swift */, - ACF44D132C2857E9008C5034 /* FixedGlassCard.swift */, - AC07617C2C31A527007B4540 /* GlassCard.swift */, - ); - path = Components; - sourceTree = ""; - }; - ACF479F62C59D76E008A9362 /* FFI */ = { - isa = PBXGroup; - children = ( - ACF479F72C59D785008A9362 /* WeakReconciler.swift */, - AC61B8F72C7D223A001B649A /* MakeIdentifiable.swift */, - AC5F3CE42C9A188300469EBA /* FfiColorScheme.swift */, - ); - path = FFI; - sourceTree = ""; - }; D0245F432C0F7B4E0042B447 = { isa = PBXGroup; children = ( AC9AB5782C34956C00BAE3BE /* Logger.swift */, D000B2EF2C0F7BAA00E32143 /* Cove.xcframework */, - AC2B13572CA1F49A00C5C708 /* CodeScanner */, - D0245F4E2C0F7B4E0042B447 /* Cove */, + AC8CF66C2CF8C86600F02F5C /* CodeScanner */, + AC8CF6022CF8C7D300F02F5C /* Cove */, D0245F4D2C0F7B4E0042B447 /* Products */, ); sourceTree = ""; @@ -418,65 +82,6 @@ name = Products; sourceTree = ""; }; - D0245F4E2C0F7B4E0042B447 /* Cove */ = { - isa = PBXGroup; - children = ( - AC08E3F02CF3C2BA00DF307D /* ViewModifier */, - AC8459C22CA5F13A00A3083F /* Cove.entitlements */, - AC739D542CA09AD6006B5FF1 /* Info.plist */, - AC4343612C6AF87B00105C03 /* SettingsScreen */, - AC73B59A2CD14EDD0003F537 /* SendFlow */, - AC4343602C6AF80000105C03 /* HomeScreens */, - ACF479F62C59D76E008A9362 /* FFI */, - D000B2F12C0F7BB100E32143 /* Cove.swift */, - AC97D1ED2C287FCE00873092 /* Styles */, - ACF44D102C2642BA008C5034 /* Components */, - ACC3016B2C21095A006790DF /* NewWalletFlow */, - AC45C4A12C991BFA002C5AEB /* TransactionDetails */, - ACB17FBB2C5ABD6C0079A96A /* SelectedWalletScreen */, - AC4343622C6AF8B900105C03 /* Views */, - ACC1CD5E2C6D4F0500C7AD89 /* Popups */, - ACC301662C20C11D006790DF /* Extention */, - D0245F4F2C0F7B4E0042B447 /* CoveApp.swift */, - AC8459C02CA5ED7700A3083F /* NFCReader.swift */, - AC08E3ED2CF3B40A00DF307D /* NFCWriter.swift */, - ACCD58D32C5A89FC00CF06F9 /* AsyncPreview.swift */, - AC6F4CE22CC6BC24008D26C0 /* LoadAndResetView.swift */, - AC2B13522CA1EC0200C5C708 /* TaggedItem.swift */, - AC73B5962CCF28960003F537 /* AppAlertState.swift */, - AC73B5982CCF2D6C0003F537 /* AppSheetState.swift */, - D0BE2EBD2C1614150055FCBE /* MainViewModel.swift */, - ACD1857A2CEED1AA003601DC /* Icons */, - AC73B5A02CD154BA0003F537 /* Constants.swift */, - 2B6032F09EA34DFDCB18090A /* RouteView.swift */, - AC49121A2C77B8A100ED8ED7 /* SecretWordsScreen.swift */, - 048B2E5F01EEF26233C1161C /* ImportWalletViewModel.swift */, - AC08E3FC2CF4AD1700DF307D /* AlertBuilder.swift */, - AC73B5942CCEFC4C0003F537 /* QrCodeScanView.swift */, - AC286C0A2CF6E0D700C6F47E /* FileReader.swift */, - ACA4CBEB2C2328BE0008F63E /* Security.swift */, - AC34AC5B6A6EF5288E8B34DC /* WalletViewModel.swift */, - AC61B8F92C7E6976001B649A /* TransactionsDetailScreen.swift */, - 80049549984BDDA80E72D91C /* WalletSettingsSheet.swift */, - AC08E3F42CF3E24F00DF307D /* PSBTFile.swift */, - D0245F532C0F7B500042B447 /* Assets.xcassets */, - D0245F552C0F7B500042B447 /* Preview Content */, - AC45C4A42C991F3C002C5AEB /* Format.swift */, - AC08E3F62CF3E7CF00DF307D /* QrCodeView.swift */, - ); - indentWidth = 4; - path = Cove; - sourceTree = ""; - tabWidth = 4; - }; - D0245F552C0F7B500042B447 /* Preview Content */ = { - isa = PBXGroup; - children = ( - D0245F562C0F7B500042B447 /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -494,9 +99,8 @@ dependencies = ( ); fileSystemSynchronizedGroups = ( - AC08E3F02CF3C2BA00DF307D /* ViewModifier */, - AC73B59A2CD14EDD0003F537 /* SendFlow */, - ACD1857A2CEED1AA003601DC /* Icons */, + AC8CF6022CF8C7D300F02F5C /* Cove */, + AC8CF66C2CF8C86600F02F5C /* CodeScanner */, ); name = Cove; packageProductDependencies = ( @@ -551,8 +155,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - D0245F572C0F7B500042B447 /* Preview Assets.xcassets in Resources */, - D0245F542C0F7B500042B447 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -563,92 +165,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D0BE2EBE2C1614150055FCBE /* MainViewModel.swift in Sources */, - ACC3017A2C221450006790DF /* PendingWalletViewModel.swift in Sources */, AC9AB5792C34956C00BAE3BE /* Logger.swift in Sources */, - D0245F502C0F7B4E0042B447 /* CoveApp.swift in Sources */, - ACF44D142C2857E9008C5034 /* FixedGlassCard.swift in Sources */, - AC07617F2C31BAA9007B4540 /* ListWalletsScreen.swift in Sources */, - D000B2F22C0F7BB100E32143 /* Cove.swift in Sources */, - AC07617D2C31A527007B4540 /* GlassCard.swift in Sources */, - AC9FBEBD2C3F5C78005CB37A /* SettingsScreen2.swift in Sources */, - ACF44D122C2642DD008C5034 /* SunsetWave.swift in Sources */, - ACC1CD622C6D5ABC00C7AD89 /* FloaterPopup.swift in Sources */, - ACC3016A2C20C9D4006790DF /* Routes+Ext.swift in Sources */, - AC08E3FD2CF4AD1A00DF307D /* AlertBuilder.swift in Sources */, - AC739D502CA09573006B5FF1 /* QrCodeImportScreen.swift in Sources */, - ACB17FBD2C5ABDD20079A96A /* WalletBalanceHeaderView.swift in Sources */, - ACCD58D42C5A89FC00CF06F9 /* AsyncPreview.swift in Sources */, - AC1290312C4EE8A500E72ECF /* Result+Ext.swift in Sources */, - AC2B13582CA1F49A00C5C708 /* ScannerViewController.swift in Sources */, - AC2B13592CA1F49A00C5C708 /* AVCaptureDevice+bestForBuiltInCamera.swift in Sources */, - AC2B135A2CA1F49A00C5C708 /* CodeScanner.swift in Sources */, - ACC301742C211281006790DF /* HotWalletSelectScreen.swift in Sources */, - AC0761812C32E3BA007B4540 /* SidebarView.swift in Sources */, - AC1290332C4EF4EA00E72ECF /* MiddlePopupView.swift in Sources */, - AC2822F92CDD59E700C403E0 /* Address+Ext.swift in Sources */, - AC49121B2C77B8A100ED8ED7 /* SecretWordsScreen.swift in Sources */, - ACCB02CE2C97572100FB2EDF /* AsyncView.swift in Sources */, - AC2B13532CA1EC1000C5C708 /* TaggedItem.swift in Sources */, - AC5F3CDB2C99E96000469EBA /* SentDetailsExpandedView.swift in Sources */, - AC5F3CE12C99EBD600469EBA /* TransactionDetailsView.swift in Sources */, - ACA4CBEC2C2328BE0008F63E /* Security.swift in Sources */, - ACF44D0D2C26131A008C5034 /* Color+Ext.swift in Sources */, - AC45C4A52C991F3C002C5AEB /* Format.swift in Sources */, - ACCAAAAD2C29CABC00FA642E /* Trait+Ext.swift in Sources */, - ACC1CD602C6D4F2C00C7AD89 /* MiddlePopup.swift in Sources */, - AC59770A2C6987BA004A0C44 /* Transaction+Ext.swift in Sources */, - AC8189542C4023F0004DCDF5 /* CustomCompletionView.swift in Sources */, - AC97D1EC2C287D4F00873092 /* CommonButtonStyles.swift in Sources */, - AC61B8FA2C7E6976001B649A /* TransactionsDetailScreen.swift in Sources */, - AC7DAC9A2C5ACA2800F9DDDB /* String+Ext.swift in Sources */, - 382288EEB9734474498ED7EE /* KeyboardObserver.swift in Sources */, - ACCB02CC2C9747AA00FB2EDF /* TransactionCapsule.swift in Sources */, - AC45C4A32C991C1F002C5AEB /* ConfirmationIndicatorView.swift in Sources */, - AC73B5992CCF2D6F0003F537 /* AppSheetState.swift in Sources */, - AC73B5952CCEFC5A0003F537 /* QrCodeScanView.swift in Sources */, - AC73B5972CCF289A0003F537 /* AppAlertState.swift in Sources */, - AC5F3CE52C9A188300469EBA /* FfiColorScheme.swift in Sources */, - AC8459BF2CA5DF4800A3083F /* ScannerView.swift in Sources */, - 6B2189B893A545A2F4E3107E /* WalletColor+Ext.swift in Sources */, - AC757CBB2C6D277400F3F41C /* ReceiveView.swift in Sources */, - AC08E3F72CF3E7CF00DF307D /* QrCodeView.swift in Sources */, - 0995B2382B1A8AA3208B6097 /* WalletViewModel.swift in Sources */, - AC61B8F82C7D223A001B649A /* MakeIdentifiable.swift in Sources */, - ACC1CD5A2C6D415400C7AD89 /* FloaterPopupView.swift in Sources */, - 52AEF2D14ADE7D9CDF81C276 /* RouteView.swift in Sources */, - AC08E3F52CF3E24F00DF307D /* PSBTFile.swift in Sources */, - AC6F511C2CA205EE00D4D27A /* StringOrData+Ext.swift in Sources */, - AC8C1FAC2C4D5D6600158283 /* NodeSelection+Ext.swift in Sources */, - AC6F4CE32CC6BC30008D26C0 /* LoadAndResetView.swift in Sources */, - AC6F4CE52CC6F56F008D26C0 /* NfcHelpView.swift in Sources */, - AC2D59252C5B213500B67277 /* TransactionsCardView.swift in Sources */, - 4B7D31B349728B3C573472DD /* Network+Ext.swift in Sources */, - AC6F511E2CA36C7600D4D27A /* BinaryDecoder.swift in Sources */, - 2C3000E623FFF7A92EB7F02D /* ColorSchemeSelection+Ext.swift in Sources */, - AC6F4CDB2CC55981008D26C0 /* General+Ext.swift in Sources */, - AC5F3CDD2C99E99800469EBA /* HeaderIcon.swift in Sources */, - AC08E3EE2CF3B40E00DF307D /* NFCWriter.swift in Sources */, - 4998F4A296FA2217EC2BD80F /* WalletSettingsSheet.swift in Sources */, - 1BE5607DDD79FE6FA8A6B6F0 /* ImportWalletViewModel.swift in Sources */, - AC93DAE32C4572C3002E5AF2 /* NumberOfWords+Ext.swift in Sources */, - ACF479F82C59D785008A9362 /* WeakReconciler.swift in Sources */, - AC5F3CDF2C99EB9D00469EBA /* ReceivedDetailsExpandedView.swift in Sources */, - AC8459C12CA5ED7E00A3083F /* NFCReader.swift in Sources */, - 09890D7BB033D5000D5EFA66 /* Balance+Ext.swift in Sources */, - AD998F28BCDE0FFFCEF64986 /* SettingsScreen.swift in Sources */, - 1333E89ACE42F5331C4B7AEB /* SelectedWalletScreen.swift in Sources */, - D6C648A0942CE7443B0D52D3 /* NewWalletSelectScreen.swift in Sources */, - AC286C0B2CF6E0DB00C6F47E /* FileReader.swift in Sources */, - 1F185905CB256BB39BA87EE1 /* NewHotWalletContainer.swift in Sources */, - E205EBB1A70E784E13268A5C /* HotWalletCreateScreen.swift in Sources */, - 2344E4672757BE424B888B58 /* HotWalletImportScreen.swift in Sources */, - 1C025A7627543FBFC072E0D1 /* VerifyWordsScreen.swift in Sources */, - 240A3B1A16A45C43F8991A9E /* NodeSelectionView.swift in Sources */, - AC6F4CD92CC554FE008D26C0 /* ChooseWalletTypeView.swift in Sources */, - 9BEA921FB93FC209CF7A8CA2 /* NewWalletContainer.swift in Sources */, - 69455D17216AD109B6EE2F25 /* WalletMetadata+Ext.swift in Sources */, - AC73B5A12CD154BE0003F537 /* Constants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/rust/ios/Cove/Cove.swift b/ios/Cove/Cove.swift similarity index 65% rename from rust/ios/Cove/Cove.swift rename to ios/Cove/Cove.swift index 18882341..c097f51b 100644 --- a/rust/ios/Cove/Cove.swift +++ b/ios/Cove/Cove.swift @@ -8,10 +8,10 @@ import Foundation // might be in a separate module, or it might be compiled inline into // this module. This is a bit of light hackery to work with both. #if canImport(coveFFI) - import coveFFI +import coveFFI #endif -private extension RustBuffer { +fileprivate extension RustBuffer { // Allocate a new buffer, copying the contents of a `UInt8` array. init(bytes: [UInt8]) { let rbuf = bytes.withUnsafeBufferPointer { ptr in @@ -21,7 +21,7 @@ private extension RustBuffer { } static func empty() -> RustBuffer { - RustBuffer(capacity: 0, len: 0, data: nil) + RustBuffer(capacity: 0, len:0, data: nil) } static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { @@ -35,7 +35,7 @@ private extension RustBuffer { } } -private extension ForeignBytes { +fileprivate extension ForeignBytes { init(bufferPointer: UnsafeBufferPointer) { self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress) } @@ -48,7 +48,7 @@ private extension ForeignBytes { // Helper classes/extensions that don't change. // Someday, this will be in a library of its own. -private extension Data { +fileprivate extension Data { init(rustBuffer: RustBuffer) { self.init( bytesNoCopy: rustBuffer.data!, @@ -72,15 +72,15 @@ private extension Data { // // Instead, the read() method and these helper functions input a tuple of data -private func createReader(data: Data) -> (data: Data, offset: Data.Index) { +fileprivate func createReader(data: Data) -> (data: Data, offset: Data.Index) { (data: data, offset: 0) } // Reads an integer at the current offset, in big-endian order, and advances // the offset on success. Throws if reading the integer would move the // offset past the end of the buffer. -private func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { - let range = reader.offset ..< reader.offset + MemoryLayout.size +fileprivate func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { + let range = reader.offset...size guard reader.data.count >= range.upperBound else { throw UniffiInternalError.bufferOverflow } @@ -90,50 +90,50 @@ private func readInt(_ reader: inout (data: Data, offset: return value as! T } var value: T = 0 - let _ = withUnsafeMutableBytes(of: &value) { reader.data.copyBytes(to: $0, from: range) } + let _ = withUnsafeMutableBytes(of: &value, { reader.data.copyBytes(to: $0, from: range)}) reader.offset = range.upperBound return value.bigEndian } // Reads an arbitrary number of bytes, to be used to read // raw bytes, this is useful when lifting strings -private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> [UInt8] { - let range = reader.offset ..< (reader.offset + count) +fileprivate func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> Array { + let range = reader.offset..<(reader.offset+count) guard reader.data.count >= range.upperBound else { throw UniffiInternalError.bufferOverflow } var value = [UInt8](repeating: 0, count: count) - value.withUnsafeMutableBufferPointer { buffer in + value.withUnsafeMutableBufferPointer({ buffer in reader.data.copyBytes(to: buffer, from: range) - } + }) reader.offset = range.upperBound return value } // Reads a float at the current offset. -private func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { - try Float(bitPattern: readInt(&reader)) +fileprivate func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { + return Float(bitPattern: try readInt(&reader)) } // Reads a float at the current offset. -private func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { - try Double(bitPattern: readInt(&reader)) +fileprivate func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { + return Double(bitPattern: try readInt(&reader)) } // Indicates if the offset has reached the end of the buffer. -private func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { - reader.offset < reader.data.count +fileprivate func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { + return reader.offset < reader.data.count } // Define writer functionality. Normally this would be defined in a class or // struct, but we use standalone functions instead in order to make external // types work. See the above discussion on Readers for details. -private func createWriter() -> [UInt8] { - [] +fileprivate func createWriter() -> [UInt8] { + return [] } -private func writeBytes(_ writer: inout [UInt8], _ byteArr: some Sequence) { +fileprivate func writeBytes(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 { writer.append(contentsOf: byteArr) } @@ -141,22 +141,22 @@ private func writeBytes(_ writer: inout [UInt8], _ byteArr: some Sequence // // Warning: make sure what you are trying to write // is in the correct type! -private func writeInt(_ writer: inout [UInt8], _ value: some FixedWidthInteger) { +fileprivate func writeInt(_ writer: inout [UInt8], _ value: T) { var value = value.bigEndian withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) } } -private func writeFloat(_ writer: inout [UInt8], _ value: Float) { +fileprivate func writeFloat(_ writer: inout [UInt8], _ value: Float) { writeInt(&writer, value.bitPattern) } -private func writeDouble(_ writer: inout [UInt8], _ value: Double) { +fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) { writeInt(&writer, value.bitPattern) } // Protocol for types that transfer other types across the FFI. This is // analogous to the Rust trait of the same name. -private protocol FfiConverter { +fileprivate protocol FfiConverter { associatedtype FfiType associatedtype SwiftType @@ -167,32 +167,32 @@ private protocol FfiConverter { } // Types conforming to `Primitive` pass themselves directly over the FFI. -private protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType {} +fileprivate protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType { } extension FfiConverterPrimitive { - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ value: FfiType) throws -> SwiftType { - value + return value } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ value: SwiftType) -> FfiType { - value + return value } } // Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`. // Used for complex types where it's hard to write a custom lift/lower. -private protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} +fileprivate protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} extension FfiConverterRustBuffer { - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ buf: RustBuffer) throws -> SwiftType { var reader = createReader(data: Data(rustBuffer: buf)) let value = try read(from: &reader) @@ -203,19 +203,18 @@ extension FfiConverterRustBuffer { return value } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ value: SwiftType) -> RustBuffer { - var writer = createWriter() - write(value, into: &writer) - return RustBuffer(bytes: writer) + var writer = createWriter() + write(value, into: &writer) + return RustBuffer(bytes: writer) } } - // An error type for FFI errors. These errors occur at the UniFFI level, not // the library level. -private enum UniffiInternalError: LocalizedError { +fileprivate enum UniffiInternalError: LocalizedError { case bufferOverflow case incompleteData case unexpectedOptionalTag @@ -228,37 +227,37 @@ private enum UniffiInternalError: LocalizedError { public var errorDescription: String? { switch self { - case .bufferOverflow: "Reading the requested value would read past the end of the buffer" - case .incompleteData: "The buffer still has data after lifting its containing value" - case .unexpectedOptionalTag: "Unexpected optional tag; should be 0 or 1" - case .unexpectedEnumCase: "Raw enum value doesn't match any cases" - case .unexpectedNullPointer: "Raw pointer value was null" - case .unexpectedRustCallStatusCode: "Unexpected RustCallStatus code" - case .unexpectedRustCallError: "CALL_ERROR but no errorClass specified" - case .unexpectedStaleHandle: "The object in the handle map has been dropped already" - case let .rustPanic(message): message + case .bufferOverflow: return "Reading the requested value would read past the end of the buffer" + case .incompleteData: return "The buffer still has data after lifting its containing value" + case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1" + case .unexpectedEnumCase: return "Raw enum value doesn't match any cases" + case .unexpectedNullPointer: return "Raw pointer value was null" + case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" + case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" + case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" + case let .rustPanic(message): return message } } } -private extension NSLock { +fileprivate extension NSLock { func withLock(f: () throws -> T) rethrows -> T { - lock() + self.lock() defer { self.unlock() } return try f() } } -private let CALL_SUCCESS: Int8 = 0 -private let CALL_ERROR: Int8 = 1 -private let CALL_UNEXPECTED_ERROR: Int8 = 2 -private let CALL_CANCELLED: Int8 = 3 +fileprivate let CALL_SUCCESS: Int8 = 0 +fileprivate let CALL_ERROR: Int8 = 1 +fileprivate let CALL_UNEXPECTED_ERROR: Int8 = 2 +fileprivate let CALL_CANCELLED: Int8 = 3 -private extension RustCallStatus { +fileprivate extension RustCallStatus { init() { self.init( code: CALL_SUCCESS, - errorBuf: RustBuffer( + errorBuf: RustBuffer.init( capacity: 0, len: 0, data: nil @@ -272,67 +271,66 @@ private func rustCall(_ callback: (UnsafeMutablePointer) -> T return try makeRustCall(callback, errorHandler: neverThrow) } -private func rustCallWithError( - _ errorHandler: @escaping (RustBuffer) throws -> some Swift.Error, - _ callback: (UnsafeMutablePointer) -> T -) throws -> T { +private func rustCallWithError( + _ errorHandler: @escaping (RustBuffer) throws -> E, + _ callback: (UnsafeMutablePointer) -> T) throws -> T { try makeRustCall(callback, errorHandler: errorHandler) } -private func makeRustCall( +private func makeRustCall( _ callback: (UnsafeMutablePointer) -> T, - errorHandler: ((RustBuffer) throws -> some Swift.Error)? + errorHandler: ((RustBuffer) throws -> E)? ) throws -> T { uniffiEnsureInitialized() - var callStatus = RustCallStatus() + var callStatus = RustCallStatus.init() let returnedVal = callback(&callStatus) try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) return returnedVal } -private func uniffiCheckCallStatus( +private func uniffiCheckCallStatus( callStatus: RustCallStatus, - errorHandler: ((RustBuffer) throws -> some Swift.Error)? + errorHandler: ((RustBuffer) throws -> E)? ) throws { switch callStatus.code { - case CALL_SUCCESS: - return + case CALL_SUCCESS: + return - case CALL_ERROR: - if let errorHandler { - throw try errorHandler(callStatus.errorBuf) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.unexpectedRustCallError - } + case CALL_ERROR: + if let errorHandler = errorHandler { + throw try errorHandler(callStatus.errorBuf) + } else { + callStatus.errorBuf.deallocate() + throw UniffiInternalError.unexpectedRustCallError + } - case CALL_UNEXPECTED_ERROR: - // When the rust code sees a panic, it tries to construct a RustBuffer - // with the message. But if that code panics, then it just sends back - // an empty buffer. - if callStatus.errorBuf.len > 0 { - throw try UniffiInternalError.rustPanic(FfiConverterString.lift(callStatus.errorBuf)) - } else { - callStatus.errorBuf.deallocate() - throw UniffiInternalError.rustPanic("Rust panic") - } + case CALL_UNEXPECTED_ERROR: + // When the rust code sees a panic, it tries to construct a RustBuffer + // with the message. But if that code panics, then it just sends back + // an empty buffer. + if callStatus.errorBuf.len > 0 { + throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf)) + } else { + callStatus.errorBuf.deallocate() + throw UniffiInternalError.rustPanic("Rust panic") + } - case CALL_CANCELLED: - fatalError("Cancellation not supported yet") + case CALL_CANCELLED: + fatalError("Cancellation not supported yet") - default: - throw UniffiInternalError.unexpectedRustCallStatusCode + default: + throw UniffiInternalError.unexpectedRustCallStatusCode } } private func uniffiTraitInterfaceCall( callStatus: UnsafeMutablePointer, makeCall: () throws -> T, - writeReturn: (T) -> Void + writeReturn: (T) -> () ) { do { try writeReturn(makeCall()) - } catch { + } catch let error { callStatus.pointee.code = CALL_UNEXPECTED_ERROR callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) } @@ -341,7 +339,7 @@ private func uniffiTraitInterfaceCall( private func uniffiTraitInterfaceCallWithError( callStatus: UnsafeMutablePointer, makeCall: () throws -> T, - writeReturn: (T) -> Void, + writeReturn: (T) -> (), lowerError: (E) -> RustBuffer ) { do { @@ -354,8 +352,7 @@ private func uniffiTraitInterfaceCallWithError( callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) } } - -private final class UniffiHandleMap: @unchecked Sendable { +fileprivate final class UniffiHandleMap: @unchecked Sendable { // All mutation happens with this lock held, which is why we implement @unchecked Sendable. private let lock = NSLock() private var map: [UInt64: T] = [:] @@ -370,7 +367,7 @@ private final class UniffiHandleMap: @unchecked Sendable { } } - func get(handle: UInt64) throws -> T { + func get(handle: UInt64) throws -> T { try lock.withLock { guard let obj = map[handle] else { throw UniffiInternalError.unexpectedStaleHandle @@ -390,21 +387,25 @@ private final class UniffiHandleMap: @unchecked Sendable { } var count: Int { - map.count + get { + map.count + } } } + // Public interface members begin here. + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterUInt8: FfiConverterPrimitive { +fileprivate struct FfiConverterUInt8: FfiConverterPrimitive { typealias FfiType = UInt8 typealias SwiftType = UInt8 public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt8 { - try lift(readInt(&buf)) + return try lift(readInt(&buf)) } public static func write(_ value: UInt8, into buf: inout [UInt8]) { @@ -413,14 +414,14 @@ private struct FfiConverterUInt8: FfiConverterPrimitive { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterUInt16: FfiConverterPrimitive { +fileprivate struct FfiConverterUInt16: FfiConverterPrimitive { typealias FfiType = UInt16 typealias SwiftType = UInt16 public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt16 { - try lift(readInt(&buf)) + return try lift(readInt(&buf)) } public static func write(_ value: SwiftType, into buf: inout [UInt8]) { @@ -429,14 +430,14 @@ private struct FfiConverterUInt16: FfiConverterPrimitive { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterUInt32: FfiConverterPrimitive { +fileprivate struct FfiConverterUInt32: FfiConverterPrimitive { typealias FfiType = UInt32 typealias SwiftType = UInt32 public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 { - try lift(readInt(&buf)) + return try lift(readInt(&buf)) } public static func write(_ value: SwiftType, into buf: inout [UInt8]) { @@ -445,14 +446,14 @@ private struct FfiConverterUInt32: FfiConverterPrimitive { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterInt32: FfiConverterPrimitive { +fileprivate struct FfiConverterInt32: FfiConverterPrimitive { typealias FfiType = Int32 typealias SwiftType = Int32 public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Int32 { - try lift(readInt(&buf)) + return try lift(readInt(&buf)) } public static func write(_ value: Int32, into buf: inout [UInt8]) { @@ -461,14 +462,14 @@ private struct FfiConverterInt32: FfiConverterPrimitive { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterUInt64: FfiConverterPrimitive { +fileprivate struct FfiConverterUInt64: FfiConverterPrimitive { typealias FfiType = UInt64 typealias SwiftType = UInt64 public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt64 { - try lift(readInt(&buf)) + return try lift(readInt(&buf)) } public static func write(_ value: SwiftType, into buf: inout [UInt8]) { @@ -477,14 +478,14 @@ private struct FfiConverterUInt64: FfiConverterPrimitive { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterDouble: FfiConverterPrimitive { +fileprivate struct FfiConverterDouble: FfiConverterPrimitive { typealias FfiType = Double typealias SwiftType = Double public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Double { - try lift(readDouble(&buf)) + return try lift(readDouble(&buf)) } public static func write(_ value: Double, into buf: inout [UInt8]) { @@ -493,22 +494,22 @@ private struct FfiConverterDouble: FfiConverterPrimitive { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterBool: FfiConverter { +fileprivate struct FfiConverterBool : FfiConverter { typealias FfiType = Int8 typealias SwiftType = Bool public static func lift(_ value: Int8) throws -> Bool { - value != 0 + return value != 0 } public static func lower(_ value: Bool) -> Int8 { - value ? 1 : 0 + return value ? 1 : 0 } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool { - try lift(readInt(&buf)) + return try lift(readInt(&buf)) } public static func write(_ value: Bool, into buf: inout [UInt8]) { @@ -517,9 +518,9 @@ private struct FfiConverterBool: FfiConverter { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterString: FfiConverter { +fileprivate struct FfiConverterString: FfiConverter { typealias SwiftType = String typealias FfiType = RustBuffer @@ -535,7 +536,7 @@ private struct FfiConverterString: FfiConverter { } public static func lower(_ value: String) -> RustBuffer { - value.utf8CString.withUnsafeBufferPointer { ptr in + return value.utf8CString.withUnsafeBufferPointer { ptr in // The swift string gives us int8_t, we want uint8_t. ptr.withMemoryRebound(to: UInt8.self) { ptr in // The swift string gives us a trailing null byte, we don't want it. @@ -547,7 +548,7 @@ private struct FfiConverterString: FfiConverter { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { let len: Int32 = try readInt(&buf) - return try String(bytes: readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! + return String(bytes: try readBytes(&buf, count: Int(len)), encoding: String.Encoding.utf8)! } public static func write(_ value: String, into buf: inout [UInt8]) { @@ -558,14 +559,14 @@ private struct FfiConverterString: FfiConverter { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterData: FfiConverterRustBuffer { +fileprivate struct FfiConverterData: FfiConverterRustBuffer { typealias SwiftType = Data public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Data { let len: Int32 = try readInt(&buf) - return try Data(readBytes(&buf, count: Int(len))) + return Data(try readBytes(&buf, count: Int(len))) } public static func write(_ value: Data, into buf: inout [UInt8]) { @@ -576,9 +577,9 @@ private struct FfiConverterData: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterDuration: FfiConverterRustBuffer { +fileprivate struct FfiConverterDuration: FfiConverterRustBuffer { typealias SwiftType = TimeInterval public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TimeInterval { @@ -603,21 +604,25 @@ private struct FfiConverterDuration: FfiConverterRustBuffer { } } -public protocol AddressProtocol: AnyObject { - func spacedOut() -> String - func string() -> String + + +public protocol AddressProtocol : AnyObject { + + func spacedOut() -> String + + func string() -> String + } open class Address: - AddressProtocol -{ + AddressProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -625,7 +630,7 @@ open class Address: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -634,71 +639,78 @@ open class Address: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_address(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_address(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_address(pointer, $0) } } - public static func fromString(address: String) throws -> Address { - try FfiConverterTypeAddress.lift(rustCallWithError(FfiConverterTypeAddressError.lift) { - uniffi_cove_fn_constructor_address_from_string( - FfiConverterString.lower(address), $0 - ) - }) - } - - public static func previewNew() -> Address { - try! FfiConverterTypeAddress.lift(try! rustCall { - uniffi_cove_fn_constructor_address_preview_new($0 - ) - }) - } + +public static func fromString(address: String)throws -> Address { + return try FfiConverterTypeAddress.lift(try rustCallWithError(FfiConverterTypeAddressError.lift) { + uniffi_cove_fn_constructor_address_from_string( + FfiConverterString.lower(address),$0 + ) +}) +} + +public static func previewNew() -> Address { + return try! FfiConverterTypeAddress.lift(try! rustCall() { + uniffi_cove_fn_constructor_address_preview_new($0 + ) +}) +} + - open func spacedOut() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_address_spaced_out(self.uniffiClonePointer(), $0) - }) - } + +open func spacedOut() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_address_spaced_out(self.uniffiClonePointer(),$0 + ) +}) +} + +open func string() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_address_string(self.uniffiClonePointer(),$0 + ) +}) +} + - open func string() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_address_string(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAddress: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Address public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Address { - Address(unsafeFromRawPointer: pointer) + return Address(unsafeFromRawPointer: pointer) } public static func lower(_ value: Address) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Address { @@ -706,7 +718,7 @@ public struct FfiConverterTypeAddress: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -719,37 +731,44 @@ public struct FfiConverterTypeAddress: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddress_lift(_ pointer: UnsafeMutableRawPointer) throws -> Address { - try FfiConverterTypeAddress.lift(pointer) + return try FfiConverterTypeAddress.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddress_lower(_ value: Address) -> UnsafeMutableRawPointer { - FfiConverterTypeAddress.lower(value) + return FfiConverterTypeAddress.lower(value) } -public protocol AddressInfoProtocol: AnyObject { - func address() -> Address - func adressString() -> String - func index() -> UInt32 + +public protocol AddressInfoProtocol : AnyObject { + + func address() -> Address + + func adressString() -> String + + func index() -> UInt32 + } open class AddressInfo: - AddressInfoProtocol -{ + AddressInfoProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -757,7 +776,7 @@ open class AddressInfo: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -766,62 +785,70 @@ open class AddressInfo: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_addressinfo(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_addressinfo(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_addressinfo(pointer, $0) } } - open func address() -> Address { - try! FfiConverterTypeAddress.lift(try! rustCall { - uniffi_cove_fn_method_addressinfo_address(self.uniffiClonePointer(), $0) - }) - } + - open func adressString() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_addressinfo_adress_string(self.uniffiClonePointer(), $0) - }) - } + +open func address() -> Address { + return try! FfiConverterTypeAddress.lift(try! rustCall() { + uniffi_cove_fn_method_addressinfo_address(self.uniffiClonePointer(),$0 + ) +}) +} + +open func adressString() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_addressinfo_adress_string(self.uniffiClonePointer(),$0 + ) +}) +} + +open func index() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffi_cove_fn_method_addressinfo_index(self.uniffiClonePointer(),$0 + ) +}) +} + - open func index() -> UInt32 { - try! FfiConverterUInt32.lift(try! rustCall { - uniffi_cove_fn_method_addressinfo_index(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAddressInfo: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = AddressInfo public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> AddressInfo { - AddressInfo(unsafeFromRawPointer: pointer) + return AddressInfo(unsafeFromRawPointer: pointer) } public static func lower(_ value: AddressInfo) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressInfo { @@ -829,7 +856,7 @@ public struct FfiConverterTypeAddressInfo: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -842,37 +869,44 @@ public struct FfiConverterTypeAddressInfo: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddressInfo_lift(_ pointer: UnsafeMutableRawPointer) throws -> AddressInfo { - try FfiConverterTypeAddressInfo.lift(pointer) + return try FfiConverterTypeAddressInfo.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddressInfo_lower(_ value: AddressInfo) -> UnsafeMutableRawPointer { - FfiConverterTypeAddressInfo.lower(value) + return FfiConverterTypeAddressInfo.lower(value) } -public protocol AddressWithNetworkProtocol: AnyObject { - func address() -> Address - func amount() -> Amount? - func network() -> Network + +public protocol AddressWithNetworkProtocol : AnyObject { + + func address() -> Address + + func amount() -> Amount? + + func network() -> Network + } open class AddressWithNetwork: - AddressWithNetworkProtocol -{ + AddressWithNetworkProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -880,7 +914,7 @@ open class AddressWithNetwork: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -889,70 +923,78 @@ open class AddressWithNetwork: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_addresswithnetwork(self.pointer, $0) } - } - - public convenience init(address: String) throws { - let pointer = - try rustCallWithError(FfiConverterTypeAddressError.lift) { - uniffi_cove_fn_constructor_addresswithnetwork_new( - FfiConverterString.lower(address), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_addresswithnetwork(self.pointer, $0) } } +public convenience init(address: String)throws { + let pointer = + try rustCallWithError(FfiConverterTypeAddressError.lift) { + uniffi_cove_fn_constructor_addresswithnetwork_new( + FfiConverterString.lower(address),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_addresswithnetwork(pointer, $0) } } - open func address() -> Address { - try! FfiConverterTypeAddress.lift(try! rustCall { - uniffi_cove_fn_method_addresswithnetwork_address(self.uniffiClonePointer(), $0) - }) - } + - open func amount() -> Amount? { - try! FfiConverterOptionTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_addresswithnetwork_amount(self.uniffiClonePointer(), $0) - }) - } + +open func address() -> Address { + return try! FfiConverterTypeAddress.lift(try! rustCall() { + uniffi_cove_fn_method_addresswithnetwork_address(self.uniffiClonePointer(),$0 + ) +}) +} + +open func amount() -> Amount? { + return try! FfiConverterOptionTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_addresswithnetwork_amount(self.uniffiClonePointer(),$0 + ) +}) +} + +open func network() -> Network { + return try! FfiConverterTypeNetwork.lift(try! rustCall() { + uniffi_cove_fn_method_addresswithnetwork_network(self.uniffiClonePointer(),$0 + ) +}) +} + - open func network() -> Network { - try! FfiConverterTypeNetwork.lift(try! rustCall { - uniffi_cove_fn_method_addresswithnetwork_network(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAddressWithNetwork: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = AddressWithNetwork public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> AddressWithNetwork { - AddressWithNetwork(unsafeFromRawPointer: pointer) + return AddressWithNetwork(unsafeFromRawPointer: pointer) } public static func lower(_ value: AddressWithNetwork) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressWithNetwork { @@ -960,7 +1002,7 @@ public struct FfiConverterTypeAddressWithNetwork: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -973,45 +1015,52 @@ public struct FfiConverterTypeAddressWithNetwork: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddressWithNetwork_lift(_ pointer: UnsafeMutableRawPointer) throws -> AddressWithNetwork { - try FfiConverterTypeAddressWithNetwork.lift(pointer) + return try FfiConverterTypeAddressWithNetwork.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddressWithNetwork_lower(_ value: AddressWithNetwork) -> UnsafeMutableRawPointer { - FfiConverterTypeAddressWithNetwork.lower(value) + return FfiConverterTypeAddressWithNetwork.lower(value) } -public protocol AmountProtocol: AnyObject { - func asBtc() -> Double - - func asSats() -> UInt64 - - func btcString() -> String - - func btcStringWithUnit() -> String - func fmtStringWithUnit(unit: Unit) -> String - func satsString() -> String - func satsStringWithUnit() -> String +public protocol AmountProtocol : AnyObject { + + func asBtc() -> Double + + func asSats() -> UInt64 + + func btcString() -> String + + func btcStringWithUnit() -> String + + func fmtStringWithUnit(unit: Unit) -> String + + func satsString() -> String + + func satsStringWithUnit() -> String + } open class Amount: - AmountProtocol -{ + AmountProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -1019,7 +1068,7 @@ open class Amount: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -1028,109 +1077,121 @@ open class Amount: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_amount(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_amount(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_amount(pointer, $0) } } - public static func fromSat(sats: UInt64) -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_constructor_amount_from_sat( - FfiConverterUInt64.lower(sats), $0 - ) - }) - } - - public static func oneBtc() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_constructor_amount_one_btc($0 - ) - }) - } - - public static func oneSat() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_constructor_amount_one_sat($0 - ) - }) - } - - open func asBtc() -> Double { - try! FfiConverterDouble.lift(try! rustCall { - uniffi_cove_fn_method_amount_as_btc(self.uniffiClonePointer(), $0) - }) - } - - open func asSats() -> UInt64 { - try! FfiConverterUInt64.lift(try! rustCall { - uniffi_cove_fn_method_amount_as_sats(self.uniffiClonePointer(), $0) - }) - } - - open func btcString() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_amount_btc_string(self.uniffiClonePointer(), $0) - }) - } - - open func btcStringWithUnit() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_amount_btc_string_with_unit(self.uniffiClonePointer(), $0) - }) - } - - open func fmtStringWithUnit(unit: Unit) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_amount_fmt_string_with_unit(self.uniffiClonePointer(), - FfiConverterTypeUnit.lower(unit), $0) - }) - } + +public static func fromSat(sats: UInt64) -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_constructor_amount_from_sat( + FfiConverterUInt64.lower(sats),$0 + ) +}) +} + +public static func oneBtc() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_constructor_amount_one_btc($0 + ) +}) +} + +public static func oneSat() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_constructor_amount_one_sat($0 + ) +}) +} + - open func satsString() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_amount_sats_string(self.uniffiClonePointer(), $0) - }) - } + +open func asBtc() -> Double { + return try! FfiConverterDouble.lift(try! rustCall() { + uniffi_cove_fn_method_amount_as_btc(self.uniffiClonePointer(),$0 + ) +}) +} + +open func asSats() -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffi_cove_fn_method_amount_as_sats(self.uniffiClonePointer(),$0 + ) +}) +} + +open func btcString() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_amount_btc_string(self.uniffiClonePointer(),$0 + ) +}) +} + +open func btcStringWithUnit() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_amount_btc_string_with_unit(self.uniffiClonePointer(),$0 + ) +}) +} + +open func fmtStringWithUnit(unit: Unit) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_amount_fmt_string_with_unit(self.uniffiClonePointer(), + FfiConverterTypeUnit.lower(unit),$0 + ) +}) +} + +open func satsString() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_amount_sats_string(self.uniffiClonePointer(),$0 + ) +}) +} + +open func satsStringWithUnit() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_amount_sats_string_with_unit(self.uniffiClonePointer(),$0 + ) +}) +} + - open func satsStringWithUnit() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_amount_sats_string_with_unit(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAmount: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Amount public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Amount { - Amount(unsafeFromRawPointer: pointer) + return Amount(unsafeFromRawPointer: pointer) } public static func lower(_ value: Amount) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Amount { @@ -1138,7 +1199,7 @@ public struct FfiConverterTypeAmount: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -1151,35 +1212,42 @@ public struct FfiConverterTypeAmount: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAmount_lift(_ pointer: UnsafeMutableRawPointer) throws -> Amount { - try FfiConverterTypeAmount.lift(pointer) + return try FfiConverterTypeAmount.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAmount_lower(_ value: Amount) -> UnsafeMutableRawPointer { - FfiConverterTypeAmount.lower(value) + return FfiConverterTypeAmount.lower(value) } -public protocol AutoComplete: AnyObject { - func autocomplete(word: String) -> [String] - func isValidWord(word: String) -> Bool + + +public protocol AutoComplete : AnyObject { + + func autocomplete(word: String) -> [String] + + func isValidWord(word: String) -> Bool + } open class AutoCompleteImpl: - AutoComplete -{ + AutoComplete { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -1187,7 +1255,7 @@ open class AutoCompleteImpl: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -1196,45 +1264,50 @@ open class AutoCompleteImpl: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_autocomplete(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_autocomplete(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_autocomplete(pointer, $0) } } - open func autocomplete(word: String) -> [String] { - try! FfiConverterSequenceString.lift(try! rustCall { - uniffi_cove_fn_method_autocomplete_autocomplete(self.uniffiClonePointer(), - FfiConverterString.lower(word), $0) - }) - } + - open func isValidWord(word: String) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_autocomplete_is_valid_word(self.uniffiClonePointer(), - FfiConverterString.lower(word), $0) - }) - } + +open func autocomplete(word: String) -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_cove_fn_method_autocomplete_autocomplete(self.uniffiClonePointer(), + FfiConverterString.lower(word),$0 + ) +}) } + +open func isValidWord(word: String) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_autocomplete_is_valid_word(self.uniffiClonePointer(), + FfiConverterString.lower(word),$0 + ) +}) +} + +} // Magic number for the Rust proxy to call using the same mechanism as every other method, // to free the callback once it's dropped by Rust. private let IDX_CALLBACK_FREE: Int32 = 0 @@ -1244,7 +1317,8 @@ private let UNIFFI_CALLBACK_ERROR: Int32 = 1 private let UNIFFI_CALLBACK_UNEXPECTED_ERROR: Int32 = 2 // Put the implementation in a struct so we don't pollute the top-level namespace -private enum UniffiCallbackInterfaceAutoComplete { +fileprivate struct UniffiCallbackInterfaceAutoComplete { + // Create the VTable using a series of closures. // Swift automatically converts these into C callback functions. // @@ -1262,11 +1336,12 @@ private enum UniffiCallbackInterfaceAutoComplete { guard let uniffiObj = try? FfiConverterTypeAutoComplete.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.autocomplete( - word: FfiConverterString.lift(word) + return uniffiObj.autocomplete( + word: try FfiConverterString.lift(word) ) } + let writeReturn = { uniffiOutReturn.pointee = FfiConverterSequenceString.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1285,11 +1360,12 @@ private enum UniffiCallbackInterfaceAutoComplete { guard let uniffiObj = try? FfiConverterTypeAutoComplete.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.isValidWord( - word: FfiConverterString.lift(word) + return uniffiObj.isValidWord( + word: try FfiConverterString.lift(word) ) } + let writeReturn = { uniffiOutReturn.pointee = FfiConverterBool.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1297,7 +1373,7 @@ private enum UniffiCallbackInterfaceAutoComplete { writeReturn: writeReturn ) }, - uniffiFree: { (uniffiHandle: UInt64) in + uniffiFree: { (uniffiHandle: UInt64) -> () in let result = try? FfiConverterTypeAutoComplete.handleMap.remove(handle: uniffiHandle) if result == nil { print("Uniffi callback interface AutoComplete: handle missing in uniffiFree") @@ -1311,7 +1387,7 @@ private func uniffiCallbackInitAutoComplete() { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAutoComplete: FfiConverter { fileprivate static let handleMap = UniffiHandleMap() @@ -1320,7 +1396,7 @@ public struct FfiConverterTypeAutoComplete: FfiConverter { typealias SwiftType = AutoComplete public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> AutoComplete { - AutoCompleteImpl(unsafeFromRawPointer: pointer) + return AutoCompleteImpl(unsafeFromRawPointer: pointer) } public static func lower(_ value: AutoComplete) -> UnsafeMutableRawPointer { @@ -1335,7 +1411,7 @@ public struct FfiConverterTypeAutoComplete: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -1348,37 +1424,44 @@ public struct FfiConverterTypeAutoComplete: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAutoComplete_lift(_ pointer: UnsafeMutableRawPointer) throws -> AutoComplete { - try FfiConverterTypeAutoComplete.lift(pointer) + return try FfiConverterTypeAutoComplete.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAutoComplete_lower(_ value: AutoComplete) -> UnsafeMutableRawPointer { - FfiConverterTypeAutoComplete.lower(value) + return FfiConverterTypeAutoComplete.lower(value) } -public protocol BbqrJoinResultProtocol: AnyObject { - func finalResult() throws -> String - func isComplete() -> Bool - func partsLeft() -> UInt32 + +public protocol BbqrJoinResultProtocol : AnyObject { + + func finalResult() throws -> String + + func isComplete() -> Bool + + func partsLeft() -> UInt32 + } open class BbqrJoinResult: - BbqrJoinResultProtocol -{ + BbqrJoinResultProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -1386,7 +1469,7 @@ open class BbqrJoinResult: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -1395,62 +1478,70 @@ open class BbqrJoinResult: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_bbqrjoinresult(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_bbqrjoinresult(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_bbqrjoinresult(pointer, $0) } } - open func finalResult() throws -> String { - try FfiConverterString.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_method_bbqrjoinresult_final_result(self.uniffiClonePointer(), $0) - }) - } + - open func isComplete() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_bbqrjoinresult_is_complete(self.uniffiClonePointer(), $0) - }) - } + +open func finalResult()throws -> String { + return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_method_bbqrjoinresult_final_result(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isComplete() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_bbqrjoinresult_is_complete(self.uniffiClonePointer(),$0 + ) +}) +} + +open func partsLeft() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffi_cove_fn_method_bbqrjoinresult_parts_left(self.uniffiClonePointer(),$0 + ) +}) +} + - open func partsLeft() -> UInt32 { - try! FfiConverterUInt32.lift(try! rustCall { - uniffi_cove_fn_method_bbqrjoinresult_parts_left(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBbqrJoinResult: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = BbqrJoinResult public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> BbqrJoinResult { - BbqrJoinResult(unsafeFromRawPointer: pointer) + return BbqrJoinResult(unsafeFromRawPointer: pointer) } public static func lower(_ value: BbqrJoinResult) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BbqrJoinResult { @@ -1458,7 +1549,7 @@ public struct FfiConverterTypeBbqrJoinResult: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -1471,35 +1562,42 @@ public struct FfiConverterTypeBbqrJoinResult: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBbqrJoinResult_lift(_ pointer: UnsafeMutableRawPointer) throws -> BbqrJoinResult { - try FfiConverterTypeBbqrJoinResult.lift(pointer) + return try FfiConverterTypeBbqrJoinResult.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBbqrJoinResult_lower(_ value: BbqrJoinResult) -> UnsafeMutableRawPointer { - FfiConverterTypeBbqrJoinResult.lower(value) + return FfiConverterTypeBbqrJoinResult.lower(value) } -public protocol BbqrJoinedProtocol: AnyObject { - func getGroupedWords(chunks: UInt8) throws -> [[String]] - func getSeedWords() throws -> [String] + + +public protocol BbqrJoinedProtocol : AnyObject { + + func getGroupedWords(chunks: UInt8) throws -> [[String]] + + func getSeedWords() throws -> [String] + } open class BbqrJoined: - BbqrJoinedProtocol -{ + BbqrJoinedProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -1507,7 +1605,7 @@ open class BbqrJoined: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -1516,57 +1614,64 @@ open class BbqrJoined: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_bbqrjoined(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_bbqrjoined(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_bbqrjoined(pointer, $0) } } - open func getGroupedWords(chunks: UInt8) throws -> [[String]] { - try FfiConverterSequenceSequenceString.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_method_bbqrjoined_get_grouped_words(self.uniffiClonePointer(), - FfiConverterUInt8.lower(chunks), $0) - }) - } + + + +open func getGroupedWords(chunks: UInt8)throws -> [[String]] { + return try FfiConverterSequenceSequenceString.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_method_bbqrjoined_get_grouped_words(self.uniffiClonePointer(), + FfiConverterUInt8.lower(chunks),$0 + ) +}) +} + +open func getSeedWords()throws -> [String] { + return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_method_bbqrjoined_get_seed_words(self.uniffiClonePointer(),$0 + ) +}) +} + - open func getSeedWords() throws -> [String] { - try FfiConverterSequenceString.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_method_bbqrjoined_get_seed_words(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBbqrJoined: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = BbqrJoined public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> BbqrJoined { - BbqrJoined(unsafeFromRawPointer: pointer) + return BbqrJoined(unsafeFromRawPointer: pointer) } public static func lower(_ value: BbqrJoined) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BbqrJoined { @@ -1574,7 +1679,7 @@ public struct FfiConverterTypeBbqrJoined: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -1587,35 +1692,42 @@ public struct FfiConverterTypeBbqrJoined: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBbqrJoined_lift(_ pointer: UnsafeMutableRawPointer) throws -> BbqrJoined { - try FfiConverterTypeBbqrJoined.lift(pointer) + return try FfiConverterTypeBbqrJoined.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBbqrJoined_lower(_ value: BbqrJoined) -> UnsafeMutableRawPointer { - FfiConverterTypeBbqrJoined.lower(value) + return FfiConverterTypeBbqrJoined.lower(value) } -public protocol Bip39AutoCompleteProtocol: AnyObject { - func autocomplete(word: String) -> [String] - func isValidWord(word: String) -> Bool + + +public protocol Bip39AutoCompleteProtocol : AnyObject { + + func autocomplete(word: String) -> [String] + + func isValidWord(word: String) -> Bool + } open class Bip39AutoComplete: - Bip39AutoCompleteProtocol -{ + Bip39AutoCompleteProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -1623,7 +1735,7 @@ open class Bip39AutoComplete: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -1632,65 +1744,72 @@ open class Bip39AutoComplete: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_bip39autocomplete(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_bip39autocomplete_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_bip39autocomplete(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_bip39autocomplete_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_bip39autocomplete(pointer, $0) } } - open func autocomplete(word: String) -> [String] { - try! FfiConverterSequenceString.lift(try! rustCall { - uniffi_cove_fn_method_bip39autocomplete_autocomplete(self.uniffiClonePointer(), - FfiConverterString.lower(word), $0) - }) - } + + + +open func autocomplete(word: String) -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_cove_fn_method_bip39autocomplete_autocomplete(self.uniffiClonePointer(), + FfiConverterString.lower(word),$0 + ) +}) +} + +open func isValidWord(word: String) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_bip39autocomplete_is_valid_word(self.uniffiClonePointer(), + FfiConverterString.lower(word),$0 + ) +}) +} + - open func isValidWord(word: String) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_bip39autocomplete_is_valid_word(self.uniffiClonePointer(), - FfiConverterString.lower(word), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBip39AutoComplete: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Bip39AutoComplete public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Bip39AutoComplete { - Bip39AutoComplete(unsafeFromRawPointer: pointer) + return Bip39AutoComplete(unsafeFromRawPointer: pointer) } public static func lower(_ value: Bip39AutoComplete) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bip39AutoComplete { @@ -1698,7 +1817,7 @@ public struct FfiConverterTypeBip39AutoComplete: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -1711,37 +1830,44 @@ public struct FfiConverterTypeBip39AutoComplete: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBip39AutoComplete_lift(_ pointer: UnsafeMutableRawPointer) throws -> Bip39AutoComplete { - try FfiConverterTypeBip39AutoComplete.lift(pointer) + return try FfiConverterTypeBip39AutoComplete.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBip39AutoComplete_lower(_ value: Bip39AutoComplete) -> UnsafeMutableRawPointer { - FfiConverterTypeBip39AutoComplete.lower(value) + return FfiConverterTypeBip39AutoComplete.lower(value) } -public protocol Bip39WordSpecificAutocompleteProtocol: AnyObject { - func autocomplete(word: String, allWords: [[String]]) -> [String] - func isBip39Word(word: String) -> Bool - func isValidWord(word: String, allWords: [[String]]) -> Bool + +public protocol Bip39WordSpecificAutocompleteProtocol : AnyObject { + + func autocomplete(word: String, allWords: [[String]]) -> [String] + + func isBip39Word(word: String) -> Bool + + func isValidWord(word: String, allWords: [[String]]) -> Bool + } open class Bip39WordSpecificAutocomplete: - Bip39WordSpecificAutocompleteProtocol -{ + Bip39WordSpecificAutocompleteProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -1749,7 +1875,7 @@ open class Bip39WordSpecificAutocomplete: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -1758,76 +1884,84 @@ open class Bip39WordSpecificAutocomplete: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_bip39wordspecificautocomplete(self.pointer, $0) } - } - - public convenience init(wordNumber: UInt16, numberOfWords: NumberOfBip39Words) { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_bip39wordspecificautocomplete_new( - FfiConverterUInt16.lower(wordNumber), - FfiConverterTypeNumberOfBip39Words.lower(numberOfWords), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) - } + return try! rustCall { uniffi_cove_fn_clone_bip39wordspecificautocomplete(self.pointer, $0) } + } +public convenience init(wordNumber: UInt16, numberOfWords: NumberOfBip39Words) { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_bip39wordspecificautocomplete_new( + FfiConverterUInt16.lower(wordNumber), + FfiConverterTypeNumberOfBip39Words.lower(numberOfWords),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_bip39wordspecificautocomplete(pointer, $0) } } - open func autocomplete(word: String, allWords: [[String]]) -> [String] { - try! FfiConverterSequenceString.lift(try! rustCall { - uniffi_cove_fn_method_bip39wordspecificautocomplete_autocomplete(self.uniffiClonePointer(), - FfiConverterString.lower(word), - FfiConverterSequenceSequenceString.lower(allWords), $0) - }) - } + - open func isBip39Word(word: String) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_bip39wordspecificautocomplete_is_bip39_word(self.uniffiClonePointer(), - FfiConverterString.lower(word), $0) - }) - } + +open func autocomplete(word: String, allWords: [[String]]) -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_cove_fn_method_bip39wordspecificautocomplete_autocomplete(self.uniffiClonePointer(), + FfiConverterString.lower(word), + FfiConverterSequenceSequenceString.lower(allWords),$0 + ) +}) +} + +open func isBip39Word(word: String) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_bip39wordspecificautocomplete_is_bip39_word(self.uniffiClonePointer(), + FfiConverterString.lower(word),$0 + ) +}) +} + +open func isValidWord(word: String, allWords: [[String]]) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_bip39wordspecificautocomplete_is_valid_word(self.uniffiClonePointer(), + FfiConverterString.lower(word), + FfiConverterSequenceSequenceString.lower(allWords),$0 + ) +}) +} + - open func isValidWord(word: String, allWords: [[String]]) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_bip39wordspecificautocomplete_is_valid_word(self.uniffiClonePointer(), - FfiConverterString.lower(word), - FfiConverterSequenceSequenceString.lower(allWords), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBip39WordSpecificAutocomplete: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Bip39WordSpecificAutocomplete public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Bip39WordSpecificAutocomplete { - Bip39WordSpecificAutocomplete(unsafeFromRawPointer: pointer) + return Bip39WordSpecificAutocomplete(unsafeFromRawPointer: pointer) } public static func lower(_ value: Bip39WordSpecificAutocomplete) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bip39WordSpecificAutocomplete { @@ -1835,7 +1969,7 @@ public struct FfiConverterTypeBip39WordSpecificAutocomplete: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -1848,37 +1982,44 @@ public struct FfiConverterTypeBip39WordSpecificAutocomplete: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBip39WordSpecificAutocomplete_lift(_ pointer: UnsafeMutableRawPointer) throws -> Bip39WordSpecificAutocomplete { - try FfiConverterTypeBip39WordSpecificAutocomplete.lift(pointer) + return try FfiConverterTypeBip39WordSpecificAutocomplete.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBip39WordSpecificAutocomplete_lower(_ value: Bip39WordSpecificAutocomplete) -> UnsafeMutableRawPointer { - FfiConverterTypeBip39WordSpecificAutocomplete.lower(value) + return FfiConverterTypeBip39WordSpecificAutocomplete.lower(value) } -public protocol BitcoinTransactionProtocol: AnyObject { - func normalizeTxId() -> String - func txId() -> TxId - func txIdHash() -> String + +public protocol BitcoinTransactionProtocol : AnyObject { + + func normalizeTxId() -> String + + func txId() -> TxId + + func txIdHash() -> String + } open class BitcoinTransaction: - BitcoinTransactionProtocol -{ + BitcoinTransactionProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -1886,7 +2027,7 @@ open class BitcoinTransaction: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -1895,78 +2036,86 @@ open class BitcoinTransaction: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_bitcointransaction(self.pointer, $0) } - } - - public convenience init(txHex: String) throws { - let pointer = - try rustCallWithError(FfiConverterTypeBitcoinTransactionError.lift) { - uniffi_cove_fn_constructor_bitcointransaction_new( - FfiConverterString.lower(txHex), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_bitcointransaction(self.pointer, $0) } } +public convenience init(txHex: String)throws { + let pointer = + try rustCallWithError(FfiConverterTypeBitcoinTransactionError.lift) { + uniffi_cove_fn_constructor_bitcointransaction_new( + FfiConverterString.lower(txHex),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_bitcointransaction(pointer, $0) } } - public static func tryFromData(data: Data) throws -> BitcoinTransaction { - try FfiConverterTypeBitcoinTransaction.lift(rustCallWithError(FfiConverterTypeBitcoinTransactionError.lift) { - uniffi_cove_fn_constructor_bitcointransaction_tryfromdata( - FfiConverterData.lower(data), $0 - ) - }) - } - - open func normalizeTxId() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_bitcointransaction_normalize_tx_id(self.uniffiClonePointer(), $0) - }) - } + +public static func tryFromData(data: Data)throws -> BitcoinTransaction { + return try FfiConverterTypeBitcoinTransaction.lift(try rustCallWithError(FfiConverterTypeBitcoinTransactionError.lift) { + uniffi_cove_fn_constructor_bitcointransaction_tryfromdata( + FfiConverterData.lower(data),$0 + ) +}) +} + - open func txId() -> TxId { - try! FfiConverterTypeTxId.lift(try! rustCall { - uniffi_cove_fn_method_bitcointransaction_tx_id(self.uniffiClonePointer(), $0) - }) - } + +open func normalizeTxId() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_bitcointransaction_normalize_tx_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func txId() -> TxId { + return try! FfiConverterTypeTxId.lift(try! rustCall() { + uniffi_cove_fn_method_bitcointransaction_tx_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func txIdHash() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_bitcointransaction_tx_id_hash(self.uniffiClonePointer(),$0 + ) +}) +} + - open func txIdHash() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_bitcointransaction_tx_id_hash(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBitcoinTransaction: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = BitcoinTransaction public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> BitcoinTransaction { - BitcoinTransaction(unsafeFromRawPointer: pointer) + return BitcoinTransaction(unsafeFromRawPointer: pointer) } public static func lower(_ value: BitcoinTransaction) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BitcoinTransaction { @@ -1974,7 +2123,7 @@ public struct FfiConverterTypeBitcoinTransaction: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -1987,33 +2136,40 @@ public struct FfiConverterTypeBitcoinTransaction: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBitcoinTransaction_lift(_ pointer: UnsafeMutableRawPointer) throws -> BitcoinTransaction { - try FfiConverterTypeBitcoinTransaction.lift(pointer) + return try FfiConverterTypeBitcoinTransaction.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBitcoinTransaction_lower(_ value: BitcoinTransaction) -> UnsafeMutableRawPointer { - FfiConverterTypeBitcoinTransaction.lower(value) + return FfiConverterTypeBitcoinTransaction.lower(value) } -public protocol BoxedRouteProtocol: AnyObject { - func route() -> Route + + + +public protocol BoxedRouteProtocol : AnyObject { + + func route() -> Route + } open class BoxedRoute: - BoxedRouteProtocol -{ + BoxedRouteProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -2021,7 +2177,7 @@ open class BoxedRoute: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -2030,58 +2186,64 @@ open class BoxedRoute: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_boxedroute(self.pointer, $0) } - } - - public convenience init(route: Route) { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_boxedroute_new( - FfiConverterTypeRoute.lower(route), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_boxedroute(self.pointer, $0) } } +public convenience init(route: Route) { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_boxedroute_new( + FfiConverterTypeRoute.lower(route),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_boxedroute(pointer, $0) } } - open func route() -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_boxedroute_route(self.uniffiClonePointer(), $0) - }) - } + + + +open func route() -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_boxedroute_route(self.uniffiClonePointer(),$0 + ) +}) +} + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBoxedRoute: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = BoxedRoute public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> BoxedRoute { - BoxedRoute(unsafeFromRawPointer: pointer) + return BoxedRoute(unsafeFromRawPointer: pointer) } public static func lower(_ value: BoxedRoute) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BoxedRoute { @@ -2089,7 +2251,7 @@ public struct FfiConverterTypeBoxedRoute: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -2102,31 +2264,38 @@ public struct FfiConverterTypeBoxedRoute: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBoxedRoute_lift(_ pointer: UnsafeMutableRawPointer) throws -> BoxedRoute { - try FfiConverterTypeBoxedRoute.lift(pointer) + return try FfiConverterTypeBoxedRoute.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBoxedRoute_lower(_ value: BoxedRoute) -> UnsafeMutableRawPointer { - FfiConverterTypeBoxedRoute.lower(value) + return FfiConverterTypeBoxedRoute.lower(value) } -public protocol ChainPositionProtocol: AnyObject {} + + + +public protocol ChainPositionProtocol : AnyObject { + +} open class ChainPosition: - ChainPositionProtocol -{ + ChainPositionProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -2134,7 +2303,7 @@ open class ChainPosition: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -2143,44 +2312,49 @@ open class ChainPosition: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_chainposition(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_chainposition(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_chainposition(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeChainPosition: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = ChainPosition public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> ChainPosition { - ChainPosition(unsafeFromRawPointer: pointer) + return ChainPosition(unsafeFromRawPointer: pointer) } public static func lower(_ value: ChainPosition) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ChainPosition { @@ -2188,7 +2362,7 @@ public struct FfiConverterTypeChainPosition: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -2201,55 +2375,62 @@ public struct FfiConverterTypeChainPosition: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeChainPosition_lift(_ pointer: UnsafeMutableRawPointer) throws -> ChainPosition { - try FfiConverterTypeChainPosition.lift(pointer) + return try FfiConverterTypeChainPosition.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeChainPosition_lower(_ value: ChainPosition) -> UnsafeMutableRawPointer { - FfiConverterTypeChainPosition.lower(value) -} - -public protocol ConfirmDetailsProtocol: AnyObject { - func feeRate() -> FeeRate - - func feeTotal() -> Amount - - func id() -> TxId - - func idHash() -> String - - func isEqual(rhs: ConfirmDetails) -> Bool - - func normalizedId() -> String - - func psbtBytes() -> Data - - func psbtToBbqr() throws -> [String] - - func psbtToHex() -> String - - func sendingAmount() -> Amount - - func sendingTo() -> Address - - func spendingAmount() -> Amount + return FfiConverterTypeChainPosition.lower(value) +} + + + + +public protocol ConfirmDetailsProtocol : AnyObject { + + func feeRate() -> FeeRate + + func feeTotal() -> Amount + + func id() -> TxId + + func idHash() -> String + + func isEqual(rhs: ConfirmDetails) -> Bool + + func normalizedId() -> String + + func psbtBytes() -> Data + + func psbtToBbqr() throws -> [String] + + func psbtToHex() -> String + + func sendingAmount() -> Amount + + func sendingTo() -> Address + + func spendingAmount() -> Amount + } open class ConfirmDetails: - ConfirmDetailsProtocol -{ + ConfirmDetailsProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -2257,7 +2438,7 @@ open class ConfirmDetails: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -2266,124 +2447,141 @@ open class ConfirmDetails: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_confirmdetails(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_confirmdetails(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_confirmdetails(pointer, $0) } } - public static func previewNew() -> ConfirmDetails { - try! FfiConverterTypeConfirmDetails.lift(try! rustCall { - uniffi_cove_fn_constructor_confirmdetails_preview_new($0 - ) - }) - } - - open func feeRate() -> FeeRate { - try! FfiConverterTypeFeeRate.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_fee_rate(self.uniffiClonePointer(), $0) - }) - } - - open func feeTotal() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_fee_total(self.uniffiClonePointer(), $0) - }) - } - - open func id() -> TxId { - try! FfiConverterTypeTxId.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_id(self.uniffiClonePointer(), $0) - }) - } - - open func idHash() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_id_hash(self.uniffiClonePointer(), $0) - }) - } - - open func isEqual(rhs: ConfirmDetails) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_is_equal(self.uniffiClonePointer(), - FfiConverterTypeConfirmDetails.lower(rhs), $0) - }) - } - - open func normalizedId() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_normalized_id(self.uniffiClonePointer(), $0) - }) - } - - open func psbtBytes() -> Data { - try! FfiConverterData.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_psbt_bytes(self.uniffiClonePointer(), $0) - }) - } - - open func psbtToBbqr() throws -> [String] { - try FfiConverterSequenceString.lift(rustCallWithError(FfiConverterTypeConfirmDetailsError.lift) { - uniffi_cove_fn_method_confirmdetails_psbt_to_bbqr(self.uniffiClonePointer(), $0) - }) - } - - open func psbtToHex() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_psbt_to_hex(self.uniffiClonePointer(), $0) - }) - } - - open func sendingAmount() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_sending_amount(self.uniffiClonePointer(), $0) - }) - } + +public static func previewNew() -> ConfirmDetails { + return try! FfiConverterTypeConfirmDetails.lift(try! rustCall() { + uniffi_cove_fn_constructor_confirmdetails_preview_new($0 + ) +}) +} + - open func sendingTo() -> Address { - try! FfiConverterTypeAddress.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_sending_to(self.uniffiClonePointer(), $0) - }) - } + +open func feeRate() -> FeeRate { + return try! FfiConverterTypeFeeRate.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_fee_rate(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeTotal() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_fee_total(self.uniffiClonePointer(),$0 + ) +}) +} + +open func id() -> TxId { + return try! FfiConverterTypeTxId.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func idHash() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_id_hash(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isEqual(rhs: ConfirmDetails) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_is_equal(self.uniffiClonePointer(), + FfiConverterTypeConfirmDetails.lower(rhs),$0 + ) +}) +} + +open func normalizedId() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_normalized_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func psbtBytes() -> Data { + return try! FfiConverterData.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_psbt_bytes(self.uniffiClonePointer(),$0 + ) +}) +} + +open func psbtToBbqr()throws -> [String] { + return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeConfirmDetailsError.lift) { + uniffi_cove_fn_method_confirmdetails_psbt_to_bbqr(self.uniffiClonePointer(),$0 + ) +}) +} + +open func psbtToHex() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_psbt_to_hex(self.uniffiClonePointer(),$0 + ) +}) +} + +open func sendingAmount() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_sending_amount(self.uniffiClonePointer(),$0 + ) +}) +} + +open func sendingTo() -> Address { + return try! FfiConverterTypeAddress.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_sending_to(self.uniffiClonePointer(),$0 + ) +}) +} + +open func spendingAmount() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_confirmdetails_spending_amount(self.uniffiClonePointer(),$0 + ) +}) +} + - open func spendingAmount() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_confirmdetails_spending_amount(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeConfirmDetails: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = ConfirmDetails public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> ConfirmDetails { - ConfirmDetails(unsafeFromRawPointer: pointer) + return ConfirmDetails(unsafeFromRawPointer: pointer) } public static func lower(_ value: ConfirmDetails) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ConfirmDetails { @@ -2391,7 +2589,7 @@ public struct FfiConverterTypeConfirmDetails: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -2404,49 +2602,56 @@ public struct FfiConverterTypeConfirmDetails: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeConfirmDetails_lift(_ pointer: UnsafeMutableRawPointer) throws -> ConfirmDetails { - try FfiConverterTypeConfirmDetails.lift(pointer) + return try FfiConverterTypeConfirmDetails.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeConfirmDetails_lower(_ value: ConfirmDetails) -> UnsafeMutableRawPointer { - FfiConverterTypeConfirmDetails.lower(value) + return FfiConverterTypeConfirmDetails.lower(value) } -public protocol ConfirmedTransactionProtocol: AnyObject { - func blockHeight() -> UInt32 - func blockHeightFmt() -> String - func confirmedAt() -> UInt64 - func confirmedAtFmt() -> String +public protocol ConfirmedTransactionProtocol : AnyObject { + + func blockHeight() -> UInt32 + + func blockHeightFmt() -> String + + func confirmedAt() -> UInt64 + + func confirmedAtFmt() -> String + + func confirmedAtFmtWithTime() -> String + + func fiatAmount() -> FiatAmount? + + func id() -> TxId + + func label() -> String + + func sentAndReceived() -> SentAndReceived + +} - func confirmedAtFmtWithTime() -> String - - func fiatAmount() -> FiatAmount? - - func id() -> TxId - - func label() -> String - - func sentAndReceived() -> SentAndReceived -} - -open class ConfirmedTransaction: - ConfirmedTransactionProtocol -{ - fileprivate let pointer: UnsafeMutableRawPointer! +open class ConfirmedTransaction: + ConfirmedTransactionProtocol { + fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -2454,7 +2659,7 @@ open class ConfirmedTransaction: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -2463,98 +2668,112 @@ open class ConfirmedTransaction: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_confirmedtransaction(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_confirmedtransaction(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_confirmedtransaction(pointer, $0) } } - open func blockHeight() -> UInt32 { - try! FfiConverterUInt32.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_block_height(self.uniffiClonePointer(), $0) - }) - } - - open func blockHeightFmt() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_block_height_fmt(self.uniffiClonePointer(), $0) - }) - } - - open func confirmedAt() -> UInt64 { - try! FfiConverterUInt64.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_confirmed_at(self.uniffiClonePointer(), $0) - }) - } - - open func confirmedAtFmt() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_confirmed_at_fmt(self.uniffiClonePointer(), $0) - }) - } - - open func confirmedAtFmtWithTime() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_confirmed_at_fmt_with_time(self.uniffiClonePointer(), $0) - }) - } - - open func fiatAmount() -> FiatAmount? { - try! FfiConverterOptionTypeFiatAmount.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_fiat_amount(self.uniffiClonePointer(), $0) - }) - } - - open func id() -> TxId { - try! FfiConverterTypeTxId.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_id(self.uniffiClonePointer(), $0) - }) - } + - open func label() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_label(self.uniffiClonePointer(), $0) - }) - } + +open func blockHeight() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_block_height(self.uniffiClonePointer(),$0 + ) +}) +} + +open func blockHeightFmt() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_block_height_fmt(self.uniffiClonePointer(),$0 + ) +}) +} + +open func confirmedAt() -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_confirmed_at(self.uniffiClonePointer(),$0 + ) +}) +} + +open func confirmedAtFmt() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_confirmed_at_fmt(self.uniffiClonePointer(),$0 + ) +}) +} + +open func confirmedAtFmtWithTime() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_confirmed_at_fmt_with_time(self.uniffiClonePointer(),$0 + ) +}) +} + +open func fiatAmount() -> FiatAmount? { + return try! FfiConverterOptionTypeFiatAmount.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_fiat_amount(self.uniffiClonePointer(),$0 + ) +}) +} + +open func id() -> TxId { + return try! FfiConverterTypeTxId.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func label() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_label(self.uniffiClonePointer(),$0 + ) +}) +} + +open func sentAndReceived() -> SentAndReceived { + return try! FfiConverterTypeSentAndReceived.lift(try! rustCall() { + uniffi_cove_fn_method_confirmedtransaction_sent_and_received(self.uniffiClonePointer(),$0 + ) +}) +} + - open func sentAndReceived() -> SentAndReceived { - try! FfiConverterTypeSentAndReceived.lift(try! rustCall { - uniffi_cove_fn_method_confirmedtransaction_sent_and_received(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeConfirmedTransaction: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = ConfirmedTransaction public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> ConfirmedTransaction { - ConfirmedTransaction(unsafeFromRawPointer: pointer) + return ConfirmedTransaction(unsafeFromRawPointer: pointer) } public static func lower(_ value: ConfirmedTransaction) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ConfirmedTransaction { @@ -2562,7 +2781,7 @@ public struct FfiConverterTypeConfirmedTransaction: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -2575,37 +2794,44 @@ public struct FfiConverterTypeConfirmedTransaction: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeConfirmedTransaction_lift(_ pointer: UnsafeMutableRawPointer) throws -> ConfirmedTransaction { - try FfiConverterTypeConfirmedTransaction.lift(pointer) + return try FfiConverterTypeConfirmedTransaction.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeConfirmedTransaction_lower(_ value: ConfirmedTransaction) -> UnsafeMutableRawPointer { - FfiConverterTypeConfirmedTransaction.lower(value) + return FfiConverterTypeConfirmedTransaction.lower(value) } -public protocol DatabaseProtocol: AnyObject { - func globalConfig() -> GlobalConfigTable - func unsignedTransactions() -> UnsignedTransactionsTable - func wallets() -> WalletsTable + +public protocol DatabaseProtocol : AnyObject { + + func globalConfig() -> GlobalConfigTable + + func unsignedTransactions() -> UnsignedTransactionsTable + + func wallets() -> WalletsTable + } open class Database: - DatabaseProtocol -{ + DatabaseProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -2613,7 +2839,7 @@ open class Database: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -2622,69 +2848,77 @@ open class Database: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_database(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_database_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_database(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_database_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_database(pointer, $0) } } - open func globalConfig() -> GlobalConfigTable { - try! FfiConverterTypeGlobalConfigTable.lift(try! rustCall { - uniffi_cove_fn_method_database_global_config(self.uniffiClonePointer(), $0) - }) - } + - open func unsignedTransactions() -> UnsignedTransactionsTable { - try! FfiConverterTypeUnsignedTransactionsTable.lift(try! rustCall { - uniffi_cove_fn_method_database_unsigned_transactions(self.uniffiClonePointer(), $0) - }) - } + +open func globalConfig() -> GlobalConfigTable { + return try! FfiConverterTypeGlobalConfigTable.lift(try! rustCall() { + uniffi_cove_fn_method_database_global_config(self.uniffiClonePointer(),$0 + ) +}) +} + +open func unsignedTransactions() -> UnsignedTransactionsTable { + return try! FfiConverterTypeUnsignedTransactionsTable.lift(try! rustCall() { + uniffi_cove_fn_method_database_unsigned_transactions(self.uniffiClonePointer(),$0 + ) +}) +} + +open func wallets() -> WalletsTable { + return try! FfiConverterTypeWalletsTable.lift(try! rustCall() { + uniffi_cove_fn_method_database_wallets(self.uniffiClonePointer(),$0 + ) +}) +} + - open func wallets() -> WalletsTable { - try! FfiConverterTypeWalletsTable.lift(try! rustCall { - uniffi_cove_fn_method_database_wallets(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeDatabase: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Database public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Database { - Database(unsafeFromRawPointer: pointer) + return Database(unsafeFromRawPointer: pointer) } public static func lower(_ value: Database) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Database { @@ -2692,7 +2926,7 @@ public struct FfiConverterTypeDatabase: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -2705,33 +2939,40 @@ public struct FfiConverterTypeDatabase: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeDatabase_lift(_ pointer: UnsafeMutableRawPointer) throws -> Database { - try FfiConverterTypeDatabase.lift(pointer) + return try FfiConverterTypeDatabase.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeDatabase_lower(_ value: Database) -> UnsafeMutableRawPointer { - FfiConverterTypeDatabase.lower(value) + return FfiConverterTypeDatabase.lower(value) } -public protocol FeeRateProtocol: AnyObject { - func satPerVb() -> Double + + + +public protocol FeeRateProtocol : AnyObject { + + func satPerVb() -> Double + } open class FeeRate: - FeeRateProtocol -{ + FeeRateProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -2739,7 +2980,7 @@ open class FeeRate: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -2748,58 +2989,64 @@ open class FeeRate: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_feerate(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_feerate(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_feerate(pointer, $0) } } - public static func fromSatPerVb(satPerVb: UInt64) -> FeeRate { - try! FfiConverterTypeFeeRate.lift(try! rustCall { - uniffi_cove_fn_constructor_feerate_from_sat_per_vb( - FfiConverterUInt64.lower(satPerVb), $0 - ) - }) - } + +public static func fromSatPerVb(satPerVb: UInt64) -> FeeRate { + return try! FfiConverterTypeFeeRate.lift(try! rustCall() { + uniffi_cove_fn_constructor_feerate_from_sat_per_vb( + FfiConverterUInt64.lower(satPerVb),$0 + ) +}) +} + + + +open func satPerVb() -> Double { + return try! FfiConverterDouble.lift(try! rustCall() { + uniffi_cove_fn_method_feerate_sat_per_vb(self.uniffiClonePointer(),$0 + ) +}) +} + - open func satPerVb() -> Double { - try! FfiConverterDouble.lift(try! rustCall { - uniffi_cove_fn_method_feerate_sat_per_vb(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFeeRate: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FeeRate public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRate { - FeeRate(unsafeFromRawPointer: pointer) + return FeeRate(unsafeFromRawPointer: pointer) } public static func lower(_ value: FeeRate) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeRate { @@ -2807,7 +3054,7 @@ public struct FfiConverterTypeFeeRate: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -2820,41 +3067,48 @@ public struct FfiConverterTypeFeeRate: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRate_lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRate { - try FfiConverterTypeFeeRate.lift(pointer) + return try FfiConverterTypeFeeRate.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRate_lower(_ value: FeeRate) -> UnsafeMutableRawPointer { - FfiConverterTypeFeeRate.lower(value) + return FfiConverterTypeFeeRate.lower(value) } -public protocol FeeRateOptionProtocol: AnyObject { - func duration() -> String - - func feeRate() -> FeeRate - func feeSpeed() -> FeeSpeed - func isEqual(rhs: FeeRateOption) -> Bool - func satPerVb() -> Double +public protocol FeeRateOptionProtocol : AnyObject { + + func duration() -> String + + func feeRate() -> FeeRate + + func feeSpeed() -> FeeSpeed + + func isEqual(rhs: FeeRateOption) -> Bool + + func satPerVb() -> Double + } open class FeeRateOption: - FeeRateOptionProtocol -{ + FeeRateOptionProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -2862,7 +3116,7 @@ open class FeeRateOption: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -2871,84 +3125,94 @@ open class FeeRateOption: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_feerateoption(self.pointer, $0) } - } - - public convenience init(feeSpeed: FeeSpeed, feeRate: UInt64) { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_feerateoption_new( - FfiConverterTypeFeeSpeed.lower(feeSpeed), - FfiConverterUInt64.lower(feeRate), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) - } + return try! rustCall { uniffi_cove_fn_clone_feerateoption(self.pointer, $0) } + } +public convenience init(feeSpeed: FeeSpeed, feeRate: UInt64) { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_feerateoption_new( + FfiConverterTypeFeeSpeed.lower(feeSpeed), + FfiConverterUInt64.lower(feeRate),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_feerateoption(pointer, $0) } } - open func duration() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_feerateoption_duration(self.uniffiClonePointer(), $0) - }) - } - - open func feeRate() -> FeeRate { - try! FfiConverterTypeFeeRate.lift(try! rustCall { - uniffi_cove_fn_method_feerateoption_fee_rate(self.uniffiClonePointer(), $0) - }) - } - - open func feeSpeed() -> FeeSpeed { - try! FfiConverterTypeFeeSpeed.lift(try! rustCall { - uniffi_cove_fn_method_feerateoption_fee_speed(self.uniffiClonePointer(), $0) - }) - } + - open func isEqual(rhs: FeeRateOption) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_feerateoption_is_equal(self.uniffiClonePointer(), - FfiConverterTypeFeeRateOption.lower(rhs), $0) - }) - } + +open func duration() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoption_duration(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeRate() -> FeeRate { + return try! FfiConverterTypeFeeRate.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoption_fee_rate(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeSpeed() -> FeeSpeed { + return try! FfiConverterTypeFeeSpeed.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoption_fee_speed(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isEqual(rhs: FeeRateOption) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoption_is_equal(self.uniffiClonePointer(), + FfiConverterTypeFeeRateOption.lower(rhs),$0 + ) +}) +} + +open func satPerVb() -> Double { + return try! FfiConverterDouble.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoption_sat_per_vb(self.uniffiClonePointer(),$0 + ) +}) +} + - open func satPerVb() -> Double { - try! FfiConverterDouble.lift(try! rustCall { - uniffi_cove_fn_method_feerateoption_sat_per_vb(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFeeRateOption: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FeeRateOption public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOption { - FeeRateOption(unsafeFromRawPointer: pointer) + return FeeRateOption(unsafeFromRawPointer: pointer) } public static func lower(_ value: FeeRateOption) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeRateOption { @@ -2956,7 +3220,7 @@ public struct FfiConverterTypeFeeRateOption: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -2969,45 +3233,52 @@ public struct FfiConverterTypeFeeRateOption: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOption_lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOption { - try FfiConverterTypeFeeRateOption.lift(pointer) + return try FfiConverterTypeFeeRateOption.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOption_lower(_ value: FeeRateOption) -> UnsafeMutableRawPointer { - FfiConverterTypeFeeRateOption.lower(value) + return FfiConverterTypeFeeRateOption.lower(value) } -public protocol FeeRateOptionWithTotalFeeProtocol: AnyObject { - func duration() -> String - - func feeRate() -> FeeRate - - func feeRateOptions() -> FeeRateOption - - func feeSpeed() -> FeeSpeed - func isEqual(rhs: FeeRateOptionWithTotalFee) -> Bool - func satPerVb() -> Double - func totalFee() -> Amount +public protocol FeeRateOptionWithTotalFeeProtocol : AnyObject { + + func duration() -> String + + func feeRate() -> FeeRate + + func feeRateOptions() -> FeeRateOption + + func feeSpeed() -> FeeSpeed + + func isEqual(rhs: FeeRateOptionWithTotalFee) -> Bool + + func satPerVb() -> Double + + func totalFee() -> Amount + } open class FeeRateOptionWithTotalFee: - FeeRateOptionWithTotalFeeProtocol -{ + FeeRateOptionWithTotalFeeProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -3015,7 +3286,7 @@ open class FeeRateOptionWithTotalFee: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -3024,87 +3295,99 @@ open class FeeRateOptionWithTotalFee: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_feerateoptionwithtotalfee(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_feerateoptionwithtotalfee(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_feerateoptionwithtotalfee(pointer, $0) } } - open func duration() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionwithtotalfee_duration(self.uniffiClonePointer(), $0) - }) - } - - open func feeRate() -> FeeRate { - try! FfiConverterTypeFeeRate.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionwithtotalfee_fee_rate(self.uniffiClonePointer(), $0) - }) - } - - open func feeRateOptions() -> FeeRateOption { - try! FfiConverterTypeFeeRateOption.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionwithtotalfee_fee_rate_options(self.uniffiClonePointer(), $0) - }) - } - - open func feeSpeed() -> FeeSpeed { - try! FfiConverterTypeFeeSpeed.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionwithtotalfee_fee_speed(self.uniffiClonePointer(), $0) - }) - } - - open func isEqual(rhs: FeeRateOptionWithTotalFee) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionwithtotalfee_is_equal(self.uniffiClonePointer(), - FfiConverterTypeFeeRateOptionWithTotalFee.lower(rhs), $0) - }) - } + - open func satPerVb() -> Double { - try! FfiConverterDouble.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionwithtotalfee_sat_per_vb(self.uniffiClonePointer(), $0) - }) - } + +open func duration() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionwithtotalfee_duration(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeRate() -> FeeRate { + return try! FfiConverterTypeFeeRate.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionwithtotalfee_fee_rate(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeRateOptions() -> FeeRateOption { + return try! FfiConverterTypeFeeRateOption.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionwithtotalfee_fee_rate_options(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeSpeed() -> FeeSpeed { + return try! FfiConverterTypeFeeSpeed.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionwithtotalfee_fee_speed(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isEqual(rhs: FeeRateOptionWithTotalFee) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionwithtotalfee_is_equal(self.uniffiClonePointer(), + FfiConverterTypeFeeRateOptionWithTotalFee.lower(rhs),$0 + ) +}) +} + +open func satPerVb() -> Double { + return try! FfiConverterDouble.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionwithtotalfee_sat_per_vb(self.uniffiClonePointer(),$0 + ) +}) +} + +open func totalFee() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionwithtotalfee_total_fee(self.uniffiClonePointer(),$0 + ) +}) +} + - open func totalFee() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionwithtotalfee_total_fee(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFeeRateOptionWithTotalFee: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FeeRateOptionWithTotalFee public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOptionWithTotalFee { - FeeRateOptionWithTotalFee(unsafeFromRawPointer: pointer) + return FeeRateOptionWithTotalFee(unsafeFromRawPointer: pointer) } public static func lower(_ value: FeeRateOptionWithTotalFee) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeRateOptionWithTotalFee { @@ -3112,7 +3395,7 @@ public struct FfiConverterTypeFeeRateOptionWithTotalFee: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -3125,37 +3408,44 @@ public struct FfiConverterTypeFeeRateOptionWithTotalFee: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOptionWithTotalFee_lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOptionWithTotalFee { - try FfiConverterTypeFeeRateOptionWithTotalFee.lift(pointer) + return try FfiConverterTypeFeeRateOptionWithTotalFee.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOptionWithTotalFee_lower(_ value: FeeRateOptionWithTotalFee) -> UnsafeMutableRawPointer { - FfiConverterTypeFeeRateOptionWithTotalFee.lower(value) + return FfiConverterTypeFeeRateOptionWithTotalFee.lower(value) } -public protocol FeeRateOptionsProtocol: AnyObject { - func fast() -> FeeRateOption - func medium() -> FeeRateOption - func slow() -> FeeRateOption + +public protocol FeeRateOptionsProtocol : AnyObject { + + func fast() -> FeeRateOption + + func medium() -> FeeRateOption + + func slow() -> FeeRateOption + } open class FeeRateOptions: - FeeRateOptionsProtocol -{ + FeeRateOptionsProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -3163,7 +3453,7 @@ open class FeeRateOptions: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -3172,69 +3462,77 @@ open class FeeRateOptions: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_feerateoptions(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_feerateoptions(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_feerateoptions(pointer, $0) } } - public static func previewNew() -> FeeRateOptions { - try! FfiConverterTypeFeeRateOptions.lift(try! rustCall { - uniffi_cove_fn_constructor_feerateoptions_preview_new($0 - ) - }) - } - - open func fast() -> FeeRateOption { - try! FfiConverterTypeFeeRateOption.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptions_fast(self.uniffiClonePointer(), $0) - }) - } + +public static func previewNew() -> FeeRateOptions { + return try! FfiConverterTypeFeeRateOptions.lift(try! rustCall() { + uniffi_cove_fn_constructor_feerateoptions_preview_new($0 + ) +}) +} + - open func medium() -> FeeRateOption { - try! FfiConverterTypeFeeRateOption.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptions_medium(self.uniffiClonePointer(), $0) - }) - } + +open func fast() -> FeeRateOption { + return try! FfiConverterTypeFeeRateOption.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptions_fast(self.uniffiClonePointer(),$0 + ) +}) +} + +open func medium() -> FeeRateOption { + return try! FfiConverterTypeFeeRateOption.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptions_medium(self.uniffiClonePointer(),$0 + ) +}) +} + +open func slow() -> FeeRateOption { + return try! FfiConverterTypeFeeRateOption.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptions_slow(self.uniffiClonePointer(),$0 + ) +}) +} + - open func slow() -> FeeRateOption { - try! FfiConverterTypeFeeRateOption.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptions_slow(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFeeRateOptions: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FeeRateOptions public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOptions { - FeeRateOptions(unsafeFromRawPointer: pointer) + return FeeRateOptions(unsafeFromRawPointer: pointer) } public static func lower(_ value: FeeRateOptions) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeRateOptions { @@ -3242,7 +3540,7 @@ public struct FfiConverterTypeFeeRateOptions: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -3255,39 +3553,46 @@ public struct FfiConverterTypeFeeRateOptions: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOptions_lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOptions { - try FfiConverterTypeFeeRateOptions.lift(pointer) + return try FfiConverterTypeFeeRateOptions.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOptions_lower(_ value: FeeRateOptions) -> UnsafeMutableRawPointer { - FfiConverterTypeFeeRateOptions.lower(value) + return FfiConverterTypeFeeRateOptions.lower(value) } -public protocol FeeRateOptionsWithTotalFeeProtocol: AnyObject { - func fast() -> FeeRateOptionWithTotalFee - func feeRateOptions() -> FeeRateOptions - func medium() -> FeeRateOptionWithTotalFee - func slow() -> FeeRateOptionWithTotalFee +public protocol FeeRateOptionsWithTotalFeeProtocol : AnyObject { + + func fast() -> FeeRateOptionWithTotalFee + + func feeRateOptions() -> FeeRateOptions + + func medium() -> FeeRateOptionWithTotalFee + + func slow() -> FeeRateOptionWithTotalFee + } open class FeeRateOptionsWithTotalFee: - FeeRateOptionsWithTotalFeeProtocol -{ + FeeRateOptionsWithTotalFeeProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -3295,7 +3600,7 @@ open class FeeRateOptionsWithTotalFee: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -3304,75 +3609,84 @@ open class FeeRateOptionsWithTotalFee: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_feerateoptionswithtotalfee(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_feerateoptionswithtotalfee(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_feerateoptionswithtotalfee(pointer, $0) } } - public static func previewNew() -> FeeRateOptionsWithTotalFee { - try! FfiConverterTypeFeeRateOptionsWithTotalFee.lift(try! rustCall { - uniffi_cove_fn_constructor_feerateoptionswithtotalfee_preview_new($0 - ) - }) - } - - open func fast() -> FeeRateOptionWithTotalFee { - try! FfiConverterTypeFeeRateOptionWithTotalFee.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionswithtotalfee_fast(self.uniffiClonePointer(), $0) - }) - } - - open func feeRateOptions() -> FeeRateOptions { - try! FfiConverterTypeFeeRateOptions.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionswithtotalfee_fee_rate_options(self.uniffiClonePointer(), $0) - }) - } + +public static func previewNew() -> FeeRateOptionsWithTotalFee { + return try! FfiConverterTypeFeeRateOptionsWithTotalFee.lift(try! rustCall() { + uniffi_cove_fn_constructor_feerateoptionswithtotalfee_preview_new($0 + ) +}) +} + - open func medium() -> FeeRateOptionWithTotalFee { - try! FfiConverterTypeFeeRateOptionWithTotalFee.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionswithtotalfee_medium(self.uniffiClonePointer(), $0) - }) - } + +open func fast() -> FeeRateOptionWithTotalFee { + return try! FfiConverterTypeFeeRateOptionWithTotalFee.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionswithtotalfee_fast(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeRateOptions() -> FeeRateOptions { + return try! FfiConverterTypeFeeRateOptions.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionswithtotalfee_fee_rate_options(self.uniffiClonePointer(),$0 + ) +}) +} + +open func medium() -> FeeRateOptionWithTotalFee { + return try! FfiConverterTypeFeeRateOptionWithTotalFee.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionswithtotalfee_medium(self.uniffiClonePointer(),$0 + ) +}) +} + +open func slow() -> FeeRateOptionWithTotalFee { + return try! FfiConverterTypeFeeRateOptionWithTotalFee.lift(try! rustCall() { + uniffi_cove_fn_method_feerateoptionswithtotalfee_slow(self.uniffiClonePointer(),$0 + ) +}) +} + - open func slow() -> FeeRateOptionWithTotalFee { - try! FfiConverterTypeFeeRateOptionWithTotalFee.lift(try! rustCall { - uniffi_cove_fn_method_feerateoptionswithtotalfee_slow(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFeeRateOptionsWithTotalFee: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FeeRateOptionsWithTotalFee public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOptionsWithTotalFee { - FeeRateOptionsWithTotalFee(unsafeFromRawPointer: pointer) + return FeeRateOptionsWithTotalFee(unsafeFromRawPointer: pointer) } public static func lower(_ value: FeeRateOptionsWithTotalFee) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeRateOptionsWithTotalFee { @@ -3380,7 +3694,7 @@ public struct FfiConverterTypeFeeRateOptionsWithTotalFee: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -3393,93 +3707,100 @@ public struct FfiConverterTypeFeeRateOptionsWithTotalFee: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOptionsWithTotalFee_lift(_ pointer: UnsafeMutableRawPointer) throws -> FeeRateOptionsWithTotalFee { - try FfiConverterTypeFeeRateOptionsWithTotalFee.lift(pointer) + return try FfiConverterTypeFeeRateOptionsWithTotalFee.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeRateOptionsWithTotalFee_lower(_ value: FeeRateOptionsWithTotalFee) -> UnsafeMutableRawPointer { - FfiConverterTypeFeeRateOptionsWithTotalFee.lower(value) + return FfiConverterTypeFeeRateOptionsWithTotalFee.lower(value) } + + + /** * Representation of our app over FFI. Essentially a wrapper of [`App`]. */ -public protocol FfiAppProtocol: AnyObject { +public protocol FfiAppProtocol : AnyObject { + /** * Frontend calls this method to send events to the rust application logic */ - func dispatch(action: AppAction) - - func fees() async throws -> FeeResponse - + func dispatch(action: AppAction) + + func fees() async throws -> FeeResponse + /** * Get the selected wallet */ - func goToSelectedWallet() -> WalletId? - + func goToSelectedWallet() -> WalletId? + /** * Check if there's any wallets */ - func hasWallets() -> Bool - + func hasWallets() -> Bool + /** * run all initialization tasks here, only called once */ - func initOnStart() async - - func listenForUpdates(updater: FfiReconcile) - + func initOnStart() async + + func listenForUpdates(updater: FfiReconcile) + /** * Load and reset the default route after 800ms delay */ - func loadAndResetDefaultRoute(route: Route) - + func loadAndResetDefaultRoute(route: Route) + /** * Load and reset the default route * Shows a laoding screen, and then resets the default route */ - func loadAndResetDefaultRouteAfter(route: Route, afterMillis: UInt32) - - func network() -> Network - + func loadAndResetDefaultRouteAfter(route: Route, afterMillis: UInt32) + + func network() -> Network + /** * Number of wallets */ - func numWallets() -> UInt16 - - func prices() async throws -> PriceResponse - + func numWallets() -> UInt16 + + func prices() async throws -> PriceResponse + /** * Change the default route, and reset the routes */ - func resetDefaultRouteTo(route: Route) - + func resetDefaultRouteTo(route: Route) + /** * Select a wallet */ - func selectWallet(id: WalletId) throws - - func state() -> AppState + func selectWallet(id: WalletId) throws + + func state() -> AppState + } /** * Representation of our app over FFI. Essentially a wrapper of [`App`]. */ open class FfiApp: - FfiAppProtocol -{ + FfiAppProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -3487,7 +3808,7 @@ open class FfiApp: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -3496,54 +3817,59 @@ open class FfiApp: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_ffiapp(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_ffiapp(self.pointer, $0) } } - /** * FFI constructor which wraps in an Arc */ - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_ffiapp_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) - } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_ffiapp_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_ffiapp(pointer, $0) } } + + + /** * Frontend calls this method to send events to the rust application logic */ - open func dispatch(action: AppAction) { try! rustCall { - uniffi_cove_fn_method_ffiapp_dispatch(self.uniffiClonePointer(), - FfiConverterTypeAppAction.lower(action), $0) - } - } - - open func fees() async throws -> FeeResponse { - try await uniffiRustCallAsync( +open func dispatch(action: AppAction) {try! rustCall() { + uniffi_cove_fn_method_ffiapp_dispatch(self.uniffiClonePointer(), + FfiConverterTypeAppAction.lower(action),$0 + ) +} +} + +open func fees()async throws -> FeeResponse { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_ffiapp_fees( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_rust_buffer, @@ -3552,34 +3878,38 @@ open class FfiApp: liftFunc: FfiConverterTypeFeeResponse.lift, errorHandler: FfiConverterTypeAppError.lift ) - } - +} + /** * Get the selected wallet */ - open func goToSelectedWallet() -> WalletId? { - try! FfiConverterOptionTypeWalletId.lift(try! rustCall { - uniffi_cove_fn_method_ffiapp_go_to_selected_wallet(self.uniffiClonePointer(), $0) - }) - } - +open func goToSelectedWallet() -> WalletId? { + return try! FfiConverterOptionTypeWalletId.lift(try! rustCall() { + uniffi_cove_fn_method_ffiapp_go_to_selected_wallet(self.uniffiClonePointer(),$0 + ) +}) +} + /** * Check if there's any wallets */ - open func hasWallets() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_ffiapp_has_wallets(self.uniffiClonePointer(), $0) - }) - } - +open func hasWallets() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_ffiapp_has_wallets(self.uniffiClonePointer(),$0 + ) +}) +} + /** * run all initialization tasks here, only called once */ - open func initOnStart() async { - try! await uniffiRustCallAsync( +open func initOnStart()async { + return + try! await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_ffiapp_init_on_start( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_void, @@ -3587,55 +3917,63 @@ open class FfiApp: freeFunc: ffi_cove_rust_future_free_void, liftFunc: { $0 }, errorHandler: nil + ) - } - - open func listenForUpdates(updater: FfiReconcile) { try! rustCall { - uniffi_cove_fn_method_ffiapp_listen_for_updates(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceFfiReconcile.lower(updater), $0) - } - } - +} + +open func listenForUpdates(updater: FfiReconcile) {try! rustCall() { + uniffi_cove_fn_method_ffiapp_listen_for_updates(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceFfiReconcile.lower(updater),$0 + ) +} +} + /** * Load and reset the default route after 800ms delay */ - open func loadAndResetDefaultRoute(route: Route) { try! rustCall { - uniffi_cove_fn_method_ffiapp_load_and_reset_default_route(self.uniffiClonePointer(), - FfiConverterTypeRoute.lower(route), $0) - } - } - +open func loadAndResetDefaultRoute(route: Route) {try! rustCall() { + uniffi_cove_fn_method_ffiapp_load_and_reset_default_route(self.uniffiClonePointer(), + FfiConverterTypeRoute.lower(route),$0 + ) +} +} + /** * Load and reset the default route * Shows a laoding screen, and then resets the default route */ - open func loadAndResetDefaultRouteAfter(route: Route, afterMillis: UInt32) { try! rustCall { - uniffi_cove_fn_method_ffiapp_load_and_reset_default_route_after(self.uniffiClonePointer(), - FfiConverterTypeRoute.lower(route), - FfiConverterUInt32.lower(afterMillis), $0) - } - } - - open func network() -> Network { - try! FfiConverterTypeNetwork.lift(try! rustCall { - uniffi_cove_fn_method_ffiapp_network(self.uniffiClonePointer(), $0) - }) - } - +open func loadAndResetDefaultRouteAfter(route: Route, afterMillis: UInt32) {try! rustCall() { + uniffi_cove_fn_method_ffiapp_load_and_reset_default_route_after(self.uniffiClonePointer(), + FfiConverterTypeRoute.lower(route), + FfiConverterUInt32.lower(afterMillis),$0 + ) +} +} + +open func network() -> Network { + return try! FfiConverterTypeNetwork.lift(try! rustCall() { + uniffi_cove_fn_method_ffiapp_network(self.uniffiClonePointer(),$0 + ) +}) +} + /** * Number of wallets */ - open func numWallets() -> UInt16 { - try! FfiConverterUInt16.lift(try! rustCall { - uniffi_cove_fn_method_ffiapp_num_wallets(self.uniffiClonePointer(), $0) - }) - } - - open func prices() async throws -> PriceResponse { - try await uniffiRustCallAsync( +open func numWallets() -> UInt16 { + return try! FfiConverterUInt16.lift(try! rustCall() { + uniffi_cove_fn_method_ffiapp_num_wallets(self.uniffiClonePointer(),$0 + ) +}) +} + +open func prices()async throws -> PriceResponse { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_ffiapp_prices( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_rust_buffer, @@ -3644,46 +3982,52 @@ open class FfiApp: liftFunc: FfiConverterTypePriceResponse.lift, errorHandler: FfiConverterTypeAppError.lift ) - } - +} + /** * Change the default route, and reset the routes */ - open func resetDefaultRouteTo(route: Route) { try! rustCall { - uniffi_cove_fn_method_ffiapp_reset_default_route_to(self.uniffiClonePointer(), - FfiConverterTypeRoute.lower(route), $0) - } - } - +open func resetDefaultRouteTo(route: Route) {try! rustCall() { + uniffi_cove_fn_method_ffiapp_reset_default_route_to(self.uniffiClonePointer(), + FfiConverterTypeRoute.lower(route),$0 + ) +} +} + /** * Select a wallet */ - open func selectWallet(id: WalletId) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_ffiapp_select_wallet(self.uniffiClonePointer(), - FfiConverterTypeWalletId.lower(id), $0) - } - } +open func selectWallet(id: WalletId)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_ffiapp_select_wallet(self.uniffiClonePointer(), + FfiConverterTypeWalletId.lower(id),$0 + ) +} +} + +open func state() -> AppState { + return try! FfiConverterTypeAppState.lift(try! rustCall() { + uniffi_cove_fn_method_ffiapp_state(self.uniffiClonePointer(),$0 + ) +}) +} + - open func state() -> AppState { - try! FfiConverterTypeAppState.lift(try! rustCall { - uniffi_cove_fn_method_ffiapp_state(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFfiApp: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FfiApp public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FfiApp { - FfiApp(unsafeFromRawPointer: pointer) + return FfiApp(unsafeFromRawPointer: pointer) } public static func lower(_ value: FfiApp) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiApp { @@ -3691,7 +4035,7 @@ public struct FfiConverterTypeFfiApp: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -3704,43 +4048,50 @@ public struct FfiConverterTypeFfiApp: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiApp_lift(_ pointer: UnsafeMutableRawPointer) throws -> FfiApp { - try FfiConverterTypeFfiApp.lift(pointer) + return try FfiConverterTypeFfiApp.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiApp_lower(_ value: FfiApp) -> UnsafeMutableRawPointer { - FfiConverterTypeFfiApp.lower(value) + return FfiConverterTypeFfiApp.lower(value) } -public protocol FfiNfcReaderProtocol: AnyObject { - func dataFromRecords(records: [NdefRecord]) -> Data - func isResumeable(data: Data) throws - func isStarted() -> Bool - func messageInfo() -> MessageInfo? - - func parse(data: Data) throws -> ParseResult - - func stringFromRecord(record: NdefRecord) -> String? +public protocol FfiNfcReaderProtocol : AnyObject { + + func dataFromRecords(records: [NdefRecord]) -> Data + + func isResumeable(data: Data) throws + + func isStarted() -> Bool + + func messageInfo() -> MessageInfo? + + func parse(data: Data) throws -> ParseResult + + func stringFromRecord(record: NdefRecord) -> String? + } open class FfiNfcReader: - FfiNfcReaderProtocol -{ + FfiNfcReaderProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -3748,7 +4099,7 @@ open class FfiNfcReader: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -3757,90 +4108,101 @@ open class FfiNfcReader: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_ffinfcreader(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_ffinfcreader_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_ffinfcreader(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_ffinfcreader_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_ffinfcreader(pointer, $0) } } - open func dataFromRecords(records: [NdefRecord]) -> Data { - try! FfiConverterData.lift(try! rustCall { - uniffi_cove_fn_method_ffinfcreader_data_from_records(self.uniffiClonePointer(), - FfiConverterSequenceTypeNdefRecord.lower(records), $0) - }) - } - - open func isResumeable(data: Data) throws { try rustCallWithError(FfiConverterTypeResumeError.lift) { - uniffi_cove_fn_method_ffinfcreader_is_resumeable(self.uniffiClonePointer(), - FfiConverterData.lower(data), $0) - } - } - - open func isStarted() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_ffinfcreader_is_started(self.uniffiClonePointer(), $0) - }) - } - - open func messageInfo() -> MessageInfo? { - try! FfiConverterOptionTypeMessageInfo.lift(try! rustCall { - uniffi_cove_fn_method_ffinfcreader_message_info(self.uniffiClonePointer(), $0) - }) - } + - open func parse(data: Data) throws -> ParseResult { - try FfiConverterTypeParseResult.lift(rustCallWithError(FfiConverterTypeNfcReaderError.lift) { - uniffi_cove_fn_method_ffinfcreader_parse(self.uniffiClonePointer(), - FfiConverterData.lower(data), $0) - }) - } + +open func dataFromRecords(records: [NdefRecord]) -> Data { + return try! FfiConverterData.lift(try! rustCall() { + uniffi_cove_fn_method_ffinfcreader_data_from_records(self.uniffiClonePointer(), + FfiConverterSequenceTypeNdefRecord.lower(records),$0 + ) +}) +} + +open func isResumeable(data: Data)throws {try rustCallWithError(FfiConverterTypeResumeError.lift) { + uniffi_cove_fn_method_ffinfcreader_is_resumeable(self.uniffiClonePointer(), + FfiConverterData.lower(data),$0 + ) +} +} + +open func isStarted() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_ffinfcreader_is_started(self.uniffiClonePointer(),$0 + ) +}) +} + +open func messageInfo() -> MessageInfo? { + return try! FfiConverterOptionTypeMessageInfo.lift(try! rustCall() { + uniffi_cove_fn_method_ffinfcreader_message_info(self.uniffiClonePointer(),$0 + ) +}) +} + +open func parse(data: Data)throws -> ParseResult { + return try FfiConverterTypeParseResult.lift(try rustCallWithError(FfiConverterTypeNfcReaderError.lift) { + uniffi_cove_fn_method_ffinfcreader_parse(self.uniffiClonePointer(), + FfiConverterData.lower(data),$0 + ) +}) +} + +open func stringFromRecord(record: NdefRecord) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffi_cove_fn_method_ffinfcreader_string_from_record(self.uniffiClonePointer(), + FfiConverterTypeNdefRecord.lower(record),$0 + ) +}) +} + - open func stringFromRecord(record: NdefRecord) -> String? { - try! FfiConverterOptionString.lift(try! rustCall { - uniffi_cove_fn_method_ffinfcreader_string_from_record(self.uniffiClonePointer(), - FfiConverterTypeNdefRecord.lower(record), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFfiNfcReader: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FfiNfcReader public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FfiNfcReader { - FfiNfcReader(unsafeFromRawPointer: pointer) + return FfiNfcReader(unsafeFromRawPointer: pointer) } public static func lower(_ value: FfiNfcReader) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiNfcReader { @@ -3848,7 +4210,7 @@ public struct FfiConverterTypeFfiNfcReader: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -3861,31 +4223,38 @@ public struct FfiConverterTypeFfiNfcReader: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiNfcReader_lift(_ pointer: UnsafeMutableRawPointer) throws -> FfiNfcReader { - try FfiConverterTypeFfiNfcReader.lift(pointer) + return try FfiConverterTypeFfiNfcReader.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiNfcReader_lower(_ value: FfiNfcReader) -> UnsafeMutableRawPointer { - FfiConverterTypeFfiNfcReader.lower(value) + return FfiConverterTypeFfiNfcReader.lower(value) } -public protocol FiatClientProtocol: AnyObject {} + + + +public protocol FiatClientProtocol : AnyObject { + +} open class FiatClient: - FiatClientProtocol -{ + FiatClientProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -3893,7 +4262,7 @@ open class FiatClient: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -3902,44 +4271,49 @@ open class FiatClient: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_fiatclient(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_fiatclient(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_fiatclient(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFiatClient: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FiatClient public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FiatClient { - FiatClient(unsafeFromRawPointer: pointer) + return FiatClient(unsafeFromRawPointer: pointer) } public static func lower(_ value: FiatClient) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FiatClient { @@ -3947,7 +4321,7 @@ public struct FfiConverterTypeFiatClient: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -3960,33 +4334,40 @@ public struct FfiConverterTypeFiatClient: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatClient_lift(_ pointer: UnsafeMutableRawPointer) throws -> FiatClient { - try FfiConverterTypeFiatClient.lift(pointer) + return try FfiConverterTypeFiatClient.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatClient_lower(_ value: FiatClient) -> UnsafeMutableRawPointer { - FfiConverterTypeFiatClient.lower(value) + return FfiConverterTypeFiatClient.lower(value) } -public protocol FileHandlerProtocol: AnyObject { - func read() throws -> MultiFormat + + + +public protocol FileHandlerProtocol : AnyObject { + + func read() throws -> MultiFormat + } open class FileHandler: - FileHandlerProtocol -{ + FileHandlerProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -3994,7 +4375,7 @@ open class FileHandler: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4003,58 +4384,64 @@ open class FileHandler: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_filehandler(self.pointer, $0) } - } - - public convenience init(filePath: String) { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_filehandler_new( - FfiConverterString.lower(filePath), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_filehandler(self.pointer, $0) } } +public convenience init(filePath: String) { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_filehandler_new( + FfiConverterString.lower(filePath),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_filehandler(pointer, $0) } } - open func read() throws -> MultiFormat { - try FfiConverterTypeMultiFormat.lift(rustCallWithError(FfiConverterTypeFileHandlerError.lift) { - uniffi_cove_fn_method_filehandler_read(self.uniffiClonePointer(), $0) - }) - } + + + +open func read()throws -> MultiFormat { + return try FfiConverterTypeMultiFormat.lift(try rustCallWithError(FfiConverterTypeFileHandlerError.lift) { + uniffi_cove_fn_method_filehandler_read(self.uniffiClonePointer(),$0 + ) +}) +} + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFileHandler: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FileHandler public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FileHandler { - FileHandler(unsafeFromRawPointer: pointer) + return FileHandler(unsafeFromRawPointer: pointer) } public static func lower(_ value: FileHandler) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FileHandler { @@ -4062,7 +4449,7 @@ public struct FfiConverterTypeFileHandler: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4075,35 +4462,42 @@ public struct FfiConverterTypeFileHandler: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFileHandler_lift(_ pointer: UnsafeMutableRawPointer) throws -> FileHandler { - try FfiConverterTypeFileHandler.lift(pointer) + return try FfiConverterTypeFileHandler.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFileHandler_lower(_ value: FileHandler) -> UnsafeMutableRawPointer { - FfiConverterTypeFileHandler.lower(value) + return FfiConverterTypeFileHandler.lower(value) } -public protocol FingerprintProtocol: AnyObject { - func asLowercase() -> String - func asUppercase() -> String + + +public protocol FingerprintProtocol : AnyObject { + + func asLowercase() -> String + + func asUppercase() -> String + } open class Fingerprint: - FingerprintProtocol -{ + FingerprintProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -4111,7 +4505,7 @@ open class Fingerprint: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4120,64 +4514,71 @@ open class Fingerprint: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_fingerprint(self.pointer, $0) } - } - - public convenience init(id: WalletId) throws { - let pointer = - try rustCallWithError(FfiConverterTypeFingerprintError.lift) { - uniffi_cove_fn_constructor_fingerprint_new( - FfiConverterTypeWalletId.lower(id), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_fingerprint(self.pointer, $0) } } +public convenience init(id: WalletId)throws { + let pointer = + try rustCallWithError(FfiConverterTypeFingerprintError.lift) { + uniffi_cove_fn_constructor_fingerprint_new( + FfiConverterTypeWalletId.lower(id),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_fingerprint(pointer, $0) } } - open func asLowercase() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_fingerprint_as_lowercase(self.uniffiClonePointer(), $0) - }) - } + + + +open func asLowercase() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_fingerprint_as_lowercase(self.uniffiClonePointer(),$0 + ) +}) +} + +open func asUppercase() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_fingerprint_as_uppercase(self.uniffiClonePointer(),$0 + ) +}) +} + - open func asUppercase() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_fingerprint_as_uppercase(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFingerprint: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Fingerprint public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Fingerprint { - Fingerprint(unsafeFromRawPointer: pointer) + return Fingerprint(unsafeFromRawPointer: pointer) } public static func lower(_ value: Fingerprint) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Fingerprint { @@ -4185,7 +4586,7 @@ public struct FfiConverterTypeFingerprint: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4198,31 +4599,38 @@ public struct FfiConverterTypeFingerprint: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFingerprint_lift(_ pointer: UnsafeMutableRawPointer) throws -> Fingerprint { - try FfiConverterTypeFingerprint.lift(pointer) + return try FfiConverterTypeFingerprint.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFingerprint_lower(_ value: Fingerprint) -> UnsafeMutableRawPointer { - FfiConverterTypeFingerprint.lower(value) + return FfiConverterTypeFingerprint.lower(value) } -public protocol FoundJsonProtocol: AnyObject {} -open class FoundJson: - FoundJsonProtocol -{ + + +public protocol FoundJsonProtocol : AnyObject { + +} + +open class FoundJson: + FoundJsonProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -4230,7 +4638,7 @@ open class FoundJson: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4239,44 +4647,49 @@ open class FoundJson: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_foundjson(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_foundjson(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_foundjson(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFoundJson: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = FoundJson public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> FoundJson { - FoundJson(unsafeFromRawPointer: pointer) + return FoundJson(unsafeFromRawPointer: pointer) } public static func lower(_ value: FoundJson) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FoundJson { @@ -4284,7 +4697,7 @@ public struct FfiConverterTypeFoundJson: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4297,55 +4710,62 @@ public struct FfiConverterTypeFoundJson: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFoundJson_lift(_ pointer: UnsafeMutableRawPointer) throws -> FoundJson { - try FfiConverterTypeFoundJson.lift(pointer) + return try FfiConverterTypeFoundJson.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFoundJson_lower(_ value: FoundJson) -> UnsafeMutableRawPointer { - FfiConverterTypeFoundJson.lower(value) -} - -public protocol GlobalConfigTableProtocol: AnyObject { - func clearSelectedWallet() throws - - func colorScheme() -> ColorSchemeSelection - - func delete(key: GlobalConfigKey) throws - - func get(key: GlobalConfigKey) throws -> String? - - func selectWallet(id: WalletId) throws - - func selectedNetwork() -> Network - - func selectedNode() -> Node - - func selectedWallet() -> WalletId? - - func set(key: GlobalConfigKey, value: String) throws - - func setColorScheme(colorScheme: ColorSchemeSelection) throws - - func setSelectedNetwork(network: Network) throws - - func setSelectedNode(node: Node) throws + return FfiConverterTypeFoundJson.lower(value) +} + + + + +public protocol GlobalConfigTableProtocol : AnyObject { + + func clearSelectedWallet() throws + + func colorScheme() -> ColorSchemeSelection + + func delete(key: GlobalConfigKey) throws + + func get(key: GlobalConfigKey) throws -> String? + + func selectWallet(id: WalletId) throws + + func selectedNetwork() -> Network + + func selectedNode() -> Node + + func selectedWallet() -> WalletId? + + func set(key: GlobalConfigKey, value: String) throws + + func setColorScheme(colorScheme: ColorSchemeSelection) throws + + func setSelectedNetwork(network: Network) throws + + func setSelectedNode(node: Node) throws + } open class GlobalConfigTable: - GlobalConfigTableProtocol -{ + GlobalConfigTableProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -4353,7 +4773,7 @@ open class GlobalConfigTable: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4362,117 +4782,134 @@ open class GlobalConfigTable: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_globalconfigtable(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_globalconfigtable(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_globalconfigtable(pointer, $0) } } - open func clearSelectedWallet() throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_clear_selected_wallet(self.uniffiClonePointer(), $0) - } - } - - open func colorScheme() -> ColorSchemeSelection { - try! FfiConverterTypeColorSchemeSelection.lift(try! rustCall { - uniffi_cove_fn_method_globalconfigtable_color_scheme(self.uniffiClonePointer(), $0) - }) - } - - open func delete(key: GlobalConfigKey) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_delete(self.uniffiClonePointer(), - FfiConverterTypeGlobalConfigKey.lower(key), $0) - } - } - - open func get(key: GlobalConfigKey) throws -> String? { - try FfiConverterOptionString.lift(rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_get(self.uniffiClonePointer(), - FfiConverterTypeGlobalConfigKey.lower(key), $0) - }) - } - - open func selectWallet(id: WalletId) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_select_wallet(self.uniffiClonePointer(), - FfiConverterTypeWalletId.lower(id), $0) - } - } - - open func selectedNetwork() -> Network { - try! FfiConverterTypeNetwork.lift(try! rustCall { - uniffi_cove_fn_method_globalconfigtable_selected_network(self.uniffiClonePointer(), $0) - }) - } - - open func selectedNode() -> Node { - try! FfiConverterTypeNode.lift(try! rustCall { - uniffi_cove_fn_method_globalconfigtable_selected_node(self.uniffiClonePointer(), $0) - }) - } - - open func selectedWallet() -> WalletId? { - try! FfiConverterOptionTypeWalletId.lift(try! rustCall { - uniffi_cove_fn_method_globalconfigtable_selected_wallet(self.uniffiClonePointer(), $0) - }) - } - - open func set(key: GlobalConfigKey, value: String) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_set(self.uniffiClonePointer(), - FfiConverterTypeGlobalConfigKey.lower(key), - FfiConverterString.lower(value), $0) - } - } - - open func setColorScheme(colorScheme: ColorSchemeSelection) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_set_color_scheme(self.uniffiClonePointer(), - FfiConverterTypeColorSchemeSelection.lower(colorScheme), $0) - } - } + - open func setSelectedNetwork(network: Network) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_set_selected_network(self.uniffiClonePointer(), - FfiConverterTypeNetwork.lower(network), $0) - } - } + +open func clearSelectedWallet()throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_clear_selected_wallet(self.uniffiClonePointer(),$0 + ) +} +} + +open func colorScheme() -> ColorSchemeSelection { + return try! FfiConverterTypeColorSchemeSelection.lift(try! rustCall() { + uniffi_cove_fn_method_globalconfigtable_color_scheme(self.uniffiClonePointer(),$0 + ) +}) +} + +open func delete(key: GlobalConfigKey)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_delete(self.uniffiClonePointer(), + FfiConverterTypeGlobalConfigKey.lower(key),$0 + ) +} +} + +open func get(key: GlobalConfigKey)throws -> String? { + return try FfiConverterOptionString.lift(try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_get(self.uniffiClonePointer(), + FfiConverterTypeGlobalConfigKey.lower(key),$0 + ) +}) +} + +open func selectWallet(id: WalletId)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_select_wallet(self.uniffiClonePointer(), + FfiConverterTypeWalletId.lower(id),$0 + ) +} +} + +open func selectedNetwork() -> Network { + return try! FfiConverterTypeNetwork.lift(try! rustCall() { + uniffi_cove_fn_method_globalconfigtable_selected_network(self.uniffiClonePointer(),$0 + ) +}) +} + +open func selectedNode() -> Node { + return try! FfiConverterTypeNode.lift(try! rustCall() { + uniffi_cove_fn_method_globalconfigtable_selected_node(self.uniffiClonePointer(),$0 + ) +}) +} + +open func selectedWallet() -> WalletId? { + return try! FfiConverterOptionTypeWalletId.lift(try! rustCall() { + uniffi_cove_fn_method_globalconfigtable_selected_wallet(self.uniffiClonePointer(),$0 + ) +}) +} + +open func set(key: GlobalConfigKey, value: String)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_set(self.uniffiClonePointer(), + FfiConverterTypeGlobalConfigKey.lower(key), + FfiConverterString.lower(value),$0 + ) +} +} + +open func setColorScheme(colorScheme: ColorSchemeSelection)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_set_color_scheme(self.uniffiClonePointer(), + FfiConverterTypeColorSchemeSelection.lower(colorScheme),$0 + ) +} +} + +open func setSelectedNetwork(network: Network)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_set_selected_network(self.uniffiClonePointer(), + FfiConverterTypeNetwork.lower(network),$0 + ) +} +} + +open func setSelectedNode(node: Node)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalconfigtable_set_selected_node(self.uniffiClonePointer(), + FfiConverterTypeNode.lower(node),$0 + ) +} +} + - open func setSelectedNode(node: Node) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalconfigtable_set_selected_node(self.uniffiClonePointer(), - FfiConverterTypeNode.lower(node), $0) - } - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGlobalConfigTable: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = GlobalConfigTable public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> GlobalConfigTable { - GlobalConfigTable(unsafeFromRawPointer: pointer) + return GlobalConfigTable(unsafeFromRawPointer: pointer) } public static func lower(_ value: GlobalConfigTable) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GlobalConfigTable { @@ -4480,7 +4917,7 @@ public struct FfiConverterTypeGlobalConfigTable: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4493,37 +4930,44 @@ public struct FfiConverterTypeGlobalConfigTable: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalConfigTable_lift(_ pointer: UnsafeMutableRawPointer) throws -> GlobalConfigTable { - try FfiConverterTypeGlobalConfigTable.lift(pointer) + return try FfiConverterTypeGlobalConfigTable.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalConfigTable_lower(_ value: GlobalConfigTable) -> UnsafeMutableRawPointer { - FfiConverterTypeGlobalConfigTable.lower(value) + return FfiConverterTypeGlobalConfigTable.lower(value) } -public protocol GlobalFlagTableProtocol: AnyObject { - func get(key: GlobalFlagKey) throws -> Bool - func set(key: GlobalFlagKey, value: Bool) throws - func toggleBoolConfig(key: GlobalFlagKey) throws + +public protocol GlobalFlagTableProtocol : AnyObject { + + func get(key: GlobalFlagKey) throws -> Bool + + func set(key: GlobalFlagKey, value: Bool) throws + + func toggleBoolConfig(key: GlobalFlagKey) throws + } open class GlobalFlagTable: - GlobalFlagTableProtocol -{ + GlobalFlagTableProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -4531,7 +4975,7 @@ open class GlobalFlagTable: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4540,64 +4984,72 @@ open class GlobalFlagTable: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_globalflagtable(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_globalflagtable(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_globalflagtable(pointer, $0) } } - open func get(key: GlobalFlagKey) throws -> Bool { - try FfiConverterBool.lift(rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalflagtable_get(self.uniffiClonePointer(), - FfiConverterTypeGlobalFlagKey.lower(key), $0) - }) - } + - open func set(key: GlobalFlagKey, value: Bool) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalflagtable_set(self.uniffiClonePointer(), - FfiConverterTypeGlobalFlagKey.lower(key), - FfiConverterBool.lower(value), $0) - } - } + +open func get(key: GlobalFlagKey)throws -> Bool { + return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalflagtable_get(self.uniffiClonePointer(), + FfiConverterTypeGlobalFlagKey.lower(key),$0 + ) +}) +} + +open func set(key: GlobalFlagKey, value: Bool)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalflagtable_set(self.uniffiClonePointer(), + FfiConverterTypeGlobalFlagKey.lower(key), + FfiConverterBool.lower(value),$0 + ) +} +} + +open func toggleBoolConfig(key: GlobalFlagKey)throws {try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_globalflagtable_toggle_bool_config(self.uniffiClonePointer(), + FfiConverterTypeGlobalFlagKey.lower(key),$0 + ) +} +} + - open func toggleBoolConfig(key: GlobalFlagKey) throws { try rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_globalflagtable_toggle_bool_config(self.uniffiClonePointer(), - FfiConverterTypeGlobalFlagKey.lower(key), $0) - } - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGlobalFlagTable: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = GlobalFlagTable public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> GlobalFlagTable { - GlobalFlagTable(unsafeFromRawPointer: pointer) + return GlobalFlagTable(unsafeFromRawPointer: pointer) } public static func lower(_ value: GlobalFlagTable) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GlobalFlagTable { @@ -4605,7 +5057,7 @@ public struct FfiConverterTypeGlobalFlagTable: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4618,31 +5070,38 @@ public struct FfiConverterTypeGlobalFlagTable: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalFlagTable_lift(_ pointer: UnsafeMutableRawPointer) throws -> GlobalFlagTable { - try FfiConverterTypeGlobalFlagTable.lift(pointer) + return try FfiConverterTypeGlobalFlagTable.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalFlagTable_lower(_ value: GlobalFlagTable) -> UnsafeMutableRawPointer { - FfiConverterTypeGlobalFlagTable.lower(value) + return FfiConverterTypeGlobalFlagTable.lower(value) } -public protocol HardwareExportProtocol: AnyObject {} + + + +public protocol HardwareExportProtocol : AnyObject { + +} open class HardwareExport: - HardwareExportProtocol -{ + HardwareExportProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -4650,7 +5109,7 @@ open class HardwareExport: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4659,44 +5118,49 @@ open class HardwareExport: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_hardwareexport(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_hardwareexport(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_hardwareexport(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeHardwareExport: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = HardwareExport public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> HardwareExport { - HardwareExport(unsafeFromRawPointer: pointer) + return HardwareExport(unsafeFromRawPointer: pointer) } public static func lower(_ value: HardwareExport) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> HardwareExport { @@ -4704,7 +5168,7 @@ public struct FfiConverterTypeHardwareExport: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4717,37 +5181,44 @@ public struct FfiConverterTypeHardwareExport: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeHardwareExport_lift(_ pointer: UnsafeMutableRawPointer) throws -> HardwareExport { - try FfiConverterTypeHardwareExport.lift(pointer) + return try FfiConverterTypeHardwareExport.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeHardwareExport_lower(_ value: HardwareExport) -> UnsafeMutableRawPointer { - FfiConverterTypeHardwareExport.lower(value) + return FfiConverterTypeHardwareExport.lower(value) } -public protocol HeaderIconPresenterProtocol: AnyObject { - func backgroundColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor - func iconColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor - func ringColor(state: TransactionState, colorScheme: FfiColorScheme, direction: TransactionDirection, confirmations: Int32, ringNumber: Int32) -> FfiColor + +public protocol HeaderIconPresenterProtocol : AnyObject { + + func backgroundColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor + + func iconColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor + + func ringColor(state: TransactionState, colorScheme: FfiColorScheme, direction: TransactionDirection, confirmations: Int32, ringNumber: Int32) -> FfiColor + } open class HeaderIconPresenter: - HeaderIconPresenterProtocol -{ + HeaderIconPresenterProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -4755,7 +5226,7 @@ open class HeaderIconPresenter: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4764,82 +5235,90 @@ open class HeaderIconPresenter: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_headericonpresenter(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_headericonpresenter_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_headericonpresenter(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_headericonpresenter_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_headericonpresenter(pointer, $0) } } - open func backgroundColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor { - try! FfiConverterTypeFfiColor.lift(try! rustCall { - uniffi_cove_fn_method_headericonpresenter_background_color(self.uniffiClonePointer(), - FfiConverterTypeTransactionState.lower(state), - FfiConverterTypeTransactionDirection.lower(direction), - FfiConverterTypeFfiColorScheme.lower(colorScheme), - FfiConverterInt32.lower(confirmationCount), $0) - }) - } + - open func iconColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor { - try! FfiConverterTypeFfiColor.lift(try! rustCall { - uniffi_cove_fn_method_headericonpresenter_icon_color(self.uniffiClonePointer(), - FfiConverterTypeTransactionState.lower(state), - FfiConverterTypeTransactionDirection.lower(direction), - FfiConverterTypeFfiColorScheme.lower(colorScheme), - FfiConverterInt32.lower(confirmationCount), $0) - }) - } + +open func backgroundColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor { + return try! FfiConverterTypeFfiColor.lift(try! rustCall() { + uniffi_cove_fn_method_headericonpresenter_background_color(self.uniffiClonePointer(), + FfiConverterTypeTransactionState.lower(state), + FfiConverterTypeTransactionDirection.lower(direction), + FfiConverterTypeFfiColorScheme.lower(colorScheme), + FfiConverterInt32.lower(confirmationCount),$0 + ) +}) +} + +open func iconColor(state: TransactionState, direction: TransactionDirection, colorScheme: FfiColorScheme, confirmationCount: Int32) -> FfiColor { + return try! FfiConverterTypeFfiColor.lift(try! rustCall() { + uniffi_cove_fn_method_headericonpresenter_icon_color(self.uniffiClonePointer(), + FfiConverterTypeTransactionState.lower(state), + FfiConverterTypeTransactionDirection.lower(direction), + FfiConverterTypeFfiColorScheme.lower(colorScheme), + FfiConverterInt32.lower(confirmationCount),$0 + ) +}) +} + +open func ringColor(state: TransactionState, colorScheme: FfiColorScheme, direction: TransactionDirection, confirmations: Int32, ringNumber: Int32) -> FfiColor { + return try! FfiConverterTypeFfiColor.lift(try! rustCall() { + uniffi_cove_fn_method_headericonpresenter_ring_color(self.uniffiClonePointer(), + FfiConverterTypeTransactionState.lower(state), + FfiConverterTypeFfiColorScheme.lower(colorScheme), + FfiConverterTypeTransactionDirection.lower(direction), + FfiConverterInt32.lower(confirmations), + FfiConverterInt32.lower(ringNumber),$0 + ) +}) +} + - open func ringColor(state: TransactionState, colorScheme: FfiColorScheme, direction: TransactionDirection, confirmations: Int32, ringNumber: Int32) -> FfiColor { - try! FfiConverterTypeFfiColor.lift(try! rustCall { - uniffi_cove_fn_method_headericonpresenter_ring_color(self.uniffiClonePointer(), - FfiConverterTypeTransactionState.lower(state), - FfiConverterTypeFfiColorScheme.lower(colorScheme), - FfiConverterTypeTransactionDirection.lower(direction), - FfiConverterInt32.lower(confirmations), - FfiConverterInt32.lower(ringNumber), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeHeaderIconPresenter: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = HeaderIconPresenter public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> HeaderIconPresenter { - HeaderIconPresenter(unsafeFromRawPointer: pointer) + return HeaderIconPresenter(unsafeFromRawPointer: pointer) } public static func lower(_ value: HeaderIconPresenter) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> HeaderIconPresenter { @@ -4847,7 +5326,7 @@ public struct FfiConverterTypeHeaderIconPresenter: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4860,31 +5339,38 @@ public struct FfiConverterTypeHeaderIconPresenter: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeHeaderIconPresenter_lift(_ pointer: UnsafeMutableRawPointer) throws -> HeaderIconPresenter { - try FfiConverterTypeHeaderIconPresenter.lift(pointer) + return try FfiConverterTypeHeaderIconPresenter.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeHeaderIconPresenter_lower(_ value: HeaderIconPresenter) -> UnsafeMutableRawPointer { - FfiConverterTypeHeaderIconPresenter.lower(value) + return FfiConverterTypeHeaderIconPresenter.lower(value) } -public protocol KeychainProtocol: AnyObject {} + + + +public protocol KeychainProtocol : AnyObject { + +} open class Keychain: - KeychainProtocol -{ + KeychainProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -4892,7 +5378,7 @@ open class Keychain: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -4901,52 +5387,57 @@ open class Keychain: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_keychain(self.pointer, $0) } - } - - public convenience init(keychain: KeychainAccess) { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_keychain_new( - FfiConverterCallbackInterfaceKeychainAccess.lower(keychain), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_keychain(self.pointer, $0) } } +public convenience init(keychain: KeychainAccess) { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_keychain_new( + FfiConverterCallbackInterfaceKeychainAccess.lower(keychain),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_keychain(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeKeychain: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Keychain public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Keychain { - Keychain(unsafeFromRawPointer: pointer) + return Keychain(unsafeFromRawPointer: pointer) } public static func lower(_ value: Keychain) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Keychain { @@ -4954,7 +5445,7 @@ public struct FfiConverterTypeKeychain: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -4967,35 +5458,42 @@ public struct FfiConverterTypeKeychain: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeKeychain_lift(_ pointer: UnsafeMutableRawPointer) throws -> Keychain { - try FfiConverterTypeKeychain.lift(pointer) + return try FfiConverterTypeKeychain.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeKeychain_lower(_ value: Keychain) -> UnsafeMutableRawPointer { - FfiConverterTypeKeychain.lower(value) + return FfiConverterTypeKeychain.lower(value) } -public protocol MnemonicProtocol: AnyObject { - func allWords() -> [GroupedWord] - func words() -> [String] + + +public protocol MnemonicProtocol : AnyObject { + + func allWords() -> [GroupedWord] + + func words() -> [String] + } open class Mnemonic: - MnemonicProtocol -{ + MnemonicProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5003,7 +5501,7 @@ open class Mnemonic: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5012,72 +5510,79 @@ open class Mnemonic: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_mnemonic(self.pointer, $0) } - } - - public convenience init(id: WalletId) throws { - let pointer = - try rustCallWithError(FfiConverterTypeMnemonicError.lift) { - uniffi_cove_fn_constructor_mnemonic_new( - FfiConverterTypeWalletId.lower(id), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_mnemonic(self.pointer, $0) } } +public convenience init(id: WalletId)throws { + let pointer = + try rustCallWithError(FfiConverterTypeMnemonicError.lift) { + uniffi_cove_fn_constructor_mnemonic_new( + FfiConverterTypeWalletId.lower(id),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_mnemonic(pointer, $0) } } - public static func preview(numberOfBip39Words: NumberOfBip39Words) -> Mnemonic { - try! FfiConverterTypeMnemonic.lift(try! rustCall { - uniffi_cove_fn_constructor_mnemonic_preview( - FfiConverterTypeNumberOfBip39Words.lower(numberOfBip39Words), $0 - ) - }) - } - - open func allWords() -> [GroupedWord] { - try! FfiConverterSequenceTypeGroupedWord.lift(try! rustCall { - uniffi_cove_fn_method_mnemonic_all_words(self.uniffiClonePointer(), $0) - }) - } - - open func words() -> [String] { - try! FfiConverterSequenceString.lift(try! rustCall { - uniffi_cove_fn_method_mnemonic_words(self.uniffiClonePointer(), $0) - }) - } + +public static func preview(numberOfBip39Words: NumberOfBip39Words) -> Mnemonic { + return try! FfiConverterTypeMnemonic.lift(try! rustCall() { + uniffi_cove_fn_constructor_mnemonic_preview( + FfiConverterTypeNumberOfBip39Words.lower(numberOfBip39Words),$0 + ) +}) } + -#if swift(>=5.8) - @_documentation(visibility: private) + +open func allWords() -> [GroupedWord] { + return try! FfiConverterSequenceTypeGroupedWord.lift(try! rustCall() { + uniffi_cove_fn_method_mnemonic_all_words(self.uniffiClonePointer(),$0 + ) +}) +} + +open func words() -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_cove_fn_method_mnemonic_words(self.uniffiClonePointer(),$0 + ) +}) +} + + +} + +#if swift(>=5.8) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMnemonic: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Mnemonic public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Mnemonic { - Mnemonic(unsafeFromRawPointer: pointer) + return Mnemonic(unsafeFromRawPointer: pointer) } public static func lower(_ value: Mnemonic) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Mnemonic { @@ -5085,7 +5590,7 @@ public struct FfiConverterTypeMnemonic: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -5098,43 +5603,50 @@ public struct FfiConverterTypeMnemonic: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMnemonic_lift(_ pointer: UnsafeMutableRawPointer) throws -> Mnemonic { - try FfiConverterTypeMnemonic.lift(pointer) + return try FfiConverterTypeMnemonic.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMnemonic_lower(_ value: Mnemonic) -> UnsafeMutableRawPointer { - FfiConverterTypeMnemonic.lower(value) + return FfiConverterTypeMnemonic.lower(value) } -public protocol MultiQrProtocol: AnyObject { - func addPart(qr: String) throws -> BbqrJoinResult - - func getGroupedWords(qr: StringOrData, groupsOf: UInt8) throws -> [[String]]? - func handleScanResult(qr: StringOrData) throws -> MultiQrScanResult - func isBbqr() -> Bool - func isSeedQr() -> Bool - - func totalParts() -> UInt32 +public protocol MultiQrProtocol : AnyObject { + + func addPart(qr: String) throws -> BbqrJoinResult + + func getGroupedWords(qr: StringOrData, groupsOf: UInt8) throws -> [[String]]? + + func handleScanResult(qr: StringOrData) throws -> MultiQrScanResult + + func isBbqr() -> Bool + + func isSeedQr() -> Bool + + func totalParts() -> UInt32 + } open class MultiQr: - MultiQrProtocol -{ + MultiQrProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5142,7 +5654,7 @@ open class MultiQr: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5151,108 +5663,119 @@ open class MultiQr: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_multiqr(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_multiqr(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_multiqr(pointer, $0) } } - public static func newFromString(qr: String) -> MultiQr { - try! FfiConverterTypeMultiQr.lift(try! rustCall { - uniffi_cove_fn_constructor_multiqr_new_from_string( - FfiConverterString.lower(qr), $0 - ) - }) - } - - public static func tryNew(qr: StringOrData) throws -> MultiQr { - try FfiConverterTypeMultiQr.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_constructor_multiqr_try_new( - FfiConverterTypeStringOrData.lower(qr), $0 - ) - }) - } - - public static func tryNewFromData(data: Data) throws -> MultiQr { - try FfiConverterTypeMultiQr.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_constructor_multiqr_try_new_from_data( - FfiConverterData.lower(data), $0 - ) - }) - } - - open func addPart(qr: String) throws -> BbqrJoinResult { - try FfiConverterTypeBbqrJoinResult.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_method_multiqr_add_part(self.uniffiClonePointer(), - FfiConverterString.lower(qr), $0) - }) - } - - open func getGroupedWords(qr: StringOrData, groupsOf: UInt8) throws -> [[String]]? { - try FfiConverterOptionSequenceSequenceString.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_method_multiqr_get_grouped_words(self.uniffiClonePointer(), - FfiConverterTypeStringOrData.lower(qr), - FfiConverterUInt8.lower(groupsOf), $0) - }) - } - - open func handleScanResult(qr: StringOrData) throws -> MultiQrScanResult { - try FfiConverterTypeMultiQrScanResult.lift(rustCallWithError(FfiConverterTypeMultiQrError.lift) { - uniffi_cove_fn_method_multiqr_handle_scan_result(self.uniffiClonePointer(), - FfiConverterTypeStringOrData.lower(qr), $0) - }) - } - - open func isBbqr() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_multiqr_is_bbqr(self.uniffiClonePointer(), $0) - }) - } + +public static func newFromString(qr: String) -> MultiQr { + return try! FfiConverterTypeMultiQr.lift(try! rustCall() { + uniffi_cove_fn_constructor_multiqr_new_from_string( + FfiConverterString.lower(qr),$0 + ) +}) +} + +public static func tryNew(qr: StringOrData)throws -> MultiQr { + return try FfiConverterTypeMultiQr.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_constructor_multiqr_try_new( + FfiConverterTypeStringOrData.lower(qr),$0 + ) +}) +} + +public static func tryNewFromData(data: Data)throws -> MultiQr { + return try FfiConverterTypeMultiQr.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_constructor_multiqr_try_new_from_data( + FfiConverterData.lower(data),$0 + ) +}) +} + - open func isSeedQr() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_multiqr_is_seed_qr(self.uniffiClonePointer(), $0) - }) - } + +open func addPart(qr: String)throws -> BbqrJoinResult { + return try FfiConverterTypeBbqrJoinResult.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_method_multiqr_add_part(self.uniffiClonePointer(), + FfiConverterString.lower(qr),$0 + ) +}) +} + +open func getGroupedWords(qr: StringOrData, groupsOf: UInt8)throws -> [[String]]? { + return try FfiConverterOptionSequenceSequenceString.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_method_multiqr_get_grouped_words(self.uniffiClonePointer(), + FfiConverterTypeStringOrData.lower(qr), + FfiConverterUInt8.lower(groupsOf),$0 + ) +}) +} + +open func handleScanResult(qr: StringOrData)throws -> MultiQrScanResult { + return try FfiConverterTypeMultiQrScanResult.lift(try rustCallWithError(FfiConverterTypeMultiQrError.lift) { + uniffi_cove_fn_method_multiqr_handle_scan_result(self.uniffiClonePointer(), + FfiConverterTypeStringOrData.lower(qr),$0 + ) +}) +} + +open func isBbqr() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_multiqr_is_bbqr(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isSeedQr() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_multiqr_is_seed_qr(self.uniffiClonePointer(),$0 + ) +}) +} + +open func totalParts() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffi_cove_fn_method_multiqr_total_parts(self.uniffiClonePointer(),$0 + ) +}) +} + - open func totalParts() -> UInt32 { - try! FfiConverterUInt32.lift(try! rustCall { - uniffi_cove_fn_method_multiqr_total_parts(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMultiQr: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = MultiQr public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> MultiQr { - MultiQr(unsafeFromRawPointer: pointer) + return MultiQr(unsafeFromRawPointer: pointer) } public static func lower(_ value: MultiQr) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MultiQr { @@ -5260,7 +5783,7 @@ public struct FfiConverterTypeMultiQr: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -5273,35 +5796,42 @@ public struct FfiConverterTypeMultiQr: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMultiQr_lift(_ pointer: UnsafeMutableRawPointer) throws -> MultiQr { - try FfiConverterTypeMultiQr.lift(pointer) + return try FfiConverterTypeMultiQr.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMultiQr_lower(_ value: MultiQr) -> UnsafeMutableRawPointer { - FfiConverterTypeMultiQr.lower(value) + return FfiConverterTypeMultiQr.lower(value) } -public protocol NdefRecordReaderProtocol: AnyObject { - func id() -> String? - func type() -> String? + + +public protocol NdefRecordReaderProtocol : AnyObject { + + func id() -> String? + + func type() -> String? + } open class NdefRecordReader: - NdefRecordReaderProtocol -{ + NdefRecordReaderProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5309,7 +5839,7 @@ open class NdefRecordReader: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5318,64 +5848,71 @@ open class NdefRecordReader: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_ndefrecordreader(self.pointer, $0) } - } - - public convenience init(record: NdefRecord) { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_ndefrecordreader_new( - FfiConverterTypeNdefRecord.lower(record), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_ndefrecordreader(self.pointer, $0) } } +public convenience init(record: NdefRecord) { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_ndefrecordreader_new( + FfiConverterTypeNdefRecord.lower(record),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_ndefrecordreader(pointer, $0) } } - open func id() -> String? { - try! FfiConverterOptionString.lift(try! rustCall { - uniffi_cove_fn_method_ndefrecordreader_id(self.uniffiClonePointer(), $0) - }) - } + + + +open func id() -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffi_cove_fn_method_ndefrecordreader_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func type() -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffi_cove_fn_method_ndefrecordreader_type_(self.uniffiClonePointer(),$0 + ) +}) +} + - open func type() -> String? { - try! FfiConverterOptionString.lift(try! rustCall { - uniffi_cove_fn_method_ndefrecordreader_type_(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNdefRecordReader: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = NdefRecordReader public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> NdefRecordReader { - NdefRecordReader(unsafeFromRawPointer: pointer) + return NdefRecordReader(unsafeFromRawPointer: pointer) } public static func lower(_ value: NdefRecordReader) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NdefRecordReader { @@ -5383,7 +5920,7 @@ public struct FfiConverterTypeNdefRecordReader: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -5396,37 +5933,44 @@ public struct FfiConverterTypeNdefRecordReader: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefRecordReader_lift(_ pointer: UnsafeMutableRawPointer) throws -> NdefRecordReader { - try FfiConverterTypeNdefRecordReader.lift(pointer) + return try FfiConverterTypeNdefRecordReader.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefRecordReader_lower(_ value: NdefRecordReader) -> UnsafeMutableRawPointer { - FfiConverterTypeNdefRecordReader.lower(value) + return FfiConverterTypeNdefRecordReader.lower(value) } -public protocol NfcConstProtocol: AnyObject { - func bytesPerBlock() -> UInt16 - func numberOfBlocksPerChunk() -> UInt16 - func totalBytesPerChunk() -> UInt16 + +public protocol NfcConstProtocol : AnyObject { + + func bytesPerBlock() -> UInt16 + + func numberOfBlocksPerChunk() -> UInt16 + + func totalBytesPerChunk() -> UInt16 + } open class NfcConst: - NfcConstProtocol -{ + NfcConstProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5434,7 +5978,7 @@ open class NfcConst: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5443,69 +5987,77 @@ open class NfcConst: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_nfcconst(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_nfcconst_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_nfcconst(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_nfcconst_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_nfcconst(pointer, $0) } } - open func bytesPerBlock() -> UInt16 { - try! FfiConverterUInt16.lift(try! rustCall { - uniffi_cove_fn_method_nfcconst_bytes_per_block(self.uniffiClonePointer(), $0) - }) - } + - open func numberOfBlocksPerChunk() -> UInt16 { - try! FfiConverterUInt16.lift(try! rustCall { - uniffi_cove_fn_method_nfcconst_number_of_blocks_per_chunk(self.uniffiClonePointer(), $0) - }) - } + +open func bytesPerBlock() -> UInt16 { + return try! FfiConverterUInt16.lift(try! rustCall() { + uniffi_cove_fn_method_nfcconst_bytes_per_block(self.uniffiClonePointer(),$0 + ) +}) +} + +open func numberOfBlocksPerChunk() -> UInt16 { + return try! FfiConverterUInt16.lift(try! rustCall() { + uniffi_cove_fn_method_nfcconst_number_of_blocks_per_chunk(self.uniffiClonePointer(),$0 + ) +}) +} + +open func totalBytesPerChunk() -> UInt16 { + return try! FfiConverterUInt16.lift(try! rustCall() { + uniffi_cove_fn_method_nfcconst_total_bytes_per_chunk(self.uniffiClonePointer(),$0 + ) +}) +} + - open func totalBytesPerChunk() -> UInt16 { - try! FfiConverterUInt16.lift(try! rustCall { - uniffi_cove_fn_method_nfcconst_total_bytes_per_chunk(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNfcConst: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = NfcConst public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> NfcConst { - NfcConst(unsafeFromRawPointer: pointer) + return NfcConst(unsafeFromRawPointer: pointer) } public static func lower(_ value: NfcConst) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NfcConst { @@ -5513,7 +6065,7 @@ public struct FfiConverterTypeNfcConst: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -5526,49 +6078,56 @@ public struct FfiConverterTypeNfcConst: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNfcConst_lift(_ pointer: UnsafeMutableRawPointer) throws -> NfcConst { - try FfiConverterTypeNfcConst.lift(pointer) + return try FfiConverterTypeNfcConst.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNfcConst_lower(_ value: NfcConst) -> UnsafeMutableRawPointer { - FfiConverterTypeNfcConst.lower(value) + return FfiConverterTypeNfcConst.lower(value) } -public protocol NodeSelectorProtocol: AnyObject { - /** - * Check the node url and set it as selected node if it is valid - */ - func checkAndSaveNode(node: Node) async throws - func checkSelectedNode(node: Node) async throws - func nodeList() -> [NodeSelection] +public protocol NodeSelectorProtocol : AnyObject { + + /** + * Check the node url and set it as selected node if it is valid + */ + func checkAndSaveNode(node: Node) async throws + + func checkSelectedNode(node: Node) async throws + + func nodeList() -> [NodeSelection] + /** * Use the url and name of the custom node to set it as the selected node */ - func parseCustomNode(url: String, name: String, enteredName: String) throws -> Node - - func selectPresetNode(name: String) throws -> Node - - func selectedNode() -> NodeSelection + func parseCustomNode(url: String, name: String, enteredName: String) throws -> Node + + func selectPresetNode(name: String) throws -> Node + + func selectedNode() -> NodeSelection + } open class NodeSelector: - NodeSelectorProtocol -{ + NodeSelectorProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5576,7 +6135,7 @@ open class NodeSelector: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5585,42 +6144,45 @@ open class NodeSelector: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_nodeselector(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_nodeselector_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_nodeselector(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_nodeselector_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_nodeselector(pointer, $0) } } + + + /** * Check the node url and set it as selected node if it is valid */ - open func checkAndSaveNode(node: Node) async throws { - try await uniffiRustCallAsync( +open func checkAndSaveNode(node: Node)async throws { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_nodeselector_check_and_save_node( self.uniffiClonePointer(), @@ -5633,10 +6195,11 @@ open class NodeSelector: liftFunc: { $0 }, errorHandler: FfiConverterTypeNodeSelectorError.lift ) - } - - open func checkSelectedNode(node: Node) async throws { - try await uniffiRustCallAsync( +} + +open func checkSelectedNode(node: Node)async throws { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_nodeselector_check_selected_node( self.uniffiClonePointer(), @@ -5649,53 +6212,60 @@ open class NodeSelector: liftFunc: { $0 }, errorHandler: FfiConverterTypeNodeSelectorError.lift ) - } - - open func nodeList() -> [NodeSelection] { - try! FfiConverterSequenceTypeNodeSelection.lift(try! rustCall { - uniffi_cove_fn_method_nodeselector_node_list(self.uniffiClonePointer(), $0) - }) - } - +} + +open func nodeList() -> [NodeSelection] { + return try! FfiConverterSequenceTypeNodeSelection.lift(try! rustCall() { + uniffi_cove_fn_method_nodeselector_node_list(self.uniffiClonePointer(),$0 + ) +}) +} + /** * Use the url and name of the custom node to set it as the selected node */ - open func parseCustomNode(url: String, name: String, enteredName: String) throws -> Node { - try FfiConverterTypeNode.lift(rustCallWithError(FfiConverterTypeNodeSelectorError.lift) { - uniffi_cove_fn_method_nodeselector_parse_custom_node(self.uniffiClonePointer(), - FfiConverterString.lower(url), - FfiConverterString.lower(name), - FfiConverterString.lower(enteredName), $0) - }) - } - - open func selectPresetNode(name: String) throws -> Node { - try FfiConverterTypeNode.lift(rustCallWithError(FfiConverterTypeNodeSelectorError.lift) { - uniffi_cove_fn_method_nodeselector_select_preset_node(self.uniffiClonePointer(), - FfiConverterString.lower(name), $0) - }) - } +open func parseCustomNode(url: String, name: String, enteredName: String)throws -> Node { + return try FfiConverterTypeNode.lift(try rustCallWithError(FfiConverterTypeNodeSelectorError.lift) { + uniffi_cove_fn_method_nodeselector_parse_custom_node(self.uniffiClonePointer(), + FfiConverterString.lower(url), + FfiConverterString.lower(name), + FfiConverterString.lower(enteredName),$0 + ) +}) +} + +open func selectPresetNode(name: String)throws -> Node { + return try FfiConverterTypeNode.lift(try rustCallWithError(FfiConverterTypeNodeSelectorError.lift) { + uniffi_cove_fn_method_nodeselector_select_preset_node(self.uniffiClonePointer(), + FfiConverterString.lower(name),$0 + ) +}) +} + +open func selectedNode() -> NodeSelection { + return try! FfiConverterTypeNodeSelection.lift(try! rustCall() { + uniffi_cove_fn_method_nodeselector_selected_node(self.uniffiClonePointer(),$0 + ) +}) +} + - open func selectedNode() -> NodeSelection { - try! FfiConverterTypeNodeSelection.lift(try! rustCall { - uniffi_cove_fn_method_nodeselector_selected_node(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNodeSelector: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = NodeSelector public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> NodeSelector { - NodeSelector(unsafeFromRawPointer: pointer) + return NodeSelector(unsafeFromRawPointer: pointer) } public static func lower(_ value: NodeSelector) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NodeSelector { @@ -5703,7 +6273,7 @@ public struct FfiConverterTypeNodeSelector: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -5716,31 +6286,38 @@ public struct FfiConverterTypeNodeSelector: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNodeSelector_lift(_ pointer: UnsafeMutableRawPointer) throws -> NodeSelector { - try FfiConverterTypeNodeSelector.lift(pointer) + return try FfiConverterTypeNodeSelector.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNodeSelector_lower(_ value: NodeSelector) -> UnsafeMutableRawPointer { - FfiConverterTypeNodeSelector.lower(value) + return FfiConverterTypeNodeSelector.lower(value) } -public protocol OutPointProtocol: AnyObject {} + + + +public protocol OutPointProtocol : AnyObject { + +} open class OutPoint: - OutPointProtocol -{ + OutPointProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5748,7 +6325,7 @@ open class OutPoint: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5757,44 +6334,49 @@ open class OutPoint: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_outpoint(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_outpoint(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_outpoint(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeOutPoint: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = OutPoint public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> OutPoint { - OutPoint(unsafeFromRawPointer: pointer) + return OutPoint(unsafeFromRawPointer: pointer) } public static func lower(_ value: OutPoint) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OutPoint { @@ -5802,7 +6384,7 @@ public struct FfiConverterTypeOutPoint: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -5815,31 +6397,38 @@ public struct FfiConverterTypeOutPoint: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeOutPoint_lift(_ pointer: UnsafeMutableRawPointer) throws -> OutPoint { - try FfiConverterTypeOutPoint.lift(pointer) + return try FfiConverterTypeOutPoint.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeOutPoint_lower(_ value: OutPoint) -> UnsafeMutableRawPointer { - FfiConverterTypeOutPoint.lower(value) + return FfiConverterTypeOutPoint.lower(value) } -public protocol PendingWalletProtocol: AnyObject {} + + + +public protocol PendingWalletProtocol : AnyObject { + +} open class PendingWallet: - PendingWalletProtocol -{ + PendingWalletProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5847,7 +6436,7 @@ open class PendingWallet: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5856,44 +6445,49 @@ open class PendingWallet: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_pendingwallet(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_pendingwallet(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_pendingwallet(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePendingWallet: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = PendingWallet public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> PendingWallet { - PendingWallet(unsafeFromRawPointer: pointer) + return PendingWallet(unsafeFromRawPointer: pointer) } public static func lower(_ value: PendingWallet) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PendingWallet { @@ -5901,7 +6495,7 @@ public struct FfiConverterTypePendingWallet: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -5914,46 +6508,53 @@ public struct FfiConverterTypePendingWallet: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWallet_lift(_ pointer: UnsafeMutableRawPointer) throws -> PendingWallet { - try FfiConverterTypePendingWallet.lift(pointer) + return try FfiConverterTypePendingWallet.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWallet_lower(_ value: PendingWallet) -> UnsafeMutableRawPointer { - FfiConverterTypePendingWallet.lower(value) + return FfiConverterTypePendingWallet.lower(value) } -public protocol PsbtProtocol: AnyObject { + + + +public protocol PsbtProtocol : AnyObject { + /** * Total fee in sats. */ - func fee() throws -> Amount - + func fee() throws -> Amount + /** * Get the transaction id of the unsigned transaction */ - func txId() -> TxId - + func txId() -> TxId + /** * The virtual size of the transaction. */ - func weight() -> UInt64 + func weight() -> UInt64 + } open class Psbt: - PsbtProtocol -{ + PsbtProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -5961,7 +6562,7 @@ open class Psbt: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -5970,79 +6571,87 @@ open class Psbt: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_psbt(self.pointer, $0) } - } - - public convenience init(data: Data) throws { - let pointer = - try rustCallWithError(FfiConverterTypePsbtError.lift) { - uniffi_cove_fn_constructor_psbt_new( - FfiConverterData.lower(data), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_psbt(self.pointer, $0) } } +public convenience init(data: Data)throws { + let pointer = + try rustCallWithError(FfiConverterTypePsbtError.lift) { + uniffi_cove_fn_constructor_psbt_new( + FfiConverterData.lower(data),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_psbt(pointer, $0) } } + + + /** * Total fee in sats. */ - open func fee() throws -> Amount { - try FfiConverterTypeAmount.lift(rustCallWithError(FfiConverterTypePsbtError.lift) { - uniffi_cove_fn_method_psbt_fee(self.uniffiClonePointer(), $0) - }) - } - +open func fee()throws -> Amount { + return try FfiConverterTypeAmount.lift(try rustCallWithError(FfiConverterTypePsbtError.lift) { + uniffi_cove_fn_method_psbt_fee(self.uniffiClonePointer(),$0 + ) +}) +} + /** * Get the transaction id of the unsigned transaction */ - open func txId() -> TxId { - try! FfiConverterTypeTxId.lift(try! rustCall { - uniffi_cove_fn_method_psbt_tx_id(self.uniffiClonePointer(), $0) - }) - } - +open func txId() -> TxId { + return try! FfiConverterTypeTxId.lift(try! rustCall() { + uniffi_cove_fn_method_psbt_tx_id(self.uniffiClonePointer(),$0 + ) +}) +} + /** * The virtual size of the transaction. */ - open func weight() -> UInt64 { - try! FfiConverterUInt64.lift(try! rustCall { - uniffi_cove_fn_method_psbt_weight(self.uniffiClonePointer(), $0) - }) - } +open func weight() -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffi_cove_fn_method_psbt_weight(self.uniffiClonePointer(),$0 + ) +}) +} + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePsbt: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Psbt public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Psbt { - Psbt(unsafeFromRawPointer: pointer) + return Psbt(unsafeFromRawPointer: pointer) } public static func lower(_ value: Psbt) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Psbt { @@ -6050,7 +6659,7 @@ public struct FfiConverterTypePsbt: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -6063,59 +6672,66 @@ public struct FfiConverterTypePsbt: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePsbt_lift(_ pointer: UnsafeMutableRawPointer) throws -> Psbt { - try FfiConverterTypePsbt.lift(pointer) + return try FfiConverterTypePsbt.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePsbt_lower(_ value: Psbt) -> UnsafeMutableRawPointer { - FfiConverterTypePsbt.lower(value) -} - -public protocol RouteFactoryProtocol: AnyObject { - func coldWalletImport(route: ColdWalletRoute) -> Route - - func hotWallet(route: HotWalletRoute) -> Route - - func hotWalletImportFromScan() -> Route - - func isSameParentRoute(route: Route, routeToCheck: Route) -> Bool - - func loadAndResetTo(resetTo: Route) -> Route - - func loadAndResetToAfter(resetTo: Route, time: UInt32) -> Route - - func newHotWallet() -> Route - - func newWalletSelect() -> Route - - func qrImport() -> Route - - func secretWords(walletId: WalletId) -> Route - - func send(send: SendRoute) -> Route - - func sendConfirm(id: WalletId, details: ConfirmDetails) -> Route - - func sendHardwareExport(id: WalletId, details: ConfirmDetails) -> Route - - func sendSetAmount(id: WalletId, address: Address?, amount: Amount?) -> Route + return FfiConverterTypePsbt.lower(value) +} + + + + +public protocol RouteFactoryProtocol : AnyObject { + + func coldWalletImport(route: ColdWalletRoute) -> Route + + func hotWallet(route: HotWalletRoute) -> Route + + func hotWalletImportFromScan() -> Route + + func isSameParentRoute(route: Route, routeToCheck: Route) -> Bool + + func loadAndResetTo(resetTo: Route) -> Route + + func loadAndResetToAfter(resetTo: Route, time: UInt32) -> Route + + func newHotWallet() -> Route + + func newWalletSelect() -> Route + + func qrImport() -> Route + + func secretWords(walletId: WalletId) -> Route + + func send(send: SendRoute) -> Route + + func sendConfirm(id: WalletId, details: ConfirmDetails) -> Route + + func sendHardwareExport(id: WalletId, details: ConfirmDetails) -> Route + + func sendSetAmount(id: WalletId, address: Address?, amount: Amount?) -> Route + } open class RouteFactory: - RouteFactoryProtocol -{ + RouteFactoryProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -6123,7 +6739,7 @@ open class RouteFactory: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -6132,151 +6748,170 @@ open class RouteFactory: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_routefactory(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_routefactory_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_routefactory(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_routefactory_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_routefactory(pointer, $0) } } - open func coldWalletImport(route: ColdWalletRoute) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_cold_wallet_import(self.uniffiClonePointer(), - FfiConverterTypeColdWalletRoute.lower(route), $0) - }) - } - - open func hotWallet(route: HotWalletRoute) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_hot_wallet(self.uniffiClonePointer(), - FfiConverterTypeHotWalletRoute.lower(route), $0) - }) - } - - open func hotWalletImportFromScan() -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_hot_wallet_import_from_scan(self.uniffiClonePointer(), $0) - }) - } - - open func isSameParentRoute(route: Route, routeToCheck: Route) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_is_same_parent_route(self.uniffiClonePointer(), - FfiConverterTypeRoute.lower(route), - FfiConverterTypeRoute.lower(routeToCheck), $0) - }) - } - - open func loadAndResetTo(resetTo: Route) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_load_and_reset_to(self.uniffiClonePointer(), - FfiConverterTypeRoute.lower(resetTo), $0) - }) - } - - open func loadAndResetToAfter(resetTo: Route, time: UInt32) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_load_and_reset_to_after(self.uniffiClonePointer(), - FfiConverterTypeRoute.lower(resetTo), - FfiConverterUInt32.lower(time), $0) - }) - } - - open func newHotWallet() -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_new_hot_wallet(self.uniffiClonePointer(), $0) - }) - } - - open func newWalletSelect() -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_new_wallet_select(self.uniffiClonePointer(), $0) - }) - } - - open func qrImport() -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_qr_import(self.uniffiClonePointer(), $0) - }) - } - - open func secretWords(walletId: WalletId) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_secret_words(self.uniffiClonePointer(), - FfiConverterTypeWalletId.lower(walletId), $0) - }) - } - - open func send(send: SendRoute) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_send(self.uniffiClonePointer(), - FfiConverterTypeSendRoute.lower(send), $0) - }) - } - - open func sendConfirm(id: WalletId, details: ConfirmDetails) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_send_confirm(self.uniffiClonePointer(), - FfiConverterTypeWalletId.lower(id), - FfiConverterTypeConfirmDetails.lower(details), $0) - }) - } + - open func sendHardwareExport(id: WalletId, details: ConfirmDetails) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_send_hardware_export(self.uniffiClonePointer(), - FfiConverterTypeWalletId.lower(id), - FfiConverterTypeConfirmDetails.lower(details), $0) - }) - } + +open func coldWalletImport(route: ColdWalletRoute) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_cold_wallet_import(self.uniffiClonePointer(), + FfiConverterTypeColdWalletRoute.lower(route),$0 + ) +}) +} + +open func hotWallet(route: HotWalletRoute) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_hot_wallet(self.uniffiClonePointer(), + FfiConverterTypeHotWalletRoute.lower(route),$0 + ) +}) +} + +open func hotWalletImportFromScan() -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_hot_wallet_import_from_scan(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isSameParentRoute(route: Route, routeToCheck: Route) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_is_same_parent_route(self.uniffiClonePointer(), + FfiConverterTypeRoute.lower(route), + FfiConverterTypeRoute.lower(routeToCheck),$0 + ) +}) +} + +open func loadAndResetTo(resetTo: Route) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_load_and_reset_to(self.uniffiClonePointer(), + FfiConverterTypeRoute.lower(resetTo),$0 + ) +}) +} + +open func loadAndResetToAfter(resetTo: Route, time: UInt32) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_load_and_reset_to_after(self.uniffiClonePointer(), + FfiConverterTypeRoute.lower(resetTo), + FfiConverterUInt32.lower(time),$0 + ) +}) +} + +open func newHotWallet() -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_new_hot_wallet(self.uniffiClonePointer(),$0 + ) +}) +} + +open func newWalletSelect() -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_new_wallet_select(self.uniffiClonePointer(),$0 + ) +}) +} + +open func qrImport() -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_qr_import(self.uniffiClonePointer(),$0 + ) +}) +} + +open func secretWords(walletId: WalletId) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_secret_words(self.uniffiClonePointer(), + FfiConverterTypeWalletId.lower(walletId),$0 + ) +}) +} + +open func send(send: SendRoute) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_send(self.uniffiClonePointer(), + FfiConverterTypeSendRoute.lower(send),$0 + ) +}) +} + +open func sendConfirm(id: WalletId, details: ConfirmDetails) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_send_confirm(self.uniffiClonePointer(), + FfiConverterTypeWalletId.lower(id), + FfiConverterTypeConfirmDetails.lower(details),$0 + ) +}) +} + +open func sendHardwareExport(id: WalletId, details: ConfirmDetails) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_send_hardware_export(self.uniffiClonePointer(), + FfiConverterTypeWalletId.lower(id), + FfiConverterTypeConfirmDetails.lower(details),$0 + ) +}) +} + +open func sendSetAmount(id: WalletId, address: Address? = nil, amount: Amount? = nil) -> Route { + return try! FfiConverterTypeRoute.lift(try! rustCall() { + uniffi_cove_fn_method_routefactory_send_set_amount(self.uniffiClonePointer(), + FfiConverterTypeWalletId.lower(id), + FfiConverterOptionTypeAddress.lower(address), + FfiConverterOptionTypeAmount.lower(amount),$0 + ) +}) +} + - open func sendSetAmount(id: WalletId, address: Address? = nil, amount: Amount? = nil) -> Route { - try! FfiConverterTypeRoute.lift(try! rustCall { - uniffi_cove_fn_method_routefactory_send_set_amount(self.uniffiClonePointer(), - FfiConverterTypeWalletId.lower(id), - FfiConverterOptionTypeAddress.lower(address), - FfiConverterOptionTypeAmount.lower(amount), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeRouteFactory: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = RouteFactory public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> RouteFactory { - RouteFactory(unsafeFromRawPointer: pointer) + return RouteFactory(unsafeFromRawPointer: pointer) } public static func lower(_ value: RouteFactory) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RouteFactory { @@ -6284,7 +6919,7 @@ public struct FfiConverterTypeRouteFactory: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -6297,43 +6932,50 @@ public struct FfiConverterTypeRouteFactory: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRouteFactory_lift(_ pointer: UnsafeMutableRawPointer) throws -> RouteFactory { - try FfiConverterTypeRouteFactory.lift(pointer) + return try FfiConverterTypeRouteFactory.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRouteFactory_lower(_ value: RouteFactory) -> UnsafeMutableRawPointer { - FfiConverterTypeRouteFactory.lower(value) + return FfiConverterTypeRouteFactory.lower(value) } -public protocol RustImportWalletViewModelProtocol: AnyObject { + + + +public protocol RustImportWalletViewModelProtocol : AnyObject { + /** * Action from the frontend to change the state of the view model */ - func dispatch(action: ImportWalletViewModelAction) - + func dispatch(action: ImportWalletViewModelAction) + /** * Import wallet view from entered words */ - func importWallet(enteredWords: [[String]]) throws -> WalletMetadata - - func listenForUpdates(reconciler: ImportWalletViewModelReconciler) + func importWallet(enteredWords: [[String]]) throws -> WalletMetadata + + func listenForUpdates(reconciler: ImportWalletViewModelReconciler) + } open class RustImportWalletViewModel: - RustImportWalletViewModelProtocol -{ + RustImportWalletViewModelProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -6341,7 +6983,7 @@ open class RustImportWalletViewModel: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -6350,76 +6992,84 @@ open class RustImportWalletViewModel: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_rustimportwalletviewmodel(self.pointer, $0) } - } - - public convenience init() { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_rustimportwalletviewmodel_new($0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_rustimportwalletviewmodel(self.pointer, $0) } } +public convenience init() { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_rustimportwalletviewmodel_new($0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_rustimportwalletviewmodel(pointer, $0) } } + + + /** * Action from the frontend to change the state of the view model */ - open func dispatch(action: ImportWalletViewModelAction) { try! rustCall { - uniffi_cove_fn_method_rustimportwalletviewmodel_dispatch(self.uniffiClonePointer(), - FfiConverterTypeImportWalletViewModelAction.lower(action), $0) - } - } - +open func dispatch(action: ImportWalletViewModelAction) {try! rustCall() { + uniffi_cove_fn_method_rustimportwalletviewmodel_dispatch(self.uniffiClonePointer(), + FfiConverterTypeImportWalletViewModelAction.lower(action),$0 + ) +} +} + /** * Import wallet view from entered words */ - open func importWallet(enteredWords: [[String]]) throws -> WalletMetadata { - try FfiConverterTypeWalletMetadata.lift(rustCallWithError(FfiConverterTypeImportWalletError.lift) { - uniffi_cove_fn_method_rustimportwalletviewmodel_import_wallet(self.uniffiClonePointer(), - FfiConverterSequenceSequenceString.lower(enteredWords), $0) - }) - } +open func importWallet(enteredWords: [[String]])throws -> WalletMetadata { + return try FfiConverterTypeWalletMetadata.lift(try rustCallWithError(FfiConverterTypeImportWalletError.lift) { + uniffi_cove_fn_method_rustimportwalletviewmodel_import_wallet(self.uniffiClonePointer(), + FfiConverterSequenceSequenceString.lower(enteredWords),$0 + ) +}) +} + +open func listenForUpdates(reconciler: ImportWalletViewModelReconciler) {try! rustCall() { + uniffi_cove_fn_method_rustimportwalletviewmodel_listen_for_updates(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceImportWalletViewModelReconciler.lower(reconciler),$0 + ) +} +} + - open func listenForUpdates(reconciler: ImportWalletViewModelReconciler) { try! rustCall { - uniffi_cove_fn_method_rustimportwalletviewmodel_listen_for_updates(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceImportWalletViewModelReconciler.lower(reconciler), $0) - } - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeRustImportWalletViewModel: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = RustImportWalletViewModel public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> RustImportWalletViewModel { - RustImportWalletViewModel(unsafeFromRawPointer: pointer) + return RustImportWalletViewModel(unsafeFromRawPointer: pointer) } public static func lower(_ value: RustImportWalletViewModel) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RustImportWalletViewModel { @@ -6427,7 +7077,7 @@ public struct FfiConverterTypeRustImportWalletViewModel: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -6440,50 +7090,57 @@ public struct FfiConverterTypeRustImportWalletViewModel: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRustImportWalletViewModel_lift(_ pointer: UnsafeMutableRawPointer) throws -> RustImportWalletViewModel { - try FfiConverterTypeRustImportWalletViewModel.lift(pointer) + return try FfiConverterTypeRustImportWalletViewModel.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRustImportWalletViewModel_lower(_ value: RustImportWalletViewModel) -> UnsafeMutableRawPointer { - FfiConverterTypeRustImportWalletViewModel.lower(value) + return FfiConverterTypeRustImportWalletViewModel.lower(value) } -public protocol RustPendingWalletViewModelProtocol: AnyObject { - func bip39Words() -> [String] - func bip39WordsGrouped() -> [[GroupedWord]] - func cardIndexes() -> UInt8 +public protocol RustPendingWalletViewModelProtocol : AnyObject { + + func bip39Words() -> [String] + + func bip39WordsGrouped() -> [[GroupedWord]] + + func cardIndexes() -> UInt8 + /** * Action from the frontend to change the state of the view model */ - func dispatch(action: PendingWalletViewModelAction) - - func getState() -> PendingWalletViewModelState - - func listenForUpdates(reconciler: PendingWalletViewModelReconciler) - - func numberOfWordsCount() -> UInt8 - - func saveWallet() throws -> WalletMetadata + func dispatch(action: PendingWalletViewModelAction) + + func getState() -> PendingWalletViewModelState + + func listenForUpdates(reconciler: PendingWalletViewModelReconciler) + + func numberOfWordsCount() -> UInt8 + + func saveWallet() throws -> WalletMetadata + } open class RustPendingWalletViewModel: - RustPendingWalletViewModelProtocol -{ + RustPendingWalletViewModelProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -6491,7 +7148,7 @@ open class RustPendingWalletViewModel: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -6500,103 +7157,116 @@ open class RustPendingWalletViewModel: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_rustpendingwalletviewmodel(self.pointer, $0) } - } - - public convenience init(numberOfWords: NumberOfBip39Words) { - let pointer = - try! rustCall { - uniffi_cove_fn_constructor_rustpendingwalletviewmodel_new( - FfiConverterTypeNumberOfBip39Words.lower(numberOfWords), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_rustpendingwalletviewmodel(self.pointer, $0) } } +public convenience init(numberOfWords: NumberOfBip39Words) { + let pointer = + try! rustCall() { + uniffi_cove_fn_constructor_rustpendingwalletviewmodel_new( + FfiConverterTypeNumberOfBip39Words.lower(numberOfWords),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_rustpendingwalletviewmodel(pointer, $0) } } - open func bip39Words() -> [String] { - try! FfiConverterSequenceString.lift(try! rustCall { - uniffi_cove_fn_method_rustpendingwalletviewmodel_bip_39_words(self.uniffiClonePointer(), $0) - }) - } - - open func bip39WordsGrouped() -> [[GroupedWord]] { - try! FfiConverterSequenceSequenceTypeGroupedWord.lift(try! rustCall { - uniffi_cove_fn_method_rustpendingwalletviewmodel_bip_39_words_grouped(self.uniffiClonePointer(), $0) - }) - } - - open func cardIndexes() -> UInt8 { - try! FfiConverterUInt8.lift(try! rustCall { - uniffi_cove_fn_method_rustpendingwalletviewmodel_card_indexes(self.uniffiClonePointer(), $0) - }) - } + + +open func bip39Words() -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_cove_fn_method_rustpendingwalletviewmodel_bip_39_words(self.uniffiClonePointer(),$0 + ) +}) +} + +open func bip39WordsGrouped() -> [[GroupedWord]] { + return try! FfiConverterSequenceSequenceTypeGroupedWord.lift(try! rustCall() { + uniffi_cove_fn_method_rustpendingwalletviewmodel_bip_39_words_grouped(self.uniffiClonePointer(),$0 + ) +}) +} + +open func cardIndexes() -> UInt8 { + return try! FfiConverterUInt8.lift(try! rustCall() { + uniffi_cove_fn_method_rustpendingwalletviewmodel_card_indexes(self.uniffiClonePointer(),$0 + ) +}) +} + /** * Action from the frontend to change the state of the view model */ - open func dispatch(action: PendingWalletViewModelAction) { try! rustCall { - uniffi_cove_fn_method_rustpendingwalletviewmodel_dispatch(self.uniffiClonePointer(), - FfiConverterTypePendingWalletViewModelAction.lower(action), $0) - } - } - - open func getState() -> PendingWalletViewModelState { - try! FfiConverterTypePendingWalletViewModelState.lift(try! rustCall { - uniffi_cove_fn_method_rustpendingwalletviewmodel_get_state(self.uniffiClonePointer(), $0) - }) - } - - open func listenForUpdates(reconciler: PendingWalletViewModelReconciler) { try! rustCall { - uniffi_cove_fn_method_rustpendingwalletviewmodel_listen_for_updates(self.uniffiClonePointer(), - FfiConverterCallbackInterfacePendingWalletViewModelReconciler.lower(reconciler), $0) - } - } - - open func numberOfWordsCount() -> UInt8 { - try! FfiConverterUInt8.lift(try! rustCall { - uniffi_cove_fn_method_rustpendingwalletviewmodel_number_of_words_count(self.uniffiClonePointer(), $0) - }) - } +open func dispatch(action: PendingWalletViewModelAction) {try! rustCall() { + uniffi_cove_fn_method_rustpendingwalletviewmodel_dispatch(self.uniffiClonePointer(), + FfiConverterTypePendingWalletViewModelAction.lower(action),$0 + ) +} +} + +open func getState() -> PendingWalletViewModelState { + return try! FfiConverterTypePendingWalletViewModelState.lift(try! rustCall() { + uniffi_cove_fn_method_rustpendingwalletviewmodel_get_state(self.uniffiClonePointer(),$0 + ) +}) +} + +open func listenForUpdates(reconciler: PendingWalletViewModelReconciler) {try! rustCall() { + uniffi_cove_fn_method_rustpendingwalletviewmodel_listen_for_updates(self.uniffiClonePointer(), + FfiConverterCallbackInterfacePendingWalletViewModelReconciler.lower(reconciler),$0 + ) +} +} + +open func numberOfWordsCount() -> UInt8 { + return try! FfiConverterUInt8.lift(try! rustCall() { + uniffi_cove_fn_method_rustpendingwalletviewmodel_number_of_words_count(self.uniffiClonePointer(),$0 + ) +}) +} + +open func saveWallet()throws -> WalletMetadata { + return try FfiConverterTypeWalletMetadata.lift(try rustCallWithError(FfiConverterTypePendingWalletViewModelError.lift) { + uniffi_cove_fn_method_rustpendingwalletviewmodel_save_wallet(self.uniffiClonePointer(),$0 + ) +}) +} + - open func saveWallet() throws -> WalletMetadata { - try FfiConverterTypeWalletMetadata.lift(rustCallWithError(FfiConverterTypePendingWalletViewModelError.lift) { - uniffi_cove_fn_method_rustpendingwalletviewmodel_save_wallet(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeRustPendingWalletViewModel: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = RustPendingWalletViewModel public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> RustPendingWalletViewModel { - RustPendingWalletViewModel(unsafeFromRawPointer: pointer) + return RustPendingWalletViewModel(unsafeFromRawPointer: pointer) } public static func lower(_ value: RustPendingWalletViewModel) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RustPendingWalletViewModel { @@ -6604,7 +7274,7 @@ public struct FfiConverterTypeRustPendingWalletViewModel: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -6617,112 +7287,119 @@ public struct FfiConverterTypeRustPendingWalletViewModel: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRustPendingWalletViewModel_lift(_ pointer: UnsafeMutableRawPointer) throws -> RustPendingWalletViewModel { - try FfiConverterTypeRustPendingWalletViewModel.lift(pointer) + return try FfiConverterTypeRustPendingWalletViewModel.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRustPendingWalletViewModel_lower(_ value: RustPendingWalletViewModel) -> UnsafeMutableRawPointer { - FfiConverterTypeRustPendingWalletViewModel.lower(value) + return FfiConverterTypeRustPendingWalletViewModel.lower(value) } -public protocol RustWalletViewModelProtocol: AnyObject { - /** - * Get address at the given index - */ - func addressAt(index: UInt32) async throws -> AddressInfo - - func amountInFiat(amount: Amount, currency: FiatCurrency) async throws -> Double - - func balance() async -> Balance - - func balanceInFiat() async throws -> Double - - func buildTransaction(amount: Amount, address: Address) async throws -> Psbt - - func buildTransactionWithFeeRate(amount: Amount, address: Address, feeRate: FeeRate) async throws -> Psbt - - func currentBlockHeight() async throws -> UInt32 - func deleteUnsignedTransaction(txId: TxId) throws - func deleteWallet() throws +public protocol RustWalletViewModelProtocol : AnyObject { + + /** + * Get address at the given index + */ + func addressAt(index: UInt32) async throws -> AddressInfo + + func amountInFiat(amount: Amount, currency: FiatCurrency) async throws -> Double + + func balance() async -> Balance + + func balanceInFiat() async throws -> Double + + func buildTransaction(amount: Amount, address: Address) async throws -> Psbt + + func buildTransactionWithFeeRate(amount: Amount, address: Address, feeRate: FeeRate) async throws -> Psbt + + func currentBlockHeight() async throws -> UInt32 + + func deleteUnsignedTransaction(txId: TxId) throws + + func deleteWallet() throws + /** * Action from the frontend to change the state of the view model */ - func dispatch(action: WalletViewModelAction) - - func displayAmount(amount: Amount) -> String - - func displayFiatAmount(amount: Double) -> String - - func displaySentAndReceivedAmount(sentAndReceived: SentAndReceived) -> String - - func feeRateOptions() async throws -> FeeRateOptions - - func feeRateOptionsWithTotalFee(feeRateOptions: FeeRateOptions?, amount: Amount, address: Address) async throws -> FeeRateOptionsWithTotalFee - - func fees() -> FeeResponse? - - func fingerprint() -> String - - func forceUpdateHeight() async throws -> UInt32 - - func forceWalletScan() async throws - - func getConfirmDetails(amount: Amount, address: Address, feeRate: FeeRate) async throws -> ConfirmDetails - - func getFeeOptions() async throws -> FeeRateOptions - - func getMaxSendAmount(fee: FeeRateOptionWithTotalFee) async throws -> Amount - - func getUnsignedTransactions() throws -> [UnsignedTransaction] - - func listenForUpdates(reconciler: WalletViewModelReconciler) - - func markWalletAsVerified() throws - + func dispatch(action: WalletViewModelAction) + + func displayAmount(amount: Amount) -> String + + func displayFiatAmount(amount: Double) -> String + + func displaySentAndReceivedAmount(sentAndReceived: SentAndReceived) -> String + + func feeRateOptions() async throws -> FeeRateOptions + + func feeRateOptionsWithTotalFee(feeRateOptions: FeeRateOptions?, amount: Amount, address: Address) async throws -> FeeRateOptionsWithTotalFee + + func fees() -> FeeResponse? + + func fingerprint() -> String + + func forceUpdateHeight() async throws -> UInt32 + + func forceWalletScan() async throws + + func getConfirmDetails(amount: Amount, address: Address, feeRate: FeeRate) async throws -> ConfirmDetails + + func getFeeOptions() async throws -> FeeRateOptions + + func getMaxSendAmount(fee: FeeRateOptionWithTotalFee) async throws -> Amount + + func getUnsignedTransactions() throws -> [UnsignedTransaction] + + func listenForUpdates(reconciler: WalletViewModelReconciler) + + func markWalletAsVerified() throws + /** * Get the next address for the wallet */ - func nextAddress() async throws -> AddressInfo - - func numberOfConfirmations(blockHeight: UInt32) async throws -> UInt32 - - func numberOfConfirmationsFmt(blockHeight: UInt32) async throws -> String - - func saveUnsignedTransaction(details: ConfirmDetails) throws - - func sentAndReceivedFiat(sentAndReceived: SentAndReceived) async throws -> Double - - func setWalletMetadata(metadata: WalletMetadata) - - func startWalletScan() async throws - - func switchToDifferentWalletAddressType(walletAddressType: WalletAddressType) async throws - - func transactionDetails(txId: TxId) async throws -> TransactionDetails - - func walletMetadata() -> WalletMetadata - - func wordValidator() throws -> WordValidator + func nextAddress() async throws -> AddressInfo + + func numberOfConfirmations(blockHeight: UInt32) async throws -> UInt32 + + func numberOfConfirmationsFmt(blockHeight: UInt32) async throws -> String + + func saveUnsignedTransaction(details: ConfirmDetails) throws + + func sentAndReceivedFiat(sentAndReceived: SentAndReceived) async throws -> Double + + func setWalletMetadata(metadata: WalletMetadata) + + func startWalletScan() async throws + + func switchToDifferentWalletAddressType(walletAddressType: WalletAddressType) async throws + + func transactionDetails(txId: TxId) async throws -> TransactionDetails + + func walletMetadata() -> WalletMetadata + + func wordValidator() throws -> WordValidator + } open class RustWalletViewModel: - RustWalletViewModelProtocol -{ + RustWalletViewModelProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -6730,7 +7407,7 @@ open class RustWalletViewModel: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -6739,58 +7416,61 @@ open class RustWalletViewModel: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_rustwalletviewmodel(self.pointer, $0) } - } - - public convenience init(id: WalletId) throws { - let pointer = - try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_constructor_rustwalletviewmodel_new( - FfiConverterTypeWalletId.lower(id), $0 - ) - } - self.init(unsafeFromRawPointer: pointer) + return try! rustCall { uniffi_cove_fn_clone_rustwalletviewmodel(self.pointer, $0) } } +public convenience init(id: WalletId)throws { + let pointer = + try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_constructor_rustwalletviewmodel_new( + FfiConverterTypeWalletId.lower(id),$0 + ) +} + self.init(unsafeFromRawPointer: pointer) +} deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_rustwalletviewmodel(pointer, $0) } } - public static func previewNewWallet() -> RustWalletViewModel { - try! FfiConverterTypeRustWalletViewModel.lift(try! rustCall { - uniffi_cove_fn_constructor_rustwalletviewmodel_preview_new_wallet($0 - ) - }) - } - - public static func tryNewFromXpub(xpub: String) throws -> RustWalletViewModel { - try FfiConverterTypeRustWalletViewModel.lift(rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_constructor_rustwalletviewmodel_try_new_from_xpub( - FfiConverterString.lower(xpub), $0 - ) - }) - } + +public static func previewNewWallet() -> RustWalletViewModel { + return try! FfiConverterTypeRustWalletViewModel.lift(try! rustCall() { + uniffi_cove_fn_constructor_rustwalletviewmodel_preview_new_wallet($0 + ) +}) +} + +public static func tryNewFromXpub(xpub: String)throws -> RustWalletViewModel { + return try FfiConverterTypeRustWalletViewModel.lift(try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_constructor_rustwalletviewmodel_try_new_from_xpub( + FfiConverterString.lower(xpub),$0 + ) +}) +} + + /** * Get address at the given index */ - open func addressAt(index: UInt32) async throws -> AddressInfo { - try await uniffiRustCallAsync( +open func addressAt(index: UInt32)async throws -> AddressInfo { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_address_at( self.uniffiClonePointer(), @@ -6803,14 +7483,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeAddressInfo.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func amountInFiat(amount: Amount, currency: FiatCurrency) async throws -> Double { - try await uniffiRustCallAsync( +} + +open func amountInFiat(amount: Amount, currency: FiatCurrency)async throws -> Double { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_amount_in_fiat( self.uniffiClonePointer(), - FfiConverterTypeAmount.lower(amount), FfiConverterTypeFiatCurrency.lower(currency) + FfiConverterTypeAmount.lower(amount),FfiConverterTypeFiatCurrency.lower(currency) ) }, pollFunc: ffi_cove_rust_future_poll_f64, @@ -6819,13 +7500,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterDouble.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func balance() async -> Balance { - try! await uniffiRustCallAsync( +} + +open func balance()async -> Balance { + return + try! await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_balance( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_rust_buffer, @@ -6833,14 +7516,17 @@ open class RustWalletViewModel: freeFunc: ffi_cove_rust_future_free_rust_buffer, liftFunc: FfiConverterTypeBalance.lift, errorHandler: nil + ) - } - - open func balanceInFiat() async throws -> Double { - try await uniffiRustCallAsync( +} + +open func balanceInFiat()async throws -> Double { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_balance_in_fiat( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_f64, @@ -6849,14 +7535,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterDouble.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func buildTransaction(amount: Amount, address: Address) async throws -> Psbt { - try await uniffiRustCallAsync( +} + +open func buildTransaction(amount: Amount, address: Address)async throws -> Psbt { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_build_transaction( self.uniffiClonePointer(), - FfiConverterTypeAmount.lower(amount), FfiConverterTypeAddress.lower(address) + FfiConverterTypeAmount.lower(amount),FfiConverterTypeAddress.lower(address) ) }, pollFunc: ffi_cove_rust_future_poll_pointer, @@ -6865,14 +7552,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypePsbt.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func buildTransactionWithFeeRate(amount: Amount, address: Address, feeRate: FeeRate) async throws -> Psbt { - try await uniffiRustCallAsync( +} + +open func buildTransactionWithFeeRate(amount: Amount, address: Address, feeRate: FeeRate)async throws -> Psbt { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_build_transaction_with_fee_rate( self.uniffiClonePointer(), - FfiConverterTypeAmount.lower(amount), FfiConverterTypeAddress.lower(address), FfiConverterTypeFeeRate.lower(feeRate) + FfiConverterTypeAmount.lower(amount),FfiConverterTypeAddress.lower(address),FfiConverterTypeFeeRate.lower(feeRate) ) }, pollFunc: ffi_cove_rust_future_poll_pointer, @@ -6881,13 +7569,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypePsbt.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func currentBlockHeight() async throws -> UInt32 { - try await uniffiRustCallAsync( +} + +open func currentBlockHeight()async throws -> UInt32 { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_current_block_height( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_u32, @@ -6896,54 +7586,62 @@ open class RustWalletViewModel: liftFunc: FfiConverterUInt32.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func deleteUnsignedTransaction(txId: TxId) throws { try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_method_rustwalletviewmodel_delete_unsigned_transaction(self.uniffiClonePointer(), - FfiConverterTypeTxId.lower(txId), $0) - } - } - - open func deleteWallet() throws { try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_method_rustwalletviewmodel_delete_wallet(self.uniffiClonePointer(), $0) - } - } - +} + +open func deleteUnsignedTransaction(txId: TxId)throws {try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_method_rustwalletviewmodel_delete_unsigned_transaction(self.uniffiClonePointer(), + FfiConverterTypeTxId.lower(txId),$0 + ) +} +} + +open func deleteWallet()throws {try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_method_rustwalletviewmodel_delete_wallet(self.uniffiClonePointer(),$0 + ) +} +} + /** * Action from the frontend to change the state of the view model */ - open func dispatch(action: WalletViewModelAction) { try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_dispatch(self.uniffiClonePointer(), - FfiConverterTypeWalletViewModelAction.lower(action), $0) - } - } - - open func displayAmount(amount: Amount) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_display_amount(self.uniffiClonePointer(), - FfiConverterTypeAmount.lower(amount), $0) - }) - } - - open func displayFiatAmount(amount: Double) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_display_fiat_amount(self.uniffiClonePointer(), - FfiConverterDouble.lower(amount), $0) - }) - } - - open func displaySentAndReceivedAmount(sentAndReceived: SentAndReceived) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_display_sent_and_received_amount(self.uniffiClonePointer(), - FfiConverterTypeSentAndReceived.lower(sentAndReceived), $0) - }) - } - - open func feeRateOptions() async throws -> FeeRateOptions { - try await uniffiRustCallAsync( +open func dispatch(action: WalletViewModelAction) {try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_dispatch(self.uniffiClonePointer(), + FfiConverterTypeWalletViewModelAction.lower(action),$0 + ) +} +} + +open func displayAmount(amount: Amount) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_display_amount(self.uniffiClonePointer(), + FfiConverterTypeAmount.lower(amount),$0 + ) +}) +} + +open func displayFiatAmount(amount: Double) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_display_fiat_amount(self.uniffiClonePointer(), + FfiConverterDouble.lower(amount),$0 + ) +}) +} + +open func displaySentAndReceivedAmount(sentAndReceived: SentAndReceived) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_display_sent_and_received_amount(self.uniffiClonePointer(), + FfiConverterTypeSentAndReceived.lower(sentAndReceived),$0 + ) +}) +} + +open func feeRateOptions()async throws -> FeeRateOptions { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_fee_rate_options( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_pointer, @@ -6952,14 +7650,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeFeeRateOptions.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func feeRateOptionsWithTotalFee(feeRateOptions: FeeRateOptions?, amount: Amount, address: Address) async throws -> FeeRateOptionsWithTotalFee { - try await uniffiRustCallAsync( +} + +open func feeRateOptionsWithTotalFee(feeRateOptions: FeeRateOptions?, amount: Amount, address: Address)async throws -> FeeRateOptionsWithTotalFee { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_fee_rate_options_with_total_fee( self.uniffiClonePointer(), - FfiConverterOptionTypeFeeRateOptions.lower(feeRateOptions), FfiConverterTypeAmount.lower(amount), FfiConverterTypeAddress.lower(address) + FfiConverterOptionTypeFeeRateOptions.lower(feeRateOptions),FfiConverterTypeAmount.lower(amount),FfiConverterTypeAddress.lower(address) ) }, pollFunc: ffi_cove_rust_future_poll_pointer, @@ -6968,25 +7667,29 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeFeeRateOptionsWithTotalFee.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func fees() -> FeeResponse? { - try! FfiConverterOptionTypeFeeResponse.lift(try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_fees(self.uniffiClonePointer(), $0) - }) - } - - open func fingerprint() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_fingerprint(self.uniffiClonePointer(), $0) - }) - } - - open func forceUpdateHeight() async throws -> UInt32 { - try await uniffiRustCallAsync( +} + +open func fees() -> FeeResponse? { + return try! FfiConverterOptionTypeFeeResponse.lift(try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_fees(self.uniffiClonePointer(),$0 + ) +}) +} + +open func fingerprint() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_fingerprint(self.uniffiClonePointer(),$0 + ) +}) +} + +open func forceUpdateHeight()async throws -> UInt32 { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_force_update_height( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_u32, @@ -6995,13 +7698,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterUInt32.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func forceWalletScan() async throws { - try await uniffiRustCallAsync( +} + +open func forceWalletScan()async throws { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_force_wallet_scan( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_void, @@ -7010,14 +7715,15 @@ open class RustWalletViewModel: liftFunc: { $0 }, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func getConfirmDetails(amount: Amount, address: Address, feeRate: FeeRate) async throws -> ConfirmDetails { - try await uniffiRustCallAsync( +} + +open func getConfirmDetails(amount: Amount, address: Address, feeRate: FeeRate)async throws -> ConfirmDetails { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_get_confirm_details( self.uniffiClonePointer(), - FfiConverterTypeAmount.lower(amount), FfiConverterTypeAddress.lower(address), FfiConverterTypeFeeRate.lower(feeRate) + FfiConverterTypeAmount.lower(amount),FfiConverterTypeAddress.lower(address),FfiConverterTypeFeeRate.lower(feeRate) ) }, pollFunc: ffi_cove_rust_future_poll_pointer, @@ -7026,13 +7732,15 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeConfirmDetails.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func getFeeOptions() async throws -> FeeRateOptions { - try await uniffiRustCallAsync( +} + +open func getFeeOptions()async throws -> FeeRateOptions { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_get_fee_options( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_pointer, @@ -7041,10 +7749,11 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeFeeRateOptions.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func getMaxSendAmount(fee: FeeRateOptionWithTotalFee) async throws -> Amount { - try await uniffiRustCallAsync( +} + +open func getMaxSendAmount(fee: FeeRateOptionWithTotalFee)async throws -> Amount { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_get_max_send_amount( self.uniffiClonePointer(), @@ -7057,33 +7766,38 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeAmount.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func getUnsignedTransactions() throws -> [UnsignedTransaction] { - try FfiConverterSequenceTypeUnsignedTransaction.lift(rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_method_rustwalletviewmodel_get_unsigned_transactions(self.uniffiClonePointer(), $0) - }) - } - - open func listenForUpdates(reconciler: WalletViewModelReconciler) { try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_listen_for_updates(self.uniffiClonePointer(), - FfiConverterCallbackInterfaceWalletViewModelReconciler.lower(reconciler), $0) - } - } - - open func markWalletAsVerified() throws { try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_method_rustwalletviewmodel_mark_wallet_as_verified(self.uniffiClonePointer(), $0) - } - } - +} + +open func getUnsignedTransactions()throws -> [UnsignedTransaction] { + return try FfiConverterSequenceTypeUnsignedTransaction.lift(try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_method_rustwalletviewmodel_get_unsigned_transactions(self.uniffiClonePointer(),$0 + ) +}) +} + +open func listenForUpdates(reconciler: WalletViewModelReconciler) {try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_listen_for_updates(self.uniffiClonePointer(), + FfiConverterCallbackInterfaceWalletViewModelReconciler.lower(reconciler),$0 + ) +} +} + +open func markWalletAsVerified()throws {try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_method_rustwalletviewmodel_mark_wallet_as_verified(self.uniffiClonePointer(),$0 + ) +} +} + /** * Get the next address for the wallet */ - open func nextAddress() async throws -> AddressInfo { - try await uniffiRustCallAsync( +open func nextAddress()async throws -> AddressInfo { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_next_address( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_pointer, @@ -7092,10 +7806,11 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeAddressInfo.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func numberOfConfirmations(blockHeight: UInt32) async throws -> UInt32 { - try await uniffiRustCallAsync( +} + +open func numberOfConfirmations(blockHeight: UInt32)async throws -> UInt32 { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_number_of_confirmations( self.uniffiClonePointer(), @@ -7108,10 +7823,11 @@ open class RustWalletViewModel: liftFunc: FfiConverterUInt32.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func numberOfConfirmationsFmt(blockHeight: UInt32) async throws -> String { - try await uniffiRustCallAsync( +} + +open func numberOfConfirmationsFmt(blockHeight: UInt32)async throws -> String { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_number_of_confirmations_fmt( self.uniffiClonePointer(), @@ -7124,16 +7840,18 @@ open class RustWalletViewModel: liftFunc: FfiConverterString.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func saveUnsignedTransaction(details: ConfirmDetails) throws { try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_method_rustwalletviewmodel_save_unsigned_transaction(self.uniffiClonePointer(), - FfiConverterTypeConfirmDetails.lower(details), $0) - } - } - - open func sentAndReceivedFiat(sentAndReceived: SentAndReceived) async throws -> Double { - try await uniffiRustCallAsync( +} + +open func saveUnsignedTransaction(details: ConfirmDetails)throws {try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_method_rustwalletviewmodel_save_unsigned_transaction(self.uniffiClonePointer(), + FfiConverterTypeConfirmDetails.lower(details),$0 + ) +} +} + +open func sentAndReceivedFiat(sentAndReceived: SentAndReceived)async throws -> Double { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_sent_and_received_fiat( self.uniffiClonePointer(), @@ -7146,19 +7864,22 @@ open class RustWalletViewModel: liftFunc: FfiConverterDouble.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func setWalletMetadata(metadata: WalletMetadata) { try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_set_wallet_metadata(self.uniffiClonePointer(), - FfiConverterTypeWalletMetadata.lower(metadata), $0) - } - } - - open func startWalletScan() async throws { - try await uniffiRustCallAsync( +} + +open func setWalletMetadata(metadata: WalletMetadata) {try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_set_wallet_metadata(self.uniffiClonePointer(), + FfiConverterTypeWalletMetadata.lower(metadata),$0 + ) +} +} + +open func startWalletScan()async throws { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_start_wallet_scan( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_void, @@ -7167,10 +7888,11 @@ open class RustWalletViewModel: liftFunc: { $0 }, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func switchToDifferentWalletAddressType(walletAddressType: WalletAddressType) async throws { - try await uniffiRustCallAsync( +} + +open func switchToDifferentWalletAddressType(walletAddressType: WalletAddressType)async throws { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_switch_to_different_wallet_address_type( self.uniffiClonePointer(), @@ -7183,10 +7905,11 @@ open class RustWalletViewModel: liftFunc: { $0 }, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func transactionDetails(txId: TxId) async throws -> TransactionDetails { - try await uniffiRustCallAsync( +} + +open func transactionDetails(txId: TxId)async throws -> TransactionDetails { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_rustwalletviewmodel_transaction_details( self.uniffiClonePointer(), @@ -7199,34 +7922,39 @@ open class RustWalletViewModel: liftFunc: FfiConverterTypeTransactionDetails.lift, errorHandler: FfiConverterTypeWalletViewModelError.lift ) - } - - open func walletMetadata() -> WalletMetadata { - try! FfiConverterTypeWalletMetadata.lift(try! rustCall { - uniffi_cove_fn_method_rustwalletviewmodel_wallet_metadata(self.uniffiClonePointer(), $0) - }) - } +} + +open func walletMetadata() -> WalletMetadata { + return try! FfiConverterTypeWalletMetadata.lift(try! rustCall() { + uniffi_cove_fn_method_rustwalletviewmodel_wallet_metadata(self.uniffiClonePointer(),$0 + ) +}) +} + +open func wordValidator()throws -> WordValidator { + return try FfiConverterTypeWordValidator.lift(try rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { + uniffi_cove_fn_method_rustwalletviewmodel_word_validator(self.uniffiClonePointer(),$0 + ) +}) +} + - open func wordValidator() throws -> WordValidator { - try FfiConverterTypeWordValidator.lift(rustCallWithError(FfiConverterTypeWalletViewModelError.lift) { - uniffi_cove_fn_method_rustwalletviewmodel_word_validator(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeRustWalletViewModel: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = RustWalletViewModel public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> RustWalletViewModel { - RustWalletViewModel(unsafeFromRawPointer: pointer) + return RustWalletViewModel(unsafeFromRawPointer: pointer) } public static func lower(_ value: RustWalletViewModel) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RustWalletViewModel { @@ -7234,7 +7962,7 @@ public struct FfiConverterTypeRustWalletViewModel: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -7247,35 +7975,42 @@ public struct FfiConverterTypeRustWalletViewModel: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRustWalletViewModel_lift(_ pointer: UnsafeMutableRawPointer) throws -> RustWalletViewModel { - try FfiConverterTypeRustWalletViewModel.lift(pointer) + return try FfiConverterTypeRustWalletViewModel.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRustWalletViewModel_lower(_ value: RustWalletViewModel) -> UnsafeMutableRawPointer { - FfiConverterTypeRustWalletViewModel.lower(value) + return FfiConverterTypeRustWalletViewModel.lower(value) } -public protocol SeedQrProtocol: AnyObject { - func getWords() -> [String] - func groupedPlainWords() -> [[String]] + + +public protocol SeedQrProtocol : AnyObject { + + func getWords() -> [String] + + func groupedPlainWords() -> [[String]] + } open class SeedQr: - SeedQrProtocol -{ + SeedQrProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -7283,7 +8018,7 @@ open class SeedQr: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -7292,72 +8027,79 @@ open class SeedQr: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_seedqr(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_seedqr(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_seedqr(pointer, $0) } } - public static func newFromData(data: Data) throws -> SeedQr { - try FfiConverterTypeSeedQr.lift(rustCallWithError(FfiConverterTypeSeedQrError.lift) { - uniffi_cove_fn_constructor_seedqr_new_from_data( - FfiConverterData.lower(data), $0 - ) - }) - } - - public static func newFromStr(qr: String) throws -> SeedQr { - try FfiConverterTypeSeedQr.lift(rustCallWithError(FfiConverterTypeSeedQrError.lift) { - uniffi_cove_fn_constructor_seedqr_new_from_str( - FfiConverterString.lower(qr), $0 - ) - }) - } + +public static func newFromData(data: Data)throws -> SeedQr { + return try FfiConverterTypeSeedQr.lift(try rustCallWithError(FfiConverterTypeSeedQrError.lift) { + uniffi_cove_fn_constructor_seedqr_new_from_data( + FfiConverterData.lower(data),$0 + ) +}) +} + +public static func newFromStr(qr: String)throws -> SeedQr { + return try FfiConverterTypeSeedQr.lift(try rustCallWithError(FfiConverterTypeSeedQrError.lift) { + uniffi_cove_fn_constructor_seedqr_new_from_str( + FfiConverterString.lower(qr),$0 + ) +}) +} + - open func getWords() -> [String] { - try! FfiConverterSequenceString.lift(try! rustCall { - uniffi_cove_fn_method_seedqr_get_words(self.uniffiClonePointer(), $0) - }) - } + +open func getWords() -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffi_cove_fn_method_seedqr_get_words(self.uniffiClonePointer(),$0 + ) +}) +} + +open func groupedPlainWords() -> [[String]] { + return try! FfiConverterSequenceSequenceString.lift(try! rustCall() { + uniffi_cove_fn_method_seedqr_grouped_plain_words(self.uniffiClonePointer(),$0 + ) +}) +} + - open func groupedPlainWords() -> [[String]] { - try! FfiConverterSequenceSequenceString.lift(try! rustCall { - uniffi_cove_fn_method_seedqr_grouped_plain_words(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeSeedQr: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = SeedQr public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> SeedQr { - SeedQr(unsafeFromRawPointer: pointer) + return SeedQr(unsafeFromRawPointer: pointer) } public static func lower(_ value: SeedQr) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SeedQr { @@ -7365,7 +8107,7 @@ public struct FfiConverterTypeSeedQr: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -7378,43 +8120,50 @@ public struct FfiConverterTypeSeedQr: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeSeedQr_lift(_ pointer: UnsafeMutableRawPointer) throws -> SeedQr { - try FfiConverterTypeSeedQr.lift(pointer) + return try FfiConverterTypeSeedQr.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeSeedQr_lower(_ value: SeedQr) -> UnsafeMutableRawPointer { - FfiConverterTypeSeedQr.lower(value) + return FfiConverterTypeSeedQr.lower(value) } -public protocol SentAndReceivedProtocol: AnyObject { - func amount() -> Amount - - func amountFmt(unit: Unit) -> String - - func direction() -> TransactionDirection - func label() -> String - func received() -> Amount - func sent() -> Amount +public protocol SentAndReceivedProtocol : AnyObject { + + func amount() -> Amount + + func amountFmt(unit: Unit) -> String + + func direction() -> TransactionDirection + + func label() -> String + + func received() -> Amount + + func sent() -> Amount + } open class SentAndReceived: - SentAndReceivedProtocol -{ + SentAndReceivedProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -7422,7 +8171,7 @@ open class SentAndReceived: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -7431,81 +8180,92 @@ open class SentAndReceived: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_sentandreceived(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_sentandreceived(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_sentandreceived(pointer, $0) } } - open func amount() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_sentandreceived_amount(self.uniffiClonePointer(), $0) - }) - } - - open func amountFmt(unit: Unit) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_sentandreceived_amount_fmt(self.uniffiClonePointer(), - FfiConverterTypeUnit.lower(unit), $0) - }) - } - - open func direction() -> TransactionDirection { - try! FfiConverterTypeTransactionDirection.lift(try! rustCall { - uniffi_cove_fn_method_sentandreceived_direction(self.uniffiClonePointer(), $0) - }) - } - - open func label() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_sentandreceived_label(self.uniffiClonePointer(), $0) - }) - } + - open func received() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_sentandreceived_received(self.uniffiClonePointer(), $0) - }) - } + +open func amount() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_sentandreceived_amount(self.uniffiClonePointer(),$0 + ) +}) +} + +open func amountFmt(unit: Unit) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_sentandreceived_amount_fmt(self.uniffiClonePointer(), + FfiConverterTypeUnit.lower(unit),$0 + ) +}) +} + +open func direction() -> TransactionDirection { + return try! FfiConverterTypeTransactionDirection.lift(try! rustCall() { + uniffi_cove_fn_method_sentandreceived_direction(self.uniffiClonePointer(),$0 + ) +}) +} + +open func label() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_sentandreceived_label(self.uniffiClonePointer(),$0 + ) +}) +} + +open func received() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_sentandreceived_received(self.uniffiClonePointer(),$0 + ) +}) +} + +open func sent() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_sentandreceived_sent(self.uniffiClonePointer(),$0 + ) +}) +} + - open func sent() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_sentandreceived_sent(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeSentAndReceived: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = SentAndReceived public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> SentAndReceived { - SentAndReceived(unsafeFromRawPointer: pointer) + return SentAndReceived(unsafeFromRawPointer: pointer) } public static func lower(_ value: SentAndReceived) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SentAndReceived { @@ -7513,7 +8273,7 @@ public struct FfiConverterTypeSentAndReceived: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -7526,65 +8286,72 @@ public struct FfiConverterTypeSentAndReceived: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeSentAndReceived_lift(_ pointer: UnsafeMutableRawPointer) throws -> SentAndReceived { - try FfiConverterTypeSentAndReceived.lift(pointer) + return try FfiConverterTypeSentAndReceived.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeSentAndReceived_lower(_ value: SentAndReceived) -> UnsafeMutableRawPointer { - FfiConverterTypeSentAndReceived.lower(value) -} - -public protocol TransactionDetailsProtocol: AnyObject { - func address() -> Address - - func addressSpacedOut() -> String - - func amount() -> Amount - - func amountFiat() async throws -> Double - - func amountFiatFmt() async throws -> String - - func amountFmt(unit: Unit) -> String - - func blockNumber() -> UInt32? - - func blockNumberFmt() -> String? - - func confirmationDateTime() -> String? - - func feeFiatFmt() async throws -> String - - func feeFmt(unit: Unit) -> String? - - func isConfirmed() -> Bool - - func isReceived() -> Bool - - func isSent() -> Bool - - func sentSansFeeFiatFmt() async throws -> String - - func sentSansFeeFmt(unit: Unit) -> String? - - func transactionUrl() -> String + return FfiConverterTypeSentAndReceived.lower(value) +} + + + + +public protocol TransactionDetailsProtocol : AnyObject { + + func address() -> Address + + func addressSpacedOut() -> String + + func amount() -> Amount + + func amountFiat() async throws -> Double + + func amountFiatFmt() async throws -> String + + func amountFmt(unit: Unit) -> String + + func blockNumber() -> UInt32? + + func blockNumberFmt() -> String? + + func confirmationDateTime() -> String? + + func feeFiatFmt() async throws -> String + + func feeFmt(unit: Unit) -> String? + + func isConfirmed() -> Bool + + func isReceived() -> Bool + + func isSent() -> Bool + + func sentSansFeeFiatFmt() async throws -> String + + func sentSansFeeFmt(unit: Unit) -> String? + + func transactionUrl() -> String + } open class TransactionDetails: - TransactionDetailsProtocol -{ + TransactionDetailsProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -7592,7 +8359,7 @@ open class TransactionDetails: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -7601,88 +8368,95 @@ open class TransactionDetails: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_transactiondetails(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_transactiondetails(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_transactiondetails(pointer, $0) } } - public static func previewConfirmedReceived() -> TransactionDetails { - try! FfiConverterTypeTransactionDetails.lift(try! rustCall { - uniffi_cove_fn_constructor_transactiondetails_preview_confirmed_received($0 - ) - }) - } - - public static func previewConfirmedSent() -> TransactionDetails { - try! FfiConverterTypeTransactionDetails.lift(try! rustCall { - uniffi_cove_fn_constructor_transactiondetails_preview_confirmed_sent($0 - ) - }) - } - - public static func previewNewConfirmed() -> TransactionDetails { - try! FfiConverterTypeTransactionDetails.lift(try! rustCall { - uniffi_cove_fn_constructor_transactiondetails_preview_new_confirmed($0 - ) - }) - } - - public static func previewPendingReceived() -> TransactionDetails { - try! FfiConverterTypeTransactionDetails.lift(try! rustCall { - uniffi_cove_fn_constructor_transactiondetails_preview_pending_received($0 - ) - }) - } - - public static func previewPendingSent() -> TransactionDetails { - try! FfiConverterTypeTransactionDetails.lift(try! rustCall { - uniffi_cove_fn_constructor_transactiondetails_preview_pending_sent($0 - ) - }) - } - - open func address() -> Address { - try! FfiConverterTypeAddress.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_address(self.uniffiClonePointer(), $0) - }) - } - - open func addressSpacedOut() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_address_spaced_out(self.uniffiClonePointer(), $0) - }) - } - - open func amount() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_amount(self.uniffiClonePointer(), $0) - }) - } + +public static func previewConfirmedReceived() -> TransactionDetails { + return try! FfiConverterTypeTransactionDetails.lift(try! rustCall() { + uniffi_cove_fn_constructor_transactiondetails_preview_confirmed_received($0 + ) +}) +} + +public static func previewConfirmedSent() -> TransactionDetails { + return try! FfiConverterTypeTransactionDetails.lift(try! rustCall() { + uniffi_cove_fn_constructor_transactiondetails_preview_confirmed_sent($0 + ) +}) +} + +public static func previewNewConfirmed() -> TransactionDetails { + return try! FfiConverterTypeTransactionDetails.lift(try! rustCall() { + uniffi_cove_fn_constructor_transactiondetails_preview_new_confirmed($0 + ) +}) +} + +public static func previewPendingReceived() -> TransactionDetails { + return try! FfiConverterTypeTransactionDetails.lift(try! rustCall() { + uniffi_cove_fn_constructor_transactiondetails_preview_pending_received($0 + ) +}) +} + +public static func previewPendingSent() -> TransactionDetails { + return try! FfiConverterTypeTransactionDetails.lift(try! rustCall() { + uniffi_cove_fn_constructor_transactiondetails_preview_pending_sent($0 + ) +}) +} + - open func amountFiat() async throws -> Double { - try await uniffiRustCallAsync( + +open func address() -> Address { + return try! FfiConverterTypeAddress.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_address(self.uniffiClonePointer(),$0 + ) +}) +} + +open func addressSpacedOut() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_address_spaced_out(self.uniffiClonePointer(),$0 + ) +}) +} + +open func amount() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_amount(self.uniffiClonePointer(),$0 + ) +}) +} + +open func amountFiat()async throws -> Double { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_transactiondetails_amount_fiat( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_f64, @@ -7691,13 +8465,15 @@ open class TransactionDetails: liftFunc: FfiConverterDouble.lift, errorHandler: FfiConverterTypeTransactionDetailError.lift ) - } - - open func amountFiatFmt() async throws -> String { - try await uniffiRustCallAsync( +} + +open func amountFiatFmt()async throws -> String { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_transactiondetails_amount_fiat_fmt( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_rust_buffer, @@ -7706,38 +8482,44 @@ open class TransactionDetails: liftFunc: FfiConverterString.lift, errorHandler: FfiConverterTypeTransactionDetailError.lift ) - } - - open func amountFmt(unit: Unit) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_amount_fmt(self.uniffiClonePointer(), - FfiConverterTypeUnit.lower(unit), $0) - }) - } - - open func blockNumber() -> UInt32? { - try! FfiConverterOptionUInt32.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_block_number(self.uniffiClonePointer(), $0) - }) - } - - open func blockNumberFmt() -> String? { - try! FfiConverterOptionString.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_block_number_fmt(self.uniffiClonePointer(), $0) - }) - } - - open func confirmationDateTime() -> String? { - try! FfiConverterOptionString.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_confirmation_date_time(self.uniffiClonePointer(), $0) - }) - } - - open func feeFiatFmt() async throws -> String { - try await uniffiRustCallAsync( +} + +open func amountFmt(unit: Unit) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_amount_fmt(self.uniffiClonePointer(), + FfiConverterTypeUnit.lower(unit),$0 + ) +}) +} + +open func blockNumber() -> UInt32? { + return try! FfiConverterOptionUInt32.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_block_number(self.uniffiClonePointer(),$0 + ) +}) +} + +open func blockNumberFmt() -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_block_number_fmt(self.uniffiClonePointer(),$0 + ) +}) +} + +open func confirmationDateTime() -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_confirmation_date_time(self.uniffiClonePointer(),$0 + ) +}) +} + +open func feeFiatFmt()async throws -> String { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_transactiondetails_fee_fiat_fmt( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_rust_buffer, @@ -7746,38 +8528,44 @@ open class TransactionDetails: liftFunc: FfiConverterString.lift, errorHandler: FfiConverterTypeTransactionDetailError.lift ) - } - - open func feeFmt(unit: Unit) -> String? { - try! FfiConverterOptionString.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_fee_fmt(self.uniffiClonePointer(), - FfiConverterTypeUnit.lower(unit), $0) - }) - } - - open func isConfirmed() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_is_confirmed(self.uniffiClonePointer(), $0) - }) - } - - open func isReceived() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_is_received(self.uniffiClonePointer(), $0) - }) - } - - open func isSent() -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_is_sent(self.uniffiClonePointer(), $0) - }) - } - - open func sentSansFeeFiatFmt() async throws -> String { - try await uniffiRustCallAsync( +} + +open func feeFmt(unit: Unit) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_fee_fmt(self.uniffiClonePointer(), + FfiConverterTypeUnit.lower(unit),$0 + ) +}) +} + +open func isConfirmed() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_is_confirmed(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isReceived() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_is_received(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isSent() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_is_sent(self.uniffiClonePointer(),$0 + ) +}) +} + +open func sentSansFeeFiatFmt()async throws -> String { + return + try await uniffiRustCallAsync( rustFutureFunc: { uniffi_cove_fn_method_transactiondetails_sent_sans_fee_fiat_fmt( self.uniffiClonePointer() + ) }, pollFunc: ffi_cove_rust_future_poll_rust_buffer, @@ -7786,35 +8574,40 @@ open class TransactionDetails: liftFunc: FfiConverterString.lift, errorHandler: FfiConverterTypeTransactionDetailError.lift ) - } - - open func sentSansFeeFmt(unit: Unit) -> String? { - try! FfiConverterOptionString.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_sent_sans_fee_fmt(self.uniffiClonePointer(), - FfiConverterTypeUnit.lower(unit), $0) - }) - } +} + +open func sentSansFeeFmt(unit: Unit) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_sent_sans_fee_fmt(self.uniffiClonePointer(), + FfiConverterTypeUnit.lower(unit),$0 + ) +}) +} + +open func transactionUrl() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_transactiondetails_transaction_url(self.uniffiClonePointer(),$0 + ) +}) +} + - open func transactionUrl() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_transactiondetails_transaction_url(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTransactionDetails: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = TransactionDetails public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> TransactionDetails { - TransactionDetails(unsafeFromRawPointer: pointer) + return TransactionDetails(unsafeFromRawPointer: pointer) } public static func lower(_ value: TransactionDetails) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TransactionDetails { @@ -7822,7 +8615,7 @@ public struct FfiConverterTypeTransactionDetails: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -7835,35 +8628,42 @@ public struct FfiConverterTypeTransactionDetails: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransactionDetails_lift(_ pointer: UnsafeMutableRawPointer) throws -> TransactionDetails { - try FfiConverterTypeTransactionDetails.lift(pointer) + return try FfiConverterTypeTransactionDetails.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransactionDetails_lower(_ value: TransactionDetails) -> UnsafeMutableRawPointer { - FfiConverterTypeTransactionDetails.lower(value) + return FfiConverterTypeTransactionDetails.lower(value) } -public protocol TxIdProtocol: AnyObject { - func asHashString() -> String - func isEqual(other: TxId) -> Bool + + +public protocol TxIdProtocol : AnyObject { + + func asHashString() -> String + + func isEqual(other: TxId) -> Bool + } open class TxId: - TxIdProtocol -{ + TxIdProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -7871,7 +8671,7 @@ open class TxId: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -7880,57 +8680,64 @@ open class TxId: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_txid(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_txid(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_txid(pointer, $0) } } - open func asHashString() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_txid_as_hash_string(self.uniffiClonePointer(), $0) - }) - } + + + +open func asHashString() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_txid_as_hash_string(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isEqual(other: TxId) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_txid_is_equal(self.uniffiClonePointer(), + FfiConverterTypeTxId.lower(other),$0 + ) +}) +} + - open func isEqual(other: TxId) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_txid_is_equal(self.uniffiClonePointer(), - FfiConverterTypeTxId.lower(other), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTxId: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = TxId public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> TxId { - TxId(unsafeFromRawPointer: pointer) + return TxId(unsafeFromRawPointer: pointer) } public static func lower(_ value: TxId) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxId { @@ -7938,7 +8745,7 @@ public struct FfiConverterTypeTxId: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -7951,31 +8758,38 @@ public struct FfiConverterTypeTxId: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTxId_lift(_ pointer: UnsafeMutableRawPointer) throws -> TxId { - try FfiConverterTypeTxId.lift(pointer) + return try FfiConverterTypeTxId.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTxId_lower(_ value: TxId) -> UnsafeMutableRawPointer { - FfiConverterTypeTxId.lower(value) + return FfiConverterTypeTxId.lower(value) } -public protocol TxInProtocol: AnyObject {} + + + +public protocol TxInProtocol : AnyObject { + +} open class TxIn: - TxInProtocol -{ + TxInProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -7983,7 +8797,7 @@ open class TxIn: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -7992,44 +8806,49 @@ open class TxIn: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_txin(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_txin(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_txin(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTxIn: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = TxIn public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> TxIn { - TxIn(unsafeFromRawPointer: pointer) + return TxIn(unsafeFromRawPointer: pointer) } public static func lower(_ value: TxIn) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxIn { @@ -8037,7 +8856,7 @@ public struct FfiConverterTypeTxIn: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8050,31 +8869,38 @@ public struct FfiConverterTypeTxIn: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTxIn_lift(_ pointer: UnsafeMutableRawPointer) throws -> TxIn { - try FfiConverterTypeTxIn.lift(pointer) + return try FfiConverterTypeTxIn.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTxIn_lower(_ value: TxIn) -> UnsafeMutableRawPointer { - FfiConverterTypeTxIn.lower(value) + return FfiConverterTypeTxIn.lower(value) } -public protocol TxOutProtocol: AnyObject {} + + + +public protocol TxOutProtocol : AnyObject { + +} open class TxOut: - TxOutProtocol -{ + TxOutProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8082,7 +8908,7 @@ open class TxOut: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8091,44 +8917,49 @@ open class TxOut: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_txout(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_txout(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_txout(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTxOut: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = TxOut public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> TxOut { - TxOut(unsafeFromRawPointer: pointer) + return TxOut(unsafeFromRawPointer: pointer) } public static func lower(_ value: TxOut) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxOut { @@ -8136,7 +8967,7 @@ public struct FfiConverterTypeTxOut: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8149,41 +8980,48 @@ public struct FfiConverterTypeTxOut: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTxOut_lift(_ pointer: UnsafeMutableRawPointer) throws -> TxOut { - try FfiConverterTypeTxOut.lift(pointer) + return try FfiConverterTypeTxOut.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTxOut_lower(_ value: TxOut) -> UnsafeMutableRawPointer { - FfiConverterTypeTxOut.lower(value) + return FfiConverterTypeTxOut.lower(value) } -public protocol UnconfirmedTransactionProtocol: AnyObject { - func fiatAmount() -> FiatAmount? - - func id() -> TxId - func label() -> String - func lastSeen() -> UInt64 - func sentAndReceived() -> SentAndReceived +public protocol UnconfirmedTransactionProtocol : AnyObject { + + func fiatAmount() -> FiatAmount? + + func id() -> TxId + + func label() -> String + + func lastSeen() -> UInt64 + + func sentAndReceived() -> SentAndReceived + } open class UnconfirmedTransaction: - UnconfirmedTransactionProtocol -{ + UnconfirmedTransactionProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8191,7 +9029,7 @@ open class UnconfirmedTransaction: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8200,74 +9038,84 @@ open class UnconfirmedTransaction: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_unconfirmedtransaction(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_unconfirmedtransaction(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_unconfirmedtransaction(pointer, $0) } } - open func fiatAmount() -> FiatAmount? { - try! FfiConverterOptionTypeFiatAmount.lift(try! rustCall { - uniffi_cove_fn_method_unconfirmedtransaction_fiat_amount(self.uniffiClonePointer(), $0) - }) - } - - open func id() -> TxId { - try! FfiConverterTypeTxId.lift(try! rustCall { - uniffi_cove_fn_method_unconfirmedtransaction_id(self.uniffiClonePointer(), $0) - }) - } - - open func label() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_unconfirmedtransaction_label(self.uniffiClonePointer(), $0) - }) - } + - open func lastSeen() -> UInt64 { - try! FfiConverterUInt64.lift(try! rustCall { - uniffi_cove_fn_method_unconfirmedtransaction_last_seen(self.uniffiClonePointer(), $0) - }) - } + +open func fiatAmount() -> FiatAmount? { + return try! FfiConverterOptionTypeFiatAmount.lift(try! rustCall() { + uniffi_cove_fn_method_unconfirmedtransaction_fiat_amount(self.uniffiClonePointer(),$0 + ) +}) +} + +open func id() -> TxId { + return try! FfiConverterTypeTxId.lift(try! rustCall() { + uniffi_cove_fn_method_unconfirmedtransaction_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func label() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_unconfirmedtransaction_label(self.uniffiClonePointer(),$0 + ) +}) +} + +open func lastSeen() -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffi_cove_fn_method_unconfirmedtransaction_last_seen(self.uniffiClonePointer(),$0 + ) +}) +} + +open func sentAndReceived() -> SentAndReceived { + return try! FfiConverterTypeSentAndReceived.lift(try! rustCall() { + uniffi_cove_fn_method_unconfirmedtransaction_sent_and_received(self.uniffiClonePointer(),$0 + ) +}) +} + - open func sentAndReceived() -> SentAndReceived { - try! FfiConverterTypeSentAndReceived.lift(try! rustCall { - uniffi_cove_fn_method_unconfirmedtransaction_sent_and_received(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeUnconfirmedTransaction: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = UnconfirmedTransaction public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> UnconfirmedTransaction { - UnconfirmedTransaction(unsafeFromRawPointer: pointer) + return UnconfirmedTransaction(unsafeFromRawPointer: pointer) } public static func lower(_ value: UnconfirmedTransaction) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UnconfirmedTransaction { @@ -8275,7 +9123,7 @@ public struct FfiConverterTypeUnconfirmedTransaction: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8288,41 +9136,48 @@ public struct FfiConverterTypeUnconfirmedTransaction: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnconfirmedTransaction_lift(_ pointer: UnsafeMutableRawPointer) throws -> UnconfirmedTransaction { - try FfiConverterTypeUnconfirmedTransaction.lift(pointer) + return try FfiConverterTypeUnconfirmedTransaction.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnconfirmedTransaction_lower(_ value: UnconfirmedTransaction) -> UnsafeMutableRawPointer { - FfiConverterTypeUnconfirmedTransaction.lower(value) + return FfiConverterTypeUnconfirmedTransaction.lower(value) } -public protocol UnsignedTransactionProtocol: AnyObject { - func details() -> ConfirmDetails - func id() -> TxId - func label() -> String - func sendingAmount() -> Amount - - func spendingAmount() -> Amount +public protocol UnsignedTransactionProtocol : AnyObject { + + func details() -> ConfirmDetails + + func id() -> TxId + + func label() -> String + + func sendingAmount() -> Amount + + func spendingAmount() -> Amount + } open class UnsignedTransaction: - UnsignedTransactionProtocol -{ + UnsignedTransactionProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8330,7 +9185,7 @@ open class UnsignedTransaction: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8339,81 +9194,91 @@ open class UnsignedTransaction: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_unsignedtransaction(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_unsignedtransaction(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_unsignedtransaction(pointer, $0) } } - public static func previewNew() -> UnsignedTransaction { - try! FfiConverterTypeUnsignedTransaction.lift(try! rustCall { - uniffi_cove_fn_constructor_unsignedtransaction_preview_new($0 - ) - }) - } - - open func details() -> ConfirmDetails { - try! FfiConverterTypeConfirmDetails.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransaction_details(self.uniffiClonePointer(), $0) - }) - } - - open func id() -> TxId { - try! FfiConverterTypeTxId.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransaction_id(self.uniffiClonePointer(), $0) - }) - } - - open func label() -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransaction_label(self.uniffiClonePointer(), $0) - }) - } + +public static func previewNew() -> UnsignedTransaction { + return try! FfiConverterTypeUnsignedTransaction.lift(try! rustCall() { + uniffi_cove_fn_constructor_unsignedtransaction_preview_new($0 + ) +}) +} + - open func sendingAmount() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransaction_sending_amount(self.uniffiClonePointer(), $0) - }) - } + +open func details() -> ConfirmDetails { + return try! FfiConverterTypeConfirmDetails.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransaction_details(self.uniffiClonePointer(),$0 + ) +}) +} + +open func id() -> TxId { + return try! FfiConverterTypeTxId.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransaction_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func label() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransaction_label(self.uniffiClonePointer(),$0 + ) +}) +} + +open func sendingAmount() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransaction_sending_amount(self.uniffiClonePointer(),$0 + ) +}) +} + +open func spendingAmount() -> Amount { + return try! FfiConverterTypeAmount.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransaction_spending_amount(self.uniffiClonePointer(),$0 + ) +}) +} + - open func spendingAmount() -> Amount { - try! FfiConverterTypeAmount.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransaction_spending_amount(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeUnsignedTransaction: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = UnsignedTransaction public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> UnsignedTransaction { - UnsignedTransaction(unsafeFromRawPointer: pointer) + return UnsignedTransaction(unsafeFromRawPointer: pointer) } public static func lower(_ value: UnsignedTransaction) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UnsignedTransaction { @@ -8421,7 +9286,7 @@ public struct FfiConverterTypeUnsignedTransaction: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8434,39 +9299,46 @@ public struct FfiConverterTypeUnsignedTransaction: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnsignedTransaction_lift(_ pointer: UnsafeMutableRawPointer) throws -> UnsignedTransaction { - try FfiConverterTypeUnsignedTransaction.lift(pointer) + return try FfiConverterTypeUnsignedTransaction.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnsignedTransaction_lower(_ value: UnsignedTransaction) -> UnsafeMutableRawPointer { - FfiConverterTypeUnsignedTransaction.lower(value) + return FfiConverterTypeUnsignedTransaction.lower(value) } -public protocol UnsignedTransactionRecordProtocol: AnyObject { - func confirmDetails() -> ConfirmDetails - func createdAt() -> UInt64 - func txId() -> TxId - func walletId() -> WalletId +public protocol UnsignedTransactionRecordProtocol : AnyObject { + + func confirmDetails() -> ConfirmDetails + + func createdAt() -> UInt64 + + func txId() -> TxId + + func walletId() -> WalletId + } open class UnsignedTransactionRecord: - UnsignedTransactionRecordProtocol -{ + UnsignedTransactionRecordProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8474,7 +9346,7 @@ open class UnsignedTransactionRecord: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8483,68 +9355,77 @@ open class UnsignedTransactionRecord: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_unsignedtransactionrecord(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_unsignedtransactionrecord(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_unsignedtransactionrecord(pointer, $0) } } - open func confirmDetails() -> ConfirmDetails { - try! FfiConverterTypeConfirmDetails.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransactionrecord_confirm_details(self.uniffiClonePointer(), $0) - }) - } - - open func createdAt() -> UInt64 { - try! FfiConverterUInt64.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransactionrecord_created_at(self.uniffiClonePointer(), $0) - }) - } + - open func txId() -> TxId { - try! FfiConverterTypeTxId.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransactionrecord_tx_id(self.uniffiClonePointer(), $0) - }) - } + +open func confirmDetails() -> ConfirmDetails { + return try! FfiConverterTypeConfirmDetails.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransactionrecord_confirm_details(self.uniffiClonePointer(),$0 + ) +}) +} + +open func createdAt() -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransactionrecord_created_at(self.uniffiClonePointer(),$0 + ) +}) +} + +open func txId() -> TxId { + return try! FfiConverterTypeTxId.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransactionrecord_tx_id(self.uniffiClonePointer(),$0 + ) +}) +} + +open func walletId() -> WalletId { + return try! FfiConverterTypeWalletId.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransactionrecord_wallet_id(self.uniffiClonePointer(),$0 + ) +}) +} + - open func walletId() -> WalletId { - try! FfiConverterTypeWalletId.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransactionrecord_wallet_id(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeUnsignedTransactionRecord: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = UnsignedTransactionRecord public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> UnsignedTransactionRecord { - UnsignedTransactionRecord(unsafeFromRawPointer: pointer) + return UnsignedTransactionRecord(unsafeFromRawPointer: pointer) } public static func lower(_ value: UnsignedTransactionRecord) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UnsignedTransactionRecord { @@ -8552,7 +9433,7 @@ public struct FfiConverterTypeUnsignedTransactionRecord: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8565,35 +9446,42 @@ public struct FfiConverterTypeUnsignedTransactionRecord: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnsignedTransactionRecord_lift(_ pointer: UnsafeMutableRawPointer) throws -> UnsignedTransactionRecord { - try FfiConverterTypeUnsignedTransactionRecord.lift(pointer) + return try FfiConverterTypeUnsignedTransactionRecord.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnsignedTransactionRecord_lower(_ value: UnsignedTransactionRecord) -> UnsafeMutableRawPointer { - FfiConverterTypeUnsignedTransactionRecord.lower(value) + return FfiConverterTypeUnsignedTransactionRecord.lower(value) } -public protocol UnsignedTransactionsTableProtocol: AnyObject { - func getTx(txId: TxId) -> UnsignedTransactionRecord? - func getTxThrow(txId: TxId) throws -> UnsignedTransactionRecord + + +public protocol UnsignedTransactionsTableProtocol : AnyObject { + + func getTx(txId: TxId) -> UnsignedTransactionRecord? + + func getTxThrow(txId: TxId) throws -> UnsignedTransactionRecord + } open class UnsignedTransactionsTable: - UnsignedTransactionsTableProtocol -{ + UnsignedTransactionsTableProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8601,7 +9489,7 @@ open class UnsignedTransactionsTable: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8610,58 +9498,65 @@ open class UnsignedTransactionsTable: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_unsignedtransactionstable(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_unsignedtransactionstable(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_unsignedtransactionstable(pointer, $0) } } - open func getTx(txId: TxId) -> UnsignedTransactionRecord? { - try! FfiConverterOptionTypeUnsignedTransactionRecord.lift(try! rustCall { - uniffi_cove_fn_method_unsignedtransactionstable_gettx(self.uniffiClonePointer(), - FfiConverterTypeTxId.lower(txId), $0) - }) - } + + + +open func getTx(txId: TxId) -> UnsignedTransactionRecord? { + return try! FfiConverterOptionTypeUnsignedTransactionRecord.lift(try! rustCall() { + uniffi_cove_fn_method_unsignedtransactionstable_gettx(self.uniffiClonePointer(), + FfiConverterTypeTxId.lower(txId),$0 + ) +}) +} + +open func getTxThrow(txId: TxId)throws -> UnsignedTransactionRecord { + return try FfiConverterTypeUnsignedTransactionRecord.lift(try rustCallWithError(FfiConverterTypeUnsignedTransactionsTableError.lift) { + uniffi_cove_fn_method_unsignedtransactionstable_gettxthrow(self.uniffiClonePointer(), + FfiConverterTypeTxId.lower(txId),$0 + ) +}) +} + - open func getTxThrow(txId: TxId) throws -> UnsignedTransactionRecord { - try FfiConverterTypeUnsignedTransactionRecord.lift(rustCallWithError(FfiConverterTypeUnsignedTransactionsTableError.lift) { - uniffi_cove_fn_method_unsignedtransactionstable_gettxthrow(self.uniffiClonePointer(), - FfiConverterTypeTxId.lower(txId), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeUnsignedTransactionsTable: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = UnsignedTransactionsTable public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> UnsignedTransactionsTable { - UnsignedTransactionsTable(unsafeFromRawPointer: pointer) + return UnsignedTransactionsTable(unsafeFromRawPointer: pointer) } public static func lower(_ value: UnsignedTransactionsTable) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UnsignedTransactionsTable { @@ -8669,7 +9564,7 @@ public struct FfiConverterTypeUnsignedTransactionsTable: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8682,33 +9577,40 @@ public struct FfiConverterTypeUnsignedTransactionsTable: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnsignedTransactionsTable_lift(_ pointer: UnsafeMutableRawPointer) throws -> UnsignedTransactionsTable { - try FfiConverterTypeUnsignedTransactionsTable.lift(pointer) + return try FfiConverterTypeUnsignedTransactionsTable.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnsignedTransactionsTable_lower(_ value: UnsignedTransactionsTable) -> UnsafeMutableRawPointer { - FfiConverterTypeUnsignedTransactionsTable.lower(value) + return FfiConverterTypeUnsignedTransactionsTable.lower(value) } -public protocol WalletProtocol: AnyObject { - func id() -> WalletId + + + +public protocol WalletProtocol : AnyObject { + + func id() -> WalletId + } open class Wallet: - WalletProtocol -{ + WalletProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8716,7 +9618,7 @@ open class Wallet: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8725,73 +9627,79 @@ open class Wallet: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_wallet(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_wallet(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_wallet(pointer, $0) } } - public static func newFromExport(export: HardwareExport) throws -> Wallet { - try FfiConverterTypeWallet.lift(rustCallWithError(FfiConverterTypeWalletError.lift) { - uniffi_cove_fn_constructor_wallet_new_from_export( - FfiConverterTypeHardwareExport.lower(export), $0 - ) - }) - } - - public static func newFromXpub(xpub: String) throws -> Wallet { - try FfiConverterTypeWallet.lift(rustCallWithError(FfiConverterTypeWalletError.lift) { - uniffi_cove_fn_constructor_wallet_new_from_xpub( - FfiConverterString.lower(xpub), $0 - ) - }) - } + +public static func newFromExport(export: HardwareExport)throws -> Wallet { + return try FfiConverterTypeWallet.lift(try rustCallWithError(FfiConverterTypeWalletError.lift) { + uniffi_cove_fn_constructor_wallet_new_from_export( + FfiConverterTypeHardwareExport.lower(export),$0 + ) +}) +} + +public static func newFromXpub(xpub: String)throws -> Wallet { + return try FfiConverterTypeWallet.lift(try rustCallWithError(FfiConverterTypeWalletError.lift) { + uniffi_cove_fn_constructor_wallet_new_from_xpub( + FfiConverterString.lower(xpub),$0 + ) +}) +} + +public static func previewNewWallet() -> Wallet { + return try! FfiConverterTypeWallet.lift(try! rustCall() { + uniffi_cove_fn_constructor_wallet_previewnewwallet($0 + ) +}) +} + - public static func previewNewWallet() -> Wallet { - try! FfiConverterTypeWallet.lift(try! rustCall { - uniffi_cove_fn_constructor_wallet_previewnewwallet($0 - ) - }) - } + +open func id() -> WalletId { + return try! FfiConverterTypeWalletId.lift(try! rustCall() { + uniffi_cove_fn_method_wallet_id(self.uniffiClonePointer(),$0 + ) +}) +} + - open func id() -> WalletId { - try! FfiConverterTypeWalletId.lift(try! rustCall { - uniffi_cove_fn_method_wallet_id(self.uniffiClonePointer(), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWallet: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = Wallet public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Wallet { - Wallet(unsafeFromRawPointer: pointer) + return Wallet(unsafeFromRawPointer: pointer) } public static func lower(_ value: Wallet) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Wallet { @@ -8799,7 +9707,7 @@ public struct FfiConverterTypeWallet: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8812,31 +9720,38 @@ public struct FfiConverterTypeWallet: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWallet_lift(_ pointer: UnsafeMutableRawPointer) throws -> Wallet { - try FfiConverterTypeWallet.lift(pointer) + return try FfiConverterTypeWallet.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWallet_lower(_ value: Wallet) -> UnsafeMutableRawPointer { - FfiConverterTypeWallet.lower(value) + return FfiConverterTypeWallet.lower(value) } -public protocol WalletDataDbProtocol: AnyObject {} + + + +public protocol WalletDataDbProtocol : AnyObject { + +} open class WalletDataDb: - WalletDataDbProtocol -{ + WalletDataDbProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8844,7 +9759,7 @@ open class WalletDataDb: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8853,44 +9768,49 @@ open class WalletDataDb: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_walletdatadb(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_walletdatadb(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_walletdatadb(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletDataDb: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = WalletDataDb public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> WalletDataDb { - WalletDataDb(unsafeFromRawPointer: pointer) + return WalletDataDb(unsafeFromRawPointer: pointer) } public static func lower(_ value: WalletDataDb) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletDataDb { @@ -8898,7 +9818,7 @@ public struct FfiConverterTypeWalletDataDb: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -8911,31 +9831,38 @@ public struct FfiConverterTypeWalletDataDb: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletDataDb_lift(_ pointer: UnsafeMutableRawPointer) throws -> WalletDataDb { - try FfiConverterTypeWalletDataDb.lift(pointer) + return try FfiConverterTypeWalletDataDb.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletDataDb_lower(_ value: WalletDataDb) -> UnsafeMutableRawPointer { - FfiConverterTypeWalletDataDb.lower(value) + return FfiConverterTypeWalletDataDb.lower(value) } -public protocol WalletKeyProtocol: AnyObject {} + + + +public protocol WalletKeyProtocol : AnyObject { + +} open class WalletKey: - WalletKeyProtocol -{ + WalletKeyProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -8943,7 +9870,7 @@ open class WalletKey: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -8952,44 +9879,49 @@ open class WalletKey: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_walletkey(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_walletkey(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_walletkey(pointer, $0) } } + + + + + } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletKey: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = WalletKey public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> WalletKey { - WalletKey(unsafeFromRawPointer: pointer) + return WalletKey(unsafeFromRawPointer: pointer) } public static func lower(_ value: WalletKey) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletKey { @@ -8997,7 +9929,7 @@ public struct FfiConverterTypeWalletKey: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -9010,37 +9942,44 @@ public struct FfiConverterTypeWalletKey: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletKey_lift(_ pointer: UnsafeMutableRawPointer) throws -> WalletKey { - try FfiConverterTypeWalletKey.lift(pointer) + return try FfiConverterTypeWalletKey.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletKey_lower(_ value: WalletKey) -> UnsafeMutableRawPointer { - FfiConverterTypeWalletKey.lower(value) + return FfiConverterTypeWalletKey.lower(value) } -public protocol WalletsTableProtocol: AnyObject { - func all() throws -> [WalletMetadata] - func isEmpty() throws -> Bool - func len(network: Network) throws -> UInt16 + +public protocol WalletsTableProtocol : AnyObject { + + func all() throws -> [WalletMetadata] + + func isEmpty() throws -> Bool + + func len(network: Network) throws -> UInt16 + } open class WalletsTable: - WalletsTableProtocol -{ + WalletsTableProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -9048,7 +9987,7 @@ open class WalletsTable: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -9057,63 +9996,71 @@ open class WalletsTable: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_walletstable(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_walletstable(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_walletstable(pointer, $0) } } - open func all() throws -> [WalletMetadata] { - try FfiConverterSequenceTypeWalletMetadata.lift(rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_walletstable_all(self.uniffiClonePointer(), $0) - }) - } + - open func isEmpty() throws -> Bool { - try FfiConverterBool.lift(rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_walletstable_is_empty(self.uniffiClonePointer(), $0) - }) - } + +open func all()throws -> [WalletMetadata] { + return try FfiConverterSequenceTypeWalletMetadata.lift(try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_walletstable_all(self.uniffiClonePointer(),$0 + ) +}) +} + +open func isEmpty()throws -> Bool { + return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_walletstable_is_empty(self.uniffiClonePointer(),$0 + ) +}) +} + +open func len(network: Network)throws -> UInt16 { + return try FfiConverterUInt16.lift(try rustCallWithError(FfiConverterTypeDatabaseError.lift) { + uniffi_cove_fn_method_walletstable_len(self.uniffiClonePointer(), + FfiConverterTypeNetwork.lower(network),$0 + ) +}) +} + - open func len(network: Network) throws -> UInt16 { - try FfiConverterUInt16.lift(rustCallWithError(FfiConverterTypeDatabaseError.lift) { - uniffi_cove_fn_method_walletstable_len(self.uniffiClonePointer(), - FfiConverterTypeNetwork.lower(network), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletsTable: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = WalletsTable public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> WalletsTable { - WalletsTable(unsafeFromRawPointer: pointer) + return WalletsTable(unsafeFromRawPointer: pointer) } public static func lower(_ value: WalletsTable) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletsTable { @@ -9121,7 +10068,7 @@ public struct FfiConverterTypeWalletsTable: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -9134,39 +10081,46 @@ public struct FfiConverterTypeWalletsTable: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletsTable_lift(_ pointer: UnsafeMutableRawPointer) throws -> WalletsTable { - try FfiConverterTypeWalletsTable.lift(pointer) + return try FfiConverterTypeWalletsTable.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletsTable_lower(_ value: WalletsTable) -> UnsafeMutableRawPointer { - FfiConverterTypeWalletsTable.lower(value) + return FfiConverterTypeWalletsTable.lower(value) } -public protocol WordValidatorProtocol: AnyObject { - func groupedWords() -> [[GroupedWord]] - func invalidWordsString(enteredWords: [[String]]) -> String - func isAllWordsValid(enteredWords: [[String]]) -> Bool - func isValidWordGroup(groupNumber: UInt8, enteredWords: [String]) -> Bool +public protocol WordValidatorProtocol : AnyObject { + + func groupedWords() -> [[GroupedWord]] + + func invalidWordsString(enteredWords: [[String]]) -> String + + func isAllWordsValid(enteredWords: [[String]]) -> Bool + + func isValidWordGroup(groupNumber: UInt8, enteredWords: [String]) -> Bool + } open class WordValidator: - WordValidatorProtocol -{ + WordValidatorProtocol { fileprivate let pointer: UnsafeMutableRawPointer! /// Used to instantiate a [FFIObject] without an actual pointer, for fakes in tests, mostly. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public struct NoPointer { public init() {} } @@ -9174,7 +10128,7 @@ open class WordValidator: // TODO: We'd like this to be `private` but for Swifty reasons, // we can't implement `FfiConverter` without making this `required` and we can't // make it `required` without making it `public`. - public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { self.pointer = pointer } @@ -9183,72 +10137,81 @@ open class WordValidator: // // - Warning: // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing [Pointer] the FFI lower functions will crash. - #if swift(>=5.8) - @_documentation(visibility: private) - #endif - public init(noPointer _: NoPointer) { - pointer = nil +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noPointer: NoPointer) { + self.pointer = nil } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public func uniffiClonePointer() -> UnsafeMutableRawPointer { - try! rustCall { uniffi_cove_fn_clone_wordvalidator(self.pointer, $0) } + return try! rustCall { uniffi_cove_fn_clone_wordvalidator(self.pointer, $0) } } - // No primary constructor declared for this class. deinit { - guard let pointer else { + guard let pointer = pointer else { return } try! rustCall { uniffi_cove_fn_free_wordvalidator(pointer, $0) } } - open func groupedWords() -> [[GroupedWord]] { - try! FfiConverterSequenceSequenceTypeGroupedWord.lift(try! rustCall { - uniffi_cove_fn_method_wordvalidator_grouped_words(self.uniffiClonePointer(), $0) - }) - } - - open func invalidWordsString(enteredWords: [[String]]) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_method_wordvalidator_invalid_words_string(self.uniffiClonePointer(), - FfiConverterSequenceSequenceString.lower(enteredWords), $0) - }) - } + - open func isAllWordsValid(enteredWords: [[String]]) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_wordvalidator_is_all_words_valid(self.uniffiClonePointer(), - FfiConverterSequenceSequenceString.lower(enteredWords), $0) - }) - } + +open func groupedWords() -> [[GroupedWord]] { + return try! FfiConverterSequenceSequenceTypeGroupedWord.lift(try! rustCall() { + uniffi_cove_fn_method_wordvalidator_grouped_words(self.uniffiClonePointer(),$0 + ) +}) +} + +open func invalidWordsString(enteredWords: [[String]]) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_method_wordvalidator_invalid_words_string(self.uniffiClonePointer(), + FfiConverterSequenceSequenceString.lower(enteredWords),$0 + ) +}) +} + +open func isAllWordsValid(enteredWords: [[String]]) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_wordvalidator_is_all_words_valid(self.uniffiClonePointer(), + FfiConverterSequenceSequenceString.lower(enteredWords),$0 + ) +}) +} + +open func isValidWordGroup(groupNumber: UInt8, enteredWords: [String]) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_method_wordvalidator_is_valid_word_group(self.uniffiClonePointer(), + FfiConverterUInt8.lower(groupNumber), + FfiConverterSequenceString.lower(enteredWords),$0 + ) +}) +} + - open func isValidWordGroup(groupNumber: UInt8, enteredWords: [String]) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_method_wordvalidator_is_valid_word_group(self.uniffiClonePointer(), - FfiConverterUInt8.lower(groupNumber), - FfiConverterSequenceString.lower(enteredWords), $0) - }) - } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWordValidator: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer typealias SwiftType = WordValidator public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> WordValidator { - WordValidator(unsafeFromRawPointer: pointer) + return WordValidator(unsafeFromRawPointer: pointer) } public static func lower(_ value: WordValidator) -> UnsafeMutableRawPointer { - value.uniffiClonePointer() + return value.uniffiClonePointer() } public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WordValidator { @@ -9256,7 +10219,7 @@ public struct FfiConverterTypeWordValidator: FfiConverter { // The Rust code won't compile if a pointer won't fit in a UInt64. // We have to go via `UInt` because that's the thing that's the size of a pointer. let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) - if ptr == nil { + if (ptr == nil) { throw UniffiInternalError.unexpectedNullPointer } return try lift(ptr!) @@ -9269,20 +10232,24 @@ public struct FfiConverterTypeWordValidator: FfiConverter { } } + + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWordValidator_lift(_ pointer: UnsafeMutableRawPointer) throws -> WordValidator { - try FfiConverterTypeWordValidator.lift(pointer) + return try FfiConverterTypeWordValidator.lift(pointer) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWordValidator_lower(_ value: WordValidator) -> UnsafeMutableRawPointer { - FfiConverterTypeWordValidator.lower(value) + return FfiConverterTypeWordValidator.lower(value) } + public struct AddressIndex { public var lastSeenIndex: UInt8 public var addressListHash: UInt64 @@ -9295,8 +10262,10 @@ public struct AddressIndex { } } + + extension AddressIndex: Equatable, Hashable { - public static func == (lhs: AddressIndex, rhs: AddressIndex) -> Bool { + public static func ==(lhs: AddressIndex, rhs: AddressIndex) -> Bool { if lhs.lastSeenIndex != rhs.lastSeenIndex { return false } @@ -9312,14 +10281,16 @@ extension AddressIndex: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAddressIndex: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressIndex { - try AddressIndex( - lastSeenIndex: FfiConverterUInt8.read(from: &buf), - addressListHash: FfiConverterUInt64.read(from: &buf) + return + try AddressIndex( + lastSeenIndex: FfiConverterUInt8.read(from: &buf), + addressListHash: FfiConverterUInt64.read(from: &buf) ) } @@ -9329,20 +10300,22 @@ public struct FfiConverterTypeAddressIndex: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddressIndex_lift(_ buf: RustBuffer) throws -> AddressIndex { - try FfiConverterTypeAddressIndex.lift(buf) + return try FfiConverterTypeAddressIndex.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAddressIndex_lower(_ value: AddressIndex) -> RustBuffer { - FfiConverterTypeAddressIndex.lower(value) + return FfiConverterTypeAddressIndex.lower(value) } + public struct AppState { public var router: Router @@ -9353,13 +10326,16 @@ public struct AppState { } } + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAppState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppState { - try AppState( - router: FfiConverterTypeRouter.read(from: &buf) + return + try AppState( + router: FfiConverterTypeRouter.read(from: &buf) ) } @@ -9368,20 +10344,22 @@ public struct FfiConverterTypeAppState: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAppState_lift(_ buf: RustBuffer) throws -> AppState { - try FfiConverterTypeAppState.lift(buf) + return try FfiConverterTypeAppState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAppState_lower(_ value: AppState) -> RustBuffer { - FfiConverterTypeAppState.lower(value) + return FfiConverterTypeAppState.lower(value) } + public struct Balance { public var immature: Amount public var trustedPending: Amount @@ -9398,16 +10376,19 @@ public struct Balance { } } + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBalance: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Balance { - try Balance( - immature: FfiConverterTypeAmount.read(from: &buf), - trustedPending: FfiConverterTypeAmount.read(from: &buf), - untrustedPending: FfiConverterTypeAmount.read(from: &buf), - confirmed: FfiConverterTypeAmount.read(from: &buf) + return + try Balance( + immature: FfiConverterTypeAmount.read(from: &buf), + trustedPending: FfiConverterTypeAmount.read(from: &buf), + untrustedPending: FfiConverterTypeAmount.read(from: &buf), + confirmed: FfiConverterTypeAmount.read(from: &buf) ) } @@ -9419,20 +10400,22 @@ public struct FfiConverterTypeBalance: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBalance_lift(_ buf: RustBuffer) throws -> Balance { - try FfiConverterTypeBalance.lift(buf) + return try FfiConverterTypeBalance.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBalance_lower(_ value: Balance) -> RustBuffer { - FfiConverterTypeBalance.lower(value) + return FfiConverterTypeBalance.lower(value) } + public struct BlockSizeLast { public var blockHeight: UInt64 public var lastSeen: TimeInterval @@ -9445,8 +10428,10 @@ public struct BlockSizeLast { } } + + extension BlockSizeLast: Equatable, Hashable { - public static func == (lhs: BlockSizeLast, rhs: BlockSizeLast) -> Bool { + public static func ==(lhs: BlockSizeLast, rhs: BlockSizeLast) -> Bool { if lhs.blockHeight != rhs.blockHeight { return false } @@ -9462,14 +10447,16 @@ extension BlockSizeLast: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBlockSizeLast: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BlockSizeLast { - try BlockSizeLast( - blockHeight: FfiConverterUInt64.read(from: &buf), - lastSeen: FfiConverterDuration.read(from: &buf) + return + try BlockSizeLast( + blockHeight: FfiConverterUInt64.read(from: &buf), + lastSeen: FfiConverterDuration.read(from: &buf) ) } @@ -9479,20 +10466,22 @@ public struct FfiConverterTypeBlockSizeLast: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBlockSizeLast_lift(_ buf: RustBuffer) throws -> BlockSizeLast { - try FfiConverterTypeBlockSizeLast.lift(buf) + return try FfiConverterTypeBlockSizeLast.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeBlockSizeLast_lower(_ value: BlockSizeLast) -> RustBuffer { - FfiConverterTypeBlockSizeLast.lower(value) + return FfiConverterTypeBlockSizeLast.lower(value) } + public struct ConfirmedDetails { public var blockNumber: UInt32 public var confirmationTime: UInt64 @@ -9505,8 +10494,10 @@ public struct ConfirmedDetails { } } + + extension ConfirmedDetails: Equatable, Hashable { - public static func == (lhs: ConfirmedDetails, rhs: ConfirmedDetails) -> Bool { + public static func ==(lhs: ConfirmedDetails, rhs: ConfirmedDetails) -> Bool { if lhs.blockNumber != rhs.blockNumber { return false } @@ -9522,14 +10513,16 @@ extension ConfirmedDetails: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeConfirmedDetails: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ConfirmedDetails { - try ConfirmedDetails( - blockNumber: FfiConverterUInt32.read(from: &buf), - confirmationTime: FfiConverterUInt64.read(from: &buf) + return + try ConfirmedDetails( + blockNumber: FfiConverterUInt32.read(from: &buf), + confirmationTime: FfiConverterUInt64.read(from: &buf) ) } @@ -9539,20 +10532,22 @@ public struct FfiConverterTypeConfirmedDetails: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeConfirmedDetails_lift(_ buf: RustBuffer) throws -> ConfirmedDetails { - try FfiConverterTypeConfirmedDetails.lift(buf) + return try FfiConverterTypeConfirmedDetails.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeConfirmedDetails_lower(_ value: ConfirmedDetails) -> RustBuffer { - FfiConverterTypeConfirmedDetails.lower(value) + return FfiConverterTypeConfirmedDetails.lower(value) } + public struct FeeResponse { public var fastestFee: UInt64 public var halfHourFee: UInt64 @@ -9571,8 +10566,10 @@ public struct FeeResponse { } } + + extension FeeResponse: Equatable, Hashable { - public static func == (lhs: FeeResponse, rhs: FeeResponse) -> Bool { + public static func ==(lhs: FeeResponse, rhs: FeeResponse) -> Bool { if lhs.fastestFee != rhs.fastestFee { return false } @@ -9600,17 +10597,19 @@ extension FeeResponse: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFeeResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeResponse { - try FeeResponse( - fastestFee: FfiConverterUInt64.read(from: &buf), - halfHourFee: FfiConverterUInt64.read(from: &buf), - hourFee: FfiConverterUInt64.read(from: &buf), - economyFee: FfiConverterUInt64.read(from: &buf), - minimumFee: FfiConverterUInt64.read(from: &buf) + return + try FeeResponse( + fastestFee: FfiConverterUInt64.read(from: &buf), + halfHourFee: FfiConverterUInt64.read(from: &buf), + hourFee: FfiConverterUInt64.read(from: &buf), + economyFee: FfiConverterUInt64.read(from: &buf), + minimumFee: FfiConverterUInt64.read(from: &buf) ) } @@ -9623,20 +10622,22 @@ public struct FfiConverterTypeFeeResponse: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeResponse_lift(_ buf: RustBuffer) throws -> FeeResponse { - try FfiConverterTypeFeeResponse.lift(buf) + return try FfiConverterTypeFeeResponse.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeResponse_lower(_ value: FeeResponse) -> RustBuffer { - FfiConverterTypeFeeResponse.lower(value) + return FfiConverterTypeFeeResponse.lower(value) } + public struct FiatAmount { public var amount: Double public var currency: FiatCurrency @@ -9649,8 +10650,10 @@ public struct FiatAmount { } } + + extension FiatAmount: Equatable, Hashable { - public static func == (lhs: FiatAmount, rhs: FiatAmount) -> Bool { + public static func ==(lhs: FiatAmount, rhs: FiatAmount) -> Bool { if lhs.amount != rhs.amount { return false } @@ -9666,14 +10669,16 @@ extension FiatAmount: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFiatAmount: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FiatAmount { - try FiatAmount( - amount: FfiConverterDouble.read(from: &buf), - currency: FfiConverterTypeFiatCurrency.read(from: &buf) + return + try FiatAmount( + amount: FfiConverterDouble.read(from: &buf), + currency: FfiConverterTypeFiatCurrency.read(from: &buf) ) } @@ -9683,20 +10688,22 @@ public struct FfiConverterTypeFiatAmount: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatAmount_lift(_ buf: RustBuffer) throws -> FiatAmount { - try FfiConverterTypeFiatAmount.lift(buf) + return try FfiConverterTypeFiatAmount.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatAmount_lower(_ value: FiatAmount) -> RustBuffer { - FfiConverterTypeFiatAmount.lower(value) + return FfiConverterTypeFiatAmount.lower(value) } + public struct FoundAddress { public var type: WalletAddressType public var firstAddress: String @@ -9709,8 +10716,10 @@ public struct FoundAddress { } } + + extension FoundAddress: Equatable, Hashable { - public static func == (lhs: FoundAddress, rhs: FoundAddress) -> Bool { + public static func ==(lhs: FoundAddress, rhs: FoundAddress) -> Bool { if lhs.type != rhs.type { return false } @@ -9726,14 +10735,16 @@ extension FoundAddress: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFoundAddress: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FoundAddress { - try FoundAddress( - type: FfiConverterTypeWalletAddressType.read(from: &buf), - firstAddress: FfiConverterString.read(from: &buf) + return + try FoundAddress( + type: FfiConverterTypeWalletAddressType.read(from: &buf), + firstAddress: FfiConverterString.read(from: &buf) ) } @@ -9743,20 +10754,22 @@ public struct FfiConverterTypeFoundAddress: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFoundAddress_lift(_ buf: RustBuffer) throws -> FoundAddress { - try FfiConverterTypeFoundAddress.lift(buf) + return try FfiConverterTypeFoundAddress.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFoundAddress_lower(_ value: FoundAddress) -> RustBuffer { - FfiConverterTypeFoundAddress.lower(value) + return FfiConverterTypeFoundAddress.lower(value) } + public struct GroupedWord { public var number: UInt8 public var word: String @@ -9769,8 +10782,10 @@ public struct GroupedWord { } } + + extension GroupedWord: Equatable, Hashable { - public static func == (lhs: GroupedWord, rhs: GroupedWord) -> Bool { + public static func ==(lhs: GroupedWord, rhs: GroupedWord) -> Bool { if lhs.number != rhs.number { return false } @@ -9786,14 +10801,16 @@ extension GroupedWord: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGroupedWord: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GroupedWord { - try GroupedWord( - number: FfiConverterUInt8.read(from: &buf), - word: FfiConverterString.read(from: &buf) + return + try GroupedWord( + number: FfiConverterUInt8.read(from: &buf), + word: FfiConverterString.read(from: &buf) ) } @@ -9803,59 +10820,71 @@ public struct FfiConverterTypeGroupedWord: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGroupedWord_lift(_ buf: RustBuffer) throws -> GroupedWord { - try FfiConverterTypeGroupedWord.lift(buf) + return try FfiConverterTypeGroupedWord.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGroupedWord_lower(_ value: GroupedWord) -> RustBuffer { - FfiConverterTypeGroupedWord.lower(value) + return FfiConverterTypeGroupedWord.lower(value) } + public struct ImportWalletViewModelState { + // Default memberwise initializers are never public by default, so we // declare one manually. - public init() {} + public init() { + } } + + extension ImportWalletViewModelState: Equatable, Hashable { - public static func == (_: ImportWalletViewModelState, _: ImportWalletViewModelState) -> Bool { - true + public static func ==(lhs: ImportWalletViewModelState, rhs: ImportWalletViewModelState) -> Bool { + return true } - public func hash(into _: inout Hasher) {} + public func hash(into hasher: inout Hasher) { + } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeImportWalletViewModelState: FfiConverterRustBuffer { - public static func read(from _: inout (data: Data, offset: Data.Index)) throws -> ImportWalletViewModelState { - ImportWalletViewModelState() + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ImportWalletViewModelState { + return + ImportWalletViewModelState() } - public static func write(_: ImportWalletViewModelState, into _: inout [UInt8]) {} + public static func write(_ value: ImportWalletViewModelState, into buf: inout [UInt8]) { + } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportWalletViewModelState_lift(_ buf: RustBuffer) throws -> ImportWalletViewModelState { - try FfiConverterTypeImportWalletViewModelState.lift(buf) + return try FfiConverterTypeImportWalletViewModelState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportWalletViewModelState_lower(_ value: ImportWalletViewModelState) -> RustBuffer { - FfiConverterTypeImportWalletViewModelState.lower(value) + return FfiConverterTypeImportWalletViewModelState.lower(value) } + public struct InternalOnlyMetadata { public var addressIndex: AddressIndex? public var lastScanFinished: TimeInterval? @@ -9870,8 +10899,10 @@ public struct InternalOnlyMetadata { } } + + extension InternalOnlyMetadata: Equatable, Hashable { - public static func == (lhs: InternalOnlyMetadata, rhs: InternalOnlyMetadata) -> Bool { + public static func ==(lhs: InternalOnlyMetadata, rhs: InternalOnlyMetadata) -> Bool { if lhs.addressIndex != rhs.addressIndex { return false } @@ -9891,15 +10922,17 @@ extension InternalOnlyMetadata: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeInternalOnlyMetadata: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> InternalOnlyMetadata { - try InternalOnlyMetadata( - addressIndex: FfiConverterOptionTypeAddressIndex.read(from: &buf), - lastScanFinished: FfiConverterOptionDuration.read(from: &buf), - lastHeightFetched: FfiConverterOptionTypeBlockSizeLast.read(from: &buf) + return + try InternalOnlyMetadata( + addressIndex: FfiConverterOptionTypeAddressIndex.read(from: &buf), + lastScanFinished: FfiConverterOptionDuration.read(from: &buf), + lastHeightFetched: FfiConverterOptionTypeBlockSizeLast.read(from: &buf) ) } @@ -9910,20 +10943,22 @@ public struct FfiConverterTypeInternalOnlyMetadata: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeInternalOnlyMetadata_lift(_ buf: RustBuffer) throws -> InternalOnlyMetadata { - try FfiConverterTypeInternalOnlyMetadata.lift(buf) + return try FfiConverterTypeInternalOnlyMetadata.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeInternalOnlyMetadata_lower(_ value: InternalOnlyMetadata) -> RustBuffer { - FfiConverterTypeInternalOnlyMetadata.lower(value) + return FfiConverterTypeInternalOnlyMetadata.lower(value) } + public struct MessageInfo { /** * The payload length of the message, including the header info @@ -9940,19 +10975,20 @@ public struct MessageInfo { public init( /** * The payload length of the message, including the header info - */ fullMessageLength: UInt16, + */fullMessageLength: UInt16, /** - * The payload length of the message, reported in the info header - * This is the length of the payload, without the header info - */ payloadLength: UInt16 - ) { + * The payload length of the message, reported in the info header + * This is the length of the payload, without the header info + */payloadLength: UInt16) { self.fullMessageLength = fullMessageLength self.payloadLength = payloadLength } } + + extension MessageInfo: Equatable, Hashable { - public static func == (lhs: MessageInfo, rhs: MessageInfo) -> Bool { + public static func ==(lhs: MessageInfo, rhs: MessageInfo) -> Bool { if lhs.fullMessageLength != rhs.fullMessageLength { return false } @@ -9968,14 +11004,16 @@ extension MessageInfo: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMessageInfo: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MessageInfo { - try MessageInfo( - fullMessageLength: FfiConverterUInt16.read(from: &buf), - payloadLength: FfiConverterUInt16.read(from: &buf) + return + try MessageInfo( + fullMessageLength: FfiConverterUInt16.read(from: &buf), + payloadLength: FfiConverterUInt16.read(from: &buf) ) } @@ -9985,20 +11023,22 @@ public struct FfiConverterTypeMessageInfo: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMessageInfo_lift(_ buf: RustBuffer) throws -> MessageInfo { - try FfiConverterTypeMessageInfo.lift(buf) + return try FfiConverterTypeMessageInfo.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMessageInfo_lower(_ value: MessageInfo) -> RustBuffer { - FfiConverterTypeMessageInfo.lower(value) + return FfiConverterTypeMessageInfo.lower(value) } + public struct NdefHeader { public var messageBegin: Bool public var messageEnd: Bool @@ -10025,8 +11065,10 @@ public struct NdefHeader { } } + + extension NdefHeader: Equatable, Hashable { - public static func == (lhs: NdefHeader, rhs: NdefHeader) -> Bool { + public static func ==(lhs: NdefHeader, rhs: NdefHeader) -> Bool { if lhs.messageBegin != rhs.messageBegin { return false } @@ -10070,21 +11112,23 @@ extension NdefHeader: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNdefHeader: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NdefHeader { - try NdefHeader( - messageBegin: FfiConverterBool.read(from: &buf), - messageEnd: FfiConverterBool.read(from: &buf), - chunked: FfiConverterBool.read(from: &buf), - shortRecord: FfiConverterBool.read(from: &buf), - hasIdLength: FfiConverterBool.read(from: &buf), - typeNameFormat: FfiConverterTypeNdefType.read(from: &buf), - typeLength: FfiConverterUInt8.read(from: &buf), - payloadLength: FfiConverterUInt32.read(from: &buf), - idLength: FfiConverterOptionUInt8.read(from: &buf) + return + try NdefHeader( + messageBegin: FfiConverterBool.read(from: &buf), + messageEnd: FfiConverterBool.read(from: &buf), + chunked: FfiConverterBool.read(from: &buf), + shortRecord: FfiConverterBool.read(from: &buf), + hasIdLength: FfiConverterBool.read(from: &buf), + typeNameFormat: FfiConverterTypeNdefType.read(from: &buf), + typeLength: FfiConverterUInt8.read(from: &buf), + payloadLength: FfiConverterUInt32.read(from: &buf), + idLength: FfiConverterOptionUInt8.read(from: &buf) ) } @@ -10101,20 +11145,22 @@ public struct FfiConverterTypeNdefHeader: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefHeader_lift(_ buf: RustBuffer) throws -> NdefHeader { - try FfiConverterTypeNdefHeader.lift(buf) + return try FfiConverterTypeNdefHeader.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefHeader_lower(_ value: NdefHeader) -> RustBuffer { - FfiConverterTypeNdefHeader.lower(value) + return FfiConverterTypeNdefHeader.lower(value) } + public struct NdefRecord { public var header: NdefHeader public var type: Data @@ -10131,8 +11177,10 @@ public struct NdefRecord { } } + + extension NdefRecord: Equatable, Hashable { - public static func == (lhs: NdefRecord, rhs: NdefRecord) -> Bool { + public static func ==(lhs: NdefRecord, rhs: NdefRecord) -> Bool { if lhs.header != rhs.header { return false } @@ -10156,16 +11204,18 @@ extension NdefRecord: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNdefRecord: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NdefRecord { - try NdefRecord( - header: FfiConverterTypeNdefHeader.read(from: &buf), - type: FfiConverterData.read(from: &buf), - id: FfiConverterOptionData.read(from: &buf), - payload: FfiConverterTypeNdefPayload.read(from: &buf) + return + try NdefRecord( + header: FfiConverterTypeNdefHeader.read(from: &buf), + type: FfiConverterData.read(from: &buf), + id: FfiConverterOptionData.read(from: &buf), + payload: FfiConverterTypeNdefPayload.read(from: &buf) ) } @@ -10177,20 +11227,22 @@ public struct FfiConverterTypeNdefRecord: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefRecord_lift(_ buf: RustBuffer) throws -> NdefRecord { - try FfiConverterTypeNdefRecord.lift(buf) + return try FfiConverterTypeNdefRecord.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefRecord_lower(_ value: NdefRecord) -> RustBuffer { - FfiConverterTypeNdefRecord.lower(value) + return FfiConverterTypeNdefRecord.lower(value) } + public struct Node { public var name: String public var network: Network @@ -10207,8 +11259,10 @@ public struct Node { } } + + extension Node: Equatable, Hashable { - public static func == (lhs: Node, rhs: Node) -> Bool { + public static func ==(lhs: Node, rhs: Node) -> Bool { if lhs.name != rhs.name { return false } @@ -10232,16 +11286,18 @@ extension Node: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNode: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Node { - try Node( - name: FfiConverterString.read(from: &buf), - network: FfiConverterTypeNetwork.read(from: &buf), - apiType: FfiConverterTypeApiType.read(from: &buf), - url: FfiConverterString.read(from: &buf) + return + try Node( + name: FfiConverterString.read(from: &buf), + network: FfiConverterTypeNetwork.read(from: &buf), + apiType: FfiConverterTypeApiType.read(from: &buf), + url: FfiConverterString.read(from: &buf) ) } @@ -10253,20 +11309,22 @@ public struct FfiConverterTypeNode: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNode_lift(_ buf: RustBuffer) throws -> Node { - try FfiConverterTypeNode.lift(buf) + return try FfiConverterTypeNode.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNode_lower(_ value: Node) -> RustBuffer { - FfiConverterTypeNode.lower(value) + return FfiConverterTypeNode.lower(value) } + public struct ParsingContext { public var messageInfo: MessageInfo public var needed: UInt16 @@ -10281,8 +11339,10 @@ public struct ParsingContext { } } + + extension ParsingContext: Equatable, Hashable { - public static func == (lhs: ParsingContext, rhs: ParsingContext) -> Bool { + public static func ==(lhs: ParsingContext, rhs: ParsingContext) -> Bool { if lhs.messageInfo != rhs.messageInfo { return false } @@ -10302,15 +11362,17 @@ extension ParsingContext: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeParsingContext: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ParsingContext { - try ParsingContext( - messageInfo: FfiConverterTypeMessageInfo.read(from: &buf), - needed: FfiConverterUInt16.read(from: &buf), - firstBlockHash: FfiConverterOptionString.read(from: &buf) + return + try ParsingContext( + messageInfo: FfiConverterTypeMessageInfo.read(from: &buf), + needed: FfiConverterUInt16.read(from: &buf), + firstBlockHash: FfiConverterOptionString.read(from: &buf) ) } @@ -10321,20 +11383,22 @@ public struct FfiConverterTypeParsingContext: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParsingContext_lift(_ buf: RustBuffer) throws -> ParsingContext { - try FfiConverterTypeParsingContext.lift(buf) + return try FfiConverterTypeParsingContext.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParsingContext_lower(_ value: ParsingContext) -> RustBuffer { - FfiConverterTypeParsingContext.lower(value) + return FfiConverterTypeParsingContext.lower(value) } + public struct ParsingMessage { public var messageInfo: MessageInfo public var leftOverBytes: Data @@ -10347,8 +11411,10 @@ public struct ParsingMessage { } } + + extension ParsingMessage: Equatable, Hashable { - public static func == (lhs: ParsingMessage, rhs: ParsingMessage) -> Bool { + public static func ==(lhs: ParsingMessage, rhs: ParsingMessage) -> Bool { if lhs.messageInfo != rhs.messageInfo { return false } @@ -10364,14 +11430,16 @@ extension ParsingMessage: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeParsingMessage: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ParsingMessage { - try ParsingMessage( - messageInfo: FfiConverterTypeMessageInfo.read(from: &buf), - leftOverBytes: FfiConverterData.read(from: &buf) + return + try ParsingMessage( + messageInfo: FfiConverterTypeMessageInfo.read(from: &buf), + leftOverBytes: FfiConverterData.read(from: &buf) ) } @@ -10381,20 +11449,22 @@ public struct FfiConverterTypeParsingMessage: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParsingMessage_lift(_ buf: RustBuffer) throws -> ParsingMessage { - try FfiConverterTypeParsingMessage.lift(buf) + return try FfiConverterTypeParsingMessage.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParsingMessage_lower(_ value: ParsingMessage) -> RustBuffer { - FfiConverterTypeParsingMessage.lower(value) + return FfiConverterTypeParsingMessage.lower(value) } + public struct PendingDetails { public var lastSeen: UInt64 @@ -10405,8 +11475,10 @@ public struct PendingDetails { } } + + extension PendingDetails: Equatable, Hashable { - public static func == (lhs: PendingDetails, rhs: PendingDetails) -> Bool { + public static func ==(lhs: PendingDetails, rhs: PendingDetails) -> Bool { if lhs.lastSeen != rhs.lastSeen { return false } @@ -10418,13 +11490,15 @@ extension PendingDetails: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePendingDetails: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PendingDetails { - try PendingDetails( - lastSeen: FfiConverterUInt64.read(from: &buf) + return + try PendingDetails( + lastSeen: FfiConverterUInt64.read(from: &buf) ) } @@ -10433,20 +11507,22 @@ public struct FfiConverterTypePendingDetails: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingDetails_lift(_ buf: RustBuffer) throws -> PendingDetails { - try FfiConverterTypePendingDetails.lift(buf) + return try FfiConverterTypePendingDetails.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingDetails_lower(_ value: PendingDetails) -> RustBuffer { - FfiConverterTypePendingDetails.lower(value) + return FfiConverterTypePendingDetails.lower(value) } + public struct PendingWalletViewModelState { public var numberOfWords: NumberOfBip39Words public var wallet: PendingWallet @@ -10459,14 +11535,17 @@ public struct PendingWalletViewModelState { } } + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePendingWalletViewModelState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PendingWalletViewModelState { - try PendingWalletViewModelState( - numberOfWords: FfiConverterTypeNumberOfBip39Words.read(from: &buf), - wallet: FfiConverterTypePendingWallet.read(from: &buf) + return + try PendingWalletViewModelState( + numberOfWords: FfiConverterTypeNumberOfBip39Words.read(from: &buf), + wallet: FfiConverterTypePendingWallet.read(from: &buf) ) } @@ -10476,20 +11555,22 @@ public struct FfiConverterTypePendingWalletViewModelState: FfiConverterRustBuffe } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWalletViewModelState_lift(_ buf: RustBuffer) throws -> PendingWalletViewModelState { - try FfiConverterTypePendingWalletViewModelState.lift(buf) + return try FfiConverterTypePendingWalletViewModelState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWalletViewModelState_lower(_ value: PendingWalletViewModelState) -> RustBuffer { - FfiConverterTypePendingWalletViewModelState.lower(value) + return FfiConverterTypePendingWalletViewModelState.lower(value) } + public struct PriceResponse { public var time: UInt64 public var usd: UInt64 @@ -10514,8 +11595,10 @@ public struct PriceResponse { } } + + extension PriceResponse: Equatable, Hashable { - public static func == (lhs: PriceResponse, rhs: PriceResponse) -> Bool { + public static func ==(lhs: PriceResponse, rhs: PriceResponse) -> Bool { if lhs.time != rhs.time { return false } @@ -10555,20 +11638,22 @@ extension PriceResponse: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePriceResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PriceResponse { - try PriceResponse( - time: FfiConverterUInt64.read(from: &buf), - usd: FfiConverterUInt64.read(from: &buf), - eur: FfiConverterUInt64.read(from: &buf), - gbp: FfiConverterUInt64.read(from: &buf), - cad: FfiConverterUInt64.read(from: &buf), - chf: FfiConverterUInt64.read(from: &buf), - aud: FfiConverterUInt64.read(from: &buf), - jpy: FfiConverterUInt64.read(from: &buf) + return + try PriceResponse( + time: FfiConverterUInt64.read(from: &buf), + usd: FfiConverterUInt64.read(from: &buf), + eur: FfiConverterUInt64.read(from: &buf), + gbp: FfiConverterUInt64.read(from: &buf), + cad: FfiConverterUInt64.read(from: &buf), + chf: FfiConverterUInt64.read(from: &buf), + aud: FfiConverterUInt64.read(from: &buf), + jpy: FfiConverterUInt64.read(from: &buf) ) } @@ -10584,20 +11669,22 @@ public struct FfiConverterTypePriceResponse: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePriceResponse_lift(_ buf: RustBuffer) throws -> PriceResponse { - try FfiConverterTypePriceResponse.lift(buf) + return try FfiConverterTypePriceResponse.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePriceResponse_lower(_ value: PriceResponse) -> RustBuffer { - FfiConverterTypePriceResponse.lower(value) + return FfiConverterTypePriceResponse.lower(value) } + public struct Rgb { public var r: UInt8 public var g: UInt8 @@ -10612,8 +11699,10 @@ public struct Rgb { } } + + extension Rgb: Equatable, Hashable { - public static func == (lhs: Rgb, rhs: Rgb) -> Bool { + public static func ==(lhs: Rgb, rhs: Rgb) -> Bool { if lhs.r != rhs.r { return false } @@ -10633,15 +11722,17 @@ extension Rgb: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeRgb: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Rgb { - try Rgb( - r: FfiConverterUInt8.read(from: &buf), - g: FfiConverterUInt8.read(from: &buf), - b: FfiConverterUInt8.read(from: &buf) + return + try Rgb( + r: FfiConverterUInt8.read(from: &buf), + g: FfiConverterUInt8.read(from: &buf), + b: FfiConverterUInt8.read(from: &buf) ) } @@ -10652,20 +11743,22 @@ public struct FfiConverterTypeRgb: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRgb_lift(_ buf: RustBuffer) throws -> Rgb { - try FfiConverterTypeRgb.lift(buf) + return try FfiConverterTypeRgb.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRgb_lower(_ value: Rgb) -> RustBuffer { - FfiConverterTypeRgb.lower(value) + return FfiConverterTypeRgb.lower(value) } + public struct Router { public var app: FfiApp public var `default`: Route @@ -10673,46 +11766,51 @@ public struct Router { // Default memberwise initializers are never public by default, so we // declare one manually. - public init(app: FfiApp, default: Route, routes: [Route]) { + public init(app: FfiApp, `default`: Route, routes: [Route]) { self.app = app - self.default = `default` + self.`default` = `default` self.routes = routes } } + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeRouter: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Router { - try Router( - app: FfiConverterTypeFfiApp.read(from: &buf), - default: FfiConverterTypeRoute.read(from: &buf), - routes: FfiConverterSequenceTypeRoute.read(from: &buf) + return + try Router( + app: FfiConverterTypeFfiApp.read(from: &buf), + default: FfiConverterTypeRoute.read(from: &buf), + routes: FfiConverterSequenceTypeRoute.read(from: &buf) ) } public static func write(_ value: Router, into buf: inout [UInt8]) { FfiConverterTypeFfiApp.write(value.app, into: &buf) - FfiConverterTypeRoute.write(value.default, into: &buf) + FfiConverterTypeRoute.write(value.`default`, into: &buf) FfiConverterSequenceTypeRoute.write(value.routes, into: &buf) } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRouter_lift(_ buf: RustBuffer) throws -> Router { - try FfiConverterTypeRouter.lift(buf) + return try FfiConverterTypeRouter.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRouter_lower(_ value: Router) -> RustBuffer { - FfiConverterTypeRouter.lower(value) + return FfiConverterTypeRouter.lower(value) } + public struct ScanningInfo { public var addressType: WalletAddressType public var count: UInt32 @@ -10725,8 +11823,10 @@ public struct ScanningInfo { } } + + extension ScanningInfo: Equatable, Hashable { - public static func == (lhs: ScanningInfo, rhs: ScanningInfo) -> Bool { + public static func ==(lhs: ScanningInfo, rhs: ScanningInfo) -> Bool { if lhs.addressType != rhs.addressType { return false } @@ -10742,14 +11842,16 @@ extension ScanningInfo: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeScanningInfo: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ScanningInfo { - try ScanningInfo( - addressType: FfiConverterTypeWalletAddressType.read(from: &buf), - count: FfiConverterUInt32.read(from: &buf) + return + try ScanningInfo( + addressType: FfiConverterTypeWalletAddressType.read(from: &buf), + count: FfiConverterUInt32.read(from: &buf) ) } @@ -10759,20 +11861,22 @@ public struct FfiConverterTypeScanningInfo: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeScanningInfo_lift(_ buf: RustBuffer) throws -> ScanningInfo { - try FfiConverterTypeScanningInfo.lift(buf) + return try FfiConverterTypeScanningInfo.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeScanningInfo_lower(_ value: ScanningInfo) -> RustBuffer { - FfiConverterTypeScanningInfo.lower(value) + return FfiConverterTypeScanningInfo.lower(value) } + public struct TextPayload { public var format: TextPayloadFormat public var language: String @@ -10787,8 +11891,10 @@ public struct TextPayload { } } + + extension TextPayload: Equatable, Hashable { - public static func == (lhs: TextPayload, rhs: TextPayload) -> Bool { + public static func ==(lhs: TextPayload, rhs: TextPayload) -> Bool { if lhs.format != rhs.format { return false } @@ -10808,15 +11914,17 @@ extension TextPayload: Equatable, Hashable { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTextPayload: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TextPayload { - try TextPayload( - format: FfiConverterTypeTextPayloadFormat.read(from: &buf), - language: FfiConverterString.read(from: &buf), - text: FfiConverterString.read(from: &buf) + return + try TextPayload( + format: FfiConverterTypeTextPayloadFormat.read(from: &buf), + language: FfiConverterString.read(from: &buf), + text: FfiConverterString.read(from: &buf) ) } @@ -10827,20 +11935,22 @@ public struct FfiConverterTypeTextPayload: FfiConverterRustBuffer { } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTextPayload_lift(_ buf: RustBuffer) throws -> TextPayload { - try FfiConverterTypeTextPayload.lift(buf) + return try FfiConverterTypeTextPayload.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTextPayload_lower(_ value: TextPayload) -> RustBuffer { - FfiConverterTypeTextPayload.lower(value) + return FfiConverterTypeTextPayload.lower(value) } + public struct WalletMetadata { public var id: WalletId public var name: String @@ -10861,7 +11971,7 @@ public struct WalletMetadata { // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: WalletId, name: String, color: WalletColor, verified: Bool, network: Network, performedFullScan: Bool, masterFingerprint: Fingerprint?, selectedUnit: Unit, selectedFiatCurrency: FiatCurrency, sensitiveVisible: Bool, detailsExpanded: Bool, walletType: WalletType, discoveryState: DiscoveryState, addressType: WalletAddressType, fiatOrBtc: FiatOrBtc, internal: InternalOnlyMetadata) { + public init(id: WalletId, name: String, color: WalletColor, verified: Bool, network: Network, performedFullScan: Bool, masterFingerprint: Fingerprint?, selectedUnit: Unit, selectedFiatCurrency: FiatCurrency, sensitiveVisible: Bool, detailsExpanded: Bool, walletType: WalletType, discoveryState: DiscoveryState, addressType: WalletAddressType, fiatOrBtc: FiatOrBtc, `internal`: InternalOnlyMetadata) { self.id = id self.name = name self.color = color @@ -10877,32 +11987,35 @@ public struct WalletMetadata { self.discoveryState = discoveryState self.addressType = addressType self.fiatOrBtc = fiatOrBtc - self.internal = `internal` + self.`internal` = `internal` } } + + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletMetadata: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletMetadata { - try WalletMetadata( - id: FfiConverterTypeWalletId.read(from: &buf), - name: FfiConverterString.read(from: &buf), - color: FfiConverterTypeWalletColor.read(from: &buf), - verified: FfiConverterBool.read(from: &buf), - network: FfiConverterTypeNetwork.read(from: &buf), - performedFullScan: FfiConverterBool.read(from: &buf), - masterFingerprint: FfiConverterOptionTypeFingerprint.read(from: &buf), - selectedUnit: FfiConverterTypeUnit.read(from: &buf), - selectedFiatCurrency: FfiConverterTypeFiatCurrency.read(from: &buf), - sensitiveVisible: FfiConverterBool.read(from: &buf), - detailsExpanded: FfiConverterBool.read(from: &buf), - walletType: FfiConverterTypeWalletType.read(from: &buf), - discoveryState: FfiConverterTypeDiscoveryState.read(from: &buf), - addressType: FfiConverterTypeWalletAddressType.read(from: &buf), - fiatOrBtc: FfiConverterTypeFiatOrBtc.read(from: &buf), - internal: FfiConverterTypeInternalOnlyMetadata.read(from: &buf) + return + try WalletMetadata( + id: FfiConverterTypeWalletId.read(from: &buf), + name: FfiConverterString.read(from: &buf), + color: FfiConverterTypeWalletColor.read(from: &buf), + verified: FfiConverterBool.read(from: &buf), + network: FfiConverterTypeNetwork.read(from: &buf), + performedFullScan: FfiConverterBool.read(from: &buf), + masterFingerprint: FfiConverterOptionTypeFingerprint.read(from: &buf), + selectedUnit: FfiConverterTypeUnit.read(from: &buf), + selectedFiatCurrency: FfiConverterTypeFiatCurrency.read(from: &buf), + sensitiveVisible: FfiConverterBool.read(from: &buf), + detailsExpanded: FfiConverterBool.read(from: &buf), + walletType: FfiConverterTypeWalletType.read(from: &buf), + discoveryState: FfiConverterTypeDiscoveryState.read(from: &buf), + addressType: FfiConverterTypeWalletAddressType.read(from: &buf), + fiatOrBtc: FfiConverterTypeFiatOrBtc.read(from: &buf), + internal: FfiConverterTypeInternalOnlyMetadata.read(from: &buf) ) } @@ -10922,25 +12035,30 @@ public struct FfiConverterTypeWalletMetadata: FfiConverterRustBuffer { FfiConverterTypeDiscoveryState.write(value.discoveryState, into: &buf) FfiConverterTypeWalletAddressType.write(value.addressType, into: &buf) FfiConverterTypeFiatOrBtc.write(value.fiatOrBtc, into: &buf) - FfiConverterTypeInternalOnlyMetadata.write(value.internal, into: &buf) + FfiConverterTypeInternalOnlyMetadata.write(value.`internal`, into: &buf) } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletMetadata_lift(_ buf: RustBuffer) throws -> WalletMetadata { - try FfiConverterTypeWalletMetadata.lift(buf) + return try FfiConverterTypeWalletMetadata.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletMetadata_lower(_ value: WalletMetadata) -> RustBuffer { - FfiConverterTypeWalletMetadata.lower(value) + return FfiConverterTypeWalletMetadata.lower(value) } + public enum AddressError { + + + case NoOutputs case ScriptError(String ) @@ -10951,8 +12069,9 @@ public enum AddressError { case EmptyAddress } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAddressError: FfiConverterRustBuffer { typealias SwiftType = AddressError @@ -10960,45 +12079,62 @@ public struct FfiConverterTypeAddressError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .NoOutputs - case 2: return try .ScriptError( - FfiConverterString.read(from: &buf) + case 2: return .ScriptError( + try FfiConverterString.read(from: &buf) ) case 3: return .InvalidAddress case 4: return .UnsupportedNetwork - case 5: return try .WrongNetwork( - current: FfiConverterTypeNetwork.read(from: &buf) + case 5: return .WrongNetwork( + current: try FfiConverterTypeNetwork.read(from: &buf) ) case 6: return .EmptyAddress - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: AddressError, into buf: inout [UInt8]) { switch value { + + + + + case .NoOutputs: writeInt(&buf, Int32(1)) - + + case let .ScriptError(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case .InvalidAddress: writeInt(&buf, Int32(3)) - + + case .UnsupportedNetwork: writeInt(&buf, Int32(4)) - + + case let .WrongNetwork(current): writeInt(&buf, Int32(5)) FfiConverterTypeNetwork.write(current, into: &buf) - + + case .EmptyAddress: writeInt(&buf, Int32(6)) + } } } + extension AddressError: Equatable, Hashable {} extension AddressError: Foundation.LocalizedError { @@ -11011,13 +12147,15 @@ extension AddressError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ApiType { + case esplora case electrum case rpc } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeApiType: FfiConverterRustBuffer { typealias SwiftType = ApiType @@ -11025,50 +12163,62 @@ public struct FfiConverterTypeApiType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ApiType { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .esplora - + case 2: return .electrum - + case 3: return .rpc - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ApiType, into buf: inout [UInt8]) { switch value { + + case .esplora: writeInt(&buf, Int32(1)) - + + case .electrum: writeInt(&buf, Int32(2)) - + + case .rpc: writeInt(&buf, Int32(3)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeApiType_lift(_ buf: RustBuffer) throws -> ApiType { - try FfiConverterTypeApiType.lift(buf) + return try FfiConverterTypeApiType.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeApiType_lower(_ value: ApiType) -> RustBuffer { - FfiConverterTypeApiType.lower(value) + return FfiConverterTypeApiType.lower(value) } + + extension ApiType: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum AppAction { + case updateRoute(routes: [Route] ) case changeNetwork(network: Network @@ -11081,8 +12231,9 @@ public enum AppAction { case updateFees } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAppAction: FfiConverterRustBuffer { typealias SwiftType = AppAction @@ -11090,76 +12241,94 @@ public struct FfiConverterTypeAppAction: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppAction { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .updateRoute(routes: FfiConverterSequenceTypeRoute.read(from: &buf) - ) - - case 2: return try .changeNetwork(network: FfiConverterTypeNetwork.read(from: &buf) - ) - - case 3: return try .changeColorScheme(FfiConverterTypeColorSchemeSelection.read(from: &buf) - ) - - case 4: return try .setSelectedNode(FfiConverterTypeNode.read(from: &buf) - ) - + + case 1: return .updateRoute(routes: try FfiConverterSequenceTypeRoute.read(from: &buf) + ) + + case 2: return .changeNetwork(network: try FfiConverterTypeNetwork.read(from: &buf) + ) + + case 3: return .changeColorScheme(try FfiConverterTypeColorSchemeSelection.read(from: &buf) + ) + + case 4: return .setSelectedNode(try FfiConverterTypeNode.read(from: &buf) + ) + case 5: return .updateFiatPrices - + case 6: return .updateFees - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: AppAction, into buf: inout [UInt8]) { switch value { + + case let .updateRoute(routes): writeInt(&buf, Int32(1)) FfiConverterSequenceTypeRoute.write(routes, into: &buf) - + + case let .changeNetwork(network): writeInt(&buf, Int32(2)) FfiConverterTypeNetwork.write(network, into: &buf) - + + case let .changeColorScheme(v1): writeInt(&buf, Int32(3)) FfiConverterTypeColorSchemeSelection.write(v1, into: &buf) - + + case let .setSelectedNode(v1): writeInt(&buf, Int32(4)) FfiConverterTypeNode.write(v1, into: &buf) - + + case .updateFiatPrices: writeInt(&buf, Int32(5)) - + + case .updateFees: writeInt(&buf, Int32(6)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAppAction_lift(_ buf: RustBuffer) throws -> AppAction { - try FfiConverterTypeAppAction.lift(buf) + return try FfiConverterTypeAppAction.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAppAction_lower(_ value: AppAction) -> RustBuffer { - FfiConverterTypeAppAction.lower(value) + return FfiConverterTypeAppAction.lower(value) } + + + + public enum AppError { + + + case PricesError(String ) case FeesError(String ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAppError: FfiConverterRustBuffer { typealias SwiftType = AppError @@ -11167,31 +12336,42 @@ public struct FfiConverterTypeAppError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .PricesError( - FfiConverterString.read(from: &buf) - ) - case 2: return try .FeesError( - FfiConverterString.read(from: &buf) + + + + case 1: return .PricesError( + try FfiConverterString.read(from: &buf) + ) + case 2: return .FeesError( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: AppError, into buf: inout [UInt8]) { switch value { + + + + + case let .PricesError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .FeesError(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) + } } } + extension AppError: Equatable, Hashable {} extension AppError: Foundation.LocalizedError { @@ -11204,6 +12384,7 @@ extension AppError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum AppStateReconcileMessage { + case defaultRouteChanged(Route ) case routeUpdated([Route] @@ -11219,8 +12400,9 @@ public enum AppStateReconcileMessage { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeAppStateReconcileMessage: FfiConverterRustBuffer { typealias SwiftType = AppStateReconcileMessage @@ -11228,77 +12410,95 @@ public struct FfiConverterTypeAppStateReconcileMessage: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppStateReconcileMessage { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .defaultRouteChanged(FfiConverterTypeRoute.read(from: &buf) - ) - - case 2: return try .routeUpdated(FfiConverterSequenceTypeRoute.read(from: &buf) - ) - + + case 1: return .defaultRouteChanged(try FfiConverterTypeRoute.read(from: &buf) + ) + + case 2: return .routeUpdated(try FfiConverterSequenceTypeRoute.read(from: &buf) + ) + case 3: return .databaseUpdated - - case 4: return try .colorSchemeChanged(FfiConverterTypeColorSchemeSelection.read(from: &buf) - ) - - case 5: return try .selectedNodeChanged(FfiConverterTypeNode.read(from: &buf) - ) - - case 6: return try .fiatPricesChanged(FfiConverterTypePriceResponse.read(from: &buf) - ) - - case 7: return try .feesChanged(FfiConverterTypeFeeResponse.read(from: &buf) - ) - + + case 4: return .colorSchemeChanged(try FfiConverterTypeColorSchemeSelection.read(from: &buf) + ) + + case 5: return .selectedNodeChanged(try FfiConverterTypeNode.read(from: &buf) + ) + + case 6: return .fiatPricesChanged(try FfiConverterTypePriceResponse.read(from: &buf) + ) + + case 7: return .feesChanged(try FfiConverterTypeFeeResponse.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: AppStateReconcileMessage, into buf: inout [UInt8]) { switch value { + + case let .defaultRouteChanged(v1): writeInt(&buf, Int32(1)) FfiConverterTypeRoute.write(v1, into: &buf) - + + case let .routeUpdated(v1): writeInt(&buf, Int32(2)) FfiConverterSequenceTypeRoute.write(v1, into: &buf) - + + case .databaseUpdated: writeInt(&buf, Int32(3)) - + + case let .colorSchemeChanged(v1): writeInt(&buf, Int32(4)) FfiConverterTypeColorSchemeSelection.write(v1, into: &buf) - + + case let .selectedNodeChanged(v1): writeInt(&buf, Int32(5)) FfiConverterTypeNode.write(v1, into: &buf) - + + case let .fiatPricesChanged(v1): writeInt(&buf, Int32(6)) FfiConverterTypePriceResponse.write(v1, into: &buf) - + + case let .feesChanged(v1): writeInt(&buf, Int32(7)) FfiConverterTypeFeeResponse.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAppStateReconcileMessage_lift(_ buf: RustBuffer) throws -> AppStateReconcileMessage { - try FfiConverterTypeAppStateReconcileMessage.lift(buf) + return try FfiConverterTypeAppStateReconcileMessage.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeAppStateReconcileMessage_lower(_ value: AppStateReconcileMessage) -> RustBuffer { - FfiConverterTypeAppStateReconcileMessage.lower(value) + return FfiConverterTypeAppStateReconcileMessage.lower(value) } + + + + public enum Bip39Error { + + + /** * Mnemonic has a word count that is not a multiple of 6, found {0}. */ @@ -11326,8 +12526,9 @@ public enum Bip39Error { case AmbiguousLanguages } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBip39Error: FfiConverterRustBuffer { typealias SwiftType = Bip39Error @@ -11335,44 +12536,60 @@ public struct FfiConverterTypeBip39Error: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bip39Error { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .BadWordCount( - FfiConverterUInt32.read(from: &buf) + + + + + case 1: return .BadWordCount( + try FfiConverterUInt32.read(from: &buf) ) - case 2: return try .UnknownWord( - FfiConverterUInt32.read(from: &buf) + case 2: return .UnknownWord( + try FfiConverterUInt32.read(from: &buf) ) - case 3: return try .BadEntropyBitCount( - FfiConverterUInt32.read(from: &buf) + case 3: return .BadEntropyBitCount( + try FfiConverterUInt32.read(from: &buf) ) case 4: return .InvalidChecksum case 5: return .AmbiguousLanguages - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Bip39Error, into buf: inout [UInt8]) { switch value { + + + + + case let .BadWordCount(v1): writeInt(&buf, Int32(1)) FfiConverterUInt32.write(v1, into: &buf) - + + case let .UnknownWord(v1): writeInt(&buf, Int32(2)) FfiConverterUInt32.write(v1, into: &buf) - + + case let .BadEntropyBitCount(v1): writeInt(&buf, Int32(3)) FfiConverterUInt32.write(v1, into: &buf) - + + case .InvalidChecksum: writeInt(&buf, Int32(4)) - + + case .AmbiguousLanguages: writeInt(&buf, Int32(5)) + } } } + extension Bip39Error: Equatable, Hashable {} extension Bip39Error: Foundation.LocalizedError { @@ -11381,15 +12598,20 @@ extension Bip39Error: Foundation.LocalizedError { } } + public enum BitcoinTransactionError { + + + case HexDecodeError(String ) case ParseTransactionError(String ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeBitcoinTransactionError: FfiConverterRustBuffer { typealias SwiftType = BitcoinTransactionError @@ -11397,31 +12619,42 @@ public struct FfiConverterTypeBitcoinTransactionError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BitcoinTransactionError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .HexDecodeError( - FfiConverterString.read(from: &buf) - ) - case 2: return try .ParseTransactionError( - FfiConverterString.read(from: &buf) + + + + case 1: return .HexDecodeError( + try FfiConverterString.read(from: &buf) + ) + case 2: return .ParseTransactionError( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BitcoinTransactionError, into buf: inout [UInt8]) { switch value { + + + + + case let .HexDecodeError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .ParseTransactionError(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) + } } } + extension BitcoinTransactionError: Equatable, Hashable {} extension BitcoinTransactionError: Foundation.LocalizedError { @@ -11434,11 +12667,13 @@ extension BitcoinTransactionError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ColdWalletRoute { + case qrCode } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeColdWalletRoute: FfiConverterRustBuffer { typealias SwiftType = ColdWalletRoute @@ -11446,47 +12681,58 @@ public struct FfiConverterTypeColdWalletRoute: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ColdWalletRoute { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .qrCode - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ColdWalletRoute, into buf: inout [UInt8]) { switch value { + + case .qrCode: writeInt(&buf, Int32(1)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeColdWalletRoute_lift(_ buf: RustBuffer) throws -> ColdWalletRoute { - try FfiConverterTypeColdWalletRoute.lift(buf) + return try FfiConverterTypeColdWalletRoute.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeColdWalletRoute_lower(_ value: ColdWalletRoute) -> RustBuffer { - FfiConverterTypeColdWalletRoute.lower(value) + return FfiConverterTypeColdWalletRoute.lower(value) } + + extension ColdWalletRoute: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ColorSchemeSelection { + case light case dark case system } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeColorSchemeSelection: FfiConverterRustBuffer { typealias SwiftType = ColorSchemeSelection @@ -11494,53 +12740,69 @@ public struct FfiConverterTypeColorSchemeSelection: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ColorSchemeSelection { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .light - + case 2: return .dark - + case 3: return .system - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ColorSchemeSelection, into buf: inout [UInt8]) { switch value { + + case .light: writeInt(&buf, Int32(1)) - + + case .dark: writeInt(&buf, Int32(2)) - + + case .system: writeInt(&buf, Int32(3)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeColorSchemeSelection_lift(_ buf: RustBuffer) throws -> ColorSchemeSelection { - try FfiConverterTypeColorSchemeSelection.lift(buf) + return try FfiConverterTypeColorSchemeSelection.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeColorSchemeSelection_lower(_ value: ColorSchemeSelection) -> RustBuffer { - FfiConverterTypeColorSchemeSelection.lower(value) + return FfiConverterTypeColorSchemeSelection.lower(value) } + + extension ColorSchemeSelection: Equatable, Hashable {} + + + public enum ConfirmDetailsError { + + + case QrCodeCreation(String ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeConfirmDetailsError: FfiConverterRustBuffer { typealias SwiftType = ConfirmDetailsError @@ -11548,23 +12810,34 @@ public struct FfiConverterTypeConfirmDetailsError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ConfirmDetailsError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .QrCodeCreation( - FfiConverterString.read(from: &buf) + + + + + case 1: return .QrCodeCreation( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ConfirmDetailsError, into buf: inout [UInt8]) { switch value { + + + + + case let .QrCodeCreation(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) + } } } + extension ConfirmDetailsError: Equatable, Hashable {} extension ConfirmDetailsError: Foundation.LocalizedError { @@ -11573,7 +12846,11 @@ extension ConfirmDetailsError: Foundation.LocalizedError { } } + public enum DatabaseError { + + + case DatabaseAccess(String ) case TableAccess(String @@ -11592,8 +12869,9 @@ public enum DatabaseError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeDatabaseError: FfiConverterRustBuffer { typealias SwiftType = DatabaseError @@ -11601,71 +12879,90 @@ public struct FfiConverterTypeDatabaseError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DatabaseError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .DatabaseAccess( - FfiConverterString.read(from: &buf) + + + + + case 1: return .DatabaseAccess( + try FfiConverterString.read(from: &buf) ) - case 2: return try .TableAccess( - FfiConverterString.read(from: &buf) + case 2: return .TableAccess( + try FfiConverterString.read(from: &buf) ) - case 3: return try .Wallets( - FfiConverterTypeWalletTableError.read(from: &buf) + case 3: return .Wallets( + try FfiConverterTypeWalletTableError.read(from: &buf) ) - case 4: return try .GlobalFlag( - FfiConverterTypeGlobalFlagTableError.read(from: &buf) + case 4: return .GlobalFlag( + try FfiConverterTypeGlobalFlagTableError.read(from: &buf) ) - case 5: return try .GlobalConfig( - FfiConverterTypeGlobalConfigTableError.read(from: &buf) + case 5: return .GlobalConfig( + try FfiConverterTypeGlobalConfigTableError.read(from: &buf) ) - case 6: return try .GlobalCache( - FfiConverterTypeGlobalCacheTableError.read(from: &buf) + case 6: return .GlobalCache( + try FfiConverterTypeGlobalCacheTableError.read(from: &buf) ) - case 7: return try .UnsignedTransactions( - FfiConverterTypeUnsignedTransactionsTableError.read(from: &buf) + case 7: return .UnsignedTransactions( + try FfiConverterTypeUnsignedTransactionsTableError.read(from: &buf) ) - case 8: return try .Serialization( - FfiConverterTypeSerdeError.read(from: &buf) + case 8: return .Serialization( + try FfiConverterTypeSerdeError.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: DatabaseError, into buf: inout [UInt8]) { switch value { + + + + + case let .DatabaseAccess(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .TableAccess(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case let .Wallets(v1): writeInt(&buf, Int32(3)) FfiConverterTypeWalletTableError.write(v1, into: &buf) - + + case let .GlobalFlag(v1): writeInt(&buf, Int32(4)) FfiConverterTypeGlobalFlagTableError.write(v1, into: &buf) - + + case let .GlobalConfig(v1): writeInt(&buf, Int32(5)) FfiConverterTypeGlobalConfigTableError.write(v1, into: &buf) - + + case let .GlobalCache(v1): writeInt(&buf, Int32(6)) FfiConverterTypeGlobalCacheTableError.write(v1, into: &buf) - + + case let .UnsignedTransactions(v1): writeInt(&buf, Int32(7)) FfiConverterTypeUnsignedTransactionsTableError.write(v1, into: &buf) - + + case let .Serialization(v1): writeInt(&buf, Int32(8)) FfiConverterTypeSerdeError.write(v1, into: &buf) + } } } + extension DatabaseError: Equatable, Hashable {} extension DatabaseError: Foundation.LocalizedError { @@ -11674,7 +12971,11 @@ extension DatabaseError: Foundation.LocalizedError { } } + public enum DescriptorError { + + + case InvalidDescriptor(String ) case MissingKeys @@ -11695,8 +12996,9 @@ public enum DescriptorError { case SinglePubkeyNotSupported } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeDescriptorError: FfiConverterRustBuffer { typealias SwiftType = DescriptorError @@ -11704,82 +13006,106 @@ public struct FfiConverterTypeDescriptorError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DescriptorError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .InvalidDescriptor( - FfiConverterString.read(from: &buf) + + + + + case 1: return .InvalidDescriptor( + try FfiConverterString.read(from: &buf) ) case 2: return .MissingKeys - case 3: return try .TooManyKeys( - FfiConverterUInt32.read(from: &buf) + case 3: return .TooManyKeys( + try FfiConverterUInt32.read(from: &buf) ) - case 4: return try .InvalidDescriptorParse( - FfiConverterString.read(from: &buf) + case 4: return .InvalidDescriptorParse( + try FfiConverterString.read(from: &buf) ) case 5: return .MissingDescriptor case 6: return .MissingXpub case 7: return .MissingDerivationPath case 8: return .MissingScriptType case 9: return .MissingFingerprint - case 10: return try .InvalidXpub( - FfiConverterString.read(from: &buf) + case 10: return .InvalidXpub( + try FfiConverterString.read(from: &buf) ) - case 11: return try .UnableToParseXpub( - FfiConverterString.read(from: &buf) + case 11: return .UnableToParseXpub( + try FfiConverterString.read(from: &buf) ) case 12: return .NoXpubInDescriptor case 13: return .SinglePubkeyNotSupported - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: DescriptorError, into buf: inout [UInt8]) { switch value { + + + + + case let .InvalidDescriptor(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case .MissingKeys: writeInt(&buf, Int32(2)) - + + case let .TooManyKeys(v1): writeInt(&buf, Int32(3)) FfiConverterUInt32.write(v1, into: &buf) - + + case let .InvalidDescriptorParse(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) - + + case .MissingDescriptor: writeInt(&buf, Int32(5)) - + + case .MissingXpub: writeInt(&buf, Int32(6)) - + + case .MissingDerivationPath: writeInt(&buf, Int32(7)) - + + case .MissingScriptType: writeInt(&buf, Int32(8)) - + + case .MissingFingerprint: writeInt(&buf, Int32(9)) - + + case let .InvalidXpub(v1): writeInt(&buf, Int32(10)) FfiConverterString.write(v1, into: &buf) - + + case let .UnableToParseXpub(v1): writeInt(&buf, Int32(11)) FfiConverterString.write(v1, into: &buf) - + + case .NoXpubInDescriptor: writeInt(&buf, Int32(12)) - + + case .SinglePubkeyNotSupported: writeInt(&buf, Int32(13)) + } } } + extension DescriptorError: Equatable, Hashable {} extension DescriptorError: Foundation.LocalizedError { @@ -11792,19 +13118,22 @@ extension DescriptorError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum DiscoveryState { + case single case startedJson(FoundJson ) case startedMnemonic - case foundAddressesFromJson([FoundAddress], FoundJson) + case foundAddressesFromJson([FoundAddress],FoundJson + ) case foundAddressesFromMnemonic([FoundAddress] ) case noneFound case choseAdressType } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeDiscoveryState: FfiConverterRustBuffer { typealias SwiftType = DiscoveryState @@ -11812,81 +13141,98 @@ public struct FfiConverterTypeDiscoveryState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DiscoveryState { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .single - - case 2: return try .startedJson(FfiConverterTypeFoundJson.read(from: &buf) - ) - + + case 2: return .startedJson(try FfiConverterTypeFoundJson.read(from: &buf) + ) + case 3: return .startedMnemonic - - case 4: return try .foundAddressesFromJson(FfiConverterSequenceTypeFoundAddress.read(from: &buf), FfiConverterTypeFoundJson.read(from: &buf)) - - case 5: return try .foundAddressesFromMnemonic(FfiConverterSequenceTypeFoundAddress.read(from: &buf) - ) - + + case 4: return .foundAddressesFromJson(try FfiConverterSequenceTypeFoundAddress.read(from: &buf), try FfiConverterTypeFoundJson.read(from: &buf) + ) + + case 5: return .foundAddressesFromMnemonic(try FfiConverterSequenceTypeFoundAddress.read(from: &buf) + ) + case 6: return .noneFound - + case 7: return .choseAdressType - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: DiscoveryState, into buf: inout [UInt8]) { switch value { + + case .single: writeInt(&buf, Int32(1)) - + + case let .startedJson(v1): writeInt(&buf, Int32(2)) FfiConverterTypeFoundJson.write(v1, into: &buf) - + + case .startedMnemonic: writeInt(&buf, Int32(3)) - - case let .foundAddressesFromJson(v1, v2): + + + case let .foundAddressesFromJson(v1,v2): writeInt(&buf, Int32(4)) FfiConverterSequenceTypeFoundAddress.write(v1, into: &buf) FfiConverterTypeFoundJson.write(v2, into: &buf) - + + case let .foundAddressesFromMnemonic(v1): writeInt(&buf, Int32(5)) FfiConverterSequenceTypeFoundAddress.write(v1, into: &buf) - + + case .noneFound: writeInt(&buf, Int32(6)) - + + case .choseAdressType: writeInt(&buf, Int32(7)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeDiscoveryState_lift(_ buf: RustBuffer) throws -> DiscoveryState { - try FfiConverterTypeDiscoveryState.lift(buf) + return try FfiConverterTypeDiscoveryState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeDiscoveryState_lower(_ value: DiscoveryState) -> RustBuffer { - FfiConverterTypeDiscoveryState.lower(value) + return FfiConverterTypeDiscoveryState.lower(value) } + + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum FeeSpeed { + case fast case medium case slow } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFeeSpeed: FfiConverterRustBuffer { typealias SwiftType = FeeSpeed @@ -11894,50 +13240,62 @@ public struct FfiConverterTypeFeeSpeed: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeSpeed { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .fast - + case 2: return .medium - + case 3: return .slow - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FeeSpeed, into buf: inout [UInt8]) { switch value { + + case .fast: writeInt(&buf, Int32(1)) - + + case .medium: writeInt(&buf, Int32(2)) - + + case .slow: writeInt(&buf, Int32(3)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeSpeed_lift(_ buf: RustBuffer) throws -> FeeSpeed { - try FfiConverterTypeFeeSpeed.lift(buf) + return try FfiConverterTypeFeeSpeed.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFeeSpeed_lower(_ value: FeeSpeed) -> RustBuffer { - FfiConverterTypeFeeSpeed.lower(value) + return FfiConverterTypeFeeSpeed.lower(value) } + + extension FeeSpeed: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum FfiColor { + case red(FfiOpacity ) case blue(FfiOpacity @@ -11960,11 +13318,13 @@ public enum FfiColor { ) case coolGray(FfiOpacity ) - case custom(Rgb, FfiOpacity) + case custom(Rgb,FfiOpacity + ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFfiColor: FfiConverterRustBuffer { typealias SwiftType = FfiColor @@ -11972,125 +13332,148 @@ public struct FfiConverterTypeFfiColor: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiColor { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .red(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 2: return try .blue(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 3: return try .green(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 4: return try .yellow(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 5: return try .orange(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 6: return try .purple(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 7: return try .pink(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 8: return try .white(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 9: return try .black(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 10: return try .gray(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 11: return try .coolGray(FfiConverterTypeFfiOpacity.read(from: &buf) - ) - - case 12: return try .custom(FfiConverterTypeRgb.read(from: &buf), FfiConverterTypeFfiOpacity.read(from: &buf)) - + + case 1: return .red(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 2: return .blue(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 3: return .green(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 4: return .yellow(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 5: return .orange(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 6: return .purple(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 7: return .pink(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 8: return .white(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 9: return .black(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 10: return .gray(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 11: return .coolGray(try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + + case 12: return .custom(try FfiConverterTypeRgb.read(from: &buf), try FfiConverterTypeFfiOpacity.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FfiColor, into buf: inout [UInt8]) { switch value { + + case let .red(v1): writeInt(&buf, Int32(1)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .blue(v1): writeInt(&buf, Int32(2)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .green(v1): writeInt(&buf, Int32(3)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .yellow(v1): writeInt(&buf, Int32(4)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .orange(v1): writeInt(&buf, Int32(5)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .purple(v1): writeInt(&buf, Int32(6)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .pink(v1): writeInt(&buf, Int32(7)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .white(v1): writeInt(&buf, Int32(8)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .black(v1): writeInt(&buf, Int32(9)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .gray(v1): writeInt(&buf, Int32(10)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - + + case let .coolGray(v1): writeInt(&buf, Int32(11)) FfiConverterTypeFfiOpacity.write(v1, into: &buf) - - case let .custom(v1, v2): + + + case let .custom(v1,v2): writeInt(&buf, Int32(12)) FfiConverterTypeRgb.write(v1, into: &buf) FfiConverterTypeFfiOpacity.write(v2, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiColor_lift(_ buf: RustBuffer) throws -> FfiColor { - try FfiConverterTypeFfiColor.lift(buf) + return try FfiConverterTypeFfiColor.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiColor_lower(_ value: FfiColor) -> RustBuffer { - FfiConverterTypeFfiColor.lower(value) + return FfiConverterTypeFfiColor.lower(value) } + + extension FfiColor: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum FfiColorScheme { + case light case dark } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFfiColorScheme: FfiConverterRustBuffer { typealias SwiftType = FfiColorScheme @@ -12098,42 +13481,56 @@ public struct FfiConverterTypeFfiColorScheme: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiColorScheme { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .light - + case 2: return .dark - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FfiColorScheme, into buf: inout [UInt8]) { switch value { + + case .light: writeInt(&buf, Int32(1)) - + + case .dark: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiColorScheme_lift(_ buf: RustBuffer) throws -> FfiColorScheme { - try FfiConverterTypeFfiColorScheme.lift(buf) + return try FfiConverterTypeFfiColorScheme.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiColorScheme_lower(_ value: FfiColorScheme) -> RustBuffer { - FfiConverterTypeFfiColorScheme.lower(value) + return FfiConverterTypeFfiColorScheme.lower(value) } + + extension FfiColorScheme: Equatable, Hashable {} + + + public enum FiatAmountError { + + + /** * Unable to convert to fiat amount, prices client unavailable {0} */ @@ -12141,8 +13538,9 @@ public enum FiatAmountError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFiatAmountError: FfiConverterRustBuffer { typealias SwiftType = FiatAmountError @@ -12150,23 +13548,34 @@ public struct FfiConverterTypeFiatAmountError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FiatAmountError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .PricesUnavailable( - FfiConverterString.read(from: &buf) + + + + + case 1: return .PricesUnavailable( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FiatAmountError, into buf: inout [UInt8]) { switch value { + + + + + case let .PricesUnavailable(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) + } } } + extension FiatAmountError: Equatable, Hashable {} extension FiatAmountError: Foundation.LocalizedError { @@ -12179,6 +13588,7 @@ extension FiatAmountError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum FiatCurrency { + case usd case eur case gbp @@ -12188,8 +13598,9 @@ public enum FiatCurrency { case jpy } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFiatCurrency: FfiConverterRustBuffer { typealias SwiftType = FiatCurrency @@ -12197,76 +13608,93 @@ public struct FfiConverterTypeFiatCurrency: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FiatCurrency { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .usd - + case 2: return .eur - + case 3: return .gbp - + case 4: return .cad - + case 5: return .chf - + case 6: return .aud - + case 7: return .jpy - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FiatCurrency, into buf: inout [UInt8]) { switch value { + + case .usd: writeInt(&buf, Int32(1)) - + + case .eur: writeInt(&buf, Int32(2)) - + + case .gbp: writeInt(&buf, Int32(3)) - + + case .cad: writeInt(&buf, Int32(4)) - + + case .chf: writeInt(&buf, Int32(5)) - + + case .aud: writeInt(&buf, Int32(6)) - + + case .jpy: writeInt(&buf, Int32(7)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatCurrency_lift(_ buf: RustBuffer) throws -> FiatCurrency { - try FfiConverterTypeFiatCurrency.lift(buf) + return try FfiConverterTypeFiatCurrency.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatCurrency_lower(_ value: FiatCurrency) -> RustBuffer { - FfiConverterTypeFiatCurrency.lower(value) + return FfiConverterTypeFiatCurrency.lower(value) } + + extension FiatCurrency: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum FiatOrBtc { + case btc case fiat } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFiatOrBtc: FfiConverterRustBuffer { typealias SwiftType = FiatOrBtc @@ -12274,42 +13702,56 @@ public struct FfiConverterTypeFiatOrBtc: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FiatOrBtc { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .btc - + case 2: return .fiat - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FiatOrBtc, into buf: inout [UInt8]) { switch value { + + case .btc: writeInt(&buf, Int32(1)) - + + case .fiat: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatOrBtc_lift(_ buf: RustBuffer) throws -> FiatOrBtc { - try FfiConverterTypeFiatOrBtc.lift(buf) + return try FfiConverterTypeFiatOrBtc.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFiatOrBtc_lower(_ value: FiatOrBtc) -> RustBuffer { - FfiConverterTypeFiatOrBtc.lower(value) + return FfiConverterTypeFiatOrBtc.lower(value) } + + extension FiatOrBtc: Equatable, Hashable {} + + + public enum FileHandlerError { + + + /** * File not found */ @@ -12331,8 +13773,9 @@ public enum FileHandlerError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFileHandlerError: FfiConverterRustBuffer { typealias SwiftType = FileHandlerError @@ -12340,40 +13783,55 @@ public struct FfiConverterTypeFileHandlerError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FileHandlerError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .FileNotFound - case 2: return try .OpenFile( - FfiConverterString.read(from: &buf) + case 2: return .OpenFile( + try FfiConverterString.read(from: &buf) ) - case 3: return try .ReadFile( - FfiConverterString.read(from: &buf) + case 3: return .ReadFile( + try FfiConverterString.read(from: &buf) ) - case 4: return try .NotRecognizedFormat( - FfiConverterTypeMultiFormatError.read(from: &buf) + case 4: return .NotRecognizedFormat( + try FfiConverterTypeMultiFormatError.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FileHandlerError, into buf: inout [UInt8]) { switch value { + + + + + case .FileNotFound: writeInt(&buf, Int32(1)) - + + case let .OpenFile(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case let .ReadFile(v1): writeInt(&buf, Int32(3)) FfiConverterString.write(v1, into: &buf) - + + case let .NotRecognizedFormat(v1): writeInt(&buf, Int32(4)) FfiConverterTypeMultiFormatError.write(v1, into: &buf) + } } } + extension FileHandlerError: Equatable, Hashable {} extension FileHandlerError: Foundation.LocalizedError { @@ -12382,12 +13840,17 @@ extension FileHandlerError: Foundation.LocalizedError { } } + public enum FingerprintError { + + + case WalletNotFound } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFingerprintError: FfiConverterRustBuffer { typealias SwiftType = FingerprintError @@ -12395,20 +13858,31 @@ public struct FfiConverterTypeFingerprintError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FingerprintError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .WalletNotFound - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: FingerprintError, into buf: inout [UInt8]) { switch value { + + + + + case .WalletNotFound: writeInt(&buf, Int32(1)) + } } } + extension FingerprintError: Equatable, Hashable {} extension FingerprintError: Foundation.LocalizedError { @@ -12417,15 +13891,20 @@ extension FingerprintError: Foundation.LocalizedError { } } + public enum GlobalCacheTableError { + + + case Save(String ) case Read(String ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGlobalCacheTableError: FfiConverterRustBuffer { typealias SwiftType = GlobalCacheTableError @@ -12433,31 +13912,42 @@ public struct FfiConverterTypeGlobalCacheTableError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GlobalCacheTableError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .Save( - FfiConverterString.read(from: &buf) - ) - case 2: return try .Read( - FfiConverterString.read(from: &buf) + + + + case 1: return .Save( + try FfiConverterString.read(from: &buf) + ) + case 2: return .Read( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: GlobalCacheTableError, into buf: inout [UInt8]) { switch value { + + + + + case let .Save(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .Read(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) + } } } + extension GlobalCacheTableError: Equatable, Hashable {} extension GlobalCacheTableError: Foundation.LocalizedError { @@ -12470,6 +13960,7 @@ extension GlobalCacheTableError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum GlobalConfigKey { + case selectedWalletId case selectedNetwork case selectedNode(Network @@ -12477,8 +13968,9 @@ public enum GlobalConfigKey { case colorScheme } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGlobalConfigKey: FfiConverterRustBuffer { typealias SwiftType = GlobalConfigKey @@ -12486,62 +13978,79 @@ public struct FfiConverterTypeGlobalConfigKey: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GlobalConfigKey { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .selectedWalletId - + case 2: return .selectedNetwork - - case 3: return try .selectedNode(FfiConverterTypeNetwork.read(from: &buf) - ) - + + case 3: return .selectedNode(try FfiConverterTypeNetwork.read(from: &buf) + ) + case 4: return .colorScheme - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: GlobalConfigKey, into buf: inout [UInt8]) { switch value { + + case .selectedWalletId: writeInt(&buf, Int32(1)) - + + case .selectedNetwork: writeInt(&buf, Int32(2)) - + + case let .selectedNode(v1): writeInt(&buf, Int32(3)) FfiConverterTypeNetwork.write(v1, into: &buf) - + + case .colorScheme: writeInt(&buf, Int32(4)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalConfigKey_lift(_ buf: RustBuffer) throws -> GlobalConfigKey { - try FfiConverterTypeGlobalConfigKey.lift(buf) + return try FfiConverterTypeGlobalConfigKey.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalConfigKey_lower(_ value: GlobalConfigKey) -> RustBuffer { - FfiConverterTypeGlobalConfigKey.lower(value) + return FfiConverterTypeGlobalConfigKey.lower(value) } + + extension GlobalConfigKey: Equatable, Hashable {} + + + public enum GlobalConfigTableError { + + + case Save(String ) case Read(String ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGlobalConfigTableError: FfiConverterRustBuffer { typealias SwiftType = GlobalConfigTableError @@ -12549,31 +14058,42 @@ public struct FfiConverterTypeGlobalConfigTableError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GlobalConfigTableError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .Save( - FfiConverterString.read(from: &buf) - ) - case 2: return try .Read( - FfiConverterString.read(from: &buf) + + + + case 1: return .Save( + try FfiConverterString.read(from: &buf) + ) + case 2: return .Read( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: GlobalConfigTableError, into buf: inout [UInt8]) { switch value { + + + + + case let .Save(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .Read(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) + } } } + extension GlobalConfigTableError: Equatable, Hashable {} extension GlobalConfigTableError: Foundation.LocalizedError { @@ -12586,11 +14106,13 @@ extension GlobalConfigTableError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum GlobalFlagKey { + case completedOnboarding } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGlobalFlagKey: FfiConverterRustBuffer { typealias SwiftType = GlobalFlagKey @@ -12598,45 +14120,59 @@ public struct FfiConverterTypeGlobalFlagKey: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GlobalFlagKey { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .completedOnboarding - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: GlobalFlagKey, into buf: inout [UInt8]) { switch value { + + case .completedOnboarding: writeInt(&buf, Int32(1)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalFlagKey_lift(_ buf: RustBuffer) throws -> GlobalFlagKey { - try FfiConverterTypeGlobalFlagKey.lift(buf) + return try FfiConverterTypeGlobalFlagKey.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeGlobalFlagKey_lower(_ value: GlobalFlagKey) -> RustBuffer { - FfiConverterTypeGlobalFlagKey.lower(value) + return FfiConverterTypeGlobalFlagKey.lower(value) } + + extension GlobalFlagKey: Equatable, Hashable {} + + + public enum GlobalFlagTableError { + + + case Save(String ) case Read(String ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeGlobalFlagTableError: FfiConverterRustBuffer { typealias SwiftType = GlobalFlagTableError @@ -12644,31 +14180,42 @@ public struct FfiConverterTypeGlobalFlagTableError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GlobalFlagTableError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .Save( - FfiConverterString.read(from: &buf) - ) - case 2: return try .Read( - FfiConverterString.read(from: &buf) + + + + case 1: return .Save( + try FfiConverterString.read(from: &buf) + ) + case 2: return .Read( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: GlobalFlagTableError, into buf: inout [UInt8]) { switch value { + + + + + case let .Save(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .Read(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) + } } } + extension GlobalFlagTableError: Equatable, Hashable {} extension GlobalFlagTableError: Foundation.LocalizedError { @@ -12681,16 +14228,19 @@ extension GlobalFlagTableError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum HotWalletRoute { + case select case create(NumberOfBip39Words ) - case `import`(NumberOfBip39Words, ImportType) + case `import`(NumberOfBip39Words,ImportType + ) case verifyWords(WalletId ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeHotWalletRoute: FfiConverterRustBuffer { typealias SwiftType = HotWalletRoute @@ -12698,68 +14248,83 @@ public struct FfiConverterTypeHotWalletRoute: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> HotWalletRoute { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .select - - case 2: return try .create(FfiConverterTypeNumberOfBip39Words.read(from: &buf) - ) - - case 3: return try .import(FfiConverterTypeNumberOfBip39Words.read(from: &buf), FfiConverterTypeImportType.read(from: &buf)) - - case 4: return try .verifyWords(FfiConverterTypeWalletId.read(from: &buf) - ) - + + case 2: return .create(try FfiConverterTypeNumberOfBip39Words.read(from: &buf) + ) + + case 3: return .`import`(try FfiConverterTypeNumberOfBip39Words.read(from: &buf), try FfiConverterTypeImportType.read(from: &buf) + ) + + case 4: return .verifyWords(try FfiConverterTypeWalletId.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: HotWalletRoute, into buf: inout [UInt8]) { switch value { + + case .select: writeInt(&buf, Int32(1)) - + + case let .create(v1): writeInt(&buf, Int32(2)) FfiConverterTypeNumberOfBip39Words.write(v1, into: &buf) - - case let .import(v1, v2): + + + case let .`import`(v1,v2): writeInt(&buf, Int32(3)) FfiConverterTypeNumberOfBip39Words.write(v1, into: &buf) FfiConverterTypeImportType.write(v2, into: &buf) - + + case let .verifyWords(v1): writeInt(&buf, Int32(4)) FfiConverterTypeWalletId.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeHotWalletRoute_lift(_ buf: RustBuffer) throws -> HotWalletRoute { - try FfiConverterTypeHotWalletRoute.lift(buf) + return try FfiConverterTypeHotWalletRoute.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeHotWalletRoute_lower(_ value: HotWalletRoute) -> RustBuffer { - FfiConverterTypeHotWalletRoute.lower(value) + return FfiConverterTypeHotWalletRoute.lower(value) } + + extension HotWalletRoute: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ImportType { + case manual case nfc case qr } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeImportType: FfiConverterRustBuffer { typealias SwiftType = ImportType @@ -12767,47 +14332,62 @@ public struct FfiConverterTypeImportType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ImportType { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .manual - + case 2: return .nfc - + case 3: return .qr - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ImportType, into buf: inout [UInt8]) { switch value { + + case .manual: writeInt(&buf, Int32(1)) - + + case .nfc: writeInt(&buf, Int32(2)) - + + case .qr: writeInt(&buf, Int32(3)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportType_lift(_ buf: RustBuffer) throws -> ImportType { - try FfiConverterTypeImportType.lift(buf) + return try FfiConverterTypeImportType.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportType_lower(_ value: ImportType) -> RustBuffer { - FfiConverterTypeImportType.lower(value) + return FfiConverterTypeImportType.lower(value) } + + extension ImportType: Equatable, Hashable {} + + + public enum ImportWalletError { + + + case WalletImportError(String ) case InvalidWordGroup(String @@ -12822,8 +14402,9 @@ public enum ImportWalletError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeImportWalletError: FfiConverterRustBuffer { typealias SwiftType = ImportWalletError @@ -12831,57 +14412,74 @@ public struct FfiConverterTypeImportWalletError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ImportWalletError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .WalletImportError( - FfiConverterString.read(from: &buf) + + + + + case 1: return .WalletImportError( + try FfiConverterString.read(from: &buf) ) - case 2: return try .InvalidWordGroup( - FfiConverterString.read(from: &buf) + case 2: return .InvalidWordGroup( + try FfiConverterString.read(from: &buf) ) - case 3: return try .KeychainError( - FfiConverterTypeKeychainError.read(from: &buf) + case 3: return .KeychainError( + try FfiConverterTypeKeychainError.read(from: &buf) ) - case 4: return try .WalletAlreadyExists( - FfiConverterTypeWalletId.read(from: &buf) + case 4: return .WalletAlreadyExists( + try FfiConverterTypeWalletId.read(from: &buf) ) - case 5: return try .DatabaseError( - FfiConverterTypeDatabaseError.read(from: &buf) + case 5: return .DatabaseError( + try FfiConverterTypeDatabaseError.read(from: &buf) ) - case 6: return try .BdkError( - FfiConverterString.read(from: &buf) + case 6: return .BdkError( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ImportWalletError, into buf: inout [UInt8]) { switch value { + + + + + case let .WalletImportError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .InvalidWordGroup(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case let .KeychainError(v1): writeInt(&buf, Int32(3)) FfiConverterTypeKeychainError.write(v1, into: &buf) - + + case let .WalletAlreadyExists(v1): writeInt(&buf, Int32(4)) FfiConverterTypeWalletId.write(v1, into: &buf) - + + case let .DatabaseError(v1): writeInt(&buf, Int32(5)) FfiConverterTypeDatabaseError.write(v1, into: &buf) - + + case let .BdkError(v1): writeInt(&buf, Int32(6)) FfiConverterString.write(v1, into: &buf) + } } } + extension ImportWalletError: Equatable, Hashable {} extension ImportWalletError: Foundation.LocalizedError { @@ -12894,11 +14492,13 @@ extension ImportWalletError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ImportWalletViewModelAction { + case noOp } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeImportWalletViewModelAction: FfiConverterRustBuffer { typealias SwiftType = ImportWalletViewModelAction @@ -12906,45 +14506,56 @@ public struct FfiConverterTypeImportWalletViewModelAction: FfiConverterRustBuffe public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ImportWalletViewModelAction { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .noOp - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ImportWalletViewModelAction, into buf: inout [UInt8]) { switch value { + + case .noOp: writeInt(&buf, Int32(1)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportWalletViewModelAction_lift(_ buf: RustBuffer) throws -> ImportWalletViewModelAction { - try FfiConverterTypeImportWalletViewModelAction.lift(buf) + return try FfiConverterTypeImportWalletViewModelAction.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportWalletViewModelAction_lower(_ value: ImportWalletViewModelAction) -> RustBuffer { - FfiConverterTypeImportWalletViewModelAction.lower(value) + return FfiConverterTypeImportWalletViewModelAction.lower(value) } + + extension ImportWalletViewModelAction: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ImportWalletViewModelReconcileMessage { + case noOp } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeImportWalletViewModelReconcileMessage: FfiConverterRustBuffer { typealias SwiftType = ImportWalletViewModelReconcileMessage @@ -12952,37 +14563,50 @@ public struct FfiConverterTypeImportWalletViewModelReconcileMessage: FfiConverte public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ImportWalletViewModelReconcileMessage { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .noOp - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ImportWalletViewModelReconcileMessage, into buf: inout [UInt8]) { switch value { + + case .noOp: writeInt(&buf, Int32(1)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportWalletViewModelReconcileMessage_lift(_ buf: RustBuffer) throws -> ImportWalletViewModelReconcileMessage { - try FfiConverterTypeImportWalletViewModelReconcileMessage.lift(buf) + return try FfiConverterTypeImportWalletViewModelReconcileMessage.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeImportWalletViewModelReconcileMessage_lower(_ value: ImportWalletViewModelReconcileMessage) -> RustBuffer { - FfiConverterTypeImportWalletViewModelReconcileMessage.lower(value) + return FfiConverterTypeImportWalletViewModelReconcileMessage.lower(value) } + + extension ImportWalletViewModelReconcileMessage: Equatable, Hashable {} + + + public enum KeychainError { + + + case Save case Delete case ParseSavedValue(String @@ -12993,8 +14617,9 @@ public enum KeychainError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeKeychainError: FfiConverterRustBuffer { typealias SwiftType = KeychainError @@ -13002,44 +14627,60 @@ public struct FfiConverterTypeKeychainError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> KeychainError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .Save case 2: return .Delete - case 3: return try .ParseSavedValue( - FfiConverterString.read(from: &buf) + case 3: return .ParseSavedValue( + try FfiConverterString.read(from: &buf) ) - case 4: return try .Encrypt( - FfiConverterString.read(from: &buf) + case 4: return .Encrypt( + try FfiConverterString.read(from: &buf) ) - case 5: return try .Decrypt( - FfiConverterString.read(from: &buf) + case 5: return .Decrypt( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: KeychainError, into buf: inout [UInt8]) { switch value { + + + + + case .Save: writeInt(&buf, Int32(1)) - + + case .Delete: writeInt(&buf, Int32(2)) - + + case let .ParseSavedValue(v1): writeInt(&buf, Int32(3)) FfiConverterString.write(v1, into: &buf) - + + case let .Encrypt(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) - + + case let .Decrypt(v1): writeInt(&buf, Int32(5)) FfiConverterString.write(v1, into: &buf) + } } } + extension KeychainError: Equatable, Hashable {} extension KeychainError: Foundation.LocalizedError { @@ -13048,15 +14689,20 @@ extension KeychainError: Foundation.LocalizedError { } } + public enum MnemonicError { + + + case GetWalletKeychain(KeychainError ) case NotAvailable(WalletId ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMnemonicError: FfiConverterRustBuffer { typealias SwiftType = MnemonicError @@ -13064,31 +14710,42 @@ public struct FfiConverterTypeMnemonicError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MnemonicError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .GetWalletKeychain( - FfiConverterTypeKeychainError.read(from: &buf) - ) - case 2: return try .NotAvailable( - FfiConverterTypeWalletId.read(from: &buf) + + + + case 1: return .GetWalletKeychain( + try FfiConverterTypeKeychainError.read(from: &buf) + ) + case 2: return .NotAvailable( + try FfiConverterTypeWalletId.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: MnemonicError, into buf: inout [UInt8]) { switch value { + + + + + case let .GetWalletKeychain(v1): writeInt(&buf, Int32(1)) FfiConverterTypeKeychainError.write(v1, into: &buf) - + + case let .NotAvailable(v1): writeInt(&buf, Int32(2)) FfiConverterTypeWalletId.write(v1, into: &buf) + } } } + extension MnemonicError: Equatable, Hashable {} extension MnemonicError: Foundation.LocalizedError { @@ -13097,12 +14754,18 @@ extension MnemonicError: Foundation.LocalizedError { } } + public enum MnemonicParseError { - case InvalidMnemonic(String, String) + + + + case InvalidMnemonic(String,String + ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMnemonicParseError: FfiConverterRustBuffer { typealias SwiftType = MnemonicParseError @@ -13110,25 +14773,36 @@ public struct FfiConverterTypeMnemonicParseError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MnemonicParseError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .InvalidMnemonic( - FfiConverterString.read(from: &buf), - FfiConverterString.read(from: &buf) + + + + + case 1: return .InvalidMnemonic( + try FfiConverterString.read(from: &buf), + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: MnemonicParseError, into buf: inout [UInt8]) { switch value { - case let .InvalidMnemonic(v1, v2): + + + + + + case let .InvalidMnemonic(v1,v2): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) FfiConverterString.write(v2, into: &buf) + } } } + extension MnemonicParseError: Equatable, Hashable {} extension MnemonicParseError: Foundation.LocalizedError { @@ -13141,6 +14815,7 @@ extension MnemonicParseError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum MultiFormat { + case address(AddressWithNetwork ) case hardwareExport(HardwareExport @@ -13151,8 +14826,9 @@ public enum MultiFormat { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMultiFormat: FfiConverterRustBuffer { typealias SwiftType = MultiFormat @@ -13160,58 +14836,73 @@ public struct FfiConverterTypeMultiFormat: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MultiFormat { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .address(FfiConverterTypeAddressWithNetwork.read(from: &buf) - ) - - case 2: return try .hardwareExport(FfiConverterTypeHardwareExport.read(from: &buf) - ) - - case 3: return try .mnemonic(FfiConverterTypeMnemonic.read(from: &buf) - ) - - case 4: return try .transaction(FfiConverterTypeBitcoinTransaction.read(from: &buf) - ) - + + case 1: return .address(try FfiConverterTypeAddressWithNetwork.read(from: &buf) + ) + + case 2: return .hardwareExport(try FfiConverterTypeHardwareExport.read(from: &buf) + ) + + case 3: return .mnemonic(try FfiConverterTypeMnemonic.read(from: &buf) + ) + + case 4: return .transaction(try FfiConverterTypeBitcoinTransaction.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: MultiFormat, into buf: inout [UInt8]) { switch value { + + case let .address(v1): writeInt(&buf, Int32(1)) FfiConverterTypeAddressWithNetwork.write(v1, into: &buf) - + + case let .hardwareExport(v1): writeInt(&buf, Int32(2)) FfiConverterTypeHardwareExport.write(v1, into: &buf) - + + case let .mnemonic(v1): writeInt(&buf, Int32(3)) FfiConverterTypeMnemonic.write(v1, into: &buf) - + + case let .transaction(v1): writeInt(&buf, Int32(4)) FfiConverterTypeBitcoinTransaction.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMultiFormat_lift(_ buf: RustBuffer) throws -> MultiFormat { - try FfiConverterTypeMultiFormat.lift(buf) + return try FfiConverterTypeMultiFormat.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMultiFormat_lower(_ value: MultiFormat) -> RustBuffer { - FfiConverterTypeMultiFormat.lower(value) + return FfiConverterTypeMultiFormat.lower(value) } + + + + public enum MultiFormatError { + + + case InvalidSeedQr(SeedQrError ) /** @@ -13224,8 +14915,9 @@ public enum MultiFormatError { case UnrecognizedFormat } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMultiFormatError: FfiConverterRustBuffer { typealias SwiftType = MultiFormatError @@ -13233,30 +14925,44 @@ public struct FfiConverterTypeMultiFormatError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MultiFormatError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .InvalidSeedQr( - FfiConverterTypeSeedQrError.read(from: &buf) + + + + + case 1: return .InvalidSeedQr( + try FfiConverterTypeSeedQrError.read(from: &buf) ) case 2: return .UnsupportedNetworkAddress case 3: return .UnrecognizedFormat - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: MultiFormatError, into buf: inout [UInt8]) { switch value { + + + + + case let .InvalidSeedQr(v1): writeInt(&buf, Int32(1)) FfiConverterTypeSeedQrError.write(v1, into: &buf) - + + case .UnsupportedNetworkAddress: writeInt(&buf, Int32(2)) - + + case .UnrecognizedFormat: writeInt(&buf, Int32(3)) + } } } + extension MultiFormatError: Equatable, Hashable {} extension MultiFormatError: Foundation.LocalizedError { @@ -13265,7 +14971,11 @@ extension MultiFormatError: Foundation.LocalizedError { } } + public enum MultiQrError { + + + case CannotAddPartToSingleQr case CannotAddPartToSeedQr case ParseError(String @@ -13281,8 +14991,9 @@ public enum MultiQrError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMultiQrError: FfiConverterRustBuffer { typealias SwiftType = MultiQrError @@ -13290,63 +15001,83 @@ public struct FfiConverterTypeMultiQrError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MultiQrError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .CannotAddPartToSingleQr case 2: return .CannotAddPartToSeedQr - case 3: return try .ParseError( - FfiConverterString.read(from: &buf) + case 3: return .ParseError( + try FfiConverterString.read(from: &buf) ) case 4: return .InvalidUtf8 case 5: return .NotYetAvailable case 6: return .CannotAddBinaryDataToBbqr - case 7: return try .BbqrDidNotContainSeedWords( - FfiConverterString.read(from: &buf) + case 7: return .BbqrDidNotContainSeedWords( + try FfiConverterString.read(from: &buf) ) - case 8: return try .InvalidSeedQr( - FfiConverterTypeSeedQrError.read(from: &buf) + case 8: return .InvalidSeedQr( + try FfiConverterTypeSeedQrError.read(from: &buf) ) - case 9: return try .InvalidPlainTextQr( - FfiConverterString.read(from: &buf) + case 9: return .InvalidPlainTextQr( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: MultiQrError, into buf: inout [UInt8]) { switch value { + + + + + case .CannotAddPartToSingleQr: writeInt(&buf, Int32(1)) - + + case .CannotAddPartToSeedQr: writeInt(&buf, Int32(2)) - + + case let .ParseError(v1): writeInt(&buf, Int32(3)) FfiConverterString.write(v1, into: &buf) - + + case .InvalidUtf8: writeInt(&buf, Int32(4)) - + + case .NotYetAvailable: writeInt(&buf, Int32(5)) - + + case .CannotAddBinaryDataToBbqr: writeInt(&buf, Int32(6)) - + + case let .BbqrDidNotContainSeedWords(v1): writeInt(&buf, Int32(7)) FfiConverterString.write(v1, into: &buf) - + + case let .InvalidSeedQr(v1): writeInt(&buf, Int32(8)) FfiConverterTypeSeedQrError.write(v1, into: &buf) - + + case let .InvalidPlainTextQr(v1): writeInt(&buf, Int32(9)) FfiConverterString.write(v1, into: &buf) + } } } + extension MultiQrError: Equatable, Hashable {} extension MultiQrError: Foundation.LocalizedError { @@ -13359,6 +15090,7 @@ extension MultiQrError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum MultiQrScanResult { + case seedQr(SeedQr ) case single(String @@ -13369,8 +15101,9 @@ public enum MultiQrScanResult { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeMultiQrScanResult: FfiConverterRustBuffer { typealias SwiftType = MultiQrScanResult @@ -13378,69 +15111,82 @@ public struct FfiConverterTypeMultiQrScanResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MultiQrScanResult { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .seedQr(FfiConverterTypeSeedQr.read(from: &buf) - ) - - case 2: return try .single(FfiConverterString.read(from: &buf) - ) - - case 3: return try .completedBBqr(FfiConverterTypeBbqrJoined.read(from: &buf) - ) - - case 4: return try .inProgressBBqr(FfiConverterUInt32.read(from: &buf) - ) - + + case 1: return .seedQr(try FfiConverterTypeSeedQr.read(from: &buf) + ) + + case 2: return .single(try FfiConverterString.read(from: &buf) + ) + + case 3: return .completedBBqr(try FfiConverterTypeBbqrJoined.read(from: &buf) + ) + + case 4: return .inProgressBBqr(try FfiConverterUInt32.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: MultiQrScanResult, into buf: inout [UInt8]) { switch value { + + case let .seedQr(v1): writeInt(&buf, Int32(1)) FfiConverterTypeSeedQr.write(v1, into: &buf) - + + case let .single(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case let .completedBBqr(v1): writeInt(&buf, Int32(3)) FfiConverterTypeBbqrJoined.write(v1, into: &buf) - + + case let .inProgressBBqr(v1): writeInt(&buf, Int32(4)) FfiConverterUInt32.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMultiQrScanResult_lift(_ buf: RustBuffer) throws -> MultiQrScanResult { - try FfiConverterTypeMultiQrScanResult.lift(buf) + return try FfiConverterTypeMultiQrScanResult.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeMultiQrScanResult_lower(_ value: MultiQrScanResult) -> RustBuffer { - FfiConverterTypeMultiQrScanResult.lower(value) + return FfiConverterTypeMultiQrScanResult.lower(value) } + + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum NdefPayload { + case text(TextPayload ) case data(Data ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNdefPayload: FfiConverterRustBuffer { typealias SwiftType = NdefPayload @@ -13448,49 +15194,60 @@ public struct FfiConverterTypeNdefPayload: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NdefPayload { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .text(FfiConverterTypeTextPayload.read(from: &buf) - ) - - case 2: return try .data(FfiConverterData.read(from: &buf) - ) - + + case 1: return .text(try FfiConverterTypeTextPayload.read(from: &buf) + ) + + case 2: return .data(try FfiConverterData.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NdefPayload, into buf: inout [UInt8]) { switch value { + + case let .text(v1): writeInt(&buf, Int32(1)) FfiConverterTypeTextPayload.write(v1, into: &buf) - + + case let .data(v1): writeInt(&buf, Int32(2)) FfiConverterData.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefPayload_lift(_ buf: RustBuffer) throws -> NdefPayload { - try FfiConverterTypeNdefPayload.lift(buf) + return try FfiConverterTypeNdefPayload.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefPayload_lower(_ value: NdefPayload) -> RustBuffer { - FfiConverterTypeNdefPayload.lower(value) + return FfiConverterTypeNdefPayload.lower(value) } + + extension NdefPayload: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum NdefType { + case empty case wellKnown case mime @@ -13501,8 +15258,9 @@ public enum NdefType { case reserved } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNdefType: FfiConverterRustBuffer { typealias SwiftType = NdefType @@ -13510,81 +15268,99 @@ public struct FfiConverterTypeNdefType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NdefType { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .empty - + case 2: return .wellKnown - + case 3: return .mime - + case 4: return .absoluteUri - + case 5: return .external - + case 6: return .unknown - + case 7: return .unchanged - + case 8: return .reserved - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NdefType, into buf: inout [UInt8]) { switch value { + + case .empty: writeInt(&buf, Int32(1)) - + + case .wellKnown: writeInt(&buf, Int32(2)) - + + case .mime: writeInt(&buf, Int32(3)) - + + case .absoluteUri: writeInt(&buf, Int32(4)) - + + case .external: writeInt(&buf, Int32(5)) - + + case .unknown: writeInt(&buf, Int32(6)) - + + case .unchanged: writeInt(&buf, Int32(7)) - + + case .reserved: writeInt(&buf, Int32(8)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefType_lift(_ buf: RustBuffer) throws -> NdefType { - try FfiConverterTypeNdefType.lift(buf) + return try FfiConverterTypeNdefType.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNdefType_lower(_ value: NdefType) -> RustBuffer { - FfiConverterTypeNdefType.lower(value) + return FfiConverterTypeNdefType.lower(value) } + + extension NdefType: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum Network { + case bitcoin case testnet } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNetwork: FfiConverterRustBuffer { typealias SwiftType = Network @@ -13592,45 +15368,56 @@ public struct FfiConverterTypeNetwork: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Network { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .bitcoin - + case 2: return .testnet - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Network, into buf: inout [UInt8]) { switch value { + + case .bitcoin: writeInt(&buf, Int32(1)) - + + case .testnet: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNetwork_lift(_ buf: RustBuffer) throws -> Network { - try FfiConverterTypeNetwork.lift(buf) + return try FfiConverterTypeNetwork.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNetwork_lower(_ value: Network) -> RustBuffer { - FfiConverterTypeNetwork.lower(value) + return FfiConverterTypeNetwork.lower(value) } + + extension Network: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum NewWalletRoute { + case select case hotWallet(HotWalletRoute ) @@ -13638,8 +15425,9 @@ public enum NewWalletRoute { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNewWalletRoute: FfiConverterRustBuffer { typealias SwiftType = NewWalletRoute @@ -13647,51 +15435,66 @@ public struct FfiConverterTypeNewWalletRoute: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NewWalletRoute { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .select - - case 2: return try .hotWallet(FfiConverterTypeHotWalletRoute.read(from: &buf) - ) - - case 3: return try .coldWallet(FfiConverterTypeColdWalletRoute.read(from: &buf) - ) - + + case 2: return .hotWallet(try FfiConverterTypeHotWalletRoute.read(from: &buf) + ) + + case 3: return .coldWallet(try FfiConverterTypeColdWalletRoute.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NewWalletRoute, into buf: inout [UInt8]) { switch value { + + case .select: writeInt(&buf, Int32(1)) - + + case let .hotWallet(v1): writeInt(&buf, Int32(2)) FfiConverterTypeHotWalletRoute.write(v1, into: &buf) - + + case let .coldWallet(v1): writeInt(&buf, Int32(3)) FfiConverterTypeColdWalletRoute.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNewWalletRoute_lift(_ buf: RustBuffer) throws -> NewWalletRoute { - try FfiConverterTypeNewWalletRoute.lift(buf) + return try FfiConverterTypeNewWalletRoute.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNewWalletRoute_lower(_ value: NewWalletRoute) -> RustBuffer { - FfiConverterTypeNewWalletRoute.lower(value) + return FfiConverterTypeNewWalletRoute.lower(value) } + + extension NewWalletRoute: Equatable, Hashable {} + + + public enum NfcReaderError { + + + /** * Error parsing the NDEF message */ @@ -13707,8 +15510,9 @@ public enum NfcReaderError { case AlreadyParsed } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNfcReaderError: FfiConverterRustBuffer { typealias SwiftType = NfcReaderError @@ -13716,30 +15520,44 @@ public struct FfiConverterTypeNfcReaderError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NfcReaderError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .ParsingError( - FfiConverterString.read(from: &buf) + + + + + case 1: return .ParsingError( + try FfiConverterString.read(from: &buf) ) case 2: return .NotEnoughData case 3: return .AlreadyParsed - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NfcReaderError, into buf: inout [UInt8]) { switch value { + + + + + case let .ParsingError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case .NotEnoughData: writeInt(&buf, Int32(2)) - + + case .AlreadyParsed: writeInt(&buf, Int32(3)) + } } } + extension NfcReaderError: Equatable, Hashable {} extension NfcReaderError: Foundation.LocalizedError { @@ -13752,14 +15570,16 @@ extension NfcReaderError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum NodeSelection { + case preset(Node ) case custom(Node ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNodeSelection: FfiConverterRustBuffer { typealias SwiftType = NodeSelection @@ -13767,46 +15587,60 @@ public struct FfiConverterTypeNodeSelection: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NodeSelection { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .preset(FfiConverterTypeNode.read(from: &buf) - ) - - case 2: return try .custom(FfiConverterTypeNode.read(from: &buf) - ) - + + case 1: return .preset(try FfiConverterTypeNode.read(from: &buf) + ) + + case 2: return .custom(try FfiConverterTypeNode.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NodeSelection, into buf: inout [UInt8]) { switch value { + + case let .preset(v1): writeInt(&buf, Int32(1)) FfiConverterTypeNode.write(v1, into: &buf) - + + case let .custom(v1): writeInt(&buf, Int32(2)) FfiConverterTypeNode.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNodeSelection_lift(_ buf: RustBuffer) throws -> NodeSelection { - try FfiConverterTypeNodeSelection.lift(buf) + return try FfiConverterTypeNodeSelection.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNodeSelection_lower(_ value: NodeSelection) -> RustBuffer { - FfiConverterTypeNodeSelection.lower(value) + return FfiConverterTypeNodeSelection.lower(value) } + + extension NodeSelection: Equatable, Hashable {} + + + public enum NodeSelectorError { + + + case NodeNotFound(String ) case SetSelectedNodeError(String @@ -13817,8 +15651,9 @@ public enum NodeSelectorError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNodeSelectorError: FfiConverterRustBuffer { typealias SwiftType = NodeSelectorError @@ -13826,43 +15661,58 @@ public struct FfiConverterTypeNodeSelectorError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NodeSelectorError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .NodeNotFound( - FfiConverterString.read(from: &buf) + + + + + case 1: return .NodeNotFound( + try FfiConverterString.read(from: &buf) ) - case 2: return try .SetSelectedNodeError( - FfiConverterString.read(from: &buf) + case 2: return .SetSelectedNodeError( + try FfiConverterString.read(from: &buf) ) - case 3: return try .NodeAccessError( - FfiConverterString.read(from: &buf) + case 3: return .NodeAccessError( + try FfiConverterString.read(from: &buf) ) - case 4: return try .ParseNodeUrlError( - FfiConverterString.read(from: &buf) + case 4: return .ParseNodeUrlError( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NodeSelectorError, into buf: inout [UInt8]) { switch value { + + + + + case let .NodeNotFound(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .SetSelectedNodeError(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case let .NodeAccessError(v1): writeInt(&buf, Int32(3)) FfiConverterString.write(v1, into: &buf) - + + case let .ParseNodeUrlError(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) + } } } + extension NodeSelectorError: Equatable, Hashable {} extension NodeSelectorError: Foundation.LocalizedError { @@ -13875,12 +15725,14 @@ extension NodeSelectorError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum NumberOfBip39Words { + case twelve case twentyFour } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeNumberOfBip39Words: FfiConverterRustBuffer { typealias SwiftType = NumberOfBip39Words @@ -13888,49 +15740,61 @@ public struct FfiConverterTypeNumberOfBip39Words: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NumberOfBip39Words { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .twelve - + case 2: return .twentyFour - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NumberOfBip39Words, into buf: inout [UInt8]) { switch value { + + case .twelve: writeInt(&buf, Int32(1)) - + + case .twentyFour: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNumberOfBip39Words_lift(_ buf: RustBuffer) throws -> NumberOfBip39Words { - try FfiConverterTypeNumberOfBip39Words.lift(buf) + return try FfiConverterTypeNumberOfBip39Words.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeNumberOfBip39Words_lower(_ value: NumberOfBip39Words) -> RustBuffer { - FfiConverterTypeNumberOfBip39Words.lower(value) + return FfiConverterTypeNumberOfBip39Words.lower(value) } + + extension NumberOfBip39Words: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ParseResult { + /** * Completed The message is a NDEF message */ - case complete(MessageInfo, [NdefRecord]) + case complete(MessageInfo,[NdefRecord] + ) /** * Incomplete, need more data to parse the message */ @@ -13938,8 +15802,9 @@ public enum ParseResult { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeParseResult: FfiConverterRustBuffer { typealias SwiftType = ParseResult @@ -13947,57 +15812,70 @@ public struct FfiConverterTypeParseResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ParseResult { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .complete(FfiConverterTypeMessageInfo.read(from: &buf), FfiConverterSequenceTypeNdefRecord.read(from: &buf)) - - case 2: return try .incomplete(FfiConverterTypeParsingMessage.read(from: &buf) - ) - + + case 1: return .complete(try FfiConverterTypeMessageInfo.read(from: &buf), try FfiConverterSequenceTypeNdefRecord.read(from: &buf) + ) + + case 2: return .incomplete(try FfiConverterTypeParsingMessage.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ParseResult, into buf: inout [UInt8]) { switch value { - case let .complete(v1, v2): + + + case let .complete(v1,v2): writeInt(&buf, Int32(1)) FfiConverterTypeMessageInfo.write(v1, into: &buf) FfiConverterSequenceTypeNdefRecord.write(v2, into: &buf) - + + case let .incomplete(v1): writeInt(&buf, Int32(2)) FfiConverterTypeParsingMessage.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParseResult_lift(_ buf: RustBuffer) throws -> ParseResult { - try FfiConverterTypeParseResult.lift(buf) + return try FfiConverterTypeParseResult.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParseResult_lower(_ value: ParseResult) -> RustBuffer { - FfiConverterTypeParseResult.lower(value) + return FfiConverterTypeParseResult.lower(value) } + + extension ParseResult: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ParserState { + case notStarted case parsing(ParsingContext ) case complete } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeParserState: FfiConverterRustBuffer { typealias SwiftType = ParserState @@ -14005,60 +15883,73 @@ public struct FfiConverterTypeParserState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ParserState { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .notStarted - - case 2: return try .parsing(FfiConverterTypeParsingContext.read(from: &buf) - ) - + + case 2: return .parsing(try FfiConverterTypeParsingContext.read(from: &buf) + ) + case 3: return .complete - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ParserState, into buf: inout [UInt8]) { switch value { + + case .notStarted: writeInt(&buf, Int32(1)) - + + case let .parsing(v1): writeInt(&buf, Int32(2)) FfiConverterTypeParsingContext.write(v1, into: &buf) - + + case .complete: writeInt(&buf, Int32(3)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParserState_lift(_ buf: RustBuffer) throws -> ParserState { - try FfiConverterTypeParserState.lift(buf) + return try FfiConverterTypeParserState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeParserState_lower(_ value: ParserState) -> RustBuffer { - FfiConverterTypeParserState.lower(value) + return FfiConverterTypeParserState.lower(value) } + + extension ParserState: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum PendingOrConfirmed { + case pending(PendingDetails ) case confirmed(ConfirmedDetails ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePendingOrConfirmed: FfiConverterRustBuffer { typealias SwiftType = PendingOrConfirmed @@ -14066,55 +15957,67 @@ public struct FfiConverterTypePendingOrConfirmed: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PendingOrConfirmed { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .pending(FfiConverterTypePendingDetails.read(from: &buf) - ) - - case 2: return try .confirmed(FfiConverterTypeConfirmedDetails.read(from: &buf) - ) - + + case 1: return .pending(try FfiConverterTypePendingDetails.read(from: &buf) + ) + + case 2: return .confirmed(try FfiConverterTypeConfirmedDetails.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PendingOrConfirmed, into buf: inout [UInt8]) { switch value { + + case let .pending(v1): writeInt(&buf, Int32(1)) FfiConverterTypePendingDetails.write(v1, into: &buf) - + + case let .confirmed(v1): writeInt(&buf, Int32(2)) FfiConverterTypeConfirmedDetails.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingOrConfirmed_lift(_ buf: RustBuffer) throws -> PendingOrConfirmed { - try FfiConverterTypePendingOrConfirmed.lift(buf) + return try FfiConverterTypePendingOrConfirmed.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingOrConfirmed_lower(_ value: PendingOrConfirmed) -> RustBuffer { - FfiConverterTypePendingOrConfirmed.lower(value) + return FfiConverterTypePendingOrConfirmed.lower(value) } + + extension PendingOrConfirmed: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum PendingWalletViewModelAction { + case updateWords(NumberOfBip39Words ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePendingWalletViewModelAction: FfiConverterRustBuffer { typealias SwiftType = PendingWalletViewModelAction @@ -14122,47 +16025,61 @@ public struct FfiConverterTypePendingWalletViewModelAction: FfiConverterRustBuff public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PendingWalletViewModelAction { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .updateWords(FfiConverterTypeNumberOfBip39Words.read(from: &buf) - ) - + + case 1: return .updateWords(try FfiConverterTypeNumberOfBip39Words.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PendingWalletViewModelAction, into buf: inout [UInt8]) { switch value { + + case let .updateWords(v1): writeInt(&buf, Int32(1)) FfiConverterTypeNumberOfBip39Words.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWalletViewModelAction_lift(_ buf: RustBuffer) throws -> PendingWalletViewModelAction { - try FfiConverterTypePendingWalletViewModelAction.lift(buf) + return try FfiConverterTypePendingWalletViewModelAction.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWalletViewModelAction_lower(_ value: PendingWalletViewModelAction) -> RustBuffer { - FfiConverterTypePendingWalletViewModelAction.lower(value) + return FfiConverterTypePendingWalletViewModelAction.lower(value) } + + extension PendingWalletViewModelAction: Equatable, Hashable {} + + + public enum PendingWalletViewModelError { + + + case BdkError(String ) case WalletCreationError(WalletCreationError ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePendingWalletViewModelError: FfiConverterRustBuffer { typealias SwiftType = PendingWalletViewModelError @@ -14170,31 +16087,42 @@ public struct FfiConverterTypePendingWalletViewModelError: FfiConverterRustBuffe public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PendingWalletViewModelError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .BdkError( - FfiConverterString.read(from: &buf) - ) - case 2: return try .WalletCreationError( - FfiConverterTypeWalletCreationError.read(from: &buf) + + + + case 1: return .BdkError( + try FfiConverterString.read(from: &buf) + ) + case 2: return .WalletCreationError( + try FfiConverterTypeWalletCreationError.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PendingWalletViewModelError, into buf: inout [UInt8]) { switch value { + + + + + case let .BdkError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .WalletCreationError(v1): writeInt(&buf, Int32(2)) FfiConverterTypeWalletCreationError.write(v1, into: &buf) + } } } + extension PendingWalletViewModelError: Equatable, Hashable {} extension PendingWalletViewModelError: Foundation.LocalizedError { @@ -14207,12 +16135,14 @@ extension PendingWalletViewModelError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum PendingWalletViewModelReconcileMessage { + case words(NumberOfBip39Words ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePendingWalletViewModelReconcileMessage: FfiConverterRustBuffer { typealias SwiftType = PendingWalletViewModelReconcileMessage @@ -14220,39 +16150,52 @@ public struct FfiConverterTypePendingWalletViewModelReconcileMessage: FfiConvert public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PendingWalletViewModelReconcileMessage { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .words(FfiConverterTypeNumberOfBip39Words.read(from: &buf) - ) - + + case 1: return .words(try FfiConverterTypeNumberOfBip39Words.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PendingWalletViewModelReconcileMessage, into buf: inout [UInt8]) { switch value { + + case let .words(v1): writeInt(&buf, Int32(1)) FfiConverterTypeNumberOfBip39Words.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWalletViewModelReconcileMessage_lift(_ buf: RustBuffer) throws -> PendingWalletViewModelReconcileMessage { - try FfiConverterTypePendingWalletViewModelReconcileMessage.lift(buf) + return try FfiConverterTypePendingWalletViewModelReconcileMessage.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypePendingWalletViewModelReconcileMessage_lower(_ value: PendingWalletViewModelReconcileMessage) -> RustBuffer { - FfiConverterTypePendingWalletViewModelReconcileMessage.lower(value) + return FfiConverterTypePendingWalletViewModelReconcileMessage.lower(value) } + + extension PendingWalletViewModelReconcileMessage: Equatable, Hashable {} + + + public enum PsbtError { + + + /** * Missing UTXO */ @@ -14272,8 +16215,9 @@ public enum PsbtError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypePsbtError: FfiConverterRustBuffer { typealias SwiftType = PsbtError @@ -14281,34 +16225,49 @@ public struct FfiConverterTypePsbtError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PsbtError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .MissingUtxo case 2: return .NegativeFee case 3: return .FeeOverflow - case 4: return try .Other( - FfiConverterString.read(from: &buf) + case 4: return .Other( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PsbtError, into buf: inout [UInt8]) { switch value { + + + + + case .MissingUtxo: writeInt(&buf, Int32(1)) - + + case .NegativeFee: writeInt(&buf, Int32(2)) - + + case .FeeOverflow: writeInt(&buf, Int32(3)) - + + case let .Other(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) + } } } + extension PsbtError: Equatable, Hashable {} extension PsbtError: Foundation.LocalizedError { @@ -14317,7 +16276,11 @@ extension PsbtError: Foundation.LocalizedError { } } + public enum ResumeError { + + + /** * Blocks do not match * @@ -14339,15 +16302,17 @@ public enum ResumeError { * The bytes passed in needs to be a multiple of crate::cove_nfc::BYTES_PER_BLOCK * The bytes passed in needs to be the same size as the bytes in the old message (NUMBER_OF_BLOCKS_PER_CHUNK * BYTES_PER_BLOCK) */ - case BlockSizeMismatch(expected: UInt16, actual: UInt16) + case BlockSizeMismatch(expected: UInt16, actual: UInt16 + ) /** * Unable to get first block hash */ case UnableToGetFirstBlockHash } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeResumeError: FfiConverterRustBuffer { typealias SwiftType = ResumeError @@ -14355,43 +16320,59 @@ public struct FfiConverterTypeResumeError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ResumeError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .BlocksDoNotMatch case 2: return .AlreadyParsed - case 3: return try .ParsingError( - FfiConverterString.read(from: &buf) + case 3: return .ParsingError( + try FfiConverterString.read(from: &buf) ) - case 4: return try .BlockSizeMismatch( - expected: FfiConverterUInt16.read(from: &buf), - actual: FfiConverterUInt16.read(from: &buf) + case 4: return .BlockSizeMismatch( + expected: try FfiConverterUInt16.read(from: &buf), + actual: try FfiConverterUInt16.read(from: &buf) ) case 5: return .UnableToGetFirstBlockHash - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ResumeError, into buf: inout [UInt8]) { switch value { + + + + + case .BlocksDoNotMatch: writeInt(&buf, Int32(1)) - + + case .AlreadyParsed: writeInt(&buf, Int32(2)) - + + case let .ParsingError(v1): writeInt(&buf, Int32(3)) FfiConverterString.write(v1, into: &buf) - - case let .BlockSizeMismatch(expected, actual): + + + case let .BlockSizeMismatch(expected,actual): writeInt(&buf, Int32(4)) FfiConverterUInt16.write(expected, into: &buf) FfiConverterUInt16.write(actual, into: &buf) - + + case .UnableToGetFirstBlockHash: writeInt(&buf, Int32(5)) + } } } + extension ResumeError: Equatable, Hashable {} extension ResumeError: Foundation.LocalizedError { @@ -14404,7 +16385,9 @@ extension ResumeError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum Route { - case loadAndReset(resetTo: BoxedRoute, afterMillis: UInt32) + + case loadAndReset(resetTo: BoxedRoute, afterMillis: UInt32 + ) case listWallets case selectedWallet(WalletId ) @@ -14413,13 +16396,15 @@ public enum Route { case settings case secretWords(WalletId ) - case transactionDetails(id: WalletId, details: TransactionDetails) + case transactionDetails(id: WalletId, details: TransactionDetails + ) case send(SendRoute ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeRoute: FfiConverterRustBuffer { typealias SwiftType = Route @@ -14427,93 +16412,112 @@ public struct FfiConverterTypeRoute: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Route { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .loadAndReset(resetTo: FfiConverterTypeBoxedRoute.read(from: &buf), afterMillis: FfiConverterUInt32.read(from: &buf)) - + + case 1: return .loadAndReset(resetTo: try FfiConverterTypeBoxedRoute.read(from: &buf), afterMillis: try FfiConverterUInt32.read(from: &buf) + ) + case 2: return .listWallets - - case 3: return try .selectedWallet(FfiConverterTypeWalletId.read(from: &buf) - ) - - case 4: return try .newWallet(FfiConverterTypeNewWalletRoute.read(from: &buf) - ) - + + case 3: return .selectedWallet(try FfiConverterTypeWalletId.read(from: &buf) + ) + + case 4: return .newWallet(try FfiConverterTypeNewWalletRoute.read(from: &buf) + ) + case 5: return .settings - - case 6: return try .secretWords(FfiConverterTypeWalletId.read(from: &buf) - ) - - case 7: return try .transactionDetails(id: FfiConverterTypeWalletId.read(from: &buf), details: FfiConverterTypeTransactionDetails.read(from: &buf)) - - case 8: return try .send(FfiConverterTypeSendRoute.read(from: &buf) - ) - + + case 6: return .secretWords(try FfiConverterTypeWalletId.read(from: &buf) + ) + + case 7: return .transactionDetails(id: try FfiConverterTypeWalletId.read(from: &buf), details: try FfiConverterTypeTransactionDetails.read(from: &buf) + ) + + case 8: return .send(try FfiConverterTypeSendRoute.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Route, into buf: inout [UInt8]) { switch value { - case let .loadAndReset(resetTo, afterMillis): + + + case let .loadAndReset(resetTo,afterMillis): writeInt(&buf, Int32(1)) FfiConverterTypeBoxedRoute.write(resetTo, into: &buf) FfiConverterUInt32.write(afterMillis, into: &buf) - + + case .listWallets: writeInt(&buf, Int32(2)) - + + case let .selectedWallet(v1): writeInt(&buf, Int32(3)) FfiConverterTypeWalletId.write(v1, into: &buf) - + + case let .newWallet(v1): writeInt(&buf, Int32(4)) FfiConverterTypeNewWalletRoute.write(v1, into: &buf) - + + case .settings: writeInt(&buf, Int32(5)) - + + case let .secretWords(v1): writeInt(&buf, Int32(6)) FfiConverterTypeWalletId.write(v1, into: &buf) - - case let .transactionDetails(id, details): + + + case let .transactionDetails(id,details): writeInt(&buf, Int32(7)) FfiConverterTypeWalletId.write(id, into: &buf) FfiConverterTypeTransactionDetails.write(details, into: &buf) - + + case let .send(v1): writeInt(&buf, Int32(8)) FfiConverterTypeSendRoute.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRoute_lift(_ buf: RustBuffer) throws -> Route { - try FfiConverterTypeRoute.lift(buf) + return try FfiConverterTypeRoute.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeRoute_lower(_ value: Route) -> RustBuffer { - FfiConverterTypeRoute.lower(value) + return FfiConverterTypeRoute.lower(value) } + + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ScanState { + case notStarted case scanning(ScanningInfo ) case completed } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeScanState: FfiConverterRustBuffer { typealias SwiftType = ScanState @@ -14521,59 +16525,72 @@ public struct FfiConverterTypeScanState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ScanState { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .notStarted - - case 2: return try .scanning(FfiConverterTypeScanningInfo.read(from: &buf) - ) - + + case 2: return .scanning(try FfiConverterTypeScanningInfo.read(from: &buf) + ) + case 3: return .completed - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ScanState, into buf: inout [UInt8]) { switch value { + + case .notStarted: writeInt(&buf, Int32(1)) - + + case let .scanning(v1): writeInt(&buf, Int32(2)) FfiConverterTypeScanningInfo.write(v1, into: &buf) - + + case .completed: writeInt(&buf, Int32(3)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeScanState_lift(_ buf: RustBuffer) throws -> ScanState { - try FfiConverterTypeScanState.lift(buf) + return try FfiConverterTypeScanState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeScanState_lower(_ value: ScanState) -> RustBuffer { - FfiConverterTypeScanState.lower(value) + return FfiConverterTypeScanState.lower(value) } + + extension ScanState: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ScannerResponse { + case foundAddresses([FoundAddress] ) case noneFound } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeScannerResponse: FfiConverterRustBuffer { typealias SwiftType = ScannerResponse @@ -14581,44 +16598,58 @@ public struct FfiConverterTypeScannerResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ScannerResponse { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .foundAddresses(FfiConverterSequenceTypeFoundAddress.read(from: &buf) - ) - + + case 1: return .foundAddresses(try FfiConverterSequenceTypeFoundAddress.read(from: &buf) + ) + case 2: return .noneFound - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ScannerResponse, into buf: inout [UInt8]) { switch value { + + case let .foundAddresses(v1): writeInt(&buf, Int32(1)) FfiConverterSequenceTypeFoundAddress.write(v1, into: &buf) - + + case .noneFound: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeScannerResponse_lift(_ buf: RustBuffer) throws -> ScannerResponse { - try FfiConverterTypeScannerResponse.lift(buf) + return try FfiConverterTypeScannerResponse.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeScannerResponse_lower(_ value: ScannerResponse) -> RustBuffer { - FfiConverterTypeScannerResponse.lower(value) + return FfiConverterTypeScannerResponse.lower(value) } + + extension ScannerResponse: Equatable, Hashable {} + + + public enum SeedQrError { + + + case ContainsNonNumericChars case IndexOutOfBounds(UInt16 ) @@ -14628,8 +16659,9 @@ public enum SeedQrError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeSeedQrError: FfiConverterRustBuffer { typealias SwiftType = SeedQrError @@ -14637,40 +16669,55 @@ public struct FfiConverterTypeSeedQrError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SeedQrError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .ContainsNonNumericChars - case 2: return try .IndexOutOfBounds( - FfiConverterUInt16.read(from: &buf) + case 2: return .IndexOutOfBounds( + try FfiConverterUInt16.read(from: &buf) ) - case 3: return try .IncorrectWordLength( - FfiConverterUInt16.read(from: &buf) + case 3: return .IncorrectWordLength( + try FfiConverterUInt16.read(from: &buf) ) - case 4: return try .InvalidMnemonic( - FfiConverterTypeBip39Error.read(from: &buf) + case 4: return .InvalidMnemonic( + try FfiConverterTypeBip39Error.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: SeedQrError, into buf: inout [UInt8]) { switch value { + + + + + case .ContainsNonNumericChars: writeInt(&buf, Int32(1)) - + + case let .IndexOutOfBounds(v1): writeInt(&buf, Int32(2)) FfiConverterUInt16.write(v1, into: &buf) - + + case let .IncorrectWordLength(v1): writeInt(&buf, Int32(3)) FfiConverterUInt16.write(v1, into: &buf) - + + case let .InvalidMnemonic(v1): writeInt(&buf, Int32(4)) FfiConverterTypeBip39Error.write(v1, into: &buf) + } } } + extension SeedQrError: Equatable, Hashable {} extension SeedQrError: Foundation.LocalizedError { @@ -14683,13 +16730,18 @@ extension SeedQrError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum SendRoute { - case setAmount(id: WalletId, address: Address?, amount: Amount?) - case hardwareExport(id: WalletId, details: ConfirmDetails) - case confirm(id: WalletId, details: ConfirmDetails) + + case setAmount(id: WalletId, address: Address?, amount: Amount? + ) + case hardwareExport(id: WalletId, details: ConfirmDetails + ) + case confirm(id: WalletId, details: ConfirmDetails + ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeSendRoute: FfiConverterRustBuffer { typealias SwiftType = SendRoute @@ -14697,60 +16749,78 @@ public struct FfiConverterTypeSendRoute: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SendRoute { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .setAmount(id: FfiConverterTypeWalletId.read(from: &buf), address: FfiConverterOptionTypeAddress.read(from: &buf), amount: FfiConverterOptionTypeAmount.read(from: &buf)) - - case 2: return try .hardwareExport(id: FfiConverterTypeWalletId.read(from: &buf), details: FfiConverterTypeConfirmDetails.read(from: &buf)) - - case 3: return try .confirm(id: FfiConverterTypeWalletId.read(from: &buf), details: FfiConverterTypeConfirmDetails.read(from: &buf)) - + + case 1: return .setAmount(id: try FfiConverterTypeWalletId.read(from: &buf), address: try FfiConverterOptionTypeAddress.read(from: &buf), amount: try FfiConverterOptionTypeAmount.read(from: &buf) + ) + + case 2: return .hardwareExport(id: try FfiConverterTypeWalletId.read(from: &buf), details: try FfiConverterTypeConfirmDetails.read(from: &buf) + ) + + case 3: return .confirm(id: try FfiConverterTypeWalletId.read(from: &buf), details: try FfiConverterTypeConfirmDetails.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: SendRoute, into buf: inout [UInt8]) { switch value { - case let .setAmount(id, address, amount): + + + case let .setAmount(id,address,amount): writeInt(&buf, Int32(1)) FfiConverterTypeWalletId.write(id, into: &buf) FfiConverterOptionTypeAddress.write(address, into: &buf) FfiConverterOptionTypeAmount.write(amount, into: &buf) - - case let .hardwareExport(id, details): + + + case let .hardwareExport(id,details): writeInt(&buf, Int32(2)) FfiConverterTypeWalletId.write(id, into: &buf) FfiConverterTypeConfirmDetails.write(details, into: &buf) - - case let .confirm(id, details): + + + case let .confirm(id,details): writeInt(&buf, Int32(3)) FfiConverterTypeWalletId.write(id, into: &buf) FfiConverterTypeConfirmDetails.write(details, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeSendRoute_lift(_ buf: RustBuffer) throws -> SendRoute { - try FfiConverterTypeSendRoute.lift(buf) + return try FfiConverterTypeSendRoute.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeSendRoute_lower(_ value: SendRoute) -> RustBuffer { - FfiConverterTypeSendRoute.lower(value) + return FfiConverterTypeSendRoute.lower(value) } + + + + public enum SerdeError { + + + case SerializationError(String ) case DeserializationError(String ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeSerdeError: FfiConverterRustBuffer { typealias SwiftType = SerdeError @@ -14758,31 +16828,42 @@ public struct FfiConverterTypeSerdeError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SerdeError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .SerializationError( - FfiConverterString.read(from: &buf) - ) - case 2: return try .DeserializationError( - FfiConverterString.read(from: &buf) + + + + case 1: return .SerializationError( + try FfiConverterString.read(from: &buf) + ) + case 2: return .DeserializationError( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: SerdeError, into buf: inout [UInt8]) { switch value { + + + + + case let .SerializationError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .DeserializationError(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) + } } } + extension SerdeError: Equatable, Hashable {} extension SerdeError: Foundation.LocalizedError { @@ -14795,14 +16876,16 @@ extension SerdeError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum StringOrData { + case string(String ) case data(Data ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeStringOrData: FfiConverterRustBuffer { typealias SwiftType = StringOrData @@ -14810,55 +16893,67 @@ public struct FfiConverterTypeStringOrData: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> StringOrData { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .string(FfiConverterString.read(from: &buf) - ) - - case 2: return try .data(FfiConverterData.read(from: &buf) - ) - + + case 1: return .string(try FfiConverterString.read(from: &buf) + ) + + case 2: return .data(try FfiConverterData.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: StringOrData, into buf: inout [UInt8]) { switch value { + + case let .string(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .data(v1): writeInt(&buf, Int32(2)) FfiConverterData.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeStringOrData_lift(_ buf: RustBuffer) throws -> StringOrData { - try FfiConverterTypeStringOrData.lift(buf) + return try FfiConverterTypeStringOrData.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeStringOrData_lower(_ value: StringOrData) -> RustBuffer { - FfiConverterTypeStringOrData.lower(value) + return FfiConverterTypeStringOrData.lower(value) } + + extension StringOrData: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum TextPayloadFormat { + case utf8 case utf16 } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTextPayloadFormat: FfiConverterRustBuffer { typealias SwiftType = TextPayloadFormat @@ -14866,53 +16961,65 @@ public struct FfiConverterTypeTextPayloadFormat: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TextPayloadFormat { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .utf8 - + case 2: return .utf16 - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TextPayloadFormat, into buf: inout [UInt8]) { switch value { + + case .utf8: writeInt(&buf, Int32(1)) - + + case .utf16: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTextPayloadFormat_lift(_ buf: RustBuffer) throws -> TextPayloadFormat { - try FfiConverterTypeTextPayloadFormat.lift(buf) + return try FfiConverterTypeTextPayloadFormat.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTextPayloadFormat_lower(_ value: TextPayloadFormat) -> RustBuffer { - FfiConverterTypeTextPayloadFormat.lower(value) + return FfiConverterTypeTextPayloadFormat.lower(value) } + + extension TextPayloadFormat: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum Transaction { + case confirmed(ConfirmedTransaction ) case unconfirmed(UnconfirmedTransaction ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTransaction: FfiConverterRustBuffer { typealias SwiftType = Transaction @@ -14920,44 +17027,57 @@ public struct FfiConverterTypeTransaction: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Transaction { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .confirmed(FfiConverterTypeConfirmedTransaction.read(from: &buf) - ) - - case 2: return try .unconfirmed(FfiConverterTypeUnconfirmedTransaction.read(from: &buf) - ) - + + case 1: return .confirmed(try FfiConverterTypeConfirmedTransaction.read(from: &buf) + ) + + case 2: return .unconfirmed(try FfiConverterTypeUnconfirmedTransaction.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Transaction, into buf: inout [UInt8]) { switch value { + + case let .confirmed(v1): writeInt(&buf, Int32(1)) FfiConverterTypeConfirmedTransaction.write(v1, into: &buf) - + + case let .unconfirmed(v1): writeInt(&buf, Int32(2)) FfiConverterTypeUnconfirmedTransaction.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransaction_lift(_ buf: RustBuffer) throws -> Transaction { - try FfiConverterTypeTransaction.lift(buf) + return try FfiConverterTypeTransaction.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransaction_lower(_ value: Transaction) -> RustBuffer { - FfiConverterTypeTransaction.lower(value) + return FfiConverterTypeTransaction.lower(value) } + + + + public enum TransactionDetailError { + + + case Fee(String ) case FeeRate(String @@ -14968,8 +17088,9 @@ public enum TransactionDetailError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTransactionDetailError: FfiConverterRustBuffer { typealias SwiftType = TransactionDetailError @@ -14977,43 +17098,58 @@ public struct FfiConverterTypeTransactionDetailError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TransactionDetailError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .Fee( - FfiConverterString.read(from: &buf) + + + + + case 1: return .Fee( + try FfiConverterString.read(from: &buf) ) - case 2: return try .FeeRate( - FfiConverterString.read(from: &buf) + case 2: return .FeeRate( + try FfiConverterString.read(from: &buf) ) - case 3: return try .Address( - FfiConverterTypeAddressError.read(from: &buf) + case 3: return .Address( + try FfiConverterTypeAddressError.read(from: &buf) ) - case 4: return try .FiatAmount( - FfiConverterString.read(from: &buf) + case 4: return .FiatAmount( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TransactionDetailError, into buf: inout [UInt8]) { switch value { + + + + + case let .Fee(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .FeeRate(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case let .Address(v1): writeInt(&buf, Int32(3)) FfiConverterTypeAddressError.write(v1, into: &buf) - + + case let .FiatAmount(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) + } } } + extension TransactionDetailError: Equatable, Hashable {} extension TransactionDetailError: Foundation.LocalizedError { @@ -15026,12 +17162,14 @@ extension TransactionDetailError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum TransactionDirection { + case incoming case outgoing } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTransactionDirection: FfiConverterRustBuffer { typealias SwiftType = TransactionDirection @@ -15039,51 +17177,63 @@ public struct FfiConverterTypeTransactionDirection: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TransactionDirection { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .incoming - + case 2: return .outgoing - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TransactionDirection, into buf: inout [UInt8]) { switch value { + + case .incoming: writeInt(&buf, Int32(1)) - + + case .outgoing: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransactionDirection_lift(_ buf: RustBuffer) throws -> TransactionDirection { - try FfiConverterTypeTransactionDirection.lift(buf) + return try FfiConverterTypeTransactionDirection.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransactionDirection_lower(_ value: TransactionDirection) -> RustBuffer { - FfiConverterTypeTransactionDirection.lower(value) + return FfiConverterTypeTransactionDirection.lower(value) } + + extension TransactionDirection: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum TransactionState { + case pending case confirmed } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeTransactionState: FfiConverterRustBuffer { typealias SwiftType = TransactionState @@ -15091,51 +17241,63 @@ public struct FfiConverterTypeTransactionState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TransactionState { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .pending - + case 2: return .confirmed - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TransactionState, into buf: inout [UInt8]) { switch value { + + case .pending: writeInt(&buf, Int32(1)) - + + case .confirmed: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransactionState_lift(_ buf: RustBuffer) throws -> TransactionState { - try FfiConverterTypeTransactionState.lift(buf) + return try FfiConverterTypeTransactionState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeTransactionState_lower(_ value: TransactionState) -> RustBuffer { - FfiConverterTypeTransactionState.lower(value) + return FfiConverterTypeTransactionState.lower(value) } + + extension TransactionState: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum Unit { + case btc case sat } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeUnit: FfiConverterRustBuffer { typealias SwiftType = Unit @@ -15143,42 +17305,56 @@ public struct FfiConverterTypeUnit: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Unit { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .btc - + case 2: return .sat - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Unit, into buf: inout [UInt8]) { switch value { + + case .btc: writeInt(&buf, Int32(1)) - + + case .sat: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnit_lift(_ buf: RustBuffer) throws -> Unit { - try FfiConverterTypeUnit.lift(buf) + return try FfiConverterTypeUnit.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeUnit_lower(_ value: Unit) -> RustBuffer { - FfiConverterTypeUnit.lower(value) + return FfiConverterTypeUnit.lower(value) } + + extension Unit: Equatable, Hashable {} + + + public enum UnsignedTransactionsTableError { + + + case Save(String ) case Read(String @@ -15186,8 +17362,9 @@ public enum UnsignedTransactionsTableError { case NoRecordFound } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeUnsignedTransactionsTableError: FfiConverterRustBuffer { typealias SwiftType = UnsignedTransactionsTableError @@ -15195,33 +17372,47 @@ public struct FfiConverterTypeUnsignedTransactionsTableError: FfiConverterRustBu public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UnsignedTransactionsTableError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .Save( - FfiConverterString.read(from: &buf) + + + + + case 1: return .Save( + try FfiConverterString.read(from: &buf) ) - case 2: return try .Read( - FfiConverterString.read(from: &buf) + case 2: return .Read( + try FfiConverterString.read(from: &buf) ) case 3: return .NoRecordFound - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: UnsignedTransactionsTableError, into buf: inout [UInt8]) { switch value { + + + + + case let .Save(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .Read(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case .NoRecordFound: writeInt(&buf, Int32(3)) + } } } + extension UnsignedTransactionsTableError: Equatable, Hashable {} extension UnsignedTransactionsTableError: Foundation.LocalizedError { @@ -15234,13 +17425,15 @@ extension UnsignedTransactionsTableError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletAddressType { + case nativeSegwit case wrappedSegwit case legacy } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletAddressType: FfiConverterRustBuffer { typealias SwiftType = WalletAddressType @@ -15248,50 +17441,62 @@ public struct FfiConverterTypeWalletAddressType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletAddressType { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .nativeSegwit - + case 2: return .wrappedSegwit - + case 3: return .legacy - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletAddressType, into buf: inout [UInt8]) { switch value { + + case .nativeSegwit: writeInt(&buf, Int32(1)) - + + case .wrappedSegwit: writeInt(&buf, Int32(2)) - + + case .legacy: writeInt(&buf, Int32(3)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletAddressType_lift(_ buf: RustBuffer) throws -> WalletAddressType { - try FfiConverterTypeWalletAddressType.lift(buf) + return try FfiConverterTypeWalletAddressType.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletAddressType_lower(_ value: WalletAddressType) -> RustBuffer { - FfiConverterTypeWalletAddressType.lower(value) + return FfiConverterTypeWalletAddressType.lower(value) } + + extension WalletAddressType: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletColor { + case red case blue case green @@ -15299,11 +17504,13 @@ public enum WalletColor { case orange case purple case pink - case custom(r: UInt8, g: UInt8, b: UInt8) + case custom(r: UInt8, g: UInt8, b: UInt8 + ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletColor: FfiConverterRustBuffer { typealias SwiftType = WalletColor @@ -15311,75 +17518,96 @@ public struct FfiConverterTypeWalletColor: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletColor { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .red - + case 2: return .blue - + case 3: return .green - + case 4: return .yellow - + case 5: return .orange - + case 6: return .purple - + case 7: return .pink - - case 8: return try .custom(r: FfiConverterUInt8.read(from: &buf), g: FfiConverterUInt8.read(from: &buf), b: FfiConverterUInt8.read(from: &buf)) - + + case 8: return .custom(r: try FfiConverterUInt8.read(from: &buf), g: try FfiConverterUInt8.read(from: &buf), b: try FfiConverterUInt8.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletColor, into buf: inout [UInt8]) { switch value { + + case .red: writeInt(&buf, Int32(1)) - + + case .blue: writeInt(&buf, Int32(2)) - + + case .green: writeInt(&buf, Int32(3)) - + + case .yellow: writeInt(&buf, Int32(4)) - + + case .orange: writeInt(&buf, Int32(5)) - + + case .purple: writeInt(&buf, Int32(6)) - + + case .pink: writeInt(&buf, Int32(7)) - - case let .custom(r, g, b): + + + case let .custom(r,g,b): writeInt(&buf, Int32(8)) FfiConverterUInt8.write(r, into: &buf) FfiConverterUInt8.write(g, into: &buf) FfiConverterUInt8.write(b, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletColor_lift(_ buf: RustBuffer) throws -> WalletColor { - try FfiConverterTypeWalletColor.lift(buf) + return try FfiConverterTypeWalletColor.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletColor_lower(_ value: WalletColor) -> RustBuffer { - FfiConverterTypeWalletColor.lower(value) + return FfiConverterTypeWalletColor.lower(value) } + + extension WalletColor: Equatable, Hashable {} + + + public enum WalletCreationError { + + + case Bdk(String ) case Keychain(KeychainError @@ -15392,8 +17620,9 @@ public enum WalletCreationError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletCreationError: FfiConverterRustBuffer { typealias SwiftType = WalletCreationError @@ -15401,50 +17630,66 @@ public struct FfiConverterTypeWalletCreationError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletCreationError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .Bdk( - FfiConverterString.read(from: &buf) + + + + + case 1: return .Bdk( + try FfiConverterString.read(from: &buf) ) - case 2: return try .Keychain( - FfiConverterTypeKeychainError.read(from: &buf) + case 2: return .Keychain( + try FfiConverterTypeKeychainError.read(from: &buf) ) - case 3: return try .Database( - FfiConverterTypeDatabaseError.read(from: &buf) + case 3: return .Database( + try FfiConverterTypeDatabaseError.read(from: &buf) ) - case 4: return try .Persist( - FfiConverterString.read(from: &buf) + case 4: return .Persist( + try FfiConverterString.read(from: &buf) ) - case 5: return try .Import( - FfiConverterString.read(from: &buf) + case 5: return .Import( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletCreationError, into buf: inout [UInt8]) { switch value { + + + + + case let .Bdk(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .Keychain(v1): writeInt(&buf, Int32(2)) FfiConverterTypeKeychainError.write(v1, into: &buf) - + + case let .Database(v1): writeInt(&buf, Int32(3)) FfiConverterTypeDatabaseError.write(v1, into: &buf) - + + case let .Persist(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) - + + case let .Import(v1): writeInt(&buf, Int32(5)) FfiConverterString.write(v1, into: &buf) + } } } + extension WalletCreationError: Equatable, Hashable {} extension WalletCreationError: Foundation.LocalizedError { @@ -15453,9 +17698,15 @@ extension WalletCreationError: Foundation.LocalizedError { } } + public enum WalletDataError { - case DatabaseAccess(id: WalletId, error: String) - case TableAccess(id: WalletId, error: String) + + + + case DatabaseAccess(id: WalletId, error: String + ) + case TableAccess(id: WalletId, error: String + ) /** * Unable to read: {0} */ @@ -15468,8 +17719,9 @@ public enum WalletDataError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletDataError: FfiConverterRustBuffer { typealias SwiftType = WalletDataError @@ -15477,47 +17729,62 @@ public struct FfiConverterTypeWalletDataError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletDataError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .DatabaseAccess( - id: FfiConverterTypeWalletId.read(from: &buf), - error: FfiConverterString.read(from: &buf) + + + + + case 1: return .DatabaseAccess( + id: try FfiConverterTypeWalletId.read(from: &buf), + error: try FfiConverterString.read(from: &buf) ) - case 2: return try .TableAccess( - id: FfiConverterTypeWalletId.read(from: &buf), - error: FfiConverterString.read(from: &buf) + case 2: return .TableAccess( + id: try FfiConverterTypeWalletId.read(from: &buf), + error: try FfiConverterString.read(from: &buf) ) - case 3: return try .Read( - FfiConverterString.read(from: &buf) + case 3: return .Read( + try FfiConverterString.read(from: &buf) ) - case 4: return try .Save( - FfiConverterString.read(from: &buf) + case 4: return .Save( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletDataError, into buf: inout [UInt8]) { switch value { - case let .DatabaseAccess(id, error): + + + + + + case let .DatabaseAccess(id,error): writeInt(&buf, Int32(1)) FfiConverterTypeWalletId.write(id, into: &buf) FfiConverterString.write(error, into: &buf) - - case let .TableAccess(id, error): + + + case let .TableAccess(id,error): writeInt(&buf, Int32(2)) FfiConverterTypeWalletId.write(id, into: &buf) FfiConverterString.write(error, into: &buf) - + + case let .Read(v1): writeInt(&buf, Int32(3)) FfiConverterString.write(v1, into: &buf) - + + case let .Save(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) + } } } + extension WalletDataError: Equatable, Hashable {} extension WalletDataError: Foundation.LocalizedError { @@ -15530,12 +17797,14 @@ extension WalletDataError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletDataKey { + case scanState(WalletAddressType ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletDataKey: FfiConverterRustBuffer { typealias SwiftType = WalletDataKey @@ -15543,39 +17812,52 @@ public struct FfiConverterTypeWalletDataKey: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletDataKey { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .scanState(FfiConverterTypeWalletAddressType.read(from: &buf) - ) - + + case 1: return .scanState(try FfiConverterTypeWalletAddressType.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletDataKey, into buf: inout [UInt8]) { switch value { + + case let .scanState(v1): writeInt(&buf, Int32(1)) FfiConverterTypeWalletAddressType.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletDataKey_lift(_ buf: RustBuffer) throws -> WalletDataKey { - try FfiConverterTypeWalletDataKey.lift(buf) + return try FfiConverterTypeWalletDataKey.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletDataKey_lower(_ value: WalletDataKey) -> RustBuffer { - FfiConverterTypeWalletDataKey.lower(value) + return FfiConverterTypeWalletDataKey.lower(value) } + + extension WalletDataKey: Equatable, Hashable {} + + + public enum WalletError { + + + case BdkError(String ) case UnsupportedWallet(String @@ -15596,8 +17878,9 @@ public enum WalletError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletError: FfiConverterRustBuffer { typealias SwiftType = WalletError @@ -15605,79 +17888,100 @@ public struct FfiConverterTypeWalletError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .BdkError( - FfiConverterString.read(from: &buf) + + + + + case 1: return .BdkError( + try FfiConverterString.read(from: &buf) ) - case 2: return try .UnsupportedWallet( - FfiConverterString.read(from: &buf) + case 2: return .UnsupportedWallet( + try FfiConverterString.read(from: &buf) ) - case 3: return try .PersistError( - FfiConverterString.read(from: &buf) + case 3: return .PersistError( + try FfiConverterString.read(from: &buf) ) - case 4: return try .LoadError( - FfiConverterString.read(from: &buf) + case 4: return .LoadError( + try FfiConverterString.read(from: &buf) ) - case 5: return try .KeychainError( - FfiConverterTypeKeychainError.read(from: &buf) + case 5: return .KeychainError( + try FfiConverterTypeKeychainError.read(from: &buf) ) - case 6: return try .DatabaseError( - FfiConverterTypeDatabaseError.read(from: &buf) + case 6: return .DatabaseError( + try FfiConverterTypeDatabaseError.read(from: &buf) ) case 7: return .WalletNotFound case 8: return .MetadataNotFound - case 9: return try .ParseXpubError( - FfiConverterTypeXpubError.read(from: &buf) + case 9: return .ParseXpubError( + try FfiConverterTypeXpubError.read(from: &buf) ) - case 10: return try .WalletAlreadyExists( - FfiConverterTypeWalletId.read(from: &buf) + case 10: return .WalletAlreadyExists( + try FfiConverterTypeWalletId.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletError, into buf: inout [UInt8]) { switch value { + + + + + case let .BdkError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .UnsupportedWallet(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case let .PersistError(v1): writeInt(&buf, Int32(3)) FfiConverterString.write(v1, into: &buf) - + + case let .LoadError(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) - + + case let .KeychainError(v1): writeInt(&buf, Int32(5)) FfiConverterTypeKeychainError.write(v1, into: &buf) - + + case let .DatabaseError(v1): writeInt(&buf, Int32(6)) FfiConverterTypeDatabaseError.write(v1, into: &buf) - + + case .WalletNotFound: writeInt(&buf, Int32(7)) - + + case .MetadataNotFound: writeInt(&buf, Int32(8)) - + + case let .ParseXpubError(v1): writeInt(&buf, Int32(9)) FfiConverterTypeXpubError.write(v1, into: &buf) - + + case let .WalletAlreadyExists(v1): writeInt(&buf, Int32(10)) FfiConverterTypeWalletId.write(v1, into: &buf) + } } } + extension WalletError: Equatable, Hashable {} extension WalletError: Foundation.LocalizedError { @@ -15690,13 +17994,15 @@ extension WalletError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletErrorAlert { + case nodeConnectionFailed(String ) case noBalance } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletErrorAlert: FfiConverterRustBuffer { typealias SwiftType = WalletErrorAlert @@ -15704,47 +18010,58 @@ public struct FfiConverterTypeWalletErrorAlert: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletErrorAlert { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .nodeConnectionFailed(FfiConverterString.read(from: &buf) - ) - + + case 1: return .nodeConnectionFailed(try FfiConverterString.read(from: &buf) + ) + case 2: return .noBalance - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletErrorAlert, into buf: inout [UInt8]) { switch value { + + case let .nodeConnectionFailed(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case .noBalance: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletErrorAlert_lift(_ buf: RustBuffer) throws -> WalletErrorAlert { - try FfiConverterTypeWalletErrorAlert.lift(buf) + return try FfiConverterTypeWalletErrorAlert.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletErrorAlert_lower(_ value: WalletErrorAlert) -> RustBuffer { - FfiConverterTypeWalletErrorAlert.lower(value) + return FfiConverterTypeWalletErrorAlert.lower(value) } + + extension WalletErrorAlert: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletLoadState { + case loading case scanning([Transaction] ) @@ -15752,8 +18069,9 @@ public enum WalletLoadState { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletLoadState: FfiConverterRustBuffer { typealias SwiftType = WalletLoadState @@ -15761,49 +18079,63 @@ public struct FfiConverterTypeWalletLoadState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletLoadState { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .loading - - case 2: return try .scanning(FfiConverterSequenceTypeTransaction.read(from: &buf) - ) - - case 3: return try .loaded(FfiConverterSequenceTypeTransaction.read(from: &buf) - ) - + + case 2: return .scanning(try FfiConverterSequenceTypeTransaction.read(from: &buf) + ) + + case 3: return .loaded(try FfiConverterSequenceTypeTransaction.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletLoadState, into buf: inout [UInt8]) { switch value { + + case .loading: writeInt(&buf, Int32(1)) - + + case let .scanning(v1): writeInt(&buf, Int32(2)) FfiConverterSequenceTypeTransaction.write(v1, into: &buf) - + + case let .loaded(v1): writeInt(&buf, Int32(3)) FfiConverterSequenceTypeTransaction.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletLoadState_lift(_ buf: RustBuffer) throws -> WalletLoadState { - try FfiConverterTypeWalletLoadState.lift(buf) + return try FfiConverterTypeWalletLoadState.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletLoadState_lower(_ value: WalletLoadState) -> RustBuffer { - FfiConverterTypeWalletLoadState.lower(value) + return FfiConverterTypeWalletLoadState.lower(value) } + + + + public enum WalletScannerError { + + + /** * No address types to scan */ @@ -15820,8 +18152,9 @@ public enum WalletScannerError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletScannerError: FfiConverterRustBuffer { typealias SwiftType = WalletScannerError @@ -15829,33 +18162,47 @@ public struct FfiConverterTypeWalletScannerError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletScannerError { let variant: Int32 = try readInt(&buf) switch variant { + + + + case 1: return .NoAddressTypes - case 2: return try .WalletCreationError( - FfiConverterTypeWalletError.read(from: &buf) + case 2: return .WalletCreationError( + try FfiConverterTypeWalletError.read(from: &buf) ) - case 3: return try .NoMnemonicAvailable( - FfiConverterTypeWalletId.read(from: &buf) + case 3: return .NoMnemonicAvailable( + try FfiConverterTypeWalletId.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletScannerError, into buf: inout [UInt8]) { switch value { + + + + + case .NoAddressTypes: writeInt(&buf, Int32(1)) - + + case let .WalletCreationError(v1): writeInt(&buf, Int32(2)) FfiConverterTypeWalletError.write(v1, into: &buf) - + + case let .NoMnemonicAvailable(v1): writeInt(&buf, Int32(3)) FfiConverterTypeWalletId.write(v1, into: &buf) + } } } + extension WalletScannerError: Equatable, Hashable {} extension WalletScannerError: Foundation.LocalizedError { @@ -15864,7 +18211,11 @@ extension WalletScannerError: Foundation.LocalizedError { } } + public enum WalletTableError { + + + case SaveError(String ) case ReadError(String @@ -15872,8 +18223,9 @@ public enum WalletTableError { case WalletAlreadyExists } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletTableError: FfiConverterRustBuffer { typealias SwiftType = WalletTableError @@ -15881,33 +18233,47 @@ public struct FfiConverterTypeWalletTableError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletTableError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .SaveError( - FfiConverterString.read(from: &buf) + + + + + case 1: return .SaveError( + try FfiConverterString.read(from: &buf) ) - case 2: return try .ReadError( - FfiConverterString.read(from: &buf) + case 2: return .ReadError( + try FfiConverterString.read(from: &buf) ) case 3: return .WalletAlreadyExists - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletTableError, into buf: inout [UInt8]) { switch value { + + + + + case let .SaveError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .ReadError(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case .WalletAlreadyExists: writeInt(&buf, Int32(3)) + } } } + extension WalletTableError: Equatable, Hashable {} extension WalletTableError: Foundation.LocalizedError { @@ -15920,12 +18286,14 @@ extension WalletTableError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletType { + case hot case cold } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletType: FfiConverterRustBuffer { typealias SwiftType = WalletType @@ -15933,45 +18301,56 @@ public struct FfiConverterTypeWalletType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletType { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .hot - + case 2: return .cold - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletType, into buf: inout [UInt8]) { switch value { + + case .hot: writeInt(&buf, Int32(1)) - + + case .cold: writeInt(&buf, Int32(2)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletType_lift(_ buf: RustBuffer) throws -> WalletType { - try FfiConverterTypeWalletType.lift(buf) + return try FfiConverterTypeWalletType.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletType_lower(_ value: WalletType) -> RustBuffer { - FfiConverterTypeWalletType.lower(value) + return FfiConverterTypeWalletType.lower(value) } + + extension WalletType: Equatable, Hashable {} + + // Note that we don't yet support `indirect` for enums. // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletViewModelAction { + case updateName(String ) case updateColor(WalletColor @@ -15991,8 +18370,9 @@ public enum WalletViewModelAction { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletViewModelAction: FfiConverterRustBuffer { typealias SwiftType = WalletViewModelAction @@ -16000,99 +18380,122 @@ public struct FfiConverterTypeWalletViewModelAction: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletViewModelAction { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .updateName(FfiConverterString.read(from: &buf) - ) - - case 2: return try .updateColor(FfiConverterTypeWalletColor.read(from: &buf) - ) - - case 3: return try .updateUnit(FfiConverterTypeUnit.read(from: &buf) - ) - - case 4: return try .updateFiatCurrency(FfiConverterTypeFiatCurrency.read(from: &buf) - ) - - case 5: return try .updateFiatOrBtc(FfiConverterTypeFiatOrBtc.read(from: &buf) - ) - + + case 1: return .updateName(try FfiConverterString.read(from: &buf) + ) + + case 2: return .updateColor(try FfiConverterTypeWalletColor.read(from: &buf) + ) + + case 3: return .updateUnit(try FfiConverterTypeUnit.read(from: &buf) + ) + + case 4: return .updateFiatCurrency(try FfiConverterTypeFiatCurrency.read(from: &buf) + ) + + case 5: return .updateFiatOrBtc(try FfiConverterTypeFiatOrBtc.read(from: &buf) + ) + case 6: return .toggleSensitiveVisibility - + case 7: return .toggleDetailsExpanded - + case 8: return .toggleFiatOrBtc - + case 9: return .toggleFiatBtcPrimarySecondary - + case 10: return .selectCurrentWalletAddressType - - case 11: return try .selectDifferentWalletAddressType(FfiConverterTypeWalletAddressType.read(from: &buf) - ) - + + case 11: return .selectDifferentWalletAddressType(try FfiConverterTypeWalletAddressType.read(from: &buf) + ) + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletViewModelAction, into buf: inout [UInt8]) { switch value { + + case let .updateName(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case let .updateColor(v1): writeInt(&buf, Int32(2)) FfiConverterTypeWalletColor.write(v1, into: &buf) - + + case let .updateUnit(v1): writeInt(&buf, Int32(3)) FfiConverterTypeUnit.write(v1, into: &buf) - + + case let .updateFiatCurrency(v1): writeInt(&buf, Int32(4)) FfiConverterTypeFiatCurrency.write(v1, into: &buf) - + + case let .updateFiatOrBtc(v1): writeInt(&buf, Int32(5)) FfiConverterTypeFiatOrBtc.write(v1, into: &buf) - + + case .toggleSensitiveVisibility: writeInt(&buf, Int32(6)) - + + case .toggleDetailsExpanded: writeInt(&buf, Int32(7)) - + + case .toggleFiatOrBtc: writeInt(&buf, Int32(8)) - + + case .toggleFiatBtcPrimarySecondary: writeInt(&buf, Int32(9)) - + + case .selectCurrentWalletAddressType: writeInt(&buf, Int32(10)) - + + case let .selectDifferentWalletAddressType(v1): writeInt(&buf, Int32(11)) FfiConverterTypeWalletAddressType.write(v1, into: &buf) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletViewModelAction_lift(_ buf: RustBuffer) throws -> WalletViewModelAction { - try FfiConverterTypeWalletViewModelAction.lift(buf) + return try FfiConverterTypeWalletViewModelAction.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletViewModelAction_lower(_ value: WalletViewModelAction) -> RustBuffer { - FfiConverterTypeWalletViewModelAction.lower(value) + return FfiConverterTypeWalletViewModelAction.lower(value) } + + extension WalletViewModelAction: Equatable, Hashable {} + + + public enum WalletViewModelError { + + + case GetSelectedWalletError(String ) case WalletDoesNotExist @@ -16116,7 +18519,8 @@ public enum WalletViewModelError { case TransactionDetailsError(String ) case ActorNotFound - case UnableToSwitch(WalletAddressType, String) + case UnableToSwitch(WalletAddressType,String + ) case FiatError(String ) case FeesError(String @@ -16129,8 +18533,9 @@ public enum WalletViewModelError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletViewModelError: FfiConverterRustBuffer { typealias SwiftType = WalletViewModelError @@ -16138,141 +18543,171 @@ public struct FfiConverterTypeWalletViewModelError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletViewModelError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .GetSelectedWalletError( - FfiConverterString.read(from: &buf) + + + + + case 1: return .GetSelectedWalletError( + try FfiConverterString.read(from: &buf) ) case 2: return .WalletDoesNotExist - case 3: return try .SecretRetrievalError( - FfiConverterTypeKeychainError.read(from: &buf) + case 3: return .SecretRetrievalError( + try FfiConverterTypeKeychainError.read(from: &buf) ) - case 4: return try .MarkWalletAsVerifiedError( - FfiConverterTypeDatabaseError.read(from: &buf) + case 4: return .MarkWalletAsVerifiedError( + try FfiConverterTypeDatabaseError.read(from: &buf) ) - case 5: return try .LoadWalletError( - FfiConverterTypeWalletError.read(from: &buf) + case 5: return .LoadWalletError( + try FfiConverterTypeWalletError.read(from: &buf) ) - case 6: return try .NodeConnectionFailed( - FfiConverterString.read(from: &buf) + case 6: return .NodeConnectionFailed( + try FfiConverterString.read(from: &buf) ) - case 7: return try .WalletScanError( - FfiConverterString.read(from: &buf) + case 7: return .WalletScanError( + try FfiConverterString.read(from: &buf) ) - case 8: return try .TransactionsRetrievalError( - FfiConverterString.read(from: &buf) + case 8: return .TransactionsRetrievalError( + try FfiConverterString.read(from: &buf) ) - case 9: return try .WalletBalanceError( - FfiConverterString.read(from: &buf) + case 9: return .WalletBalanceError( + try FfiConverterString.read(from: &buf) ) - case 10: return try .NextAddressError( - FfiConverterString.read(from: &buf) + case 10: return .NextAddressError( + try FfiConverterString.read(from: &buf) ) case 11: return .GetHeightError - case 12: return try .TransactionDetailsError( - FfiConverterString.read(from: &buf) + case 12: return .TransactionDetailsError( + try FfiConverterString.read(from: &buf) ) case 13: return .ActorNotFound - case 14: return try .UnableToSwitch( - FfiConverterTypeWalletAddressType.read(from: &buf), - FfiConverterString.read(from: &buf) + case 14: return .UnableToSwitch( + try FfiConverterTypeWalletAddressType.read(from: &buf), + try FfiConverterString.read(from: &buf) ) - case 15: return try .FiatError( - FfiConverterString.read(from: &buf) + case 15: return .FiatError( + try FfiConverterString.read(from: &buf) ) - case 16: return try .FeesError( - FfiConverterString.read(from: &buf) + case 16: return .FeesError( + try FfiConverterString.read(from: &buf) ) - case 17: return try .BuildTxError( - FfiConverterString.read(from: &buf) + case 17: return .BuildTxError( + try FfiConverterString.read(from: &buf) ) - case 18: return try .InsufficientFunds( - FfiConverterString.read(from: &buf) + case 18: return .InsufficientFunds( + try FfiConverterString.read(from: &buf) ) - case 19: return try .GetConfirmDetailsError( - FfiConverterString.read(from: &buf) + case 19: return .GetConfirmDetailsError( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletViewModelError, into buf: inout [UInt8]) { switch value { + + + + + case let .GetSelectedWalletError(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - + + case .WalletDoesNotExist: writeInt(&buf, Int32(2)) - + + case let .SecretRetrievalError(v1): writeInt(&buf, Int32(3)) FfiConverterTypeKeychainError.write(v1, into: &buf) - + + case let .MarkWalletAsVerifiedError(v1): writeInt(&buf, Int32(4)) FfiConverterTypeDatabaseError.write(v1, into: &buf) - + + case let .LoadWalletError(v1): writeInt(&buf, Int32(5)) FfiConverterTypeWalletError.write(v1, into: &buf) - + + case let .NodeConnectionFailed(v1): writeInt(&buf, Int32(6)) FfiConverterString.write(v1, into: &buf) - + + case let .WalletScanError(v1): writeInt(&buf, Int32(7)) FfiConverterString.write(v1, into: &buf) - + + case let .TransactionsRetrievalError(v1): writeInt(&buf, Int32(8)) FfiConverterString.write(v1, into: &buf) - + + case let .WalletBalanceError(v1): writeInt(&buf, Int32(9)) FfiConverterString.write(v1, into: &buf) - + + case let .NextAddressError(v1): writeInt(&buf, Int32(10)) FfiConverterString.write(v1, into: &buf) - + + case .GetHeightError: writeInt(&buf, Int32(11)) - + + case let .TransactionDetailsError(v1): writeInt(&buf, Int32(12)) FfiConverterString.write(v1, into: &buf) - + + case .ActorNotFound: writeInt(&buf, Int32(13)) - - case let .UnableToSwitch(v1, v2): + + + case let .UnableToSwitch(v1,v2): writeInt(&buf, Int32(14)) FfiConverterTypeWalletAddressType.write(v1, into: &buf) FfiConverterString.write(v2, into: &buf) - + + case let .FiatError(v1): writeInt(&buf, Int32(15)) FfiConverterString.write(v1, into: &buf) - + + case let .FeesError(v1): writeInt(&buf, Int32(16)) FfiConverterString.write(v1, into: &buf) - + + case let .BuildTxError(v1): writeInt(&buf, Int32(17)) FfiConverterString.write(v1, into: &buf) - + + case let .InsufficientFunds(v1): writeInt(&buf, Int32(18)) FfiConverterString.write(v1, into: &buf) - + + case let .GetConfirmDetailsError(v1): writeInt(&buf, Int32(19)) FfiConverterString.write(v1, into: &buf) + } } } + extension WalletViewModelError: Equatable, Hashable {} extension WalletViewModelError: Foundation.LocalizedError { @@ -16285,6 +18720,7 @@ extension WalletViewModelError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WalletViewModelReconcileMessage { + case startedWalletScan case availableTransactions([Transaction] ) @@ -16305,8 +18741,9 @@ public enum WalletViewModelReconcileMessage { case unsignedTransactionsChanged } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletViewModelReconcileMessage: FfiConverterRustBuffer { typealias SwiftType = WalletViewModelReconcileMessage @@ -16314,96 +18751,117 @@ public struct FfiConverterTypeWalletViewModelReconcileMessage: FfiConverterRustB public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletViewModelReconcileMessage { let variant: Int32 = try readInt(&buf) switch variant { + case 1: return .startedWalletScan - - case 2: return try .availableTransactions(FfiConverterSequenceTypeTransaction.read(from: &buf) - ) - - case 3: return try .scanComplete(FfiConverterSequenceTypeTransaction.read(from: &buf) - ) - - case 4: return try .nodeConnectionFailed(FfiConverterString.read(from: &buf) - ) - - case 5: return try .walletMetadataChanged(FfiConverterTypeWalletMetadata.read(from: &buf) - ) - - case 6: return try .walletBalanceChanged(FfiConverterTypeBalance.read(from: &buf) - ) - - case 7: return try .walletError(FfiConverterTypeWalletViewModelError.read(from: &buf) - ) - - case 8: return try .unknownError(FfiConverterString.read(from: &buf) - ) - - case 9: return try .walletScannerResponse(FfiConverterTypeScannerResponse.read(from: &buf) - ) - + + case 2: return .availableTransactions(try FfiConverterSequenceTypeTransaction.read(from: &buf) + ) + + case 3: return .scanComplete(try FfiConverterSequenceTypeTransaction.read(from: &buf) + ) + + case 4: return .nodeConnectionFailed(try FfiConverterString.read(from: &buf) + ) + + case 5: return .walletMetadataChanged(try FfiConverterTypeWalletMetadata.read(from: &buf) + ) + + case 6: return .walletBalanceChanged(try FfiConverterTypeBalance.read(from: &buf) + ) + + case 7: return .walletError(try FfiConverterTypeWalletViewModelError.read(from: &buf) + ) + + case 8: return .unknownError(try FfiConverterString.read(from: &buf) + ) + + case 9: return .walletScannerResponse(try FfiConverterTypeScannerResponse.read(from: &buf) + ) + case 10: return .unsignedTransactionsChanged - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletViewModelReconcileMessage, into buf: inout [UInt8]) { switch value { + + case .startedWalletScan: writeInt(&buf, Int32(1)) - + + case let .availableTransactions(v1): writeInt(&buf, Int32(2)) FfiConverterSequenceTypeTransaction.write(v1, into: &buf) - + + case let .scanComplete(v1): writeInt(&buf, Int32(3)) FfiConverterSequenceTypeTransaction.write(v1, into: &buf) - + + case let .nodeConnectionFailed(v1): writeInt(&buf, Int32(4)) FfiConverterString.write(v1, into: &buf) - + + case let .walletMetadataChanged(v1): writeInt(&buf, Int32(5)) FfiConverterTypeWalletMetadata.write(v1, into: &buf) - + + case let .walletBalanceChanged(v1): writeInt(&buf, Int32(6)) FfiConverterTypeBalance.write(v1, into: &buf) - + + case let .walletError(v1): writeInt(&buf, Int32(7)) FfiConverterTypeWalletViewModelError.write(v1, into: &buf) - + + case let .unknownError(v1): writeInt(&buf, Int32(8)) FfiConverterString.write(v1, into: &buf) - + + case let .walletScannerResponse(v1): writeInt(&buf, Int32(9)) FfiConverterTypeScannerResponse.write(v1, into: &buf) - + + case .unsignedTransactionsChanged: writeInt(&buf, Int32(10)) + } } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletViewModelReconcileMessage_lift(_ buf: RustBuffer) throws -> WalletViewModelReconcileMessage { - try FfiConverterTypeWalletViewModelReconcileMessage.lift(buf) + return try FfiConverterTypeWalletViewModelReconcileMessage.lift(buf) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletViewModelReconcileMessage_lower(_ value: WalletViewModelReconcileMessage) -> RustBuffer { - FfiConverterTypeWalletViewModelReconcileMessage.lower(value) + return FfiConverterTypeWalletViewModelReconcileMessage.lower(value) } + + + + public enum XpubError { + + + case InvalidDescriptor(DescriptorError ) case InvalidJson(String @@ -16414,8 +18872,9 @@ public enum XpubError { ) } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeXpubError: FfiConverterRustBuffer { typealias SwiftType = XpubError @@ -16423,44 +18882,60 @@ public struct FfiConverterTypeXpubError: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> XpubError { let variant: Int32 = try readInt(&buf) switch variant { - case 1: return try .InvalidDescriptor( - FfiConverterTypeDescriptorError.read(from: &buf) + + + + + case 1: return .InvalidDescriptor( + try FfiConverterTypeDescriptorError.read(from: &buf) ) - case 2: return try .InvalidJson( - FfiConverterString.read(from: &buf) + case 2: return .InvalidJson( + try FfiConverterString.read(from: &buf) ) case 3: return .InvalidDescriptorInJson case 4: return .JsonNoDecriptor - case 5: return try .MissingXpub( - FfiConverterString.read(from: &buf) + case 5: return .MissingXpub( + try FfiConverterString.read(from: &buf) ) - default: throw UniffiInternalError.unexpectedEnumCase + + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: XpubError, into buf: inout [UInt8]) { switch value { + + + + + case let .InvalidDescriptor(v1): writeInt(&buf, Int32(1)) FfiConverterTypeDescriptorError.write(v1, into: &buf) - + + case let .InvalidJson(v1): writeInt(&buf, Int32(2)) FfiConverterString.write(v1, into: &buf) - + + case .InvalidDescriptorInJson: writeInt(&buf, Int32(3)) - + + case .JsonNoDecriptor: writeInt(&buf, Int32(4)) - + + case let .MissingXpub(v1): writeInt(&buf, Int32(5)) FfiConverterString.write(v1, into: &buf) + } } } + extension XpubError: Equatable, Hashable {} extension XpubError: Foundation.LocalizedError { @@ -16469,15 +18944,23 @@ extension XpubError: Foundation.LocalizedError { } } -public protocol FfiReconcile: AnyObject { + + + +public protocol FfiReconcile : AnyObject { + /** * Essentially a callback to the frontend */ - func reconcile(message: AppStateReconcileMessage) + func reconcile(message: AppStateReconcileMessage) + } + + // Put the implementation in a struct so we don't pollute the top-level namespace -private enum UniffiCallbackInterfaceFfiReconcile { +fileprivate struct UniffiCallbackInterfaceFfiReconcile { + // Create the VTable using a series of closures. // Swift automatically converts these into C callback functions. // @@ -16487,19 +18970,20 @@ private enum UniffiCallbackInterfaceFfiReconcile { reconcile: { ( uniffiHandle: UInt64, message: RustBuffer, - _: UnsafeMutableRawPointer, + uniffiOutReturn: UnsafeMutableRawPointer, uniffiCallStatus: UnsafeMutablePointer ) in let makeCall = { - () throws in + () throws -> () in guard let uniffiObj = try? FfiConverterCallbackInterfaceFfiReconcile.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.reconcile( - message: FfiConverterTypeAppStateReconcileMessage.lift(message) + return uniffiObj.reconcile( + message: try FfiConverterTypeAppStateReconcileMessage.lift(message) ) } + let writeReturn = { () } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -16507,7 +18991,7 @@ private enum UniffiCallbackInterfaceFfiReconcile { writeReturn: writeReturn ) }, - uniffiFree: { (uniffiHandle: UInt64) in + uniffiFree: { (uniffiHandle: UInt64) -> () in let result = try? FfiConverterCallbackInterfaceFfiReconcile.handleMap.remove(handle: uniffiHandle) if result == nil { print("Uniffi callback interface FfiReconcile: handle missing in uniffiFree") @@ -16522,58 +19006,66 @@ private func uniffiCallbackInitFfiReconcile() { // FfiConverter protocol for callback interfaces #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private enum FfiConverterCallbackInterfaceFfiReconcile { +fileprivate struct FfiConverterCallbackInterfaceFfiReconcile { fileprivate static let handleMap = UniffiHandleMap() } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -extension FfiConverterCallbackInterfaceFfiReconcile: FfiConverter { +extension FfiConverterCallbackInterfaceFfiReconcile : FfiConverter { typealias SwiftType = FfiReconcile typealias FfiType = UInt64 - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ handle: UInt64) throws -> SwiftType { try handleMap.get(handle: handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { let handle: UInt64 = try readInt(&buf) return try lift(handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ v: SwiftType) -> UInt64 { - handleMap.insert(obj: v) + return handleMap.insert(obj: v) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func write(_ v: SwiftType, into buf: inout [UInt8]) { writeInt(&buf, lower(v)) } } -public protocol ImportWalletViewModelReconciler: AnyObject { + + + +public protocol ImportWalletViewModelReconciler : AnyObject { + /** * Tells the frontend to reconcile the view model changes */ - func reconcile(message: ImportWalletViewModelReconcileMessage) + func reconcile(message: ImportWalletViewModelReconcileMessage) + } + + // Put the implementation in a struct so we don't pollute the top-level namespace -private enum UniffiCallbackInterfaceImportWalletViewModelReconciler { +fileprivate struct UniffiCallbackInterfaceImportWalletViewModelReconciler { + // Create the VTable using a series of closures. // Swift automatically converts these into C callback functions. // @@ -16583,19 +19075,20 @@ private enum UniffiCallbackInterfaceImportWalletViewModelReconciler { reconcile: { ( uniffiHandle: UInt64, message: RustBuffer, - _: UnsafeMutableRawPointer, + uniffiOutReturn: UnsafeMutableRawPointer, uniffiCallStatus: UnsafeMutablePointer ) in let makeCall = { - () throws in + () throws -> () in guard let uniffiObj = try? FfiConverterCallbackInterfaceImportWalletViewModelReconciler.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.reconcile( - message: FfiConverterTypeImportWalletViewModelReconcileMessage.lift(message) + return uniffiObj.reconcile( + message: try FfiConverterTypeImportWalletViewModelReconcileMessage.lift(message) ) } + let writeReturn = { () } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -16603,7 +19096,7 @@ private enum UniffiCallbackInterfaceImportWalletViewModelReconciler { writeReturn: writeReturn ) }, - uniffiFree: { (uniffiHandle: UInt64) in + uniffiFree: { (uniffiHandle: UInt64) -> () in let result = try? FfiConverterCallbackInterfaceImportWalletViewModelReconciler.handleMap.remove(handle: uniffiHandle) if result == nil { print("Uniffi callback interface ImportWalletViewModelReconciler: handle missing in uniffiFree") @@ -16618,59 +19111,67 @@ private func uniffiCallbackInitImportWalletViewModelReconciler() { // FfiConverter protocol for callback interfaces #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private enum FfiConverterCallbackInterfaceImportWalletViewModelReconciler { +fileprivate struct FfiConverterCallbackInterfaceImportWalletViewModelReconciler { fileprivate static let handleMap = UniffiHandleMap() } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -extension FfiConverterCallbackInterfaceImportWalletViewModelReconciler: FfiConverter { +extension FfiConverterCallbackInterfaceImportWalletViewModelReconciler : FfiConverter { typealias SwiftType = ImportWalletViewModelReconciler typealias FfiType = UInt64 - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ handle: UInt64) throws -> SwiftType { try handleMap.get(handle: handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { let handle: UInt64 = try readInt(&buf) return try lift(handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ v: SwiftType) -> UInt64 { - handleMap.insert(obj: v) + return handleMap.insert(obj: v) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func write(_ v: SwiftType, into buf: inout [UInt8]) { writeInt(&buf, lower(v)) } } -public protocol KeychainAccess: AnyObject { - func save(key: String, value: String) throws - func get(key: String) -> String? - func delete(key: String) -> Bool + +public protocol KeychainAccess : AnyObject { + + func save(key: String, value: String) throws + + func get(key: String) -> String? + + func delete(key: String) -> Bool + } + + // Put the implementation in a struct so we don't pollute the top-level namespace -private enum UniffiCallbackInterfaceKeychainAccess { +fileprivate struct UniffiCallbackInterfaceKeychainAccess { + // Create the VTable using a series of closures. // Swift automatically converts these into C callback functions. // @@ -16681,20 +19182,21 @@ private enum UniffiCallbackInterfaceKeychainAccess { uniffiHandle: UInt64, key: RustBuffer, value: RustBuffer, - _: UnsafeMutableRawPointer, + uniffiOutReturn: UnsafeMutableRawPointer, uniffiCallStatus: UnsafeMutablePointer ) in let makeCall = { - () throws in + () throws -> () in guard let uniffiObj = try? FfiConverterCallbackInterfaceKeychainAccess.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } return try uniffiObj.save( - key: FfiConverterString.lift(key), - value: FfiConverterString.lift(value) + key: try FfiConverterString.lift(key), + value: try FfiConverterString.lift(value) ) } + let writeReturn = { () } uniffiTraitInterfaceCallWithError( callStatus: uniffiCallStatus, @@ -16714,11 +19216,12 @@ private enum UniffiCallbackInterfaceKeychainAccess { guard let uniffiObj = try? FfiConverterCallbackInterfaceKeychainAccess.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.get( - key: FfiConverterString.lift(key) + return uniffiObj.get( + key: try FfiConverterString.lift(key) ) } + let writeReturn = { uniffiOutReturn.pointee = FfiConverterOptionString.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -16737,11 +19240,12 @@ private enum UniffiCallbackInterfaceKeychainAccess { guard let uniffiObj = try? FfiConverterCallbackInterfaceKeychainAccess.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.delete( - key: FfiConverterString.lift(key) + return uniffiObj.delete( + key: try FfiConverterString.lift(key) ) } + let writeReturn = { uniffiOutReturn.pointee = FfiConverterBool.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -16749,7 +19253,7 @@ private enum UniffiCallbackInterfaceKeychainAccess { writeReturn: writeReturn ) }, - uniffiFree: { (uniffiHandle: UInt64) in + uniffiFree: { (uniffiHandle: UInt64) -> () in let result = try? FfiConverterCallbackInterfaceKeychainAccess.handleMap.remove(handle: uniffiHandle) if result == nil { print("Uniffi callback interface KeychainAccess: handle missing in uniffiFree") @@ -16764,58 +19268,66 @@ private func uniffiCallbackInitKeychainAccess() { // FfiConverter protocol for callback interfaces #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private enum FfiConverterCallbackInterfaceKeychainAccess { +fileprivate struct FfiConverterCallbackInterfaceKeychainAccess { fileprivate static let handleMap = UniffiHandleMap() } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -extension FfiConverterCallbackInterfaceKeychainAccess: FfiConverter { +extension FfiConverterCallbackInterfaceKeychainAccess : FfiConverter { typealias SwiftType = KeychainAccess typealias FfiType = UInt64 - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ handle: UInt64) throws -> SwiftType { try handleMap.get(handle: handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { let handle: UInt64 = try readInt(&buf) return try lift(handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ v: SwiftType) -> UInt64 { - handleMap.insert(obj: v) + return handleMap.insert(obj: v) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func write(_ v: SwiftType, into buf: inout [UInt8]) { writeInt(&buf, lower(v)) } } -public protocol PendingWalletViewModelReconciler: AnyObject { + + + +public protocol PendingWalletViewModelReconciler : AnyObject { + /** * Tells the frontend to reconcile the view model changes */ - func reconcile(message: PendingWalletViewModelReconcileMessage) + func reconcile(message: PendingWalletViewModelReconcileMessage) + } + + // Put the implementation in a struct so we don't pollute the top-level namespace -private enum UniffiCallbackInterfacePendingWalletViewModelReconciler { +fileprivate struct UniffiCallbackInterfacePendingWalletViewModelReconciler { + // Create the VTable using a series of closures. // Swift automatically converts these into C callback functions. // @@ -16825,19 +19337,20 @@ private enum UniffiCallbackInterfacePendingWalletViewModelReconciler { reconcile: { ( uniffiHandle: UInt64, message: RustBuffer, - _: UnsafeMutableRawPointer, + uniffiOutReturn: UnsafeMutableRawPointer, uniffiCallStatus: UnsafeMutablePointer ) in let makeCall = { - () throws in + () throws -> () in guard let uniffiObj = try? FfiConverterCallbackInterfacePendingWalletViewModelReconciler.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.reconcile( - message: FfiConverterTypePendingWalletViewModelReconcileMessage.lift(message) + return uniffiObj.reconcile( + message: try FfiConverterTypePendingWalletViewModelReconcileMessage.lift(message) ) } + let writeReturn = { () } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -16845,7 +19358,7 @@ private enum UniffiCallbackInterfacePendingWalletViewModelReconciler { writeReturn: writeReturn ) }, - uniffiFree: { (uniffiHandle: UInt64) in + uniffiFree: { (uniffiHandle: UInt64) -> () in let result = try? FfiConverterCallbackInterfacePendingWalletViewModelReconciler.handleMap.remove(handle: uniffiHandle) if result == nil { print("Uniffi callback interface PendingWalletViewModelReconciler: handle missing in uniffiFree") @@ -16860,58 +19373,66 @@ private func uniffiCallbackInitPendingWalletViewModelReconciler() { // FfiConverter protocol for callback interfaces #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private enum FfiConverterCallbackInterfacePendingWalletViewModelReconciler { +fileprivate struct FfiConverterCallbackInterfacePendingWalletViewModelReconciler { fileprivate static let handleMap = UniffiHandleMap() } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -extension FfiConverterCallbackInterfacePendingWalletViewModelReconciler: FfiConverter { +extension FfiConverterCallbackInterfacePendingWalletViewModelReconciler : FfiConverter { typealias SwiftType = PendingWalletViewModelReconciler typealias FfiType = UInt64 - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ handle: UInt64) throws -> SwiftType { try handleMap.get(handle: handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { let handle: UInt64 = try readInt(&buf) return try lift(handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ v: SwiftType) -> UInt64 { - handleMap.insert(obj: v) + return handleMap.insert(obj: v) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func write(_ v: SwiftType, into buf: inout [UInt8]) { writeInt(&buf, lower(v)) } } -public protocol WalletViewModelReconciler: AnyObject { + + + +public protocol WalletViewModelReconciler : AnyObject { + /** * Tells the frontend to reconcile the view model changes */ - func reconcile(message: WalletViewModelReconcileMessage) + func reconcile(message: WalletViewModelReconcileMessage) + } + + // Put the implementation in a struct so we don't pollute the top-level namespace -private enum UniffiCallbackInterfaceWalletViewModelReconciler { +fileprivate struct UniffiCallbackInterfaceWalletViewModelReconciler { + // Create the VTable using a series of closures. // Swift automatically converts these into C callback functions. // @@ -16921,19 +19442,20 @@ private enum UniffiCallbackInterfaceWalletViewModelReconciler { reconcile: { ( uniffiHandle: UInt64, message: RustBuffer, - _: UnsafeMutableRawPointer, + uniffiOutReturn: UnsafeMutableRawPointer, uniffiCallStatus: UnsafeMutablePointer ) in let makeCall = { - () throws in + () throws -> () in guard let uniffiObj = try? FfiConverterCallbackInterfaceWalletViewModelReconciler.handleMap.get(handle: uniffiHandle) else { throw UniffiInternalError.unexpectedStaleHandle } - return try uniffiObj.reconcile( - message: FfiConverterTypeWalletViewModelReconcileMessage.lift(message) + return uniffiObj.reconcile( + message: try FfiConverterTypeWalletViewModelReconcileMessage.lift(message) ) } + let writeReturn = { () } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -16941,7 +19463,7 @@ private enum UniffiCallbackInterfaceWalletViewModelReconciler { writeReturn: writeReturn ) }, - uniffiFree: { (uniffiHandle: UInt64) in + uniffiFree: { (uniffiHandle: UInt64) -> () in let result = try? FfiConverterCallbackInterfaceWalletViewModelReconciler.handleMap.remove(handle: uniffiHandle) if result == nil { print("Uniffi callback interface WalletViewModelReconciler: handle missing in uniffiFree") @@ -16956,57 +19478,57 @@ private func uniffiCallbackInitWalletViewModelReconciler() { // FfiConverter protocol for callback interfaces #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private enum FfiConverterCallbackInterfaceWalletViewModelReconciler { +fileprivate struct FfiConverterCallbackInterfaceWalletViewModelReconciler { fileprivate static let handleMap = UniffiHandleMap() } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -extension FfiConverterCallbackInterfaceWalletViewModelReconciler: FfiConverter { +extension FfiConverterCallbackInterfaceWalletViewModelReconciler : FfiConverter { typealias SwiftType = WalletViewModelReconciler typealias FfiType = UInt64 - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lift(_ handle: UInt64) throws -> SwiftType { try handleMap.get(handle: handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { let handle: UInt64 = try readInt(&buf) return try lift(handle) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func lower(_ v: SwiftType) -> UInt64 { - handleMap.insert(obj: v) + return handleMap.insert(obj: v) } - #if swift(>=5.8) - @_documentation(visibility: private) - #endif +#if swift(>=5.8) + @_documentation(visibility: private) +#endif public static func write(_ v: SwiftType, into buf: inout [UInt8]) { writeInt(&buf, lower(v)) } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionUInt8: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionUInt8: FfiConverterRustBuffer { typealias SwiftType = UInt8? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17024,13 +19546,13 @@ private struct FfiConverterOptionUInt8: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionUInt32: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionUInt32: FfiConverterRustBuffer { typealias SwiftType = UInt32? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17048,13 +19570,13 @@ private struct FfiConverterOptionUInt32: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionString: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionString: FfiConverterRustBuffer { typealias SwiftType = String? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17072,13 +19594,13 @@ private struct FfiConverterOptionString: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionData: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionData: FfiConverterRustBuffer { typealias SwiftType = Data? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17096,13 +19618,13 @@ private struct FfiConverterOptionData: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionDuration: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionDuration: FfiConverterRustBuffer { typealias SwiftType = TimeInterval? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17120,13 +19642,13 @@ private struct FfiConverterOptionDuration: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeAddress: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeAddress: FfiConverterRustBuffer { typealias SwiftType = Address? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17144,13 +19666,13 @@ private struct FfiConverterOptionTypeAddress: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeAmount: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeAmount: FfiConverterRustBuffer { typealias SwiftType = Amount? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17168,13 +19690,13 @@ private struct FfiConverterOptionTypeAmount: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeFeeRateOptions: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeFeeRateOptions: FfiConverterRustBuffer { typealias SwiftType = FeeRateOptions? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17192,13 +19714,13 @@ private struct FfiConverterOptionTypeFeeRateOptions: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeFingerprint: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeFingerprint: FfiConverterRustBuffer { typealias SwiftType = Fingerprint? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17216,13 +19738,13 @@ private struct FfiConverterOptionTypeFingerprint: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeUnsignedTransactionRecord: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeUnsignedTransactionRecord: FfiConverterRustBuffer { typealias SwiftType = UnsignedTransactionRecord? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17240,13 +19762,13 @@ private struct FfiConverterOptionTypeUnsignedTransactionRecord: FfiConverterRust } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeAddressIndex: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeAddressIndex: FfiConverterRustBuffer { typealias SwiftType = AddressIndex? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17264,13 +19786,13 @@ private struct FfiConverterOptionTypeAddressIndex: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeBlockSizeLast: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeBlockSizeLast: FfiConverterRustBuffer { typealias SwiftType = BlockSizeLast? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17288,13 +19810,13 @@ private struct FfiConverterOptionTypeBlockSizeLast: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeFeeResponse: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeFeeResponse: FfiConverterRustBuffer { typealias SwiftType = FeeResponse? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17312,13 +19834,13 @@ private struct FfiConverterOptionTypeFeeResponse: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeFiatAmount: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeFiatAmount: FfiConverterRustBuffer { typealias SwiftType = FiatAmount? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17336,13 +19858,13 @@ private struct FfiConverterOptionTypeFiatAmount: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeMessageInfo: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeMessageInfo: FfiConverterRustBuffer { typealias SwiftType = MessageInfo? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17360,13 +19882,13 @@ private struct FfiConverterOptionTypeMessageInfo: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionSequenceSequenceString: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionSequenceSequenceString: FfiConverterRustBuffer { typealias SwiftType = [[String]]? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17384,13 +19906,13 @@ private struct FfiConverterOptionSequenceSequenceString: FfiConverterRustBuffer } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterOptionTypeWalletId: FfiConverterRustBuffer { +fileprivate struct FfiConverterOptionTypeWalletId: FfiConverterRustBuffer { typealias SwiftType = WalletId? public static func write(_ value: SwiftType, into buf: inout [UInt8]) { - guard let value else { + guard let value = value else { writeInt(&buf, Int8(0)) return } @@ -17408,9 +19930,9 @@ private struct FfiConverterOptionTypeWalletId: FfiConverterRustBuffer { } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceString: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceString: FfiConverterRustBuffer { typealias SwiftType = [String] public static func write(_ value: [String], into buf: inout [UInt8]) { @@ -17426,16 +19948,16 @@ private struct FfiConverterSequenceString: FfiConverterRustBuffer { var seq = [String]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterString.read(from: &buf)) + seq.append(try FfiConverterString.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeUnsignedTransaction: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeUnsignedTransaction: FfiConverterRustBuffer { typealias SwiftType = [UnsignedTransaction] public static func write(_ value: [UnsignedTransaction], into buf: inout [UInt8]) { @@ -17451,16 +19973,16 @@ private struct FfiConverterSequenceTypeUnsignedTransaction: FfiConverterRustBuff var seq = [UnsignedTransaction]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeUnsignedTransaction.read(from: &buf)) + seq.append(try FfiConverterTypeUnsignedTransaction.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeFoundAddress: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeFoundAddress: FfiConverterRustBuffer { typealias SwiftType = [FoundAddress] public static func write(_ value: [FoundAddress], into buf: inout [UInt8]) { @@ -17476,16 +19998,16 @@ private struct FfiConverterSequenceTypeFoundAddress: FfiConverterRustBuffer { var seq = [FoundAddress]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeFoundAddress.read(from: &buf)) + seq.append(try FfiConverterTypeFoundAddress.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeGroupedWord: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeGroupedWord: FfiConverterRustBuffer { typealias SwiftType = [GroupedWord] public static func write(_ value: [GroupedWord], into buf: inout [UInt8]) { @@ -17501,16 +20023,16 @@ private struct FfiConverterSequenceTypeGroupedWord: FfiConverterRustBuffer { var seq = [GroupedWord]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeGroupedWord.read(from: &buf)) + seq.append(try FfiConverterTypeGroupedWord.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeNdefRecord: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeNdefRecord: FfiConverterRustBuffer { typealias SwiftType = [NdefRecord] public static func write(_ value: [NdefRecord], into buf: inout [UInt8]) { @@ -17526,16 +20048,16 @@ private struct FfiConverterSequenceTypeNdefRecord: FfiConverterRustBuffer { var seq = [NdefRecord]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeNdefRecord.read(from: &buf)) + seq.append(try FfiConverterTypeNdefRecord.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeWalletMetadata: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeWalletMetadata: FfiConverterRustBuffer { typealias SwiftType = [WalletMetadata] public static func write(_ value: [WalletMetadata], into buf: inout [UInt8]) { @@ -17551,16 +20073,16 @@ private struct FfiConverterSequenceTypeWalletMetadata: FfiConverterRustBuffer { var seq = [WalletMetadata]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeWalletMetadata.read(from: &buf)) + seq.append(try FfiConverterTypeWalletMetadata.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeColorSchemeSelection: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeColorSchemeSelection: FfiConverterRustBuffer { typealias SwiftType = [ColorSchemeSelection] public static func write(_ value: [ColorSchemeSelection], into buf: inout [UInt8]) { @@ -17576,16 +20098,16 @@ private struct FfiConverterSequenceTypeColorSchemeSelection: FfiConverterRustBuf var seq = [ColorSchemeSelection]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeColorSchemeSelection.read(from: &buf)) + seq.append(try FfiConverterTypeColorSchemeSelection.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeNetwork: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeNetwork: FfiConverterRustBuffer { typealias SwiftType = [Network] public static func write(_ value: [Network], into buf: inout [UInt8]) { @@ -17601,16 +20123,16 @@ private struct FfiConverterSequenceTypeNetwork: FfiConverterRustBuffer { var seq = [Network]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeNetwork.read(from: &buf)) + seq.append(try FfiConverterTypeNetwork.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeNodeSelection: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeNodeSelection: FfiConverterRustBuffer { typealias SwiftType = [NodeSelection] public static func write(_ value: [NodeSelection], into buf: inout [UInt8]) { @@ -17626,16 +20148,16 @@ private struct FfiConverterSequenceTypeNodeSelection: FfiConverterRustBuffer { var seq = [NodeSelection]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeNodeSelection.read(from: &buf)) + seq.append(try FfiConverterTypeNodeSelection.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeRoute: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeRoute: FfiConverterRustBuffer { typealias SwiftType = [Route] public static func write(_ value: [Route], into buf: inout [UInt8]) { @@ -17651,16 +20173,16 @@ private struct FfiConverterSequenceTypeRoute: FfiConverterRustBuffer { var seq = [Route]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeRoute.read(from: &buf)) + seq.append(try FfiConverterTypeRoute.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeTransaction: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeTransaction: FfiConverterRustBuffer { typealias SwiftType = [Transaction] public static func write(_ value: [Transaction], into buf: inout [UInt8]) { @@ -17676,16 +20198,16 @@ private struct FfiConverterSequenceTypeTransaction: FfiConverterRustBuffer { var seq = [Transaction]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeTransaction.read(from: &buf)) + seq.append(try FfiConverterTypeTransaction.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceTypeUnit: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceTypeUnit: FfiConverterRustBuffer { typealias SwiftType = [Unit] public static func write(_ value: [Unit], into buf: inout [UInt8]) { @@ -17701,16 +20223,16 @@ private struct FfiConverterSequenceTypeUnit: FfiConverterRustBuffer { var seq = [Unit]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterTypeUnit.read(from: &buf)) + seq.append(try FfiConverterTypeUnit.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceSequenceString: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceSequenceString: FfiConverterRustBuffer { typealias SwiftType = [[String]] public static func write(_ value: [[String]], into buf: inout [UInt8]) { @@ -17726,16 +20248,16 @@ private struct FfiConverterSequenceSequenceString: FfiConverterRustBuffer { var seq = [[String]]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterSequenceString.read(from: &buf)) + seq.append(try FfiConverterSequenceString.read(from: &buf)) } return seq } } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif -private struct FfiConverterSequenceSequenceTypeGroupedWord: FfiConverterRustBuffer { +fileprivate struct FfiConverterSequenceSequenceTypeGroupedWord: FfiConverterRustBuffer { typealias SwiftType = [[GroupedWord]] public static func write(_ value: [[GroupedWord]], into buf: inout [UInt8]) { @@ -17751,12 +20273,13 @@ private struct FfiConverterSequenceSequenceTypeGroupedWord: FfiConverterRustBuff var seq = [[GroupedWord]]() seq.reserveCapacity(Int(len)) for _ in 0 ..< len { - try seq.append(FfiConverterSequenceTypeGroupedWord.read(from: &buf)) + seq.append(try FfiConverterSequenceTypeGroupedWord.read(from: &buf)) } return seq } } + /** * Typealias from the type name used in the UDL file to the builtin type. This * is needed because the UDL type name is used in function/method signatures. @@ -17764,40 +20287,43 @@ private struct FfiConverterSequenceSequenceTypeGroupedWord: FfiConverterRustBuff public typealias FfiOpacity = UInt8 #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeFfiOpacity: FfiConverter { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiOpacity { - try FfiConverterUInt8.read(from: &buf) + return try FfiConverterUInt8.read(from: &buf) } public static func write(_ value: FfiOpacity, into buf: inout [UInt8]) { - FfiConverterUInt8.write(value, into: &buf) + return FfiConverterUInt8.write(value, into: &buf) } public static func lift(_ value: UInt8) throws -> FfiOpacity { - try FfiConverterUInt8.lift(value) + return try FfiConverterUInt8.lift(value) } public static func lower(_ value: FfiOpacity) -> UInt8 { - FfiConverterUInt8.lower(value) + return FfiConverterUInt8.lower(value) } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiOpacity_lift(_ value: UInt8) throws -> FfiOpacity { - try FfiConverterTypeFfiOpacity.lift(value) + return try FfiConverterTypeFfiOpacity.lift(value) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeFfiOpacity_lower(_ value: FfiOpacity) -> UInt8 { - FfiConverterTypeFfiOpacity.lower(value) + return FfiConverterTypeFfiOpacity.lower(value) } + + /** * Typealias from the type name used in the UDL file to the builtin type. This * is needed because the UDL type name is used in function/method signatures. @@ -17805,50 +20331,51 @@ public func FfiConverterTypeFfiOpacity_lower(_ value: FfiOpacity) -> UInt8 { public typealias WalletId = String #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public struct FfiConverterTypeWalletId: FfiConverter { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletId { - try FfiConverterString.read(from: &buf) + return try FfiConverterString.read(from: &buf) } public static func write(_ value: WalletId, into buf: inout [UInt8]) { - FfiConverterString.write(value, into: &buf) + return FfiConverterString.write(value, into: &buf) } public static func lift(_ value: RustBuffer) throws -> WalletId { - try FfiConverterString.lift(value) + return try FfiConverterString.lift(value) } public static func lower(_ value: WalletId) -> RustBuffer { - FfiConverterString.lower(value) + return FfiConverterString.lower(value) } } + #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletId_lift(_ value: RustBuffer) throws -> WalletId { - try FfiConverterTypeWalletId.lift(value) + return try FfiConverterTypeWalletId.lift(value) } #if swift(>=5.8) - @_documentation(visibility: private) +@_documentation(visibility: private) #endif public func FfiConverterTypeWalletId_lower(_ value: WalletId) -> RustBuffer { - FfiConverterTypeWalletId.lower(value) + return FfiConverterTypeWalletId.lower(value) } private let UNIFFI_RUST_FUTURE_POLL_READY: Int8 = 0 private let UNIFFI_RUST_FUTURE_POLL_MAYBE_READY: Int8 = 1 -private let uniffiContinuationHandleMap = UniffiHandleMap>() +fileprivate let uniffiContinuationHandleMap = UniffiHandleMap>() -private func uniffiRustCallAsync( +fileprivate func uniffiRustCallAsync( rustFutureFunc: () -> UInt64, - pollFunc: (UInt64, @escaping UniffiRustFutureContinuationCallback, UInt64) -> Void, + pollFunc: (UInt64, @escaping UniffiRustFutureContinuationCallback, UInt64) -> (), completeFunc: (UInt64, UnsafeMutablePointer) -> F, - freeFunc: (UInt64) -> Void, + freeFunc: (UInt64) -> (), liftFunc: (F) throws -> T, errorHandler: ((RustBuffer) throws -> Swift.Error)? ) async throws -> T { @@ -17859,7 +20386,7 @@ private func uniffiRustCallAsync( defer { freeFunc(rustFuture) } - var pollResult: Int8 + var pollResult: Int8; repeat { pollResult = await withUnsafeContinuation { pollFunc( @@ -17878,286 +20405,254 @@ private func uniffiRustCallAsync( // Callback handlers for an async calls. These are invoked by Rust when the future is ready. They // lift the return value or error and resume the suspended function. -private func uniffiFutureContinuationCallback(handle: UInt64, pollResult: Int8) { +fileprivate func uniffiFutureContinuationCallback(handle: UInt64, pollResult: Int8) { if let continuation = try? uniffiContinuationHandleMap.remove(handle: handle) { continuation.resume(returning: pollResult) } else { print("uniffiFutureContinuationCallback invalid handle") } } - -public func addressIsEqual(lhs: Address, rhs: Address) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_func_address_is_equal( - FfiConverterTypeAddress.lower(lhs), - FfiConverterTypeAddress.lower(rhs), $0 - ) - }) +public func addressIsEqual(lhs: Address, rhs: Address) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_func_address_is_equal( + FfiConverterTypeAddress.lower(lhs), + FfiConverterTypeAddress.lower(rhs),$0 + ) +}) } - -public func addressIsValid(address: String) throws { try rustCallWithError(FfiConverterTypeAddressError.lift) { +public func addressIsValid(address: String)throws {try rustCallWithError(FfiConverterTypeAddressError.lift) { uniffi_cove_fn_func_address_is_valid( - FfiConverterString.lower(address), $0 + FfiConverterString.lower(address),$0 ) } } - -public func addressIsValidForNetwork(address: String, network: Network) throws { try rustCallWithError(FfiConverterTypeAddressError.lift) { +public func addressIsValidForNetwork(address: String, network: Network)throws {try rustCallWithError(FfiConverterTypeAddressError.lift) { uniffi_cove_fn_func_address_is_valid_for_network( FfiConverterString.lower(address), - FfiConverterTypeNetwork.lower(network), $0 + FfiConverterTypeNetwork.lower(network),$0 ) } } - -public func addressStringSpacedOut(address: String) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_func_address_string_spaced_out( - FfiConverterString.lower(address), $0 - ) - }) -} - -public func allColorSchemes() -> [ColorSchemeSelection] { - try! FfiConverterSequenceTypeColorSchemeSelection.lift(try! rustCall { - uniffi_cove_fn_func_all_color_schemes($0 - ) - }) +public func addressStringSpacedOut(address: String) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_func_address_string_spaced_out( + FfiConverterString.lower(address),$0 + ) +}) } - -public func allNetworks() -> [Network] { - try! FfiConverterSequenceTypeNetwork.lift(try! rustCall { - uniffi_cove_fn_func_all_networks($0 - ) - }) +public func allColorSchemes() -> [ColorSchemeSelection] { + return try! FfiConverterSequenceTypeColorSchemeSelection.lift(try! rustCall() { + uniffi_cove_fn_func_all_color_schemes($0 + ) +}) } - -public func allUnits() -> [Unit] { - try! FfiConverterSequenceTypeUnit.lift(try! rustCall { - uniffi_cove_fn_func_all_units($0 - ) - }) +public func allNetworks() -> [Network] { + return try! FfiConverterSequenceTypeNetwork.lift(try! rustCall() { + uniffi_cove_fn_func_all_networks($0 + ) +}) } - -public func balanceZero() -> Balance { - try! FfiConverterTypeBalance.lift(try! rustCall { - uniffi_cove_fn_func_balance_zero($0 - ) - }) +public func allUnits() -> [Unit] { + return try! FfiConverterSequenceTypeUnit.lift(try! rustCall() { + uniffi_cove_fn_func_all_units($0 + ) +}) } - -public func colorSchemeSelectionCapitalizedString(colorScheme: ColorSchemeSelection) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_func_color_scheme_selection_capitalized_string( - FfiConverterTypeColorSchemeSelection.lower(colorScheme), $0 - ) - }) +public func balanceZero() -> Balance { + return try! FfiConverterTypeBalance.lift(try! rustCall() { + uniffi_cove_fn_func_balance_zero($0 + ) +}) } - -public func defaultNodeSelection() -> NodeSelection { - try! FfiConverterTypeNodeSelection.lift(try! rustCall { - uniffi_cove_fn_func_default_node_selection($0 - ) - }) +public func colorSchemeSelectionCapitalizedString(colorScheme: ColorSchemeSelection) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_func_color_scheme_selection_capitalized_string( + FfiConverterTypeColorSchemeSelection.lower(colorScheme),$0 + ) +}) } - -public func discoveryStateIsEqual(lhs: DiscoveryState, rhs: DiscoveryState) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_func_discovery_state_is_equal( - FfiConverterTypeDiscoveryState.lower(lhs), - FfiConverterTypeDiscoveryState.lower(rhs), $0 - ) - }) +public func defaultNodeSelection() -> NodeSelection { + return try! FfiConverterTypeNodeSelection.lift(try! rustCall() { + uniffi_cove_fn_func_default_node_selection($0 + ) +}) } - -public func feeSpeedDuration(feeSpeed: FeeSpeed) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_func_fee_speed_duration( - FfiConverterTypeFeeSpeed.lower(feeSpeed), $0 - ) - }) +public func discoveryStateIsEqual(lhs: DiscoveryState, rhs: DiscoveryState) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_func_discovery_state_is_equal( + FfiConverterTypeDiscoveryState.lower(lhs), + FfiConverterTypeDiscoveryState.lower(rhs),$0 + ) +}) } - -public func feeSpeedToCircleColor(feeSpeed: FeeSpeed) -> FfiColor { - try! FfiConverterTypeFfiColor.lift(try! rustCall { - uniffi_cove_fn_func_fee_speed_to_circle_color( - FfiConverterTypeFeeSpeed.lower(feeSpeed), $0 - ) - }) +public func feeSpeedDuration(feeSpeed: FeeSpeed) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_func_fee_speed_duration( + FfiConverterTypeFeeSpeed.lower(feeSpeed),$0 + ) +}) } - -public func feeSpeedToString(feeSpeed: FeeSpeed) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_func_fee_speed_to_string( - FfiConverterTypeFeeSpeed.lower(feeSpeed), $0 - ) - }) +public func feeSpeedToCircleColor(feeSpeed: FeeSpeed) -> FfiColor { + return try! FfiConverterTypeFfiColor.lift(try! rustCall() { + uniffi_cove_fn_func_fee_speed_to_circle_color( + FfiConverterTypeFeeSpeed.lower(feeSpeed),$0 + ) +}) } - -public func fiatAmountPreviewNew() -> FiatAmount { - try! FfiConverterTypeFiatAmount.lift(try! rustCall { - uniffi_cove_fn_func_fiat_amount_preview_new($0 - ) - }) +public func feeSpeedToString(feeSpeed: FeeSpeed) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_func_fee_speed_to_string( + FfiConverterTypeFeeSpeed.lower(feeSpeed),$0 + ) +}) } - -public func groupedPlainWordsOf(mnemonic: String, groups: UInt8) throws -> [[String]] { - try FfiConverterSequenceSequenceString.lift(rustCallWithError(FfiConverterTypeMnemonicParseError.lift) { - uniffi_cove_fn_func_grouped_plain_words_of( - FfiConverterString.lower(mnemonic), - FfiConverterUInt8.lower(groups), $0 - ) - }) +public func fiatAmountPreviewNew() -> FiatAmount { + return try! FfiConverterTypeFiatAmount.lift(try! rustCall() { + uniffi_cove_fn_func_fiat_amount_preview_new($0 + ) +}) } - -public func hashRoute(route: Route) -> UInt64 { - try! FfiConverterUInt64.lift(try! rustCall { - uniffi_cove_fn_func_hash_route( - FfiConverterTypeRoute.lower(route), $0 - ) - }) +public func groupedPlainWordsOf(mnemonic: String, groups: UInt8)throws -> [[String]] { + return try FfiConverterSequenceSequenceString.lift(try rustCallWithError(FfiConverterTypeMnemonicParseError.lift) { + uniffi_cove_fn_func_grouped_plain_words_of( + FfiConverterString.lower(mnemonic), + FfiConverterUInt8.lower(groups),$0 + ) +}) } - -public func isRouteEqual(route: Route, routeToCheck: Route) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_func_is_route_equal( - FfiConverterTypeRoute.lower(route), - FfiConverterTypeRoute.lower(routeToCheck), $0 - ) - }) +public func hashRoute(route: Route) -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffi_cove_fn_func_hash_route( + FfiConverterTypeRoute.lower(route),$0 + ) +}) } - -public func networkToString(network: Network) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_func_network_to_string( - FfiConverterTypeNetwork.lower(network), $0 - ) - }) +public func isRouteEqual(route: Route, routeToCheck: Route) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_func_is_route_equal( + FfiConverterTypeRoute.lower(route), + FfiConverterTypeRoute.lower(routeToCheck),$0 + ) +}) } - -public func nodeSelectionToNode(node: NodeSelection) -> Node { - try! FfiConverterTypeNode.lift(try! rustCall { - uniffi_cove_fn_func_node_selection_to_node( - FfiConverterTypeNodeSelection.lower(node), $0 - ) - }) +public func networkToString(network: Network) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_func_network_to_string( + FfiConverterTypeNetwork.lower(network),$0 + ) +}) } - -public func numberOfWordsInGroups(me: NumberOfBip39Words, of: UInt8) -> [[String]] { - try! FfiConverterSequenceSequenceString.lift(try! rustCall { - uniffi_cove_fn_func_number_of_words_in_groups( - FfiConverterTypeNumberOfBip39Words.lower(me), - FfiConverterUInt8.lower(of), $0 - ) - }) +public func nodeSelectionToNode(node: NodeSelection) -> Node { + return try! FfiConverterTypeNode.lift(try! rustCall() { + uniffi_cove_fn_func_node_selection_to_node( + FfiConverterTypeNodeSelection.lower(node),$0 + ) +}) } - -public func numberOfWordsToWordCount(me: NumberOfBip39Words) -> UInt8 { - try! FfiConverterUInt8.lift(try! rustCall { - uniffi_cove_fn_func_number_of_words_to_word_count( - FfiConverterTypeNumberOfBip39Words.lower(me), $0 - ) - }) +public func numberOfWordsInGroups(me: NumberOfBip39Words, of: UInt8) -> [[String]] { + return try! FfiConverterSequenceSequenceString.lift(try! rustCall() { + uniffi_cove_fn_func_number_of_words_in_groups( + FfiConverterTypeNumberOfBip39Words.lower(me), + FfiConverterUInt8.lower(of),$0 + ) +}) } - -public func previewNewLegacyFoundAddress() -> FoundAddress { - try! FfiConverterTypeFoundAddress.lift(try! rustCall { - uniffi_cove_fn_func_preview_new_legacy_found_address($0 - ) - }) +public func numberOfWordsToWordCount(me: NumberOfBip39Words) -> UInt8 { + return try! FfiConverterUInt8.lift(try! rustCall() { + uniffi_cove_fn_func_number_of_words_to_word_count( + FfiConverterTypeNumberOfBip39Words.lower(me),$0 + ) +}) } - -public func previewNewWrappedFoundAddress() -> FoundAddress { - try! FfiConverterTypeFoundAddress.lift(try! rustCall { - uniffi_cove_fn_func_preview_new_wrapped_found_address($0 - ) - }) +public func previewNewLegacyFoundAddress() -> FoundAddress { + return try! FfiConverterTypeFoundAddress.lift(try! rustCall() { + uniffi_cove_fn_func_preview_new_legacy_found_address($0 + ) +}) } - -public func stringOrDataTryIntoMultiFormat(stringOrData: StringOrData) throws -> MultiFormat { - try FfiConverterTypeMultiFormat.lift(rustCallWithError(FfiConverterTypeMultiFormatError.lift) { - uniffi_cove_fn_func_string_or_data_try_into_multi_format( - FfiConverterTypeStringOrData.lower(stringOrData), $0 - ) - }) +public func previewNewWrappedFoundAddress() -> FoundAddress { + return try! FfiConverterTypeFoundAddress.lift(try! rustCall() { + uniffi_cove_fn_func_preview_new_wrapped_found_address($0 + ) +}) } - -public func transactionPreviewConfirmedNew() -> Transaction { - try! FfiConverterTypeTransaction.lift(try! rustCall { - uniffi_cove_fn_func_transaction_preview_confirmed_new($0 - ) - }) +public func stringOrDataTryIntoMultiFormat(stringOrData: StringOrData)throws -> MultiFormat { + return try FfiConverterTypeMultiFormat.lift(try rustCallWithError(FfiConverterTypeMultiFormatError.lift) { + uniffi_cove_fn_func_string_or_data_try_into_multi_format( + FfiConverterTypeStringOrData.lower(stringOrData),$0 + ) +}) } - -public func transactionPreviewUnconfirmedNew() -> Transaction { - try! FfiConverterTypeTransaction.lift(try! rustCall { - uniffi_cove_fn_func_transaction_preview_unconfirmed_new($0 - ) - }) +public func transactionPreviewConfirmedNew() -> Transaction { + return try! FfiConverterTypeTransaction.lift(try! rustCall() { + uniffi_cove_fn_func_transaction_preview_confirmed_new($0 + ) +}) } - -public func transactionsPreviewNew(confirmed: UInt8, unconfirmed: UInt8) -> [Transaction] { - try! FfiConverterSequenceTypeTransaction.lift(try! rustCall { - uniffi_cove_fn_func_transactions_preview_new( - FfiConverterUInt8.lower(confirmed), - FfiConverterUInt8.lower(unconfirmed), $0 - ) - }) +public func transactionPreviewUnconfirmedNew() -> Transaction { + return try! FfiConverterTypeTransaction.lift(try! rustCall() { + uniffi_cove_fn_func_transaction_preview_unconfirmed_new($0 + ) +}) } - -public func unitToString(unit: Unit) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_func_unit_to_string( - FfiConverterTypeUnit.lower(unit), $0 - ) - }) +public func transactionsPreviewNew(confirmed: UInt8, unconfirmed: UInt8) -> [Transaction] { + return try! FfiConverterSequenceTypeTransaction.lift(try! rustCall() { + uniffi_cove_fn_func_transactions_preview_new( + FfiConverterUInt8.lower(confirmed), + FfiConverterUInt8.lower(unconfirmed),$0 + ) +}) } - -public func updatePricesIfNeeded() async { - try! await uniffiRustCallAsync( - rustFutureFunc: { - uniffi_cove_fn_func_update_prices_if_needed( - ) - }, - pollFunc: ffi_cove_rust_future_poll_void, - completeFunc: ffi_cove_rust_future_complete_void, - freeFunc: ffi_cove_rust_future_free_void, - liftFunc: { $0 }, - errorHandler: nil +public func unitToString(unit: Unit) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_func_unit_to_string( + FfiConverterTypeUnit.lower(unit),$0 ) +}) } - -public func walletAddressTypeLessThan(lhs: WalletAddressType, rhs: WalletAddressType) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_func_wallet_address_type_less_than( - FfiConverterTypeWalletAddressType.lower(lhs), - FfiConverterTypeWalletAddressType.lower(rhs), $0 +public func updatePricesIfNeeded()async { + return + try! await uniffiRustCallAsync( + rustFutureFunc: { + uniffi_cove_fn_func_update_prices_if_needed( + ) + }, + pollFunc: ffi_cove_rust_future_poll_void, + completeFunc: ffi_cove_rust_future_complete_void, + freeFunc: ffi_cove_rust_future_free_void, + liftFunc: { $0 }, + errorHandler: nil + ) - }) } - -public func walletAddressTypeToString(walletAddressType: WalletAddressType) -> String { - try! FfiConverterString.lift(try! rustCall { - uniffi_cove_fn_func_wallet_address_type_to_string( - FfiConverterTypeWalletAddressType.lower(walletAddressType), $0 - ) - }) +public func walletAddressTypeLessThan(lhs: WalletAddressType, rhs: WalletAddressType) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_func_wallet_address_type_less_than( + FfiConverterTypeWalletAddressType.lower(lhs), + FfiConverterTypeWalletAddressType.lower(rhs),$0 + ) +}) } - -public func walletMetadataPreview() -> WalletMetadata { - try! FfiConverterTypeWalletMetadata.lift(try! rustCall { - uniffi_cove_fn_func_wallet_metadata_preview($0 - ) - }) +public func walletAddressTypeToString(walletAddressType: WalletAddressType) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_cove_fn_func_wallet_address_type_to_string( + FfiConverterTypeWalletAddressType.lower(walletAddressType),$0 + ) +}) } - -public func walletStateIsEqual(lhs: WalletLoadState, rhs: WalletLoadState) -> Bool { - try! FfiConverterBool.lift(try! rustCall { - uniffi_cove_fn_func_wallet_state_is_equal( - FfiConverterTypeWalletLoadState.lower(lhs), - FfiConverterTypeWalletLoadState.lower(rhs), $0 - ) - }) +public func walletMetadataPreview() -> WalletMetadata { + return try! FfiConverterTypeWalletMetadata.lift(try! rustCall() { + uniffi_cove_fn_func_wallet_metadata_preview($0 + ) +}) +} +public func walletStateIsEqual(lhs: WalletLoadState, rhs: WalletLoadState) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffi_cove_fn_func_wallet_state_is_equal( + FfiConverterTypeWalletLoadState.lower(lhs), + FfiConverterTypeWalletLoadState.lower(rhs),$0 + ) +}) } private enum InitializationResult { @@ -18165,7 +20660,6 @@ private enum InitializationResult { case contractVersionMismatch case apiChecksumMismatch } - // Use a global variable to perform the versioning checks. Swift ensures that // the code inside is only computed once. private let initializationResult: InitializationResult = { @@ -18176,1024 +20670,1024 @@ private let initializationResult: InitializationResult = { if bindings_contract_version != scaffolding_contract_version { return InitializationResult.contractVersionMismatch } - if uniffi_cove_checksum_func_address_is_equal() != 63981 { + if (uniffi_cove_checksum_func_address_is_equal() != 63981) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_address_is_valid() != 22920 { + if (uniffi_cove_checksum_func_address_is_valid() != 22920) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_address_is_valid_for_network() != 41522 { + if (uniffi_cove_checksum_func_address_is_valid_for_network() != 41522) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_address_string_spaced_out() != 60902 { + if (uniffi_cove_checksum_func_address_string_spaced_out() != 60902) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_all_color_schemes() != 24835 { + if (uniffi_cove_checksum_func_all_color_schemes() != 24835) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_all_networks() != 30650 { + if (uniffi_cove_checksum_func_all_networks() != 30650) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_all_units() != 36925 { + if (uniffi_cove_checksum_func_all_units() != 36925) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_balance_zero() != 63807 { + if (uniffi_cove_checksum_func_balance_zero() != 63807) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_color_scheme_selection_capitalized_string() != 42247 { + if (uniffi_cove_checksum_func_color_scheme_selection_capitalized_string() != 42247) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_default_node_selection() != 14665 { + if (uniffi_cove_checksum_func_default_node_selection() != 14665) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_discovery_state_is_equal() != 12390 { + if (uniffi_cove_checksum_func_discovery_state_is_equal() != 12390) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_fee_speed_duration() != 28599 { + if (uniffi_cove_checksum_func_fee_speed_duration() != 28599) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_fee_speed_to_circle_color() != 46076 { + if (uniffi_cove_checksum_func_fee_speed_to_circle_color() != 46076) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_fee_speed_to_string() != 21405 { + if (uniffi_cove_checksum_func_fee_speed_to_string() != 21405) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_fiat_amount_preview_new() != 6422 { + if (uniffi_cove_checksum_func_fiat_amount_preview_new() != 6422) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_grouped_plain_words_of() != 45802 { + if (uniffi_cove_checksum_func_grouped_plain_words_of() != 45802) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_hash_route() != 32817 { + if (uniffi_cove_checksum_func_hash_route() != 32817) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_is_route_equal() != 25732 { + if (uniffi_cove_checksum_func_is_route_equal() != 25732) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_network_to_string() != 60660 { + if (uniffi_cove_checksum_func_network_to_string() != 60660) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_node_selection_to_node() != 57209 { + if (uniffi_cove_checksum_func_node_selection_to_node() != 57209) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_number_of_words_in_groups() != 14214 { + if (uniffi_cove_checksum_func_number_of_words_in_groups() != 14214) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_number_of_words_to_word_count() != 24846 { + if (uniffi_cove_checksum_func_number_of_words_to_word_count() != 24846) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_preview_new_legacy_found_address() != 36773 { + if (uniffi_cove_checksum_func_preview_new_legacy_found_address() != 36773) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_preview_new_wrapped_found_address() != 57500 { + if (uniffi_cove_checksum_func_preview_new_wrapped_found_address() != 57500) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_string_or_data_try_into_multi_format() != 34953 { + if (uniffi_cove_checksum_func_string_or_data_try_into_multi_format() != 34953) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_transaction_preview_confirmed_new() != 43706 { + if (uniffi_cove_checksum_func_transaction_preview_confirmed_new() != 43706) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_transaction_preview_unconfirmed_new() != 49725 { + if (uniffi_cove_checksum_func_transaction_preview_unconfirmed_new() != 49725) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_transactions_preview_new() != 60166 { + if (uniffi_cove_checksum_func_transactions_preview_new() != 60166) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_unit_to_string() != 63080 { + if (uniffi_cove_checksum_func_unit_to_string() != 63080) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_update_prices_if_needed() != 27986 { + if (uniffi_cove_checksum_func_update_prices_if_needed() != 27986) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_wallet_address_type_less_than() != 14566 { + if (uniffi_cove_checksum_func_wallet_address_type_less_than() != 14566) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_wallet_address_type_to_string() != 36064 { + if (uniffi_cove_checksum_func_wallet_address_type_to_string() != 36064) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_wallet_metadata_preview() != 1229 { + if (uniffi_cove_checksum_func_wallet_metadata_preview() != 1229) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_func_wallet_state_is_equal() != 27037 { + if (uniffi_cove_checksum_func_wallet_state_is_equal() != 27037) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_address_spaced_out() != 29461 { + if (uniffi_cove_checksum_method_address_spaced_out() != 29461) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_address_string() != 10597 { + if (uniffi_cove_checksum_method_address_string() != 10597) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_addressinfo_address() != 59376 { + if (uniffi_cove_checksum_method_addressinfo_address() != 59376) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_addressinfo_adress_string() != 41627 { + if (uniffi_cove_checksum_method_addressinfo_adress_string() != 41627) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_addressinfo_index() != 45529 { + if (uniffi_cove_checksum_method_addressinfo_index() != 45529) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_addresswithnetwork_address() != 33477 { + if (uniffi_cove_checksum_method_addresswithnetwork_address() != 33477) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_addresswithnetwork_amount() != 23019 { + if (uniffi_cove_checksum_method_addresswithnetwork_amount() != 23019) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_addresswithnetwork_network() != 64145 { + if (uniffi_cove_checksum_method_addresswithnetwork_network() != 64145) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_amount_as_btc() != 7531 { + if (uniffi_cove_checksum_method_amount_as_btc() != 7531) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_amount_as_sats() != 62969 { + if (uniffi_cove_checksum_method_amount_as_sats() != 62969) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_amount_btc_string() != 21387 { + if (uniffi_cove_checksum_method_amount_btc_string() != 21387) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_amount_btc_string_with_unit() != 10939 { + if (uniffi_cove_checksum_method_amount_btc_string_with_unit() != 10939) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_amount_fmt_string_with_unit() != 14497 { + if (uniffi_cove_checksum_method_amount_fmt_string_with_unit() != 14497) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_amount_sats_string() != 36019 { + if (uniffi_cove_checksum_method_amount_sats_string() != 36019) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_amount_sats_string_with_unit() != 34409 { + if (uniffi_cove_checksum_method_amount_sats_string_with_unit() != 34409) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_autocomplete_autocomplete() != 4748 { + if (uniffi_cove_checksum_method_autocomplete_autocomplete() != 4748) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_autocomplete_is_valid_word() != 18021 { + if (uniffi_cove_checksum_method_autocomplete_is_valid_word() != 18021) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bbqrjoinresult_final_result() != 44157 { + if (uniffi_cove_checksum_method_bbqrjoinresult_final_result() != 44157) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bbqrjoinresult_is_complete() != 4119 { + if (uniffi_cove_checksum_method_bbqrjoinresult_is_complete() != 4119) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bbqrjoinresult_parts_left() != 39828 { + if (uniffi_cove_checksum_method_bbqrjoinresult_parts_left() != 39828) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bbqrjoined_get_grouped_words() != 36018 { + if (uniffi_cove_checksum_method_bbqrjoined_get_grouped_words() != 36018) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bbqrjoined_get_seed_words() != 64693 { + if (uniffi_cove_checksum_method_bbqrjoined_get_seed_words() != 64693) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bip39autocomplete_autocomplete() != 21847 { + if (uniffi_cove_checksum_method_bip39autocomplete_autocomplete() != 21847) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bip39autocomplete_is_valid_word() != 19081 { + if (uniffi_cove_checksum_method_bip39autocomplete_is_valid_word() != 19081) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bip39wordspecificautocomplete_autocomplete() != 34680 { + if (uniffi_cove_checksum_method_bip39wordspecificautocomplete_autocomplete() != 34680) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bip39wordspecificautocomplete_is_bip39_word() != 59249 { + if (uniffi_cove_checksum_method_bip39wordspecificautocomplete_is_bip39_word() != 59249) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bip39wordspecificautocomplete_is_valid_word() != 4400 { + if (uniffi_cove_checksum_method_bip39wordspecificautocomplete_is_valid_word() != 4400) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bitcointransaction_normalize_tx_id() != 15620 { + if (uniffi_cove_checksum_method_bitcointransaction_normalize_tx_id() != 15620) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bitcointransaction_tx_id() != 39904 { + if (uniffi_cove_checksum_method_bitcointransaction_tx_id() != 39904) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_bitcointransaction_tx_id_hash() != 59940 { + if (uniffi_cove_checksum_method_bitcointransaction_tx_id_hash() != 59940) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_boxedroute_route() != 26050 { + if (uniffi_cove_checksum_method_boxedroute_route() != 26050) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_fee_rate() != 32230 { + if (uniffi_cove_checksum_method_confirmdetails_fee_rate() != 32230) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_fee_total() != 15069 { + if (uniffi_cove_checksum_method_confirmdetails_fee_total() != 15069) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_id() != 46525 { + if (uniffi_cove_checksum_method_confirmdetails_id() != 46525) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_id_hash() != 11280 { + if (uniffi_cove_checksum_method_confirmdetails_id_hash() != 11280) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_is_equal() != 16719 { + if (uniffi_cove_checksum_method_confirmdetails_is_equal() != 16719) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_normalized_id() != 32961 { + if (uniffi_cove_checksum_method_confirmdetails_normalized_id() != 32961) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_psbt_bytes() != 48686 { + if (uniffi_cove_checksum_method_confirmdetails_psbt_bytes() != 48686) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_psbt_to_bbqr() != 44579 { + if (uniffi_cove_checksum_method_confirmdetails_psbt_to_bbqr() != 44579) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_psbt_to_hex() != 3021 { + if (uniffi_cove_checksum_method_confirmdetails_psbt_to_hex() != 3021) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_sending_amount() != 58788 { + if (uniffi_cove_checksum_method_confirmdetails_sending_amount() != 58788) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_sending_to() != 43075 { + if (uniffi_cove_checksum_method_confirmdetails_sending_to() != 43075) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmdetails_spending_amount() != 62205 { + if (uniffi_cove_checksum_method_confirmdetails_spending_amount() != 62205) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_block_height() != 62845 { + if (uniffi_cove_checksum_method_confirmedtransaction_block_height() != 62845) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_block_height_fmt() != 22839 { + if (uniffi_cove_checksum_method_confirmedtransaction_block_height_fmt() != 22839) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_confirmed_at() != 21481 { + if (uniffi_cove_checksum_method_confirmedtransaction_confirmed_at() != 21481) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_confirmed_at_fmt() != 28835 { + if (uniffi_cove_checksum_method_confirmedtransaction_confirmed_at_fmt() != 28835) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_confirmed_at_fmt_with_time() != 36703 { + if (uniffi_cove_checksum_method_confirmedtransaction_confirmed_at_fmt_with_time() != 36703) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_fiat_amount() != 31522 { + if (uniffi_cove_checksum_method_confirmedtransaction_fiat_amount() != 31522) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_id() != 63537 { + if (uniffi_cove_checksum_method_confirmedtransaction_id() != 63537) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_label() != 17010 { + if (uniffi_cove_checksum_method_confirmedtransaction_label() != 17010) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_confirmedtransaction_sent_and_received() != 3525 { + if (uniffi_cove_checksum_method_confirmedtransaction_sent_and_received() != 3525) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_database_global_config() != 4476 { + if (uniffi_cove_checksum_method_database_global_config() != 4476) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_database_unsigned_transactions() != 8913 { + if (uniffi_cove_checksum_method_database_unsigned_transactions() != 8913) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_database_wallets() != 38115 { + if (uniffi_cove_checksum_method_database_wallets() != 38115) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerate_sat_per_vb() != 31119 { + if (uniffi_cove_checksum_method_feerate_sat_per_vb() != 31119) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoption_duration() != 58541 { + if (uniffi_cove_checksum_method_feerateoption_duration() != 58541) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoption_fee_rate() != 56298 { + if (uniffi_cove_checksum_method_feerateoption_fee_rate() != 56298) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoption_fee_speed() != 22536 { + if (uniffi_cove_checksum_method_feerateoption_fee_speed() != 22536) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoption_is_equal() != 48538 { + if (uniffi_cove_checksum_method_feerateoption_is_equal() != 48538) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoption_sat_per_vb() != 60748 { + if (uniffi_cove_checksum_method_feerateoption_sat_per_vb() != 60748) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionwithtotalfee_duration() != 26593 { + if (uniffi_cove_checksum_method_feerateoptionwithtotalfee_duration() != 26593) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionwithtotalfee_fee_rate() != 14029 { + if (uniffi_cove_checksum_method_feerateoptionwithtotalfee_fee_rate() != 14029) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionwithtotalfee_fee_rate_options() != 29806 { + if (uniffi_cove_checksum_method_feerateoptionwithtotalfee_fee_rate_options() != 29806) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionwithtotalfee_fee_speed() != 32155 { + if (uniffi_cove_checksum_method_feerateoptionwithtotalfee_fee_speed() != 32155) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionwithtotalfee_is_equal() != 47764 { + if (uniffi_cove_checksum_method_feerateoptionwithtotalfee_is_equal() != 47764) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionwithtotalfee_sat_per_vb() != 40506 { + if (uniffi_cove_checksum_method_feerateoptionwithtotalfee_sat_per_vb() != 40506) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionwithtotalfee_total_fee() != 40202 { + if (uniffi_cove_checksum_method_feerateoptionwithtotalfee_total_fee() != 40202) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptions_fast() != 29009 { + if (uniffi_cove_checksum_method_feerateoptions_fast() != 29009) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptions_medium() != 5747 { + if (uniffi_cove_checksum_method_feerateoptions_medium() != 5747) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptions_slow() != 58269 { + if (uniffi_cove_checksum_method_feerateoptions_slow() != 58269) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionswithtotalfee_fast() != 15779 { + if (uniffi_cove_checksum_method_feerateoptionswithtotalfee_fast() != 15779) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionswithtotalfee_fee_rate_options() != 7503 { + if (uniffi_cove_checksum_method_feerateoptionswithtotalfee_fee_rate_options() != 7503) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionswithtotalfee_medium() != 444 { + if (uniffi_cove_checksum_method_feerateoptionswithtotalfee_medium() != 444) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_feerateoptionswithtotalfee_slow() != 1762 { + if (uniffi_cove_checksum_method_feerateoptionswithtotalfee_slow() != 1762) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_dispatch() != 48712 { + if (uniffi_cove_checksum_method_ffiapp_dispatch() != 48712) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_fees() != 44559 { + if (uniffi_cove_checksum_method_ffiapp_fees() != 44559) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_go_to_selected_wallet() != 36820 { + if (uniffi_cove_checksum_method_ffiapp_go_to_selected_wallet() != 36820) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_has_wallets() != 3792 { + if (uniffi_cove_checksum_method_ffiapp_has_wallets() != 3792) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_init_on_start() != 44630 { + if (uniffi_cove_checksum_method_ffiapp_init_on_start() != 44630) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_listen_for_updates() != 48795 { + if (uniffi_cove_checksum_method_ffiapp_listen_for_updates() != 48795) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_load_and_reset_default_route() != 16043 { + if (uniffi_cove_checksum_method_ffiapp_load_and_reset_default_route() != 16043) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_load_and_reset_default_route_after() != 14335 { + if (uniffi_cove_checksum_method_ffiapp_load_and_reset_default_route_after() != 14335) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_network() != 26747 { + if (uniffi_cove_checksum_method_ffiapp_network() != 26747) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_num_wallets() != 28903 { + if (uniffi_cove_checksum_method_ffiapp_num_wallets() != 28903) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_prices() != 58350 { + if (uniffi_cove_checksum_method_ffiapp_prices() != 58350) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_reset_default_route_to() != 40613 { + if (uniffi_cove_checksum_method_ffiapp_reset_default_route_to() != 40613) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_select_wallet() != 4478 { + if (uniffi_cove_checksum_method_ffiapp_select_wallet() != 4478) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffiapp_state() != 19551 { + if (uniffi_cove_checksum_method_ffiapp_state() != 19551) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffinfcreader_data_from_records() != 32962 { + if (uniffi_cove_checksum_method_ffinfcreader_data_from_records() != 32962) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffinfcreader_is_resumeable() != 21759 { + if (uniffi_cove_checksum_method_ffinfcreader_is_resumeable() != 21759) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffinfcreader_is_started() != 956 { + if (uniffi_cove_checksum_method_ffinfcreader_is_started() != 956) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffinfcreader_message_info() != 7402 { + if (uniffi_cove_checksum_method_ffinfcreader_message_info() != 7402) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffinfcreader_parse() != 39581 { + if (uniffi_cove_checksum_method_ffinfcreader_parse() != 39581) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffinfcreader_string_from_record() != 60818 { + if (uniffi_cove_checksum_method_ffinfcreader_string_from_record() != 60818) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_filehandler_read() != 31508 { + if (uniffi_cove_checksum_method_filehandler_read() != 31508) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_fingerprint_as_lowercase() != 25321 { + if (uniffi_cove_checksum_method_fingerprint_as_lowercase() != 25321) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_fingerprint_as_uppercase() != 11522 { + if (uniffi_cove_checksum_method_fingerprint_as_uppercase() != 11522) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_clear_selected_wallet() != 22146 { + if (uniffi_cove_checksum_method_globalconfigtable_clear_selected_wallet() != 22146) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_color_scheme() != 18859 { + if (uniffi_cove_checksum_method_globalconfigtable_color_scheme() != 18859) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_delete() != 13364 { + if (uniffi_cove_checksum_method_globalconfigtable_delete() != 13364) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_get() != 52128 { + if (uniffi_cove_checksum_method_globalconfigtable_get() != 52128) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_select_wallet() != 52001 { + if (uniffi_cove_checksum_method_globalconfigtable_select_wallet() != 52001) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_selected_network() != 7657 { + if (uniffi_cove_checksum_method_globalconfigtable_selected_network() != 7657) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_selected_node() != 31353 { + if (uniffi_cove_checksum_method_globalconfigtable_selected_node() != 31353) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_selected_wallet() != 51568 { + if (uniffi_cove_checksum_method_globalconfigtable_selected_wallet() != 51568) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_set() != 31033 { + if (uniffi_cove_checksum_method_globalconfigtable_set() != 31033) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_set_color_scheme() != 24086 { + if (uniffi_cove_checksum_method_globalconfigtable_set_color_scheme() != 24086) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_set_selected_network() != 34312 { + if (uniffi_cove_checksum_method_globalconfigtable_set_selected_network() != 34312) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalconfigtable_set_selected_node() != 35090 { + if (uniffi_cove_checksum_method_globalconfigtable_set_selected_node() != 35090) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalflagtable_get() != 42810 { + if (uniffi_cove_checksum_method_globalflagtable_get() != 42810) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalflagtable_set() != 23016 { + if (uniffi_cove_checksum_method_globalflagtable_set() != 23016) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_globalflagtable_toggle_bool_config() != 12062 { + if (uniffi_cove_checksum_method_globalflagtable_toggle_bool_config() != 12062) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_headericonpresenter_background_color() != 61819 { + if (uniffi_cove_checksum_method_headericonpresenter_background_color() != 61819) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_headericonpresenter_icon_color() != 52203 { + if (uniffi_cove_checksum_method_headericonpresenter_icon_color() != 52203) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_headericonpresenter_ring_color() != 23010 { + if (uniffi_cove_checksum_method_headericonpresenter_ring_color() != 23010) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_mnemonic_all_words() != 45039 { + if (uniffi_cove_checksum_method_mnemonic_all_words() != 45039) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_mnemonic_words() != 35319 { + if (uniffi_cove_checksum_method_mnemonic_words() != 35319) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_multiqr_add_part() != 11179 { + if (uniffi_cove_checksum_method_multiqr_add_part() != 11179) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_multiqr_get_grouped_words() != 21029 { + if (uniffi_cove_checksum_method_multiqr_get_grouped_words() != 21029) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_multiqr_handle_scan_result() != 3857 { + if (uniffi_cove_checksum_method_multiqr_handle_scan_result() != 3857) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_multiqr_is_bbqr() != 22296 { + if (uniffi_cove_checksum_method_multiqr_is_bbqr() != 22296) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_multiqr_is_seed_qr() != 10256 { + if (uniffi_cove_checksum_method_multiqr_is_seed_qr() != 10256) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_multiqr_total_parts() != 51119 { + if (uniffi_cove_checksum_method_multiqr_total_parts() != 51119) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ndefrecordreader_id() != 37849 { + if (uniffi_cove_checksum_method_ndefrecordreader_id() != 37849) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ndefrecordreader_type_() != 27060 { + if (uniffi_cove_checksum_method_ndefrecordreader_type_() != 27060) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nfcconst_bytes_per_block() != 35854 { + if (uniffi_cove_checksum_method_nfcconst_bytes_per_block() != 35854) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nfcconst_number_of_blocks_per_chunk() != 48258 { + if (uniffi_cove_checksum_method_nfcconst_number_of_blocks_per_chunk() != 48258) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nfcconst_total_bytes_per_chunk() != 41799 { + if (uniffi_cove_checksum_method_nfcconst_total_bytes_per_chunk() != 41799) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nodeselector_check_and_save_node() != 48519 { + if (uniffi_cove_checksum_method_nodeselector_check_and_save_node() != 48519) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nodeselector_check_selected_node() != 19872 { + if (uniffi_cove_checksum_method_nodeselector_check_selected_node() != 19872) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nodeselector_node_list() != 23402 { + if (uniffi_cove_checksum_method_nodeselector_node_list() != 23402) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nodeselector_parse_custom_node() != 54190 { + if (uniffi_cove_checksum_method_nodeselector_parse_custom_node() != 54190) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nodeselector_select_preset_node() != 36330 { + if (uniffi_cove_checksum_method_nodeselector_select_preset_node() != 36330) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_nodeselector_selected_node() != 29849 { + if (uniffi_cove_checksum_method_nodeselector_selected_node() != 29849) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_psbt_fee() != 37973 { + if (uniffi_cove_checksum_method_psbt_fee() != 37973) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_psbt_tx_id() != 61047 { + if (uniffi_cove_checksum_method_psbt_tx_id() != 61047) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_psbt_weight() != 5696 { + if (uniffi_cove_checksum_method_psbt_weight() != 5696) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_cold_wallet_import() != 14120 { + if (uniffi_cove_checksum_method_routefactory_cold_wallet_import() != 14120) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_hot_wallet() != 7846 { + if (uniffi_cove_checksum_method_routefactory_hot_wallet() != 7846) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_hot_wallet_import_from_scan() != 63262 { + if (uniffi_cove_checksum_method_routefactory_hot_wallet_import_from_scan() != 63262) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_is_same_parent_route() != 43168 { + if (uniffi_cove_checksum_method_routefactory_is_same_parent_route() != 43168) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_load_and_reset_to() != 41201 { + if (uniffi_cove_checksum_method_routefactory_load_and_reset_to() != 41201) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_load_and_reset_to_after() != 39743 { + if (uniffi_cove_checksum_method_routefactory_load_and_reset_to_after() != 39743) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_new_hot_wallet() != 51032 { + if (uniffi_cove_checksum_method_routefactory_new_hot_wallet() != 51032) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_new_wallet_select() != 21343 { + if (uniffi_cove_checksum_method_routefactory_new_wallet_select() != 21343) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_qr_import() != 17980 { + if (uniffi_cove_checksum_method_routefactory_qr_import() != 17980) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_secret_words() != 64915 { + if (uniffi_cove_checksum_method_routefactory_secret_words() != 64915) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_send() != 62083 { + if (uniffi_cove_checksum_method_routefactory_send() != 62083) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_send_confirm() != 14299 { + if (uniffi_cove_checksum_method_routefactory_send_confirm() != 14299) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_send_hardware_export() != 34735 { + if (uniffi_cove_checksum_method_routefactory_send_hardware_export() != 34735) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_routefactory_send_set_amount() != 33578 { + if (uniffi_cove_checksum_method_routefactory_send_set_amount() != 33578) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustimportwalletviewmodel_dispatch() != 54003 { + if (uniffi_cove_checksum_method_rustimportwalletviewmodel_dispatch() != 54003) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustimportwalletviewmodel_import_wallet() != 22388 { + if (uniffi_cove_checksum_method_rustimportwalletviewmodel_import_wallet() != 22388) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustimportwalletviewmodel_listen_for_updates() != 3156 { + if (uniffi_cove_checksum_method_rustimportwalletviewmodel_listen_for_updates() != 3156) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_bip_39_words() != 43976 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_bip_39_words() != 43976) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_bip_39_words_grouped() != 45204 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_bip_39_words_grouped() != 45204) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_card_indexes() != 33165 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_card_indexes() != 33165) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_dispatch() != 8422 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_dispatch() != 8422) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_get_state() != 22652 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_get_state() != 22652) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_listen_for_updates() != 25486 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_listen_for_updates() != 25486) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_number_of_words_count() != 47399 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_number_of_words_count() != 47399) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustpendingwalletviewmodel_save_wallet() != 45300 { + if (uniffi_cove_checksum_method_rustpendingwalletviewmodel_save_wallet() != 45300) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_address_at() != 38561 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_address_at() != 38561) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_amount_in_fiat() != 53684 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_amount_in_fiat() != 53684) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_balance() != 10059 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_balance() != 10059) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_balance_in_fiat() != 18683 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_balance_in_fiat() != 18683) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_build_transaction() != 22450 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_build_transaction() != 22450) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_build_transaction_with_fee_rate() != 28947 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_build_transaction_with_fee_rate() != 28947) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_current_block_height() != 59265 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_current_block_height() != 59265) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_delete_unsigned_transaction() != 60038 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_delete_unsigned_transaction() != 60038) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_delete_wallet() != 30016 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_delete_wallet() != 30016) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_dispatch() != 35864 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_dispatch() != 35864) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_display_amount() != 59974 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_display_amount() != 59974) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_display_fiat_amount() != 40818 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_display_fiat_amount() != 40818) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_display_sent_and_received_amount() != 30788 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_display_sent_and_received_amount() != 30788) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_fee_rate_options() != 44766 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_fee_rate_options() != 44766) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_fee_rate_options_with_total_fee() != 22160 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_fee_rate_options_with_total_fee() != 22160) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_fees() != 36596 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_fees() != 36596) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_fingerprint() != 38447 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_fingerprint() != 38447) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_force_update_height() != 17709 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_force_update_height() != 17709) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_force_wallet_scan() != 47434 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_force_wallet_scan() != 47434) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_get_confirm_details() != 13990 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_get_confirm_details() != 13990) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_get_fee_options() != 47126 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_get_fee_options() != 47126) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_get_max_send_amount() != 1655 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_get_max_send_amount() != 1655) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_get_unsigned_transactions() != 23375 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_get_unsigned_transactions() != 23375) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_listen_for_updates() != 31064 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_listen_for_updates() != 31064) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_mark_wallet_as_verified() != 64306 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_mark_wallet_as_verified() != 64306) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_next_address() != 23410 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_next_address() != 23410) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_number_of_confirmations() != 21053 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_number_of_confirmations() != 21053) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_number_of_confirmations_fmt() != 20695 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_number_of_confirmations_fmt() != 20695) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_save_unsigned_transaction() != 20775 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_save_unsigned_transaction() != 20775) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_sent_and_received_fiat() != 25413 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_sent_and_received_fiat() != 25413) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_set_wallet_metadata() != 16289 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_set_wallet_metadata() != 16289) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_start_wallet_scan() != 46525 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_start_wallet_scan() != 46525) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_switch_to_different_wallet_address_type() != 46868 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_switch_to_different_wallet_address_type() != 46868) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_transaction_details() != 62006 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_transaction_details() != 62006) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_wallet_metadata() != 44518 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_wallet_metadata() != 44518) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_rustwalletviewmodel_word_validator() != 32309 { + if (uniffi_cove_checksum_method_rustwalletviewmodel_word_validator() != 32309) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_seedqr_get_words() != 64188 { + if (uniffi_cove_checksum_method_seedqr_get_words() != 64188) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_seedqr_grouped_plain_words() != 35569 { + if (uniffi_cove_checksum_method_seedqr_grouped_plain_words() != 35569) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_sentandreceived_amount() != 29581 { + if (uniffi_cove_checksum_method_sentandreceived_amount() != 29581) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_sentandreceived_amount_fmt() != 55767 { + if (uniffi_cove_checksum_method_sentandreceived_amount_fmt() != 55767) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_sentandreceived_direction() != 63307 { + if (uniffi_cove_checksum_method_sentandreceived_direction() != 63307) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_sentandreceived_label() != 28947 { + if (uniffi_cove_checksum_method_sentandreceived_label() != 28947) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_sentandreceived_received() != 12400 { + if (uniffi_cove_checksum_method_sentandreceived_received() != 12400) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_sentandreceived_sent() != 29124 { + if (uniffi_cove_checksum_method_sentandreceived_sent() != 29124) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_address() != 31151 { + if (uniffi_cove_checksum_method_transactiondetails_address() != 31151) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_address_spaced_out() != 61966 { + if (uniffi_cove_checksum_method_transactiondetails_address_spaced_out() != 61966) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_amount() != 16978 { + if (uniffi_cove_checksum_method_transactiondetails_amount() != 16978) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_amount_fiat() != 34436 { + if (uniffi_cove_checksum_method_transactiondetails_amount_fiat() != 34436) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_amount_fiat_fmt() != 60211 { + if (uniffi_cove_checksum_method_transactiondetails_amount_fiat_fmt() != 60211) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_amount_fmt() != 3569 { + if (uniffi_cove_checksum_method_transactiondetails_amount_fmt() != 3569) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_block_number() != 61262 { + if (uniffi_cove_checksum_method_transactiondetails_block_number() != 61262) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_block_number_fmt() != 52006 { + if (uniffi_cove_checksum_method_transactiondetails_block_number_fmt() != 52006) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_confirmation_date_time() != 54859 { + if (uniffi_cove_checksum_method_transactiondetails_confirmation_date_time() != 54859) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_fee_fiat_fmt() != 62198 { + if (uniffi_cove_checksum_method_transactiondetails_fee_fiat_fmt() != 62198) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_fee_fmt() != 46565 { + if (uniffi_cove_checksum_method_transactiondetails_fee_fmt() != 46565) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_is_confirmed() != 54031 { + if (uniffi_cove_checksum_method_transactiondetails_is_confirmed() != 54031) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_is_received() != 54839 { + if (uniffi_cove_checksum_method_transactiondetails_is_received() != 54839) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_is_sent() != 7556 { + if (uniffi_cove_checksum_method_transactiondetails_is_sent() != 7556) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_sent_sans_fee_fiat_fmt() != 62275 { + if (uniffi_cove_checksum_method_transactiondetails_sent_sans_fee_fiat_fmt() != 62275) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_sent_sans_fee_fmt() != 54855 { + if (uniffi_cove_checksum_method_transactiondetails_sent_sans_fee_fmt() != 54855) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_transactiondetails_transaction_url() != 12235 { + if (uniffi_cove_checksum_method_transactiondetails_transaction_url() != 12235) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_txid_as_hash_string() != 50846 { + if (uniffi_cove_checksum_method_txid_as_hash_string() != 50846) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_txid_is_equal() != 5460 { + if (uniffi_cove_checksum_method_txid_is_equal() != 5460) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unconfirmedtransaction_fiat_amount() != 59016 { + if (uniffi_cove_checksum_method_unconfirmedtransaction_fiat_amount() != 59016) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unconfirmedtransaction_id() != 59175 { + if (uniffi_cove_checksum_method_unconfirmedtransaction_id() != 59175) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unconfirmedtransaction_label() != 12913 { + if (uniffi_cove_checksum_method_unconfirmedtransaction_label() != 12913) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unconfirmedtransaction_last_seen() != 29089 { + if (uniffi_cove_checksum_method_unconfirmedtransaction_last_seen() != 29089) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unconfirmedtransaction_sent_and_received() != 24593 { + if (uniffi_cove_checksum_method_unconfirmedtransaction_sent_and_received() != 24593) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransaction_details() != 5504 { + if (uniffi_cove_checksum_method_unsignedtransaction_details() != 5504) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransaction_id() != 29504 { + if (uniffi_cove_checksum_method_unsignedtransaction_id() != 29504) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransaction_label() != 12609 { + if (uniffi_cove_checksum_method_unsignedtransaction_label() != 12609) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransaction_sending_amount() != 15688 { + if (uniffi_cove_checksum_method_unsignedtransaction_sending_amount() != 15688) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransaction_spending_amount() != 36292 { + if (uniffi_cove_checksum_method_unsignedtransaction_spending_amount() != 36292) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransactionrecord_confirm_details() != 25286 { + if (uniffi_cove_checksum_method_unsignedtransactionrecord_confirm_details() != 25286) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransactionrecord_created_at() != 62407 { + if (uniffi_cove_checksum_method_unsignedtransactionrecord_created_at() != 62407) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransactionrecord_tx_id() != 61639 { + if (uniffi_cove_checksum_method_unsignedtransactionrecord_tx_id() != 61639) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransactionrecord_wallet_id() != 32815 { + if (uniffi_cove_checksum_method_unsignedtransactionrecord_wallet_id() != 32815) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransactionstable_gettx() != 8611 { + if (uniffi_cove_checksum_method_unsignedtransactionstable_gettx() != 8611) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_unsignedtransactionstable_gettxthrow() != 32085 { + if (uniffi_cove_checksum_method_unsignedtransactionstable_gettxthrow() != 32085) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_wallet_id() != 39072 { + if (uniffi_cove_checksum_method_wallet_id() != 39072) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_walletstable_all() != 19569 { + if (uniffi_cove_checksum_method_walletstable_all() != 19569) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_walletstable_is_empty() != 57763 { + if (uniffi_cove_checksum_method_walletstable_is_empty() != 57763) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_walletstable_len() != 35149 { + if (uniffi_cove_checksum_method_walletstable_len() != 35149) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_wordvalidator_grouped_words() != 32035 { + if (uniffi_cove_checksum_method_wordvalidator_grouped_words() != 32035) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_wordvalidator_invalid_words_string() != 7159 { + if (uniffi_cove_checksum_method_wordvalidator_invalid_words_string() != 7159) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_wordvalidator_is_all_words_valid() != 17704 { + if (uniffi_cove_checksum_method_wordvalidator_is_all_words_valid() != 17704) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_wordvalidator_is_valid_word_group() != 6393 { + if (uniffi_cove_checksum_method_wordvalidator_is_valid_word_group() != 6393) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_address_from_string() != 47046 { + if (uniffi_cove_checksum_constructor_address_from_string() != 47046) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_address_preview_new() != 14015 { + if (uniffi_cove_checksum_constructor_address_preview_new() != 14015) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_addresswithnetwork_new() != 36898 { + if (uniffi_cove_checksum_constructor_addresswithnetwork_new() != 36898) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_amount_from_sat() != 58319 { + if (uniffi_cove_checksum_constructor_amount_from_sat() != 58319) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_amount_one_btc() != 59586 { + if (uniffi_cove_checksum_constructor_amount_one_btc() != 59586) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_amount_one_sat() != 58118 { + if (uniffi_cove_checksum_constructor_amount_one_sat() != 58118) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_bip39autocomplete_new() != 41839 { + if (uniffi_cove_checksum_constructor_bip39autocomplete_new() != 41839) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_bip39wordspecificautocomplete_new() != 49814 { + if (uniffi_cove_checksum_constructor_bip39wordspecificautocomplete_new() != 49814) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_bitcointransaction_new() != 54397 { + if (uniffi_cove_checksum_constructor_bitcointransaction_new() != 54397) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_bitcointransaction_tryfromdata() != 16116 { + if (uniffi_cove_checksum_constructor_bitcointransaction_tryfromdata() != 16116) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_boxedroute_new() != 62486 { + if (uniffi_cove_checksum_constructor_boxedroute_new() != 62486) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_confirmdetails_preview_new() != 31485 { + if (uniffi_cove_checksum_constructor_confirmdetails_preview_new() != 31485) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_database_new() != 41458 { + if (uniffi_cove_checksum_constructor_database_new() != 41458) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_feerate_from_sat_per_vb() != 58499 { + if (uniffi_cove_checksum_constructor_feerate_from_sat_per_vb() != 58499) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_feerateoption_new() != 49009 { + if (uniffi_cove_checksum_constructor_feerateoption_new() != 49009) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_feerateoptions_preview_new() != 9368 { + if (uniffi_cove_checksum_constructor_feerateoptions_preview_new() != 9368) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_feerateoptionswithtotalfee_preview_new() != 15548 { + if (uniffi_cove_checksum_constructor_feerateoptionswithtotalfee_preview_new() != 15548) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_ffiapp_new() != 11955 { + if (uniffi_cove_checksum_constructor_ffiapp_new() != 11955) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_ffinfcreader_new() != 27409 { + if (uniffi_cove_checksum_constructor_ffinfcreader_new() != 27409) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_filehandler_new() != 50695 { + if (uniffi_cove_checksum_constructor_filehandler_new() != 50695) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_fingerprint_new() != 20831 { + if (uniffi_cove_checksum_constructor_fingerprint_new() != 20831) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_headericonpresenter_new() != 10425 { + if (uniffi_cove_checksum_constructor_headericonpresenter_new() != 10425) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_keychain_new() != 34449 { + if (uniffi_cove_checksum_constructor_keychain_new() != 34449) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_mnemonic_new() != 56597 { + if (uniffi_cove_checksum_constructor_mnemonic_new() != 56597) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_mnemonic_preview() != 3882 { + if (uniffi_cove_checksum_constructor_mnemonic_preview() != 3882) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_multiqr_new_from_string() != 2028 { + if (uniffi_cove_checksum_constructor_multiqr_new_from_string() != 2028) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_multiqr_try_new() != 18617 { + if (uniffi_cove_checksum_constructor_multiqr_try_new() != 18617) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_multiqr_try_new_from_data() != 36957 { + if (uniffi_cove_checksum_constructor_multiqr_try_new_from_data() != 36957) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_ndefrecordreader_new() != 36791 { + if (uniffi_cove_checksum_constructor_ndefrecordreader_new() != 36791) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_nfcconst_new() != 22455 { + if (uniffi_cove_checksum_constructor_nfcconst_new() != 22455) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_nodeselector_new() != 61659 { + if (uniffi_cove_checksum_constructor_nodeselector_new() != 61659) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_psbt_new() != 25544 { + if (uniffi_cove_checksum_constructor_psbt_new() != 25544) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_routefactory_new() != 4959 { + if (uniffi_cove_checksum_constructor_routefactory_new() != 4959) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_rustimportwalletviewmodel_new() != 30630 { + if (uniffi_cove_checksum_constructor_rustimportwalletviewmodel_new() != 30630) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_rustpendingwalletviewmodel_new() != 47075 { + if (uniffi_cove_checksum_constructor_rustpendingwalletviewmodel_new() != 47075) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_rustwalletviewmodel_new() != 37675 { + if (uniffi_cove_checksum_constructor_rustwalletviewmodel_new() != 37675) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_rustwalletviewmodel_preview_new_wallet() != 37026 { + if (uniffi_cove_checksum_constructor_rustwalletviewmodel_preview_new_wallet() != 37026) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_rustwalletviewmodel_try_new_from_xpub() != 6171 { + if (uniffi_cove_checksum_constructor_rustwalletviewmodel_try_new_from_xpub() != 6171) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_seedqr_new_from_data() != 13640 { + if (uniffi_cove_checksum_constructor_seedqr_new_from_data() != 13640) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_seedqr_new_from_str() != 6520 { + if (uniffi_cove_checksum_constructor_seedqr_new_from_str() != 6520) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_transactiondetails_preview_confirmed_received() != 6979 { + if (uniffi_cove_checksum_constructor_transactiondetails_preview_confirmed_received() != 6979) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_transactiondetails_preview_confirmed_sent() != 20500 { + if (uniffi_cove_checksum_constructor_transactiondetails_preview_confirmed_sent() != 20500) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_transactiondetails_preview_new_confirmed() != 2385 { + if (uniffi_cove_checksum_constructor_transactiondetails_preview_new_confirmed() != 2385) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_transactiondetails_preview_pending_received() != 1731 { + if (uniffi_cove_checksum_constructor_transactiondetails_preview_pending_received() != 1731) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_transactiondetails_preview_pending_sent() != 378 { + if (uniffi_cove_checksum_constructor_transactiondetails_preview_pending_sent() != 378) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_unsignedtransaction_preview_new() != 1909 { + if (uniffi_cove_checksum_constructor_unsignedtransaction_preview_new() != 1909) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_wallet_new_from_export() != 11192 { + if (uniffi_cove_checksum_constructor_wallet_new_from_export() != 11192) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_wallet_new_from_xpub() != 31726 { + if (uniffi_cove_checksum_constructor_wallet_new_from_xpub() != 31726) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_constructor_wallet_previewnewwallet() != 56877 { + if (uniffi_cove_checksum_constructor_wallet_previewnewwallet() != 56877) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_ffireconcile_reconcile() != 54238 { + if (uniffi_cove_checksum_method_ffireconcile_reconcile() != 54238) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_importwalletviewmodelreconciler_reconcile() != 63459 { + if (uniffi_cove_checksum_method_importwalletviewmodelreconciler_reconcile() != 63459) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_keychainaccess_save() != 63039 { + if (uniffi_cove_checksum_method_keychainaccess_save() != 63039) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_keychainaccess_get() != 3155 { + if (uniffi_cove_checksum_method_keychainaccess_get() != 3155) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_keychainaccess_delete() != 11466 { + if (uniffi_cove_checksum_method_keychainaccess_delete() != 11466) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_pendingwalletviewmodelreconciler_reconcile() != 37929 { + if (uniffi_cove_checksum_method_pendingwalletviewmodelreconciler_reconcile() != 37929) { return InitializationResult.apiChecksumMismatch } - if uniffi_cove_checksum_method_walletviewmodelreconciler_reconcile() != 28159 { + if (uniffi_cove_checksum_method_walletviewmodelreconciler_reconcile() != 28159) { return InitializationResult.apiChecksumMismatch } @@ -19217,4 +21711,4 @@ private func uniffiEnsureInitialized() { } } -// swiftlint:enable all +// swiftlint:enable all \ No newline at end of file diff --git a/ios/Cove/NewWalletFlow/ColdWallet/QrCodeImportScreen.swift b/ios/Cove/Flows/NewWalletFlow/ColdWallet/QrCodeImportScreen.swift similarity index 100% rename from ios/Cove/NewWalletFlow/ColdWallet/QrCodeImportScreen.swift rename to ios/Cove/Flows/NewWalletFlow/ColdWallet/QrCodeImportScreen.swift diff --git a/ios/Cove/NewWalletFlow/Container/NewHotWalletContainer.swift b/ios/Cove/Flows/NewWalletFlow/Container/NewHotWalletContainer.swift similarity index 100% rename from ios/Cove/NewWalletFlow/Container/NewHotWalletContainer.swift rename to ios/Cove/Flows/NewWalletFlow/Container/NewHotWalletContainer.swift diff --git a/ios/Cove/NewWalletFlow/Container/NewWalletContainer.swift b/ios/Cove/Flows/NewWalletFlow/Container/NewWalletContainer.swift similarity index 100% rename from ios/Cove/NewWalletFlow/Container/NewWalletContainer.swift rename to ios/Cove/Flows/NewWalletFlow/Container/NewWalletContainer.swift diff --git a/ios/Cove/NewWalletFlow/HotWallet/HotWalletCreateScreen.swift b/ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletCreateScreen.swift similarity index 100% rename from ios/Cove/NewWalletFlow/HotWallet/HotWalletCreateScreen.swift rename to ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletCreateScreen.swift diff --git a/ios/Cove/NewWalletFlow/HotWallet/HotWalletImportScreen.swift b/ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletImportScreen.swift similarity index 100% rename from ios/Cove/NewWalletFlow/HotWallet/HotWalletImportScreen.swift rename to ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletImportScreen.swift diff --git a/ios/Cove/NewWalletFlow/HotWallet/HotWalletSelectScreen.swift b/ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletSelectScreen.swift similarity index 100% rename from ios/Cove/NewWalletFlow/HotWallet/HotWalletSelectScreen.swift rename to ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletSelectScreen.swift diff --git a/ios/Cove/NewWalletFlow/HotWallet/VerifyWordsScreen.swift b/ios/Cove/Flows/NewWalletFlow/HotWallet/VerifyWordsScreen.swift similarity index 100% rename from ios/Cove/NewWalletFlow/HotWallet/VerifyWordsScreen.swift rename to ios/Cove/Flows/NewWalletFlow/HotWallet/VerifyWordsScreen.swift diff --git a/ios/Cove/NewWalletFlow/NewWalletSelectScreen.swift b/ios/Cove/Flows/NewWalletFlow/NewWalletSelectScreen.swift similarity index 100% rename from ios/Cove/NewWalletFlow/NewWalletSelectScreen.swift rename to ios/Cove/Flows/NewWalletFlow/NewWalletSelectScreen.swift diff --git a/ios/Cove/NewWalletFlow/NfcHelpView.swift b/ios/Cove/Flows/NewWalletFlow/NfcHelpView.swift similarity index 100% rename from ios/Cove/NewWalletFlow/NfcHelpView.swift rename to ios/Cove/Flows/NewWalletFlow/NfcHelpView.swift diff --git a/ios/Cove/NewWalletFlow/PendingWalletViewModel.swift b/ios/Cove/Flows/NewWalletFlow/PendingWalletViewModel.swift similarity index 100% rename from ios/Cove/NewWalletFlow/PendingWalletViewModel.swift rename to ios/Cove/Flows/NewWalletFlow/PendingWalletViewModel.swift diff --git a/ios/Cove/SelectedWalletScreen/ChooseWalletTypeView.swift b/ios/Cove/Flows/SelectedWalletFlow/ChooseWalletTypeView.swift similarity index 100% rename from ios/Cove/SelectedWalletScreen/ChooseWalletTypeView.swift rename to ios/Cove/Flows/SelectedWalletFlow/ChooseWalletTypeView.swift diff --git a/ios/Cove/SelectedWalletScreen/ReceiveView.swift b/ios/Cove/Flows/SelectedWalletFlow/ReceiveView.swift similarity index 100% rename from ios/Cove/SelectedWalletScreen/ReceiveView.swift rename to ios/Cove/Flows/SelectedWalletFlow/ReceiveView.swift diff --git a/ios/Cove/SecretWordsScreen.swift b/ios/Cove/Flows/SelectedWalletFlow/SecretWordsScreen.swift similarity index 100% rename from ios/Cove/SecretWordsScreen.swift rename to ios/Cove/Flows/SelectedWalletFlow/SecretWordsScreen.swift diff --git a/ios/Cove/Flows/SelectedWalletFlow/SelectedWalletContainer.swift b/ios/Cove/Flows/SelectedWalletFlow/SelectedWalletContainer.swift new file mode 100644 index 00000000..e8af5260 --- /dev/null +++ b/ios/Cove/Flows/SelectedWalletFlow/SelectedWalletContainer.swift @@ -0,0 +1,78 @@ +// +// SelectedWalletScreen.swift +// Cove +// +// Created by Praveen Perera on 7/1/24. +// + +import SwiftUI + +struct SelectedWalletContainer: View { + @Environment(\.colorScheme) private var colorScheme + @Environment(MainViewModel.self) private var app + @Environment(\.navigate) private var navigate + + let id: WalletId + @State private var model: WalletViewModel? = nil + + func loadModel() { + if model != nil { return } + + do { + Log.debug("Getting wallet \(id)") + model = try app.getWalletViewModel(id: id) + } catch { + Log.error("Something went very wrong: \(error)") + navigate(Route.listWallets) + } + } + + var body: some View { + Group { + if let model { + SelectedWalletScreen(model: model) + .background( + model.loadState == .loading ? + LinearGradient(colors: [ + .black.opacity(colorScheme == .dark ? 0.9 : 0), + .black.opacity(colorScheme == .dark ? 0.9 : 0), + ], startPoint: .top, endPoint: .bottom) : + LinearGradient(stops: [ + .init(color: .midnightBlue, location: 0.45), + .init(color: colorScheme == .dark ? .black.opacity(0.9) : .clear, location: 0.55), + ], startPoint: .top, endPoint: .bottom) + ) + .background(Color.white) + + } else { + Text("Loading...") + } + } + .onAppear { + loadModel() + } + .task { + // small delay and then start scanning wallet + if let model { + do { + try? await Task.sleep(for: .milliseconds(400)) + try await model.rust.startWalletScan() + } catch { + Log.error("Wallet Scan Failed \(error.localizedDescription)") + } + } + } + .onChange(of: model?.loadState) { _, loadState in + if case .loaded = loadState { + if let model { + app.updateWalletVm(model) + } + } + } + } +} + +#Preview { + SelectedWalletContainer(id: WalletId()) + .environment(MainViewModel()) +} diff --git a/ios/Cove/HomeScreens/SelectedWalletScreen.swift b/ios/Cove/Flows/SelectedWalletFlow/SelectedWalletScreen.swift similarity index 58% rename from ios/Cove/HomeScreens/SelectedWalletScreen.swift rename to ios/Cove/Flows/SelectedWalletFlow/SelectedWalletScreen.swift index a98d9a0f..21bfda19 100644 --- a/ios/Cove/HomeScreens/SelectedWalletScreen.swift +++ b/ios/Cove/Flows/SelectedWalletFlow/SelectedWalletScreen.swift @@ -2,84 +2,19 @@ // SelectedWalletScreen.swift // Cove // -// Created by Praveen Perera on 7/1/24. +// Created by Praveen Perera on 11/28/24. // import ActivityIndicatorView import SwiftUI -struct SelectedWalletScreen: View { - @Environment(\.colorScheme) private var colorScheme - @Environment(MainViewModel.self) private var app - @Environment(\.navigate) private var navigate - - let id: WalletId - @State private var model: WalletViewModel? = nil - - func loadModel() { - if model != nil { return } - - do { - Log.debug("Getting wallet \(id)") - model = try app.getWalletViewModel(id: id) - } catch { - Log.error("Something went very wrong: \(error)") - navigate(Route.listWallets) - } - } - - var body: some View { - Group { - if let model { - SelectedWalletScreenInner(model: model) - .background( - model.loadState == .loading ? - LinearGradient(colors: [ - .black.opacity(colorScheme == .dark ? 0.9 : 0), - .black.opacity(colorScheme == .dark ? 0.9 : 0), - ], startPoint: .top, endPoint: .bottom) : - LinearGradient(stops: [ - .init(color: .midnightBlue, location: 0.45), - .init(color: colorScheme == .dark ? .black.opacity(0.9) : .clear, location: 0.55), - ], startPoint: .top, endPoint: .bottom) - ) - .background(Color.white) - - } else { - Text("Loading...") - } - } - .onAppear { - loadModel() - } - .task { - // small delay and then start scanning wallet - if let model { - do { - try? await Task.sleep(for: .milliseconds(400)) - try await model.rust.startWalletScan() - } catch { - Log.error("Wallet Scan Failed \(error.localizedDescription)") - } - } - } - .onChange(of: model?.loadState) { _, loadState in - if case .loaded = loadState { - if let model { - app.updateWalletVm(model) - } - } - } - } -} - private enum SheetState: Equatable { case receive case settings case chooseAddressType([FoundAddress]) } -struct SelectedWalletScreenInner: View { +struct SelectedWalletScreen: View { @Environment(\.safeAreaInsets) private var safeAreaInsets @Environment(\.colorScheme) private var colorScheme @Environment(MainViewModel.self) private var app @@ -192,54 +127,65 @@ struct SelectedWalletScreenInner: View { sheetState = TaggedItem(.receive) } - var body: some View { - VStack { - ScrollView { - VStack(spacing: 0) { - WalletBalanceHeaderView( - balance: model.balance.confirmed, - metadata: model.walletMetadata, - updater: updater, - showReceiveSheet: showReceiveSheet - ) - .clipped() - .ignoresSafeArea(.all) - - VerifyReminder( - walletId: model.walletMetadata.id, isVerified: model.walletMetadata.verified - ) + @ViewBuilder + var MainContent: some View { + VStack(spacing: 0) { + WalletBalanceHeaderView( + balance: model.balance.confirmed, + metadata: model.walletMetadata, + updater: updater, + showReceiveSheet: showReceiveSheet + ) + .clipped() + .ignoresSafeArea(.all) - Transactions - .environment(model) - } - .toolbar { - ToolbarItem(placement: .principal) { - HStack(spacing: 10) { - if metadata.walletType == .cold { - BitcoinShieldIcon(width: 13, color: .white) - } + VerifyReminder( + walletId: model.walletMetadata.id, isVerified: model.walletMetadata.verified + ) - Text(metadata.name) - .foregroundStyle(.white) - .font(.callout) - .fontWeight(.semibold) - } + Transactions + .environment(model) + } + .toolbar { + ToolbarItem(placement: .principal) { + HStack(spacing: 10) { + if metadata.walletType == .cold { + BitcoinShieldIcon(width: 13, color: .white) } - ToolbarItem(placement: .navigationBarTrailing) { - Button(action: { - sheetState = TaggedItem(.settings) - }) { - Image(systemName: "gear") - .foregroundStyle(.white) - .font(.callout) - } + Text(metadata.name) + .foregroundStyle(.white) + .font(.callout) + .fontWeight(.semibold) + } + .contentShape(.contextMenuPreview, RoundedRectangle(cornerRadius: 8).inset(by: -8)) + .contextMenu { + Button("Settings") { + sheetState = .init(.settings) } } - .toolbarColorScheme(.dark, for: .navigationBar) - .toolbarBackground(Color.midnightBlue.opacity(0.9), for: .navigationBar) - .toolbarBackground(shouldShowNavBar ? .visible : .hidden, for: .navigationBar) - .sheet(item: $sheetState, content: SheetContent) + } + + ToolbarItemGroup(placement: .navigationBarTrailing) { + Button(action: { + app.sheetState = .init(.qr) + }) { + Image(systemName: "qrcode") + .foregroundStyle(.white) + .font(.callout) + } + } + } + .toolbarColorScheme(.dark, for: .navigationBar) + .toolbarBackground(Color.midnightBlue.opacity(0.9), for: .navigationBar) + .toolbarBackground(shouldShowNavBar ? .visible : .hidden, for: .navigationBar) + .sheet(item: $sheetState, content: SheetContent) + } + + var body: some View { + VStack { + ScrollView { + MainContent } .refreshable { try? await model.rust.forceWalletScan() @@ -290,15 +236,10 @@ struct VerifyReminder: View { } } -#Preview("Loading") { - SelectedWalletScreen(id: WalletId()) - .environment(MainViewModel()) -} - -#Preview("Loaded Wallet") { +#Preview { AsyncPreview { NavigationStack { - SelectedWalletScreenInner(model: WalletViewModel(preview: "preview_only")) + SelectedWalletScreen(model: WalletViewModel(preview: "preview_only")) .environment(MainViewModel()) } } diff --git a/ios/Cove/TransactionDetails/ConfirmationIndicatorView.swift b/ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/ConfirmationIndicatorView.swift similarity index 100% rename from ios/Cove/TransactionDetails/ConfirmationIndicatorView.swift rename to ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/ConfirmationIndicatorView.swift diff --git a/ios/Cove/TransactionDetails/HeaderIcon.swift b/ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/HeaderIcon.swift similarity index 100% rename from ios/Cove/TransactionDetails/HeaderIcon.swift rename to ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/HeaderIcon.swift diff --git a/ios/Cove/TransactionDetails/ReceivedDetailsExpandedView.swift b/ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/ReceivedDetailsExpandedView.swift similarity index 100% rename from ios/Cove/TransactionDetails/ReceivedDetailsExpandedView.swift rename to ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/ReceivedDetailsExpandedView.swift diff --git a/ios/Cove/TransactionDetails/SentDetailsExpandedView.swift b/ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/SentDetailsExpandedView.swift similarity index 100% rename from ios/Cove/TransactionDetails/SentDetailsExpandedView.swift rename to ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/SentDetailsExpandedView.swift diff --git a/ios/Cove/TransactionDetails/TransactionDetailsView.swift b/ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/TransactionDetailsView.swift similarity index 100% rename from ios/Cove/TransactionDetails/TransactionDetailsView.swift rename to ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/TransactionDetailsView.swift diff --git a/ios/Cove/TransactionsDetailScreen.swift b/ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/TransactionsDetailScreen.swift similarity index 100% rename from ios/Cove/TransactionsDetailScreen.swift rename to ios/Cove/Flows/SelectedWalletFlow/TransactionDetails/TransactionsDetailScreen.swift diff --git a/ios/Cove/SelectedWalletScreen/TransactionsCardView.swift b/ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift similarity index 100% rename from ios/Cove/SelectedWalletScreen/TransactionsCardView.swift rename to ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift diff --git a/ios/Cove/SelectedWalletScreen/WalletBalanceHeaderView.swift b/ios/Cove/Flows/SelectedWalletFlow/WalletBalanceHeaderView.swift similarity index 99% rename from ios/Cove/SelectedWalletScreen/WalletBalanceHeaderView.swift rename to ios/Cove/Flows/SelectedWalletFlow/WalletBalanceHeaderView.swift index c3b0326c..22dff3e4 100644 --- a/ios/Cove/SelectedWalletScreen/WalletBalanceHeaderView.swift +++ b/ios/Cove/Flows/SelectedWalletFlow/WalletBalanceHeaderView.swift @@ -84,7 +84,7 @@ struct WalletBalanceHeaderView: View { } var body: some View { - VStack(spacing: 30) { + VStack(spacing: 26) { VStack(spacing: 6) { HStack { Text(secondaryBalanceString) @@ -161,7 +161,7 @@ struct WalletBalanceHeaderView: View { } } .padding() - .padding(.vertical, 30) + .padding(.vertical, 26) .padding(.top, safeAreaInsets.top + 25) .background( Image(.headerPattern) diff --git a/ios/Cove/SendFlow/Common/SendFlowAccountSection.swift b/ios/Cove/Flows/SendFlow/Common/SendFlowAccountSection.swift similarity index 100% rename from ios/Cove/SendFlow/Common/SendFlowAccountSection.swift rename to ios/Cove/Flows/SendFlow/Common/SendFlowAccountSection.swift diff --git a/ios/Cove/SendFlow/Common/SendFlowDetailsSheetView.swift b/ios/Cove/Flows/SendFlow/Common/SendFlowDetailsSheetView.swift similarity index 100% rename from ios/Cove/SendFlow/Common/SendFlowDetailsSheetView.swift rename to ios/Cove/Flows/SendFlow/Common/SendFlowDetailsSheetView.swift diff --git a/ios/Cove/SendFlow/Common/SendFlowDetailsView.swift b/ios/Cove/Flows/SendFlow/Common/SendFlowDetailsView.swift similarity index 100% rename from ios/Cove/SendFlow/Common/SendFlowDetailsView.swift rename to ios/Cove/Flows/SendFlow/Common/SendFlowDetailsView.swift diff --git a/ios/Cove/SendFlow/Common/SendFlowHeaderView.swift b/ios/Cove/Flows/SendFlow/Common/SendFlowHeaderView.swift similarity index 100% rename from ios/Cove/SendFlow/Common/SendFlowHeaderView.swift rename to ios/Cove/Flows/SendFlow/Common/SendFlowHeaderView.swift diff --git a/ios/Cove/SendFlow/ConfirmScreen/SwipeToSendView.swift b/ios/Cove/Flows/SendFlow/ConfirmScreen/SwipeToSendView.swift similarity index 100% rename from ios/Cove/SendFlow/ConfirmScreen/SwipeToSendView.swift rename to ios/Cove/Flows/SendFlow/ConfirmScreen/SwipeToSendView.swift diff --git a/ios/Cove/SendFlow/SendFlowConfirmScreen.swift b/ios/Cove/Flows/SendFlow/SendFlowConfirmScreen.swift similarity index 100% rename from ios/Cove/SendFlow/SendFlowConfirmScreen.swift rename to ios/Cove/Flows/SendFlow/SendFlowConfirmScreen.swift diff --git a/ios/Cove/SendFlow/SendFlowHardwareScreen.swift b/ios/Cove/Flows/SendFlow/SendFlowHardwareScreen.swift similarity index 100% rename from ios/Cove/SendFlow/SendFlowHardwareScreen.swift rename to ios/Cove/Flows/SendFlow/SendFlowHardwareScreen.swift diff --git a/ios/Cove/SendFlow/SendFlowHardwareScreen/SendFlowBbqrExport.swift b/ios/Cove/Flows/SendFlow/SendFlowHardwareScreen/SendFlowBbqrExport.swift similarity index 100% rename from ios/Cove/SendFlow/SendFlowHardwareScreen/SendFlowBbqrExport.swift rename to ios/Cove/Flows/SendFlow/SendFlowHardwareScreen/SendFlowBbqrExport.swift diff --git a/ios/Cove/SendFlow/SendFlowSetAmountPresenter.swift b/ios/Cove/Flows/SendFlow/SendFlowSetAmountPresenter.swift similarity index 100% rename from ios/Cove/SendFlow/SendFlowSetAmountPresenter.swift rename to ios/Cove/Flows/SendFlow/SendFlowSetAmountPresenter.swift diff --git a/ios/Cove/SendFlow/SendFlowSetAmountScreen.swift b/ios/Cove/Flows/SendFlow/SendFlowSetAmountScreen.swift similarity index 100% rename from ios/Cove/SendFlow/SendFlowSetAmountScreen.swift rename to ios/Cove/Flows/SendFlow/SendFlowSetAmountScreen.swift diff --git a/ios/Cove/SendFlow/SendRouteContainer.swift b/ios/Cove/Flows/SendFlow/SendRouteContainer.swift similarity index 100% rename from ios/Cove/SendFlow/SendRouteContainer.swift rename to ios/Cove/Flows/SendFlow/SendRouteContainer.swift diff --git a/ios/Cove/SendFlow/SetAmountScreen/AddressTextEditor.swift b/ios/Cove/Flows/SendFlow/SetAmountScreen/AddressTextEditor.swift similarity index 100% rename from ios/Cove/SendFlow/SetAmountScreen/AddressTextEditor.swift rename to ios/Cove/Flows/SendFlow/SetAmountScreen/AddressTextEditor.swift diff --git a/ios/Cove/SendFlow/SetAmountScreen/EnterAddressView.swift b/ios/Cove/Flows/SendFlow/SetAmountScreen/EnterAddressView.swift similarity index 100% rename from ios/Cove/SendFlow/SetAmountScreen/EnterAddressView.swift rename to ios/Cove/Flows/SendFlow/SetAmountScreen/EnterAddressView.swift diff --git a/ios/Cove/SendFlow/SetAmountScreen/EnterAmountView.swift b/ios/Cove/Flows/SendFlow/SetAmountScreen/EnterAmountView.swift similarity index 100% rename from ios/Cove/SendFlow/SetAmountScreen/EnterAmountView.swift rename to ios/Cove/Flows/SendFlow/SetAmountScreen/EnterAmountView.swift diff --git a/ios/Cove/SendFlow/SetAmountScreen/QrCodeAddressView.swift b/ios/Cove/Flows/SendFlow/SetAmountScreen/QrCodeAddressView.swift similarity index 100% rename from ios/Cove/SendFlow/SetAmountScreen/QrCodeAddressView.swift rename to ios/Cove/Flows/SendFlow/SetAmountScreen/QrCodeAddressView.swift diff --git a/ios/Cove/SendFlow/SetAmountScreen/SendFlowSelectFeeRateView.swift b/ios/Cove/Flows/SendFlow/SetAmountScreen/SendFlowSelectFeeRateView.swift similarity index 100% rename from ios/Cove/SendFlow/SetAmountScreen/SendFlowSelectFeeRateView.swift rename to ios/Cove/Flows/SendFlow/SetAmountScreen/SendFlowSelectFeeRateView.swift diff --git a/ios/Cove/RouteView.swift b/ios/Cove/RouteView.swift index a1e32bd6..720e60d4 100644 --- a/ios/Cove/RouteView.swift +++ b/ios/Cove/RouteView.swift @@ -17,10 +17,12 @@ struct RouteView: View { .id(model.routeId) } else { VStack { - ActivityIndicatorView(isVisible: Binding.constant(true), type: .growingArc(.orange, lineWidth: 4)) - .frame(width: 75, height: 75) - .padding(.bottom, 100) - .foregroundColor(.orange) + ActivityIndicatorView( + isVisible: Binding.constant(true), type: .growingArc(.orange, lineWidth: 4) + ) + .frame(width: 75, height: 75) + .padding(.bottom, 100) + .foregroundColor(.orange) } } } @@ -44,7 +46,7 @@ func routeToView(model: MainViewModel, route: Route) -> some View { case let .newWallet(route: route): NewWalletContainer(route: route) case let .selectedWallet(walletId): - SelectedWalletScreen(id: walletId) + SelectedWalletContainer(id: walletId) case let .secretWords(id: walletId): SecretWordsScreen(id: walletId) case let .transactionDetails(id: id, details: details): diff --git a/scripts/build-ios.sh b/scripts/build-ios.sh index d2538d6e..80457cd2 100644 --- a/scripts/build-ios.sh +++ b/scripts/build-ios.sh @@ -58,8 +58,8 @@ done mv ./bindings/coveFFI.modulemap ./bindings/module.modulemap # Move the Swift file to the project -rm ./ios/Cove/Cove.swift || true -mv ./bindings/cove.swift ./ios/Cove/Cove.swift +rm ../ios/Cove/Cove.swift || true +mv ./bindings/cove.swift ../ios/Cove/Cove.swift # Recreate XCFramework rm -rf "ios/Cove.xcframework" || true