@instadapp/avocado-base 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +64 -65
- package/abi/avoFactoryProxy.json +1 -1
- package/abi/forwarder.json +1 -1
- package/abi/multisigAgnosticForwarder.json +936 -937
- package/abi/multisigForwarder.json +680 -680
- package/app.vue +5 -5
- package/components/ActionLogo.vue +15 -15
- package/components/AuthorityAvatar.vue +8 -6
- package/components/ChainLogo.vue +19 -15
- package/components/CopyClipboard.vue +1 -1
- package/components/metadata/Bridge.vue +22 -23
- package/components/metadata/GasTopup.vue +14 -15
- package/components/metadata/Permit2.vue +12 -13
- package/eslint.config.mjs +14 -0
- package/nuxt.config.ts +4 -0
- package/package.json +5 -5
- package/server/utils/index.ts +4 -4
- package/utils/avocado.ts +17 -17
- package/utils/bignumber.ts +47 -36
- package/utils/formatter.ts +54 -60
- package/utils/helper.ts +33 -30
- package/utils/metadata.ts +366 -403
- package/utils/network.ts +2 -2
- package/utils/services.ts +11 -13
package/utils/network.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ethers } from 'ethers'
|
|
2
|
+
import { defineChain } from 'viem'
|
|
2
3
|
import {
|
|
3
4
|
arbitrum,
|
|
4
5
|
aurora,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
polygonZkEvm,
|
|
19
20
|
scroll,
|
|
20
21
|
} from 'viem/chains'
|
|
21
|
-
import { defineChain } from 'viem'
|
|
22
22
|
import {
|
|
23
23
|
AVO_PROD_CHAIN_ID,
|
|
24
24
|
AVO_PROD_CHAIN_NAME,
|
|
@@ -614,7 +614,7 @@ export function getRpcURLByChainId(chainId: ChainId | number | string) {
|
|
|
614
614
|
const network = getNetworkByChainId(chainId)
|
|
615
615
|
return network.params.rpcUrls[0]
|
|
616
616
|
}
|
|
617
|
-
catch
|
|
617
|
+
catch {
|
|
618
618
|
return ''
|
|
619
619
|
}
|
|
620
620
|
}
|
package/utils/services.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
export
|
|
2
|
-
address
|
|
3
|
-
|
|
4
|
-
tokens?: ITokenPrice[]
|
|
5
|
-
) => {
|
|
6
|
-
if (!address || !chainId) return null;
|
|
1
|
+
export async function fetchTokenByAddress(address: string, chainId: string | number, tokens?: ITokenPrice[]) {
|
|
2
|
+
if (!address || !chainId)
|
|
3
|
+
return null
|
|
7
4
|
|
|
8
5
|
if (tokens?.length) {
|
|
9
|
-
const token = tokens.find(
|
|
10
|
-
if (token)
|
|
6
|
+
const token = tokens.find(token => token.address?.toLocaleLowerCase() === address?.toLocaleLowerCase() && token.chain_id == chainId)
|
|
7
|
+
if (token)
|
|
8
|
+
return token
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
const [token] = (await $fetch(`${blockQueryURL}/${chainId}/tokens`, {
|
|
14
12
|
params: {
|
|
15
|
-
sparkline: false,
|
|
16
|
-
|
|
13
|
+
'sparkline': false,
|
|
14
|
+
'addresses[]': [address],
|
|
17
15
|
},
|
|
18
|
-
})) as ITokenPrice[]
|
|
16
|
+
})) as ITokenPrice[]
|
|
19
17
|
|
|
20
|
-
return token
|
|
21
|
-
}
|
|
18
|
+
return token
|
|
19
|
+
}
|