Skip to content

Commit

Permalink
v3.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Jan 17, 2025
1 parent 7bfb89b commit a8ab6b9
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 34 deletions.
1 change: 1 addition & 0 deletions changelogs/3.2.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bug fixes and performance improvements
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mytonwallet",
"version": "3.2.7",
"version": "3.2.8",
"description": "The most feature-rich web wallet and browser extension for TON – with support of multi-accounts, tokens (jettons), NFT, TON DNS, TON Sites, TON Proxy, and TON Magic.",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -198,7 +198,7 @@
"@capacitor/keyboard": "6.0.3",
"@capacitor/push-notifications": "6.0.2",
"@capacitor/share": "6.0.2",
"@capgo/capacitor-native-biometric": "github:mytonwallet-org/capacitor-native-biometric#956d06d1ab78a839f1293921d0bff449edf4ef4d",
"@capgo/capacitor-native-biometric": "github:mytonwallet-org/capacitor-native-biometric#15ac58cbf555bd47278d6488cb3c3a069c0ea821",
"@capgo/native-audio": "6.4.21",
"@ledgerhq/hw-transport-webhid": "6.29.4",
"@ledgerhq/hw-transport-webusb": "6.29.4",
Expand Down
12 changes: 12 additions & 0 deletions public/static-sites/get/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,15 @@ function setupRateButtons() {
});
}
}

const actions = {
redirectToStore,
downloadAndroidDirect,
redirectToFullList,
downloadDefault,
download,
};

