mirror of
https://github.com/andrei0x309/clear-wallet.git
synced 2024-12-19 00:00:45 +00:00
chore: changes for 1.2.8
This commit is contained in:
parent
a4d99f04fd
commit
42a6434713
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user