chore: changes for 1.2.8

This commit is contained in:
Andrei O 2023-04-27 05:32:26 +03:00
parent a4d99f04fd
commit 42a6434713
No known key found for this signature in database
GPG Key ID: B961E5B68389457E
4 changed files with 22 additions and 6 deletions

View File

@ -1,5 +1,10 @@
# 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

@ -121,7 +121,16 @@ class MetaMaskAPI {
// Deprecated
send (arg1: unknown, arg2: unknown): unknown {
if (arg2 === undefined) {
console.error('Clear Wallet: Sync calling is deprecated and not supported')
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')
}
}else if( typeof arg1 === 'string' ) {
return sendMessage({
method: arg1,
@ -293,7 +302,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.7",
"version_name": "1.2.7",
"version": "1.2.8",
"version_name": "1.2.8",
"icons": {
"16": "assets/extension-icon/wallet_16.png",
"32": "assets/extension-icon/wallet_32.png",

View File

@ -211,12 +211,14 @@ const mainListner = (message: RequestArguments, sender:any, sendResponse: (a: an
})
break
}
sendResponse(await estimateGas({
const gas = 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({