Skip to content

Commit

Permalink
v1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Jun 16, 2024
1 parent 96d47f9 commit 7fc1654
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions changelogs/1.20.5.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": "1.20.4",
"version": "1.20.5",
"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 @@
1.20.4
1.20.5
21 changes: 13 additions & 8 deletions src/components/explore/hooks/useDappBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ export function useDappBridge({
const bridgeObject = useMemo((): WebViewTonConnectBridge | undefined => {
if (!origin) return undefined;

const dappRequest = {
origin,
accountId: getGlobal().currentAccountId,
};

return {
deviceInfo: tonConnectGetDeviceInfo(),
protocolVersion: TONCONNECT_PROTOCOL_VERSION,
Expand All @@ -74,7 +69,7 @@ export function useDappBridge({

const response = await callApi(
'tonConnect_connect',
dappRequest,
buildDappRequest(origin),
request,
requestId,
);
Expand Down Expand Up @@ -113,7 +108,7 @@ export function useDappBridge({
try {
const response = await callApi(
'tonConnect_reconnect',
dappRequest,
buildDappRequest(origin),
requestId,
);
setRequestId(requestId + 1);
Expand All @@ -140,9 +135,10 @@ export function useDappBridge({

disconnect: async () => {
setRequestId(0);

await callApi(
'tonConnect_disconnect',
dappRequest,
buildDappRequest(origin),
{ id: requestId.toString(), method: 'disconnect', params: [] },
);
},
Expand All @@ -161,6 +157,8 @@ export function useDappBridge({
};
}

const dappRequest = buildDappRequest(origin);

try {
switch (request.method) {
case 'sendTransaction': {
Expand Down Expand Up @@ -284,3 +282,10 @@ function verifyConnectRequest(request: ConnectRequest) {
throw new Error('Wrong request data');
}
}

function buildDappRequest(origin: string) {
return {
origin,
accountId: getGlobal().currentAccountId,
};
}

0 comments on commit 7fc1654

Please sign in to comment.