@instadapp/avocado-base 0.0.0-dev.d8050bd → 0.0.0-dev.dcb4af3

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.
Files changed (39) hide show
  1. package/.github/workflows/npm-publish-dev.yml +2 -5
  2. package/.vscode/settings.json +67 -0
  3. package/abi/avoFactoryProxy.json +1 -1
  4. package/abi/forwarder.json +1 -1
  5. package/abi/multisigAgnosticForwarder.json +937 -0
  6. package/abi/multisigForwarder.json +680 -680
  7. package/app.vue +5 -5
  8. package/assets/images/icons/check.svg +3 -0
  9. package/assets/images/icons/copy.svg +9 -2
  10. package/assets/images/icons/stars.svg +4 -0
  11. package/components/ActionLogo.vue +33 -31
  12. package/components/ActionMetadata.vue +30 -20
  13. package/components/Address.vue +74 -0
  14. package/components/AuthorityAvatar.vue +4 -3
  15. package/components/ChainLogo.vue +22 -25
  16. package/components/CopyClipboard.vue +16 -38
  17. package/components/metadata/Bridge.vue +22 -23
  18. package/components/metadata/CrossTransfer.vue +29 -32
  19. package/components/metadata/GasTopup.vue +14 -15
  20. package/components/metadata/Permit2.vue +12 -13
  21. package/components/metadata/Signers.vue +11 -55
  22. package/components/metadata/Swap.vue +45 -53
  23. package/components/metadata/Transfer.vue +26 -27
  24. package/contracts/MultisigAgnosticForwarder.ts +1423 -0
  25. package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
  26. package/contracts/factories/index.ts +1 -0
  27. package/contracts/index.ts +2 -0
  28. package/eslint.config.mjs +34 -0
  29. package/nuxt.config.ts +21 -12
  30. package/package.json +14 -14
  31. package/server/utils/index.ts +4 -4
  32. package/utils/avocado.ts +17 -17
  33. package/utils/bignumber.ts +47 -36
  34. package/utils/formatter.ts +55 -61
  35. package/utils/helper.ts +33 -30
  36. package/utils/metadata.ts +408 -349
  37. package/utils/network.ts +508 -263
  38. package/utils/services.ts +11 -13
  39. package/utils/utils.d.ts +117 -103
@@ -6,4 +6,5 @@ export { BalanceResolver__factory } from "./BalanceResolver__factory";
6
6
  export { Erc20__factory } from "./Erc20__factory";
7
7
  export { Forwarder__factory } from "./Forwarder__factory";
8
8
  export { GaslessWallet__factory } from "./GaslessWallet__factory";
9
+ export { MultisigAgnosticForwarder__factory } from "./MultisigAgnosticForwarder__factory";
9
10
  export { MultisigForwarder__factory } from "./MultisigForwarder__factory";
@@ -6,6 +6,7 @@ export type { BalanceResolver } from "./BalanceResolver";
6
6
  export type { Erc20 } from "./Erc20";
7
7
  export type { Forwarder } from "./Forwarder";
8
8
  export type { GaslessWallet } from "./GaslessWallet";
9
+ export type { MultisigAgnosticForwarder } from "./MultisigAgnosticForwarder";
9
10
  export type { MultisigForwarder } from "./MultisigForwarder";
10
11
  export * as factories from "./factories";
11
12
  export { AvoFactoryProxy__factory } from "./factories/AvoFactoryProxy__factory";
@@ -13,4 +14,5 @@ export { BalanceResolver__factory } from "./factories/BalanceResolver__factory";
13
14
  export { Erc20__factory } from "./factories/Erc20__factory";
14
15
  export { Forwarder__factory } from "./factories/Forwarder__factory";
15
16
  export { GaslessWallet__factory } from "./factories/GaslessWallet__factory";
17
+ export { MultisigAgnosticForwarder__factory } from "./factories/MultisigAgnosticForwarder__factory";
16
18
  export { MultisigForwarder__factory } from "./factories/MultisigForwarder__factory";
