Skip to content

Commit

Permalink
v3.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Jan 13, 2025
1 parent 10049f1 commit 7bfb89b
Show file tree
Hide file tree
Showing 78 changed files with 725 additions and 402 deletions.
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ src/lib/noble-ed25519/index.js
src/lib/dexie/
src/lib/axios-retry/
src/lib/is-retry-allowed/
babel.config.js
jest.config.js
playwright.config.ts
postcss.config.js
Expand Down
19 changes: 19 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
presets: [
[
'@babel/typescript'
],
[
'@babel/preset-env'
],
[
'@babel/preset-react'
]
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-syntax-nullish-coalescing-operator',
'@babel/plugin-proposal-logical-assignment-operators'
]
};
1 change: 1 addition & 0 deletions changelogs/3.2.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bug fixes and performance improvements
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ module.exports = {
'\\.(jsx?|tsx?)$': 'babel-jest',
'\\.txt$': 'jest-raw-loader',
},
transformIgnorePatterns: [
'/node_modules/(?!(axios)/)',
],
};
10 changes: 6 additions & 4 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.6",
"version": "3.2.7",
"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 @@ -225,7 +225,7 @@
"qr-code-styling": "github:mytonwallet-org/qr-code-styling#8d56b409da29122a92da2767d049b45b1bc24db2",
"qrcode-generator": "1.4.4",
"stream-browserify": "3.0.0",
"tonapi-sdk-js": "2.0.3",
"tonapi-sdk-js": "2.0.7",
"tonweb-mnemonic": "1.0.1",
"tronweb": "6.0.0",
"tweetnacl": "1.0.3",
Expand Down
Binary file removed public/static-sites/_common/images/QR-code-1.5x.webp
Binary file not shown.
Binary file removed public/static-sites/_common/images/QR-code-1x.webp
Binary file not shown.
Binary file removed public/static-sites/_common/images/QR-code-2x.webp
Binary file not shown.
1 change: 1 addition & 0 deletions public/static-sites/_common/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 17 additions & 3 deletions public/static-sites/_common/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,23 @@ a:hover {
border-radius: 1.25rem;
}

