@instadapp/avocado-base 0.0.0-dev.aceef3f → 0.0.0-dev.afb1d81

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 (59) hide show
  1. package/abi/forwarder.json +1253 -149
  2. package/assets/images/icons/arrow-left.svg +5 -0
  3. package/assets/images/icons/arrow-right.svg +5 -0
  4. package/assets/images/icons/avocado.svg +4 -0
  5. package/assets/images/icons/bridge-2.svg +3 -0
  6. package/assets/images/icons/bridge.svg +7 -0
  7. package/assets/images/icons/calendar.svg +8 -0
  8. package/assets/images/icons/check-circle.svg +4 -0
  9. package/assets/images/icons/chevron-down.svg +4 -0
  10. package/assets/images/icons/clipboard.svg +7 -0
  11. package/assets/images/icons/clock-circle.svg +5 -0
  12. package/assets/images/icons/copy.svg +5 -0
  13. package/assets/images/icons/error-circle.svg +6 -0
  14. package/assets/images/icons/exclamation-circle.svg +13 -0
  15. package/assets/images/icons/exclamation-octagon.svg +13 -0
  16. package/assets/images/icons/exclamation-triangle.svg +5 -0
  17. package/assets/images/icons/external-link.svg +6 -0
  18. package/assets/images/icons/eye.svg +4 -0
  19. package/assets/images/icons/flowers.svg +8 -0
  20. package/assets/images/icons/gas-emoji.svg +193 -0
  21. package/assets/images/icons/gas.svg +7 -0
  22. package/assets/images/icons/gift.svg +153 -0
  23. package/assets/images/icons/globe.svg +110 -0
  24. package/assets/images/icons/hamburger.svg +6 -0
  25. package/assets/images/icons/logout.svg +3 -0
  26. package/assets/images/icons/moon.svg +3 -0
  27. package/assets/images/icons/network.svg +13 -0
  28. package/assets/images/icons/options.svg +5 -0
  29. package/assets/images/icons/plus.svg +5 -0
  30. package/assets/images/icons/power-off-bg.svg +24 -0
  31. package/assets/images/icons/power-off.svg +19 -0
  32. package/assets/images/icons/power-on.svg +19 -0
  33. package/assets/images/icons/qr.svg +20 -0
  34. package/assets/images/icons/question-circle.svg +14 -0
  35. package/assets/images/icons/refresh.svg +6 -0
  36. package/assets/images/icons/search.svg +12 -0
  37. package/assets/images/icons/sun.svg +3 -0
  38. package/assets/images/icons/wave.svg +214 -0
  39. package/assets/images/icons/x.svg +5 -0
  40. package/components/ActionMetadata.vue +50 -0
  41. package/components/ChainLogo.vue +141 -1
  42. package/components/metadata/Bridge.vue +37 -0
  43. package/components/metadata/CrossTransfer.vue +65 -0
  44. package/components/metadata/GasTopup.vue +31 -0
  45. package/components/metadata/Permit2.vue +37 -0
  46. package/components/metadata/Swap.vue +66 -0
  47. package/components/metadata/Transfer.vue +43 -0
  48. package/components.d.ts +13 -0
  49. package/contracts/Forwarder.ts +856 -2
  50. package/contracts/factories/Forwarder__factory.ts +816 -16
  51. package/nuxt.config.ts +17 -1
  52. package/package.json +6 -3
  53. package/utils/avocado.ts +2 -0
  54. package/utils/bignumber.ts +20 -0
  55. package/utils/formatter.ts +49 -6
  56. package/utils/metadata.ts +107 -3
  57. package/utils/network.ts +130 -67
  58. package/utils/services.ts +14 -0
  59. package/utils/utils.d.ts +49 -7
@@ -0,0 +1,14 @@
1
+ export const fetchTokenByAddress = async (
2
+ address: string,
3
+ chainId: string | number
4
+ ) => {
5
+ if (!address || !chainId) return null;
6
+ const [token] = (await $fetch(`${blockQueryURL}/${chainId}/tokens`, {
7
+ params: {
8
+ sparkline: false,
9
+ "addresses[]": [address],
10
+ },
11
+ })) as ITokenPrice[];
12
+
13
+ return token;
14
+ };
package/utils/utils.d.ts CHANGED
@@ -1,4 +1,16 @@
1
- type ChainId = 1 | 137 | 42161 | 10 | 56 | 43114 | 100 | 1101 | 634 | 63400;
1
+ type ChainId =
2
+ | 1
3
+ | 137
4
+ | 42161
5
+ | 10
6
+ | 56
7
+ | 43114
8
+ | 100
9
+ | 1101
10
+ | 250
11
+ | 634
12
+ | 1313161554
13
+ | 63400;
2
14
 
3
15
  type ISlackMessageType = "danger" | "error" | "success" | "banner";
4
16
 
@@ -6,16 +18,18 @@ interface Network {
6
18
  name: string;
7
19
  debankName?: string;
8
20
  ankrName?: string;
21
+ zerionName?: string;
9
22
  chainId: ChainId;
23
+ color: string;
10
24
  isAvocado?: boolean;
25
+ serverRpcUrl: string | undefined;
26
+ balanceResolverAddress?: string;
27
+ usdcAddress: string;
28
+ explorerUrl: string;
11
29
  params: {
12
30
  chainName?: string;
13
- rpcUrls: string[];
14
- serverRpcUrl: string | undefined;
15
- balanceResolverAddress?: string;
16
- usdcAddress: string;
17
- explorerUrl: string;
18
31
  iconUrls?: string[];
32
+ rpcUrls: string[];
19
33
  nativeCurrency?: {
20
34
  name: string;
21
35
  symbol: string;
@@ -42,6 +56,20 @@ type SendMetadataProps = {
42
56
  receiver: string;
43
57
  };
44
58
 
59
+ type CrossSendMetadataProps = {
60
+ fromToken: string;
61
+ toToken: string;
62
+ toChainId: string;
63
+ amount: string;
64
+ receiver: string;
65
+ };
66
+
67
+ type AuthMetadataProps = {
68
+ address: string;
69
+ chainId: string;
70
+ remove: boolean;
71
+ };
72
+
45
73
  type UpgradeMetadataProps = {
46
74
  version: string;
47
75
  walletImpl: string;
@@ -82,7 +110,21 @@ type MetadataProps = {
82
110
  | "upgrade"
83
111
  | "dapp"
84
112
  | "deploy"
85
- | "permit2";
113
+ | "permit2"
114
+ | "cross-transfer"
115
+ | "auth";
86
116
  encodedData: string;
87
117
  version?: string;
88
118
  };
119
+
120
+ interface ITokenPrice {
121
+ address: string;
122
+ chain_id: string;
123
+ name: string;
124
+ symbol: string;
125
+ decimals: number;
126
+ logo_url: string;
127
+ price: string;
128
+ coingecko_id: string;
129
+ sparkline_price_7d: number[];
130
+ }