@@ -0,0 +1,34 @@
1
+ // @ts-check
2
+ import antfu from '@antfu/eslint-config'
3
+ import withNuxt from './.nuxt/eslint.config.mjs'
4
+
5
+ export default withNuxt(
6
+ antfu({
7
+ ignores: [
8
+ '*.png',
9
+ '*.ico',
10
+ '*.toml',
11
+ '*.yml',
12
+ '.github/',
13
+ 'deployments/',
14
+ '*.patch',
15
+ '*.txt',
16
+ 'Dockerfile',
17
+ 'public/',
18
+ 'contracts/',
19
+ 'yarn.lock',
20
+ ],
21
+ yaml: false,
22
+ rules: {
23
+ 'style/max-statements-per-line': 'off',
24
+ 'max-statements-per-line': 'off',
25
+ '@stylistic/max-statements-per-line': 'off',
26
+ 'vue/return-in-computed-property': 'off',
27
+ 'no-console': 'off',
28
+ 'ts/ban-ts-comment': 'off',
29
+ 'vue/prop-name-casing': 'off',
30
+ 'node/prefer-global/process': 'off',
31
+ 'eqeqeq': 'off',
32
+ },
33
+ }),
34
+ )
package/nuxt.config.ts CHANGED
@@ -1,20 +1,29 @@
1
1
  // https://nuxt.com/docs/api/configuration/nuxt-config
2
- import ViteComponents from "unplugin-vue-components/vite";
2
+ // import ViteComponents from "unplugin-vue-components/vite";
3
3
 
4
4
  export default defineNuxtConfig({
5
- modules: ["@nuxtjs/tailwindcss", "nuxt-svgo", "@vueuse/nuxt"],
5
+ modules: ['@nuxtjs/tailwindcss', 'nuxt-svgo', '@vueuse/nuxt', '@nuxt/eslint'],
6
+
6
7
  svgo: {
7
- defaultImport: "component",
8
- autoImportPath: "./assets/images/icons",
8
+ defaultImport: 'component',
9
+ autoImportPath: './assets/images/icons',
9
10
  svgoConfig: {
10
- plugins: ["prefixIds"],
11
+ plugins: ['prefixIds'],
11
12
  },
12
13
  },
13
- vite: {
14
- plugins: [
15
- ViteComponents({
16
- dts: true,
17
- }),
18
- ],
14
+
15
+ // vite: {
16
+ // plugins: [
17
+ // ViteComponents({
18
+ // dts: true,
19
+ // }),
20
+ // ],
21
+ // },
22
+ eslint: {
23
+ config: {
24
+ standalone: false,
25
+ },
19
26
  },
20
- });
27
+
28
+ compatibilityDate: '2024-09-18',
29
+ })
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.0-dev.d8050bd",
4
3
  "type": "module",
4
+ "version": "0.0.0-dev.dcb4af3",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",
7
+ "engines": {
8
+ "node": ">=v20.16.0"
9
+ },
7
10
  "scripts": {
8
11
  "build": "nuxt build",
9
12
  "dev": "nuxt dev",
10
13
  "generate": "nuxt generate",
11
14
  "preview": "nuxt preview",
12
- "generate:contracts": "rimraf contracts && typechain --target=ethers-v5 'abi/*.json' --out-dir 'contracts'"
13
- },
14
- "devDependencies": {
15
- "@instadapp/avocado": "^0.1.10",
16
- "@instadapp/avocado-dev": "npm:@instadapp/avocado@dev",
17
- "@nuxtjs/tailwindcss": "^6.6.5",
18
- "@typechain/ethers-v5": "^10.2.0",
19
- "nuxt": "^3.6.1",
20
- "nuxt-svgo": "^3.1.0",
21
- "rimraf": "^3.0.2",
22
- "typechain": "^8.1.1",
23
- "unplugin-vue-components": "^0.25.1",
24
- "vue-tippy": "^6.0.0"
15
+ "typecheck": "nuxi typecheck"
25
16
  },
26
17
  "dependencies": {
18
+ "@antfu/eslint-config": "^3.6.2",
27
19
  "@vueuse/nuxt": "^10.2.0",
28
20
  "bignumber.js": "^9.1.1",
29
21
  "ethers": "^5.7.2",
22
+ "viem": "^2.21.54",
30
23
  "xxhashjs": "^0.2.2"
24
+ },
25
+ "devDependencies": {
26
+ "@nuxt/eslint": "^0.5.7",
27
+ "@nuxtjs/tailwindcss": "^6.12.1",
28
+ "nuxt": "3.13.2",
29
+ "nuxt-svgo": "^4.0.6",
30
+ "vue-tippy": "^6.0.0"
31
31
  }
