Skip to content

Commit

Permalink
v3.0.31
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Oct 17, 2024
1 parent a272749 commit 9e2ec5a
Show file tree
Hide file tree
Showing 27 changed files with 255 additions and 134 deletions.
10 changes: 5 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
}
],
"react/jsx-key": [2, { "checkFragmentShorthand": false }],
"react/jsx-key": [2, { "checkFragmentShorthand": true}],
"arrow-body-style": "off",
"no-else-return": "off",
"no-plusplus": "off",
Expand Down Expand Up @@ -95,15 +95,15 @@
"import/named": "off",
"import/no-webpack-loader-syntax": "off",
"import/extensions": "off",
"react/prop-types": "off",
"react/jsx-one-expression-per-line": "off",
"react/button-has-type": "off",
"react/require-default-props": "off",
"react/jsx-one-expression-per-line": "off",
"react/function-component-definition": "off",
"react/no-is-mounted": "off",
"react/prop-types": "off",
"react/require-default-props": "off",
// Teact feature
"react/style-prop-object": "off",
"react/no-unknown-property": "off",
"react/no-is-mounted": "off",
"react/jsx-no-bind": [
"error",
{
Expand Down
1 change: 1 addition & 0 deletions changelogs/3.0.31.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.30",
"version": "3.0.31",
"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.30
3.0.31
18 changes: 14 additions & 4 deletions src/api/chains/ton/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,26 @@ export const KnownContracts: Record<ContractName, ContractInfo> = {
hash: '14ce618a0e9a94adc99fa6e975219ddd675425b30dfa9728f98714c8dc55f9da',
isSwapAllowed: true,
},
stonRouterV2: {
name: 'stonRouterV2',
stonRouterV2_1: {
name: 'stonRouterV2_1',
hash: 'd61cb7fb7bee0cc414286a482fccdec53c3f8717e4aae4fc362d98ab6254e6cd',
isSwapAllowed: true,
},
stonPoolV2: {
name: 'stonPoolV2',
stonPoolV2_1: {
name: 'stonPoolV2_1',
hash: '16cc513c380e329f45d54f294787e2030e289799eca138961c1cd7e26e882c7c',
isSwapAllowed: true,
},
stonRouterV2_2: {
name: 'stonRouterV2_2',
hash: '094b5084111addda1b6fac7007c8a8f85ff4ccc63475815ab3dfa3b5b4c6b102',
isSwapAllowed: true,
},
stonPoolV2_2: {
name: 'stonPoolV2_2',
hash: '11eaf6db706e63adf9327897aaa845c77a631856abfc14375837f19b617cacb4',
isSwapAllowed: true,
},
stonPtonWalletV2: {
name: 'stonPtonWalletV2',
hash: '2761042202032258de9eb1b672e1ec2e4f13b2af00700195801ada33f7ced1b6',
Expand Down
3 changes: 2 additions & 1 deletion src/api/chains/ton/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export type ContractName = ApiTonWalletVersion
| 'v4R1' | 'highloadV2' | 'multisig' | 'multisigV2' | 'multisigNew'
| 'nominatorPool' | 'vesting'
| 'dedustPool' | 'dedustVaultNative' | 'dedustVaultJetton'
| 'stonPtonWallet' | 'stonRouter' | 'stonRouterV2' | 'stonPoolV2' | 'stonPtonWalletV2'
| 'stonPtonWallet' | 'stonRouter' | 'stonRouterV2_1' | 'stonPoolV2_1'
| 'stonRouterV2_2' | 'stonPoolV2_2' | 'stonPtonWalletV2'
| 'megatonWtonMaster' | 'megatonRouter';

export type ContractInfo = {
Expand Down
13 changes: 10 additions & 3 deletions src/api/chains/tron/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import { getWalletBalance } from './wallet';
import type { ApiSubmitTransferTronResult } from './types';
import { hexToString } from '../../../util/stringFormat';
import { ONE_TRX } from './constants';
import { getChainConfig } from '../../../util/chain';

const SIGNATURE_SIZE = 65;
const FEE_LIMIT_TRX = 35_000_000n; // 35 TRX

const chainConfig = getChainConfig('tron');

export async function checkTransactionDraft(
options: CheckTransactionDraftOptions,
Expand Down Expand Up @@ -50,7 +52,12 @@ export async function checkTransactionDraft(

if (tokenAddress) {
const buildResult = await buildTrc20Transaction(tronWeb, {
toAddress, tokenAddress, amount, energyUnitFee, feeLimitTrx: FEE_LIMIT_TRX, fromAddress: address,
toAddress,
tokenAddress,
amount,
energyUnitFee,
feeLimitTrx: chainConfig.gas.maxTransferToken,
fromAddress: address,
});

transaction = buildResult.transaction;
Expand Down Expand Up @@ -109,7 +116,7 @@ export async function submitTransfer(options: ApiSubmitTransferOptions): Promise
const privateKey = tronWeb.fromMnemonic(mnemonic!.join(' ')).privateKey.slice(2);

if (tokenAddress) {
const feeLimitTrx = FEE_LIMIT_TRX;
const feeLimitTrx = chainConfig.gas.maxTransferToken;
const { energyUnitFee } = await getChainParameters(network);

const { transaction, energyFee } = await buildTrc20Transaction(tronWeb, {
Expand Down
17 changes: 17 additions & 0 deletions src/api/methods/other.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import nacl from 'tweetnacl';

import type { Theme } from '../../global/types';
import type { AccountCache } from '../common/cache';
import type { ApiChain, ApiNetwork } from '../types';

import { logDebugError } from '../../util/logs';
import { setIsAppFocused } from '../../util/pauseOrFocus';
import chains from '../chains';
import { fetchStoredAccounts, fetchStoredTonWallet, updateStoredAccount } from '../common/accounts';
import { callBackendGet } from '../common/backend';
import { updateAccountCache } from '../common/cache';
import { handleServerError } from '../errors';
import { storage } from '../storages';

const SIGN_MESSAGE = Buffer.from('MyTonWallet_AuthToken_n6i0k4w8pb');
Expand Down Expand Up @@ -65,3 +69,16 @@ export function updateAccountMemoryCache(accountId: string, address: string, par
}

export { setIsAppFocused };

export async function getMoonpayOnrampUrl(address: string, theme: Theme) {
try {
return await callBackendGet<{ url: string }>('/onramp-url', {
address,
theme,
});
} catch (err) {
logDebugError('getMoonpayOnrampUrl', err);

return handleServerError(err);
}
}
30 changes: 30 additions & 0 deletions src/components/dapps/Dapp.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,18 @@
&:first-child {
margin-left: 0.75rem;
}

@media (hover: hover) {
&:hover,
&:focus-visible {
.feedItemLogoImg {
transform: scale(1.1);
}
.feedItemAppNameMini, .feedItemAppNameTile {
color: var(--color-blue);
}
}
}
}

.feedItemAppNameMini {
Expand Down Expand Up @@ -840,6 +852,24 @@
border-radius: 0.75rem;
}

.feedItemLogoMini, .feedItemLogoTile {
overflow: hidden;
}

.feedItemLogoImg {
transform-origin: center;

width: 100%;
height: 100%;

object-fit: cover;

transition: transform 300ms;
:global(html.animation-level-0) & {
transition: none !important;
}
}

.feedSettingsIconContainer {
display: flex;
flex-direction: column;
Expand Down
3 changes: 2 additions & 1 deletion src/components/dapps/DappFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { SettingsState } from '../../global/types';

import { selectCurrentAccountState } from '../../global/selectors';
import buildClassName from '../../util/buildClassName';
import { MEMO_EMPTY_ARRAY } from '../../util/memo';

import useHorizontalScroll from '../../hooks/useHorizontalScroll';
import useLang from '../../hooks/useLang';
Expand Down Expand Up @@ -106,7 +107,7 @@ function DappFeed({ dapps: dappsFromState, dappLastOpenedDatesByOrigin = {} }: S
}

export default memo(withGlobal((global): StateProps => {
const { dapps } = global.settings;
const { dapps = MEMO_EMPTY_ARRAY } = selectCurrentAccountState(global) || {};
const { dappLastOpenedDatesByOrigin } = selectCurrentAccountState(global) || {};
return { dapps, dappLastOpenedDatesByOrigin };
})(DappFeed));
7 changes: 6 additions & 1 deletion src/components/dapps/DappFeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ function DappFeedItem({

return (
<div className={iconClassName}>
<Image url={iconUrl} className={iconClassName} imageClassName={iconClassName} alt={lang('Icon')} />
<Image
url={iconUrl}
className={iconClassName}
imageClassName={styles.feedItemLogoImg}
alt={lang('Icon')}
/>
</div>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/explore/hooks/useDappBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ export function useDappBridge({

send: async <T extends RpcMethod>(request: AppRequest<T>) => {
setRequestId(requestId + 1);
const isConnected = getGlobal().settings.dapps?.some((dapp) => dapp.origin === origin);
const global = getGlobal();
const isConnected = global.byAccountId[global.currentAccountId!].dapps?.some((dapp) => dapp.origin === origin);

if (!isConnected) {
return {
Expand Down
16 changes: 4 additions & 12 deletions src/components/main/modals/OnRampWidgetModal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
.modalDialog {
overflow: hidden;

height: 28rem;

@supports (height: var(--safe-area-bottom)) {
height: calc(28rem + var(--safe-area-bottom));
}

:global(.is-native-bottom-sheet) & {
height: calc(28rem + var(--safe-area-bottom, 0rem)) !important;
}
}

.modalDialogExtraHeight {
height: 38.5rem;

@supports (height: var(--safe-area-bottom)) {
Expand All @@ -40,6 +28,10 @@
height: 100%;
}

.iframe {
border: none !important;
}

.loaderContainer {
position: absolute;

Expand Down
Loading

0 comments on commit 9e2ec5a

Please sign in to comment.