Skip to content

Commit

Permalink
Merge pull request #1079 from tonwhales/release/v2.3.17
Browse files Browse the repository at this point in the history
Release/v2.3.17
  • Loading branch information
vzhovnitsky authored Sep 26, 2024
2 parents bba042d + 9348ee5 commit 3175394
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 20 deletions.
2 changes: 1 addition & 1 deletion VERSION_CODE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
210
211
2 changes: 1 addition & 1 deletion app/engine/hooks/jettons/useJetton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function useJetton(params: { owner: Address | string, master?: Address |
symbol,
description,
decimals: content.decimals ?? null,
icon: content.image?.preview256 ?? null,
icon: content.image?.preview256 || content.originalImage || null,
disabled: false,
assets: !!content.assets ? [content.assets[0], content.assets[1]] : null,
pool: content.pool,
Expand Down
13 changes: 7 additions & 6 deletions app/fragments/secure/SimpleTransferFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ export const SimpleTransferFragment = fragment(() => {
}, [validAmount, target, domain, commentString, stateInit, jettonState, params?.app, acc, ledgerAddress, known, jettonPayload]);

const walletVersion = useWalletVersion();
const isV5 = walletVersion === WalletVersions.v5R1;
const supportsGaslessTransfer = hasGaslessTransfer && isV5;

// Estimate fee
const config = useConfig();
Expand Down Expand Up @@ -456,7 +458,6 @@ export const SimpleTransferFragment = fragment(() => {
// Load contract
const pubKey = ledgerContext.addr?.publicKey ?? currentAcc.publicKey;
const contract = await contractFromPublicKey(pubKey, walletVersion, network.isTestnet);
const isV5 = walletVersion === WalletVersions.v5R1;

const transferParams = {
seqno: seqno,
Expand All @@ -474,8 +475,6 @@ export const SimpleTransferFragment = fragment(() => {
return;
}

const supportsGaslessTransfer = hasGaslessTransfer && isV5;

// Resolve fee
if (config && accountLite && !supportsGaslessTransfer) {
const externalMessage = external({
Expand All @@ -502,7 +501,7 @@ export const SimpleTransferFragment = fragment(() => {
return () => {
ended = true;
}
}, [order, accountLite, client, config, commentString, ledgerAddress, walletVersion, hasGaslessTransfer, jettonPayload?.customPayload, jettonPayload?.stateInit]);
}, [order, accountLite, client, config, commentString, ledgerAddress, walletVersion, supportsGaslessTransfer, jettonPayload?.customPayload, jettonPayload?.stateInit]);

const linkNavigator = useLinkNavigator(network.isTestnet);
const onQRCodeRead = useCallback((src: string) => {
Expand Down Expand Up @@ -701,7 +700,8 @@ export const SimpleTransferFragment = fragment(() => {
order: order as Order,
job: params && params.job ? params.job : null,
callback,
back: params && params.back ? params.back + 1 : undefined
back: params && params.back ? params.back + 1 : undefined,
useGasless: supportsGaslessTransfer
});
}, [
amount, target, domain, commentString,
Expand All @@ -712,7 +712,8 @@ export const SimpleTransferFragment = fragment(() => {
jettonState,
ledgerAddress,
isLedger,
balance
balance,
supportsGaslessTransfer
]);

const onFocus = useCallback((index: number) => {
Expand Down
41 changes: 34 additions & 7 deletions app/fragments/secure/TransferFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export type TransferFragmentProps = {
order: Order,
job: string | null,
callback?: ((ok: boolean, result: Cell | null) => void) | null,
back?: number
back?: number,
useGasless?: boolean
};

export type OrderMessage = {
Expand Down Expand Up @@ -176,7 +177,7 @@ export const TransferFragment = fragment(() => {
const job = useMemo(() => params.job, []);
const callback = useMemo(() => params.callback, []);

const [useGasless, setUseGasless] = useState(true);
const [useGasless, setUseGasless] = useState(params.useGasless ?? false);

const handleReturnStrategy = useCallback((returnStrategy: string) => {
if (returnStrategy === 'back') {
Expand Down Expand Up @@ -230,13 +231,36 @@ export const TransferFragment = fragment(() => {
// Fetch all required parameters
const [loadedProps, setLoadedProps] = useState<ConfirmLoadedProps | null>(null);

const onError = useCallback(({ message, title }: { message?: string, title: string }) => {
const onError = useCallback(({ message, title, gaslessEstimate }: { message?: string, title: string, gaslessEstimate?: boolean }) => {
if (finished.current) {
return;
}

finished.current = true;

if (gaslessEstimate) {
Alert.alert(title, message,
[{
text: t('common.back'),
onPress: () => {
if (params.back && params.back > 0) {
for (let i = 0; i < params.back; i++) {
navigation.goBack();
}
} else {
navigation.goBack();
}
}
},
{
text: t('transfer.error.gaslessCooldownPayTon'),
onPress: () => onSetUseGasless?.(false)
}]
);

return;
}

Alert.alert(title, message,
[{
text: t('common.back'),
Expand Down Expand Up @@ -436,7 +460,7 @@ export const TransferFragment = fragment(() => {
) {
throw Error('Error resolving wallet address');
}
} catch (e) {
} catch {
onError({ title: t('transfer.error.invalidDomain') });
return;
}
Expand Down Expand Up @@ -575,18 +599,21 @@ export const TransferFragment = fragment(() => {
if (gaslessEstimate.error === 'not-enough') {
onError({
title: t('transfer.error.gaslessNotEnoughFunds'),
message: t('transfer.error.gaslessNotEnoughFundsMessage')
message: t('transfer.error.gaslessNotEnoughFundsMessage'),
gaslessEstimate: true
});
} else if (gaslessEstimate.error === 'try-later') {
onError({
title: t('transfer.error.gaslessTryLater'),
message: t('transfer.error.gaslessTryLaterMessage')
message: t('transfer.error.gaslessTryLaterMessage'),
gaslessEstimate: true
});
} else {
warn(`Gasless estimate failed: ${gaslessEstimate.error}`);
onError({
title: t('transfer.error.gaslessFailed'),
message: t('transfer.error.gaslessFailedEstimate')
message: t('transfer.error.gaslessFailedEstimate'),
gaslessEstimate: true
});
}
return;
Expand Down
8 changes: 6 additions & 2 deletions assets/jettons/knownJettons.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
"tickers": [
"TON",
"USDT",
"USD₮"
"USD₮",
"HMSTR",
"NOT"
],
"specialJetton": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"masters": {
"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs": {},
"EQD0laik0FgHV8aNfRhebi8GDG2rpDyKGXem0MBfya_Ew1-8": {}
"EQD0laik0FgHV8aNfRhebi8GDG2rpDyKGXem0MBfya_Ew1-8": {},
"EQAJ8uWd7EBqsmpSWaRdf_I-8R8-XHwh3gsNKhy-UrdrPcUo": {},
"EQAvlWFDxGF2lXm67y4yzC17wYKD9A0guwPkMs1gOsM__NOT": {}
}
}
}
4 changes: 2 additions & 2 deletions ios/wallet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>2.3.16</string>
<string>2.3.17</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -41,7 +41,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>210</string>
<string>211</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wallet",
"version": "2.3.16",
"version": "2.3.17",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
Expand Down

0 comments on commit 3175394

Please sign in to comment.