32
32
  }
@@ -1,4 +1,4 @@
1
- export * from "../../utils/avocado";
2
- export * from "../../utils/network";
3
- export * from "../../utils/bignumber";
4
- export * from "../../utils/formatter";
1
+ export * from '../../utils/avocado'
2
+ export * from '../../utils/bignumber'
3
+ export * from '../../utils/formatter'
4
+ export * from '../../utils/network'
package/utils/avocado.ts CHANGED
@@ -1,24 +1,24 @@
1
- export const AVO_PROD_CHAIN_ID = 634;
2
- export const AVO_PROD_CHAIN_NAME = "Avocado";
1
+ export const AVO_PROD_CHAIN_ID = 634
2
+ export const AVO_PROD_CHAIN_NAME = 'Avocado'
3
3
 
4
- export const AVO_STAGING_CHAIN_ID = 63400;
5
- export const AVO_STAGING_CHAIN_NAME = "Avocado Testnet";
4
+ export const AVO_STAGING_CHAIN_ID = 63400
5
+ export const AVO_STAGING_CHAIN_NAME = 'Avocado Testnet'
6
6
 
7
- export const AVO_PROD_EXPLORER_URL = "https://avoscan.co";
8
- export const AVO_STAGING_EXPLORER_URL = "https://explorer.avocado.instad.app";
7
+ export const AVO_PROD_EXPLORER_URL = 'https://avoscan.co'
8
+ export const AVO_STAGING_EXPLORER_URL = 'https://explorer.avocado.instad.app'
9
9
 
10
- export const AVO_PROD_FORWARDER_ADDR =
11
- "0x375F6B0CD12b34Dc28e34C26853a37012C24dDE5";
12
- export const AVO_STAGING_FORWARDER_ADDR =
13
- "0x8CDaAC0371a443985c6Faf07938dDAa7A5818674";
10
+ export const AVO_PROD_FORWARDER_ADDR
11
+ = '0x375F6B0CD12b34Dc28e34C26853a37012C24dDE5'
12
+ export const AVO_STAGING_FORWARDER_ADDR
13
+ = '0x8CDaAC0371a443985c6Faf07938dDAa7A5818674'
14
14
 
15
- export const AVO_PROD_DEPOSIT_ADDRESS =
16
- "0xE8385fB3A5F15dED06EB5E20E5A81BF43115eb8E";
17
- export const AVO_STAGING_DEPOSIT_ADDRESS =
18
- "0x853e991d800Dfd6bC1F83AED3310e859482323dc";
15
+ export const AVO_PROD_DEPOSIT_ADDRESS
16
+ = '0xE8385fB3A5F15dED06EB5E20E5A81BF43115eb8E'
17
+ export const AVO_STAGING_DEPOSIT_ADDRESS
18
+ = '0x853e991d800Dfd6bC1F83AED3310e859482323dc'
19
19
 
20
- export const AVO_PROD_RPC_URL = "https://rpc.avocado.instadapp.io";
20
+ export const AVO_PROD_RPC_URL = 'https://rpc.avocado.instadapp.io'
21
21
 
22
- export const AVO_STAGING_RPC_URL = "https://rpc.avocado.instad.app";
22
+ export const AVO_STAGING_RPC_URL = 'https://rpc.avocado.instad.app'
23
23
 
24
- export const blockQueryURL = "https://blockquery.instadapp.io";
24
+ export const blockQueryURL = 'https://blockquery.instadapp.io'
@@ -1,51 +1,62 @@
1
- import { BigNumber } from "bignumber.js";
2
- import { BigNumber as BN } from "ethers";
1
+ import { BigNumber } from 'bignumber.js'
2
+ import { BigNumber as BN } from 'ethers'
3
3
 
4
- type CombinedBigNumber = BigNumber | string | number;
4
+ type CombinedBigNumber = BigNumber | string | number
5
5
 