for (const action of Object.keys(actions)) {
window[action] = actions[action];
}
2 changes: 1 addition & 1 deletion public/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.7
3.2.8
4 changes: 2 additions & 2 deletions src/api/chains/ton/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export type ApiFetchEstimateDieselResult = {
status: DieselStatus;
/**
* The amount of the diesel itself. It will be sent together with the actual transfer. None of this will return back
* as the excess. Charged on top of the transferred amount. If the diesel is available, guaranteed to be > 0.
* The token and stars amounts can't be non-zero simultaneously.
* as the excess. Charged on top of the transferred amount. The token and stars amounts can't be non-zero
* simultaneously. Warning: the values can be zeros simultaneously, e.g. when the status is 'pending-previous'.
*/
amount: {
/** Measured in the transferred token */
Expand Down
8 changes: 4 additions & 4 deletions src/components/swap/SwapInitial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ function SwapInitial({
}

if (swapType === SwapType.OnChain) {
if (ourFeePercent) {
value = bigintDivideToNumber(value, 1 + (ourFeePercent / 100));
}

if (dieselFeeBigint) {
value -= dieselFeeBigint;
}

if (ourFeePercent) {
value = bigintDivideToNumber(value, 1 + (ourFeePercent / 100));
}
}

return bigintMax(value, 0n);
Expand Down
6 changes: 0 additions & 6 deletions src/giveaways/components/App.module.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
@import '../../styles/mixins';

.app {
display: flex;
flex-direction: column;
align-items: center;

max-width: 40rem;
height: 100%;
margin: 0 auto;
padding: 5rem 1rem 1rem;

font-size: 1.0625rem;
Expand Down
8 changes: 8 additions & 0 deletions src/giveaways/components/CommonPage.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.container {
display: flex;
flex-direction: column;
align-items: center;

max-width: 40rem;
margin: 0 auto;
}
6 changes: 5 additions & 1 deletion src/giveaways/components/CommonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import React, { memo } from '../../lib/teact/teact';

import Footer from './Footer';

import styles from './CommonPage.module.scss';

interface OwnProps {
children: React.ReactNode;
onConnectClick?: (args?: any) => any;
Expand All @@ -15,7 +17,9 @@ function CommonPage({
}: OwnProps) {
return (
<>
{children}
<div className={styles.container}>
{children}
</div>
<Footer
onConnectClick={onConnectClick}
wallet={wallet}
Expand Down
15 changes: 9 additions & 6 deletions src/giveaways/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { prettifyAddress } from '../utils/tonConnect';

import Button from '../../components/ui/Button';

import pageStyles from './CommonPage.module.scss';
import styles from './Footer.module.scss';

interface OwnProps {
Expand All @@ -28,12 +29,14 @@ function Footer({ onConnectClick, wallet, isGiveawayFinished }: OwnProps) {
</div>
)
: !isGiveawayFinished && (
<Button
isSimple
className={styles.button}
onClick={onConnectClick!}
>Connect MyTonWallet
</Button>
<div className={pageStyles.container}>
<Button
isSimple
className={styles.button}
onClick={onConnectClick!}
>Connect MyTonWallet
</Button>
</div>
)}
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions src/giveaways/pages/GiveawayInfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function GiveawayInfoPage({
function renderAwaitingPageContent() {
return (
<>
<ImageSection status={ImageSectionStatus.AwaitingResults} />
<ImageSection key={ImageSectionStatus.AwaitingResults} status={ImageSectionStatus.AwaitingResults} />
<div className={titleStyles.title}>You are all set!</div>
<div className={styles.giveawayInfoText}>Please wait for the results. Good luck!</div>
<GiveawayInfo giveaway={giveaway} />
Expand All @@ -45,7 +45,7 @@ function GiveawayInfoPage({

return (
<>
<ImageSection status={ImageSectionStatus.Paid} />
<ImageSection key={ImageSectionStatus.Paid} status={ImageSectionStatus.Paid} />
<div className={titleStyles.title}>Congratulations!</div>
<div className={styles.giveawayInfoText}>
<div>Your Reward</div>
Expand Down Expand Up @@ -78,7 +78,7 @@ function GiveawayInfoPage({

return (
<>
<ImageSection status={ImageSectionStatus.Lost} />
<ImageSection key={ImageSectionStatus.Lost} status={ImageSectionStatus.Lost} />
<div className={titleStyles.title}>Giveaway Finished</div>
<div className={styles.giveawayInfoText}>Unfortunately, you did not receive a<br />reward in it.</div>
</>
Expand Down
1 change: 1 addition & 0 deletions src/global/actions/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ addActionHandler('enableNativeBiometrics', async (global, actions, { password })
const isVerified = await NativeBiometric.verifyIdentity({
title: APP_NAME,
subtitle: '',
maxAttempts: 1,
})
.then(() => true)
.catch(() => false);
Expand Down
1 change: 1 addition & 0 deletions src/util/authApi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async function getPassword(config: AuthConfig) {
title: APP_NAME,
subtitle: '',
isWeakAuthenticatorAllowed: true,
maxAttempts: 1,
})
.then(() => true)
.catch(() => false);
Expand Down
8 changes: 4 additions & 4 deletions src/util/fee/transferFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,32 @@ function explainGaslessTransferFee({ diesel }: ApiFeeWithDiesel) {
// Cover as much displayed real fee as possible with diesel, because in the excess it will return as the native token.
const dieselRealFee = bigintMin(dieselAmount, realFeeInDiesel);
// Cover the remaining real fee with the native token.
const nativeRealFee = convertFee(realFeeInDiesel - dieselRealFee, dieselAmount, diesel.nativeAmount);
const nativeRealFee = bigintMax(0n, diesel.realFee - diesel.nativeAmount);

return {
isGasless: true,
canTransferFullBalance: false,
fullFee: {
precision: 'lessThan',
terms: {
native: diesel.remainingFee,
token: diesel.amount.token,
stars: diesel.amount.stars,
native: diesel.remainingFee,
},
},
realFee: {
precision: 'approximate',
terms: {
native: nativeRealFee,
[dieselKey]: dieselRealFee,
native: nativeRealFee,
},
},
} satisfies ExplainedTransferFee;
}

/**
* `exampleFromAmount` and `exampleToAmount` define the exchange rate used to convert `amount`.
* `exampleFromAmount` is defined in the same currency as `amount`.
* `exampleFromAmount` is defined in the same currency as `amount`. Mustn't be 0.
* `exampleToAmount` is defined in the currency you want to get.
*/
function convertFee(
Expand Down

0 comments on commit a8ab6b9

Please sign in to comment.