.qr-code.without-margin {
margin: 0 !important;
margin-top: -16px !important;
.qr-code-canvas {
position: relative;

width: 12rem;
height: 12rem;

background: white;
border-radius: 1.25rem;
}

.qr-code-canvas canvas {
position: absolute;
top: 0.5rem;
left: 0.5rem;

width: calc(100% - 1rem);
height: calc(100% - 1rem);
}

.special-section {
Expand Down
32 changes: 24 additions & 8 deletions public/static-sites/connect/desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MyTonWallet Connect</title>
<link rel="stylesheet" href="/index.css">
<script type="text/javascript" src="https://unpkg.com/[email protected]/lib/qr-code-styling.js"></script>
</head>
<body>
<div class="container small-padding with-gap desktop">
Expand All @@ -15,11 +16,7 @@ <h1>Connect <span class="gradient-text">MyTonWallet</span></h1>
<p>
Scan QR to open the app <br /> on your mobile device:
</p>
<img class="qr-code without-margin" srcset="
./images/QR-code-1x.webp 1x,
./images/QR-code-1.5x.webp 1.5x,
./images/QR-code-2x.webp 2x
" src="./images/QR-code-2x.webp" />
<div class="qr-code-canvas"></div>
</info-block>
<info-block class="column">
<span class="subheader">On Desktop</span>
Expand Down Expand Up @@ -54,14 +51,33 @@ <h1>Connect <span class="gradient-text">MyTonWallet</span></h1>
const {
pathname,
search,
hash,
} = location;

const redirectTo = search;
const QR_SIZE = 600;

document.getElementById('btn-sign-in').href = `mytonwallet-tc://${redirectTo}`;
const redirectTo = hash.slice(1) || search;
const fullRedirectUrl = `mytonwallet-tc://${redirectTo}`;

document.getElementById('btn-sign-in').href = fullRedirectUrl;

const qrCode = new QRCodeStyling({
width: QR_SIZE,
height: QR_SIZE,
image: './images/logo.svg',
margin: 0,
type: 'canvas',
dotsOptions: { type: 'rounded' },
cornersSquareOptions: { type: 'extra-rounded' },
imageOptions: { imageSize: 0.4, margin: 8, crossOrigin: 'anonymous' },
qrOptions: { errorCorrectionLevel: 'M' },
data: fullRedirectUrl,
});

qrCode.append(document.querySelector(".qr-code-canvas"));

if (!search?.includes('no-redirect')) {
location.href = `mytonwallet-tc://${redirectTo}`;
location.href = fullRedirectUrl;
history.replaceState({}, '', `${pathname}${search}${search ? '&' : '?'}no-redirect`);
}
</script>
Expand Down
12 changes: 6 additions & 6 deletions public/static-sites/connect/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ <h1>Connect <span class="gradient-text">MyTonWallet</span></h1>
</div>
</div>
<script type="module">
import { IS_DESKTOP } from "./common.js";
import { IS_DESKTOP } from "/common.js";

function main() {
if (IS_DESKTOP) {
location.href = "/desktop";
return;
}

const {
pathname,
search,
} = location;

const redirectTo = search;

if (IS_DESKTOP) {
location.href = `/desktop#${redirectTo}`;
return;
}

document.getElementById('btn-sign-in').href = `mytonwallet-tc://${redirectTo}`;

if (!search?.includes('no-redirect')) {
Expand Down
2 changes: 1 addition & 1 deletion public/static-sites/get/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IS_DESKTOP, IS_MOBILE, platform } from "./common.js";
import { IS_DESKTOP, IS_MOBILE, platform } from "/common.js";


const REPO = 'mytonwalletorg/mytonwallet';
Expand Down
25 changes: 20 additions & 5 deletions public/static-sites/get/mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title>MyTonWallet App</title>
<script src="./index.js" type="module"></script>
<link rel="stylesheet" href="./index.css">
<script type="text/javascript" src="https://unpkg.com/[email protected]/lib/qr-code-styling.js"></script>
</head>

<body>
Expand All @@ -18,17 +19,31 @@ <h1 class="no-margin">MyTonWallet <span class="gradient-text">App</span></h1>
<br />
on your mobile device:
</div>
<img class="qr-code" srcset="
./images/QR-code-1x.webp 1x,
./images/QR-code-1.5x.webp 1.5x,
./images/QR-code-2x.webp 2x
" src="./images/QR-code-2x.webp" />
<div class="qr-code-canvas qr-code"></div>
<div class="footer">
<div class="version">&nbsp;</div>
<a href="javascript:redirectToFullList();">Other platforms</a>
· <a href="https://mytonwallet.io">mytonwallet.io</a>
</div>
</div>
<script>
const QR_SIZE = 600;

const qrCode = new QRCodeStyling({
width: QR_SIZE,
height: QR_SIZE,
image: './images/logo.svg',
margin: 0,
type: 'canvas',
dotsOptions: { type: 'rounded' },
cornersSquareOptions: { type: 'extra-rounded' },
imageOptions: { imageSize: 0.4, margin: 8, crossOrigin: 'anonymous' },
qrOptions: { errorCorrectionLevel: 'M' },
data: 'https://mytonwallet.io/get',
});

qrCode.append(document.querySelector(".qr-code-canvas"));
</script>
</body>

</html>
32 changes: 24 additions & 8 deletions public/static-sites/go/desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Open MyTonWallet</title>
<link rel="stylesheet" href="/index.css">
<script type="text/javascript" src="https://unpkg.com/[email protected]/lib/qr-code-styling.js"></script>
</head>
<body>
<div class="container desktop small-padding">
Expand All @@ -15,11 +16,7 @@ <h1>Open <span class="gradient-text">MyTonWallet</span></h1>
<p>
Scan QR to open the app <br /> on your mobile device:
</p>
<img class="qr-code without-margin" srcset="
./images/QR-code-1x.webp 1x,
./images/QR-code-1.5x.webp 1.5x,
./images/QR-code-2x.webp 2x
" src="./images/QR-code-2x.webp" />
<div class="qr-code-canvas"></div>
</info-block>
<info-block class="column">
<span class="subheader">On Desktop</span>
Expand Down Expand Up @@ -49,14 +46,33 @@ <h1>Open <span class="gradient-text">MyTonWallet</span></h1>
const {
pathname,
search,
hash,
} = location;

const redirectTo = `${pathname.slice(1)}${search}`;
const QR_SIZE = 600;

document.getElementById('btn-sign-in').href = `mtw://${redirectTo}`;
const redirectTo = hash.slice(1) || `${pathname.slice(1)}${search}`;
const fullRedirectUrl = `mtw://${redirectTo}`;

document.getElementById('btn-sign-in').href = fullRedirectUrl;

const qrCode = new QRCodeStyling({
width: QR_SIZE,
height: QR_SIZE,
image: './images/logo.svg',
margin: 0,
type: 'canvas',
dotsOptions: { type: 'rounded' },
cornersSquareOptions: { type: 'extra-rounded' },
imageOptions: { imageSize: 0.4, margin: 8, crossOrigin: 'anonymous' },
qrOptions: { errorCorrectionLevel: 'M' },
data: fullRedirectUrl,
});

qrCode.append(document.querySelector(".qr-code-canvas"));

if (!search?.includes('no-redirect')) {
location.href = `mtw://${redirectTo}`;
location.href = fullRedirectUrl;
history.replaceState({}, '', `${pathname}${search}${search ? '&' : '?'}no-redirect`);
}
</script>
Expand Down
18 changes: 9 additions & 9 deletions public/static-sites/go/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
<title>Open MyTonWallet</title>
<link rel="stylesheet" href="/index.css">
<script type="module">
import { IS_DESKTOP } from './common.js';
import { IS_DESKTOP } from '/common.js';

const {
pathname,
search,
} = location;

const redirectTo = `${pathname.slice(1)}${search}`;

function main() {
if (IS_DESKTOP) {
location.href = '/desktop';
location.href = `/desktop#${redirectTo}`;
return;
}

document.addEventListener('DOMContentLoaded', () => {
const {
pathname,
search,
} = location;

const redirectTo = `${pathname.slice(1)}${search}`;

document.getElementById('btn-sign-in').href = `mtw://${redirectTo}`;

if (!search?.includes('no-redirect')) {
Expand Down
2 changes: 1 addition & 1 deletion public/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.6
3.2.7
6 changes: 6 additions & 0 deletions src/api/chains/ton/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export const CLAIM_MINTLESS_AMOUNT = 20000000n; // 0.02 TON

export const NFT_TRANSFER_AMOUNT = 100000000n; // 0.1 TON
export const NFT_TRANSFER_FORWARD_AMOUNT = 1n; // 0.000000001 TON
/**
* When the NFT contract handles the payload we send, it simply adds its data to the payload. If the resulting payload
* size becomes greater than the cell capacity, the contract fails to send the NFT. To avoid that, we keep some free
* space in the payload cell we send. This constant is the size of the free space in bits.
*/
export const NFT_PAYLOAD_SAFE_MARGIN = 14 * 8;

export const TON_GAS = {
stakeNominators: ONE_TON,
Expand Down
1 change: 0 additions & 1 deletion src/api/chains/ton/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export {
export {
getAccountTokenBalances,
getTokenBalances,
getAddressTokenBalances,
fetchToken,
insertMintlessPayload,
} from './tokens';
Expand Down
Loading

0 comments on commit 7bfb89b

Please sign in to comment.