From 3f31f668b9df7da16ed32741ab6ddcd522868c43 Mon Sep 17 00:00:00 2001 From: vzhovnitsky Date: Fri, 14 Jun 2024 15:25:37 +0300 Subject: [PATCH 1/2] fix: imports for jettonWalletAddressQueryFn & pending tx preview --- .../wallet/PendingTxPreviewFragment.tsx | 74 +------------------ app/useLinkNavigator.ts | 5 +- 2 files changed, 3 insertions(+), 76 deletions(-) diff --git a/app/fragments/wallet/PendingTxPreviewFragment.tsx b/app/fragments/wallet/PendingTxPreviewFragment.tsx index 57dcb2b38..3156c4f8d 100644 --- a/app/fragments/wallet/PendingTxPreviewFragment.tsx +++ b/app/fragments/wallet/PendingTxPreviewFragment.tsx @@ -32,79 +32,7 @@ import { PendingTransaction } from "../../engine/state/pending"; import { parseBody } from "../../engine/transactions/parseWalletTransaction"; import { resolveOperation } from "../../engine/transactions/resolveOperation"; import { RoundButton } from "../../components/RoundButton"; -import { SimpleTransferParams } from "../secure/SimpleTransferFragment"; -import { TransferFragmentProps } from "../secure/TransferFragment"; -import { fromBnWithDecimals } from "../../utils/withDecimals"; - -type PendingTxParams = (SimpleTransferParams & { type: 'simple' }) | (TransferFragmentProps & { type: 'transfer' }); - -function pendingTxToSimpleTransferParams(tx: PendingTransaction, testOnly: boolean): PendingTxParams | null { - if (!tx.address) { - return null; - } - - // Skip batch transactions - if (tx.body?.type === 'batch') { - return null; - } - - if (tx.body?.type === 'token') { - const amount = fromBnWithDecimals(tx.body.amount, tx.body.jetton.decimals ?? 9); - - return { - type: 'simple', - target: tx.body.target.toString({ testOnly: true, bounceable: tx.body.bounceable }), - comment: tx.body.comment, - amount: toNano(amount), - stateInit: null, - job: null, - jetton: tx.body.jetton.wallet, - callback: null - }; - } - - if (tx.body?.type === 'payload') { - return { - type: 'transfer', - text: null, - job: null, - order: { - type: 'order', - messages: [{ - target: tx.address?.toString({ testOnly, bounceable: tx.bounceable }) || '', - amount: -tx.amount, - amountAll: false, - stateInit: tx.body.stateInit || null, - payload: tx.body.cell - }] - } - }; - } - - if (tx.body?.type === 'comment') { - return { - type: 'simple', - target: tx.address?.toString({ testOnly, bounceable: tx.bounceable }) || '', - comment: tx.body.comment, - amount: -tx.amount, - stateInit: null, - job: null, - jetton: null, - callback: null - }; - } - - return { - type: 'simple', - target: tx.address.toString({ testOnly, bounceable: tx.bounceable }), - comment: null, - amount: -tx.amount, - stateInit: null, - job: null, - jetton: null, - callback: null - }; -} +import { pendingTxToTransferParams } from "../../utils/toTransferParams"; const PendingTxPreview = () => { const theme = useTheme(); diff --git a/app/useLinkNavigator.ts b/app/useLinkNavigator.ts index ad8128e19..edce65bc5 100644 --- a/app/useLinkNavigator.ts +++ b/app/useLinkNavigator.ts @@ -4,12 +4,11 @@ import { ResolvedUrl } from './utils/resolveUrl'; import { Queries } from './engine/queries'; import { useClient4 } from './engine/hooks'; import { useSelectedAccount } from './engine/hooks'; -import { jettonWalletAddressQueryFn } from './engine/hooks/jettons/useJettonWalletAddress'; import { useQueryClient } from '@tanstack/react-query'; import { Address } from '@ton/core'; import { ToastDuration, useToaster } from './components/toast/ToastProvider'; import { useCallback } from 'react'; -import { jettonWalletQueryFn } from './engine/hooks/jettons/usePrefetchHints'; +import { jettonWalletAddressQueryFn, jettonWalletQueryFn } from './engine/hooks/jettons/usePrefetchHints'; import { useGlobalLoader } from './components/useGlobalLoader'; import { StoredJettonWallet } from './engine/metadata/StoredMetadata'; @@ -67,7 +66,7 @@ export function useLinkNavigator( try { jettonWalletAddress = await queryClient.fetchQuery({ queryKey: Queries.Jettons().Address(selected!.addressString).Wallet(resolved.jettonMaster.toString({ testOnly: isTestnet })), - queryFn: jettonWalletAddressQueryFn(client, resolved.jettonMaster.toString({ testOnly: isTestnet }), selected!.addressString, isTestnet) + queryFn: jettonWalletAddressQueryFn(resolved.jettonMaster.toString({ testOnly: isTestnet }), selected!.addressString, isTestnet) }); } catch { console.warn('Failed to fetch jetton wallet address', selected!.addressString, resolved.jettonMaster.toString({ testOnly: isTestnet })); From 6bc5a1a85d1d4d7046edf3ce6c171964dabcfa75 Mon Sep 17 00:00:00 2001 From: vzhovnitsky Date: Fri, 14 Jun 2024 15:28:48 +0300 Subject: [PATCH 2/2] v2.3.4 --- VERSION_CODE | 2 +- ios/wallet/Info.plist | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION_CODE b/VERSION_CODE index fb3518156..8e24a69a0 100644 --- a/VERSION_CODE +++ b/VERSION_CODE @@ -1 +1 @@ -197 \ No newline at end of file +198 \ No newline at end of file diff --git a/ios/wallet/Info.plist b/ios/wallet/Info.plist index d88e224f9..3d02c5614 100644 --- a/ios/wallet/Info.plist +++ b/ios/wallet/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 2.3.3 + 2.3.4 CFBundleSignature ???? CFBundleURLTypes @@ -41,7 +41,7 @@ CFBundleVersion - 197 + 198 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/package.json b/package.json index 5043b64ee..8550953f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wallet", - "version": "2.3.3", + "version": "2.3.4", "scripts": { "start": "expo start --dev-client", "android": "expo run:android",