Skip to content

Commit

Permalink
v3.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Aug 15, 2024
1 parent 798d091 commit 547cd5e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelogs/3.0.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bug fixes and performance improvements
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mytonwallet",
"version": "3.0.7",
"version": "3.0.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
2 changes: 1 addition & 1 deletion public/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.7
3.0.8
11 changes: 8 additions & 3 deletions src/components/swap/SwapInitial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
CHANGELLY_TERMS_OF_USE,
DEFAULT_FEE,
DEFAULT_SWAP_SECOND_TOKEN_SLUG,
DIESEL_TOKENS,
TON_SYMBOL,
TONCOIN_SLUG,
} from '../../config';
Expand Down Expand Up @@ -153,6 +154,10 @@ function SwapInitial({

const isErrorExist = errorType !== undefined;
const isEnoughToncoin = toncoin.amount > totalToncoinAmount;
const isDieselSwap = swapType === SwapType.OnChain
&& !isEnoughToncoin
&& tokenIn?.slug
&& DIESEL_TOKENS.has(tokenIn.slug);

// eslint-disable-next-line max-len
const isCorrectAmountIn = Boolean(
Expand Down Expand Up @@ -308,7 +313,7 @@ function SwapInitial({
return;
}

if (!isEnoughToncoin && dieselStatus === 'not-authorized') {
if (isDieselSwap && dieselStatus === 'not-authorized') {
authorizeDiesel();
return;
}
Expand Down Expand Up @@ -470,13 +475,13 @@ function SwapInitial({

if (
swapType === SwapType.OnChain
&& !isEnoughToncoin
&& isDieselSwap
&& swapFee
&& tokenIn
&& tokenIn?.slug !== TONCOIN_SLUG
&& !isLoading
) {
// Gasless swap
// Diesel swap
feeBlock = (
<span className={styles.feeText}>{lang('$fee_value', {
fee: formatCurrency(swapFee, tokenIn.symbol),
Expand Down
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,7 @@ export const RE_LINK_TEMPLATE = /((ftp|https?):\/\/)?(?<host>(www\\.)?[-a-zA-Z0-
export const RE_TG_BOT_MENTION = /telegram[:\s-]*((@[a-z0-9_]+)|(https:\/\/)?(t\.me|telegram\.me|telegram\.dog)\/[a-z0-9_]+)/mig;

export const DIESEL_ADDRESS = process.env.DIESEL_ADDRESS || 'EQDUkQbpTVIgt7v66-JTFR-3-eXRFz_4V66F-Ufn6vOg0D5s';
export const DIESEL_TOKENS = new Set([
'ton-eqcxe6mutq', // USDT
'ton-eqavlwfdxg', // Notcoin
]);
2 changes: 1 addition & 1 deletion src/util/formatNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const formatInteger = withCache((
const dp = value.gte(1) || noFloor ? fractionDigits : DEFAULT_DECIMAL_PLACES;
let fixed = value.round(dp, noFloor ? Big.roundHalfUp : undefined).toString();

if (countSignificantDigits(fixed) < fractionDigits) {
if (value.lt(1) && countSignificantDigits(fixed) < fractionDigits) {
fixed = value.toString();
}

Expand Down

2 comments on commit 547cd5e

@rezababaeeeiii
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your connected address is UQD6Vlls_TTf4VbpjJMgTjNAH_1gadwAHa9ZlAik7ZXxT9UW.

@rezababaeeeiii
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your connected address is UQD6Vlls_TTf4VbpjJMgTjNAH_1gadwAHa9ZlAik7ZXxT9UW.

Please sign in to comment.