6
- export const toBN = (value: BigNumber.Value | BN) =>
7
- new BigNumber(BN.isBigNumber(value) ? value.toString() : value);
8
- export const isZero = (value: BigNumber.Value | BN) => toBN(value).isZero();
9
- export const times = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
10
- toBN(a).times(toBN(b));
11
- export const minus = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
12
- toBN(a).minus(toBN(b));
13
- export const plus = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
14
- toBN(a).plus(toBN(b));
15
- export const lte = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
16
- toBN(a).lte(toBN(b));
17
- export const gte = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
18
- toBN(a).gte(toBN(b));
19
- export const div = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
20
- toBN(a).div(toBN(b));
21
- export const lt = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
22
- toBN(a).lt(toBN(b));
23
- export const gt = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
24
- toBN(a).gt(toBN(b));
25
- export const ensureValue = (value: any) => {
26
- if (!value) return toBN("0");
27
- if (toBN(value).isNaN()) return toBN("0");
6
+ export function toBN(value: BigNumber.Value | BN) {
7
+ return new BigNumber(BN.isBigNumber(value) ? value.toString() : value)
8
+ }
9
+ export const isZero = (value: BigNumber.Value | BN) => toBN(value).isZero()
10
+ export function times(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
11
+ return toBN(a).times(toBN(b))
12
+ }
13
+ export function minus(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
14
+ return toBN(a).minus(toBN(b))
15
+ }
16
+ export function plus(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
17
+ return toBN(a).plus(toBN(b))
18
+ }
19
+ export function lte(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
20
+ return toBN(a).lte(toBN(b))
21
+ }
22
+ export function gte(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
23
+ return toBN(a).gte(toBN(b))
24
+ }
25
+ export function div(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
26
+ return toBN(a).div(toBN(b))
27
+ }
28
+ export function lt(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
29
+ return toBN(a).lt(toBN(b))
30
+ }
31
+ export function gt(a: BigNumber.Value | BN, b: BigNumber.Value | BN) {
32
+ return toBN(a).gt(toBN(b))
33
+ }
34
+ export function ensureValue(value: any) {
35
+ if (!value)
36
+ return toBN('0')
37
+ if (toBN(value).isNaN())
38
+ return toBN('0')
28
39
 
29
- return toBN(value);
30
- };
31
- export const max = (...args: BigNumber.Value[]) => {
32
- return BigNumber.max(...args);
33
- };
40
+ return toBN(value)
41
+ }
42
+ export function max(...args: BigNumber.Value[]) {
43
+ return BigNumber.max(...args)
44
+ }
34
45
 
35
46
  export function pow(value: CombinedBigNumber, exponent: string | number) {
36
- return toBN(value).pow(toBN(exponent));
47
+ return toBN(value).pow(toBN(exponent))
37
48
  }
38
49
 
39
50
  export function toWei(val: CombinedBigNumber, decimals: number): string {
40
- const num = toBN(val);
41
- const multiplier = pow(10, decimals);
42
- return times(num, multiplier).toFixed(0);
51
+ const num = toBN(val)
52
+ const multiplier = pow(10, decimals)
53
+ return times(num, multiplier).toFixed(0)
43
54
  }
44
55
 
45
56
  export function fromWei(val: CombinedBigNumber, decimal = 18) {
46
- return toBN(val).div(new BigNumber(10).pow(decimal));
57
+ return toBN(val).div(new BigNumber(10).pow(decimal))
47
58
  }
48
59
 
49
60
  export function abs(value: CombinedBigNumber) {
50
- return toBN(value).abs();
61
+ return toBN(value).abs()
51
62
  }
