Compare commits

..

No commits in common. "2638ea94f45c89035c6c34aac05165ff42ba219f" and "a4d99f04fde6b9cb4fff6b5fdcd20feab9f6da68" have entirely different histories.

5 changed files with 7 additions and 23 deletions

View File

@ -1,10 +1,5 @@
# Changelog
## Manifest Version 1.2.8
- better support for estimate gas
- added support for deprecated .send method to support more websites
## Manifest Version 1.2.7
- improve compatibility with ionic 7

View File

@ -1,6 +1,6 @@
{
"name": "clear-wallet",
"version": "1.2.8",
"version": "1.2.7",
"private": true,
"scripts": {
"dev": "vite",

View File

@ -121,16 +121,7 @@ class MetaMaskAPI {
// Deprecated
send (arg1: unknown, arg2: unknown): unknown {
if (arg2 === undefined) {
if( typeof arg1 === 'string' ) {
return sendMessage({
method: arg1,
params: undefined
})
} else if (typeof arg1 === 'object') {
return sendMessage(arg1 as RequestArguments)
} else {
console.error('Clear Wallet: faulty request')
}
console.error('Clear Wallet: Sync calling is deprecated and not supported')
}else if( typeof arg1 === 'string' ) {
return sendMessage({
method: arg1,
@ -302,7 +293,7 @@ const listner = function(event: any) {
try {
if(event?.data?.data?.error){
promResolvers.get(event.data.resId)?.reject(event.data.data);
console.error(event?.data?.data)
// console.error(event?.data?.data)
}else {
promResolvers.get(event.data.resId)?.resolve(event.data.data);
}

View File

@ -3,8 +3,8 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
"version": "1.2.8",
"version_name": "1.2.8",
"version": "1.2.7",
"version_name": "1.2.7",
"icons": {
"16": "assets/extension-icon/wallet_16.png",
"32": "assets/extension-icon/wallet_32.png",

View File

@ -211,14 +211,12 @@ const mainListner = (message: RequestArguments, sender:any, sendResponse: (a: an
})
break
}
const gas = await estimateGas({
sendResponse(await estimateGas({
to: params?.to ?? '',
from: params?.from ?? '',
data: params?.data ?? '',
value: params?.value ?? '0x0'
})
const gasHex = gas?._hex ? gas?._hex : gas
sendResponse(gasHex)
}))
} catch(err) {
if(String(err).includes('UNPREDICTABLE_GAS_LIMIT')) {
chrome.notifications.create({