@@ -1,94 +1,88 @@
1
1
  export function formatPercent(
2
2
  value?: number | string,
3
3
  fractionDigits = 2,
4
- maxValue = null
4
+ maxValue = null,
5
5
  ) {
6
- if (!value || isZero(value)) return "0.00%";
6
+ if (!value || isZero(value))
7
+ return '0.00%'
7
8
 
8
- const valueAsNumber = toBN(value).toNumber();
9
+ const valueAsNumber = toBN(value).toNumber()
9
10
 
10
- if (maxValue && gt(times(valueAsNumber, "100"), maxValue))
11
- return `>${maxValue}%`;
11
+ if (maxValue && gt(times(valueAsNumber, '100'), maxValue))
12
+ return `>${maxValue}%`
12
13
 
13
- const formatter = new Intl.NumberFormat("en-US", {
14
- style: "percent",
14
+ const formatter = new Intl.NumberFormat('en-US', {
15
+ style: 'percent',
15
16
  minimumFractionDigits: fractionDigits,
16
17
  maximumFractionDigits: fractionDigits,
17
- });
18
+ })
18
19
 
19
- return formatter.format(valueAsNumber);
20
+ return formatter.format(valueAsNumber)
20
21
  }
21
22
 
22
- export function shortenHash(hash: string, length: number = 4) {
23
- if (!hash) return;
24
- if (hash.length < 12) return hash;
25
- const beginningChars = hash.startsWith("0x") ? length + 2 : length;
26
- const shortened =
27
- hash.substr(0, beginningChars) + "..." + hash.substr(-length);
28
- return shortened;
23
+ export function shortenHash(hash: string | `0x${string}`, length: number = 4) {
24
+ if (!hash)
25
+ return
26
+ if (hash.length < 12)
27
+ return hash
28
+ const beginningChars = hash.startsWith('0x') ? length + 2 : length
29
+ const shortened
30
+ = `${hash.substr(0, beginningChars)}...${hash.substr(-length)}`
31
+ return shortened
29
32
  }
30
33
 
31
34
  export function formatUsd(value: any, fractionDigits = 2) {
32
- const formatter = new Intl.NumberFormat("en-US", {
33
- style: "currency",
34
- currency: "USD",
35
+ const formatter = new Intl.NumberFormat('en-US', {
36
+ style: 'currency',
37
+ currency: 'USD',
35
38
  minimumFractionDigits: fractionDigits,
36
39
  maximumFractionDigits: fractionDigits,
37
- });
40
+ })
38
41
 
39
- return formatter.format(value);
42
+ return formatter.format(value)
40
43
  }
41
44
 
42
45
  export function signedNumber(numb: string | number) {
43
- return new Intl.NumberFormat("en-US", {
44
- signDisplay: "exceptZero",
45
- }).format(toBN(numb).toNumber());
46
- }
47
-
48
- function getFractionDigits(value: string | number) {
49
- const absoluteValue = toBN(value).abs();
50
-
51
- if (isZero(absoluteValue)) {
52
- return 2;
53
- } else if (lt(absoluteValue, 0.01)) {
54
- return 6;
55
- } else if (lt(absoluteValue, 1)) {
56
- return 4;
57
- } else if (lt(absoluteValue, 10000)) {
58
- return 2;
59
- } else {
60
- return 0;
61
- }
46
+ return new Intl.NumberFormat('en-US', {
47
+ signDisplay: 'exceptZero',
48
+ }).format(toBN(numb).toNumber())
62
49
  }
63
50
 
64
51
  export function formatDecimal(value: string | number, fractionDigits?: number) {
65
52
  if (!value) {
66
- value = "0";
53
+ value = '0'
54
+ }
55
+ if (lt(value, '0.0001') && gt(value, '0')) {
56
+ return '< 0.0001'
67
57
  }
68
- if (lt(value, "0.0001") && gt(value, "0")) {
69
- return "< 0.0001";
70
- } else {
71
- const num = toBN(value);
72
- let decimals;
58
+ else {
59
+ const num = toBN(value)
60
+ let decimals
73
61
 
74
62
  if (num.lt(1)) {
75
- decimals = 4;
76
- } else if (num.lt(10)) {
77
- decimals = 6;
78
- } else if (num.lt(100)) {
79
- decimals = 4;
80
- } else if (num.lt(1000)) {
81
- decimals = 3;
82
- } else if (num.lt(10000)) {
83
- decimals = 2;
84
- } else if (num.lt(100000)) {
85
- decimals = 1;
86
- } else {
87
- decimals = 0;
63
+ decimals = 4
64
+ }
65
+ else if (num.lt(10)) {
66
+ decimals = 6
67
+ }
68
+ else if (num.lt(100)) {
69
+ decimals = 4
70
+ }
71
+ else if (num.lt(1000)) {
72
+ decimals = 3
73
+ }
74
+ else if (num.lt(10000)) {
75
+ decimals = 2
76
+ }
77
+ else if (num.lt(100000)) {
78
+ decimals = 1
79
+ }
80
+ else {
81
+ decimals = 0
88
82
  }
89
83
 
90
- const formattedNumber = num.toFixed(fractionDigits || decimals);
84
+ const formattedNumber = num.toFixed(fractionDigits || decimals)
91
85
 
92
- return toBN(formattedNumber).toFormat();
86
+ return toBN(formattedNumber).toFormat()
93
87
  }
94
88
  }
package/utils/helper.ts CHANGED
@@ -1,62 +1,65 @@
1
- export const indexSorter = (aIndex: number, bIndex: number) => {
1
+ export function indexSorter(aIndex: number, bIndex: number) {
2
2
  if (aIndex === -1 && bIndex === -1) {
3
- return 0; // fallback to other sorting criteria
4
- } else if (aIndex === -1) {
5
- return 1; // b comes first if a is not in the priority list
6
- } else if (bIndex === -1) {
7
- return -1; // a comes first if b is not in the priority list
8
- } else {
9
- return aIndex - bIndex; // sort by the index in the priority list
3
+ return 0 // fallback to other sorting criteria
10
4
  }
11
- };
5
+ else if (aIndex === -1) {
6
+ return 1 // b comes first if a is not in the priority list
7
+ }
8
+ else if (bIndex === -1) {
9
+ return -1 // a comes first if b is not in the priority list
10
+ }
11
+ else {
12
+ return aIndex - bIndex // sort by the index in the priority list
13
+ }
14
+ }
12
15
 
13
16
  export function sortByMany<T>(
14
17
  items: T[],
15
- callback: ((a: T, b: T) => number)[]
18
+ callback: ((a: T, b: T) => number)[],
16
19
  ) {
17
- return items.sort(function (a, b) {
18
- var result = 0;
19
- for (var i = 0; i < callback.length; i++) {
20
- var func = callback[i];
21
- result = func(a, b);
20
+ return items.sort((a, b) => {
21
+ let result = 0
22
+ for (let i = 0; i < callback.length; i++) {
23
+ const func = callback[i]
24
+ result = func(a, b)
22
25
  if (result !== 0) {
23
- break;
26
+ break
24
27
  }
25
28
  }
26
- return result;
27
- });
29
+ return result
30
+ })
28
31
  }
29
32
 
30
33
  export function cloneDeep<T>(value: T): T {
31
- return JSON.parse(JSON.stringify(value));
34
+ return JSON.parse(JSON.stringify(value))
32
35
  }
33
36
 
34
37
  export function filterArray(array: any, filters: any) {
35
- const filterKeys = Object.keys(filters);
38
+ const filterKeys = Object.keys(filters)
36
39
  return array.filter((item: any) => {
37
40
  // validates all filter criteria
38
41
  return filterKeys.every((key) => {
39
42
  // ignores non-function predicates
40
- if (typeof filters[key] !== "function") return true;
41
- return filters[key](item[key], item);
42
- });
43
- });
43
+ if (typeof filters[key] !== 'function')
44
+ return true
45
+ return filters[key](item[key], item)
46
+ })
47
+ })
44
48
  }
45
49
 
46
50
  export function onImageError(this: HTMLImageElement) {
47
- const parentElement = this.parentElement;
48
- this.onerror = null;
49
- this.remove();
51
+ const parentElement = this.parentElement
52
+ this.onerror = null
53
+ this.remove()
50
54
 
51
55
  if (parentElement) {
52
- parentElement.classList.add("bg-gray-300");
56
+ parentElement.classList.add('bg-gray-300')
53
57
  }
54
58
  }
55
59
 
56
60
  export function formatMultipleAddresses(addresses: string[], shorten = true) {
57
61
  const formatter = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' })
58
62
  const formattedString = formatter.format(addresses.map(i => shorten ? shortenHash(i) || '' : i))
59
-
63
+
60
64
  return formattedString
61
65
  }
62
-