@instadapp/avocado-base 0.0.0-dev.e76fab2 → 0.0.0-dev.e9aa00c

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 (77) hide show
  1. package/abi/forwarder.json +8 -8
  2. package/app.vue +7 -0
  3. package/assets/images/icons/arrow-left.svg +5 -0
  4. package/assets/images/icons/arrow-right.svg +5 -0
  5. package/assets/images/icons/avocado.svg +4 -0
  6. package/assets/images/icons/bridge-2.svg +3 -0
  7. package/assets/images/icons/bridge.svg +7 -0
  8. package/assets/images/icons/calendar.svg +8 -0
  9. package/assets/images/icons/change-threshold.svg +4 -0
  10. package/assets/images/icons/check-circle.svg +4 -0
  11. package/assets/images/icons/chevron-down.svg +4 -0
  12. package/assets/images/icons/clipboard.svg +7 -0
  13. package/assets/images/icons/clock-circle.svg +5 -0
  14. package/assets/images/icons/copy.svg +5 -0
  15. package/assets/images/icons/cross-transfer.svg +7 -0
  16. package/assets/images/icons/dapp.svg +4 -0
  17. package/assets/images/icons/deploy.svg +12 -0
  18. package/assets/images/icons/error-circle.svg +6 -0
  19. package/assets/images/icons/exclamation-circle.svg +13 -0
  20. package/assets/images/icons/exclamation-octagon.svg +13 -0
  21. package/assets/images/icons/exclamation-triangle.svg +5 -0
  22. package/assets/images/icons/external-link.svg +6 -0
  23. package/assets/images/icons/eye.svg +4 -0
  24. package/assets/images/icons/flowers.svg +8 -0
  25. package/assets/images/icons/gas-emoji.svg +193 -0
  26. package/assets/images/icons/gas.svg +14 -0
  27. package/assets/images/icons/gift.svg +153 -0
  28. package/assets/images/icons/globe.svg +110 -0
  29. package/assets/images/icons/hamburger.svg +6 -0
  30. package/assets/images/icons/instadapp-pro.svg +4 -0
  31. package/assets/images/icons/logout.svg +3 -0
  32. package/assets/images/icons/moon.svg +3 -0
  33. package/assets/images/icons/multi-send.svg +7 -0
  34. package/assets/images/icons/network.svg +13 -0
  35. package/assets/images/icons/options.svg +5 -0
  36. package/assets/images/icons/permit-sign.svg +11 -0
  37. package/assets/images/icons/plus-circle.svg +6 -0
  38. package/assets/images/icons/plus.svg +5 -0
  39. package/assets/images/icons/power-off-bg.svg +24 -0
  40. package/assets/images/icons/power-off.svg +19 -0
  41. package/assets/images/icons/power-on.svg +19 -0
  42. package/assets/images/icons/qr.svg +20 -0
  43. package/assets/images/icons/question-circle.svg +14 -0
  44. package/assets/images/icons/refresh.svg +6 -0
  45. package/assets/images/icons/reject-proposal.svg +6 -0
  46. package/assets/images/icons/search.svg +12 -0
  47. package/assets/images/icons/sun.svg +3 -0
  48. package/assets/images/icons/transfer.svg +5 -0
  49. package/assets/images/icons/trash-2.svg +8 -0
  50. package/assets/images/icons/upgrade.svg +4 -0
  51. package/assets/images/icons/wave.svg +214 -0
  52. package/assets/images/icons/x.svg +5 -0
  53. package/components/ActionLogo.vue +38 -0
  54. package/components/ActionMetadata.vue +72 -0
  55. package/components/AuthorityAvatar.vue +26 -0
  56. package/components/ChainLogo.vue +99 -442
  57. package/components/CopyClipboard.vue +64 -0
  58. package/components/metadata/Bridge.vue +43 -0
  59. package/components/metadata/CrossTransfer.vue +71 -0
  60. package/components/metadata/GasTopup.vue +39 -0
  61. package/components/metadata/Permit2.vue +42 -0
  62. package/components/metadata/Signers.vue +45 -0
  63. package/components/metadata/Swap.vue +74 -0
  64. package/components/metadata/Transfer.vue +50 -0
  65. package/components.d.ts +13 -0
  66. package/contracts/Forwarder.ts +4 -4
  67. package/contracts/factories/Forwarder__factory.ts +8 -8
  68. package/nuxt.config.ts +17 -1
  69. package/package.json +9 -4
  70. package/utils/avocado.ts +2 -0
  71. package/utils/bignumber.ts +20 -0
  72. package/utils/formatter.ts +1 -1
  73. package/utils/helper.ts +19 -0
  74. package/utils/metadata.ts +296 -177
  75. package/utils/network.ts +37 -2
  76. package/utils/services.ts +21 -0
  77. package/utils/utils.d.ts +128 -114
package/utils/utils.d.ts CHANGED
@@ -1,118 +1,132 @@
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;
14
-
15
- type ISlackMessageType = "danger" | "error" | "success" | "banner";
16
-
17
- interface Network {
18
- name: string;
19
- debankName?: string;
20
- ankrName?: string;
21
- zerionName?: string;
22
- chainId: ChainId;
23
- color: string;
24
- isAvocado?: boolean;
25
- serverRpcUrl: string | undefined;
26
- balanceResolverAddress?: string;
27
- usdcAddress: string;
28
- explorerUrl: string;
29
- params: {
30
- chainName?: string;
31
- iconUrls?: string[];
32
- rpcUrls: string[];
33
- nativeCurrency?: {
34
- name: string;
35
- symbol: string;
36
- decimals: number;
1
+ declare global {
2
+ type ChainId =
3
+ | 1
4
+ | 137
5
+ | 42161
6
+ | 10
7
+ | 56
8
+ | 43114
9
+ | 100
10
+ | 1101
11
+ | 250
12
+ | 634
13
+ | 1313161554
14
+ | 8453
15
+ | 63400;
16
+
17
+ type ISlackMessageType = "danger" | "error" | "success" | "banner";
18
+
19
+ type MetadataTypes = keyof typeof MetadataEnums;
20
+
21
+ type PayloadFunction = (data: any, type: MetadataTypes) => any;
22
+
23
+ type IPayload = Record<MetadataTypes, PayloadFunction>;
24
+
25
+ interface Network {
26
+ name: string;
27
+ debankName?: string;
28
+ ankrName?: string;
29
+ zerionName?: string;
30
+ chainId: ChainId;
31
+ color: string;
32
+ isAvocado?: boolean;
33
+ serverRpcUrl: string | undefined;
34
+ balanceResolverAddress?: string;
35
+ usdcAddress: string;
36
+ explorerUrl: string;
37
+ params: {
38
+ chainName?: string;
39
+ iconUrls?: string[];
40
+ rpcUrls: string[];
41
+ nativeCurrency?: {
42
+ name: string;
43
+ symbol: string;
44
+ decimals: number;
45
+ };
37
46
  };
47
+ }
48
+
49
+ type SignMetadataProps = {
50
+ token: string;
51
+ spender: string;
52
+ amount: string;
53
+ expiration: string;
54
+ };
55
+
56
+ type DappMetadataProps = {
57
+ name: string;
58
+ url: string;
59
+ };
60
+
61
+ type SendMetadataProps = {
62
+ token: string;
63
+ amount: string;
64
+ receiver: string;
65
+ };
66
+
67
+ type CrossSendMetadataProps = {
68
+ fromToken: string;
69
+ toToken: string;
70
+ toChainId: string;
71
+ amount: string;
72
+ receiver: string;
73
+ };
74
+
75
+ type AuthMetadataProps = {
76
+ address: string;
77
+ chainId: string;
78
+ remove: boolean;
38
79
  };
80
+
81
+ type UpgradeMetadataProps = {
82
+ version: string;
83
+ walletImpl: string;
84
+ };
85
+
86
+ type TopupMetadataProps = {
87
+ amount: string;
88
+ token: string;
89
+ onBehalf: string;
90
+ };
91
+
92
+ type BridgeMetadataProps = {
93
+ amount: string;
94
+ receiver: string;
95
+ fromToken: string;
96
+ toToken: string;
97
+ toChainId: string;
98
+ bridgeFee: string;
99
+ nativeToken: string;
100
+ };
101
+
102
+ type SwapMetadataProps = {
103
+ sellToken: string;
104
+ buyToken: string;
105
+ sellAmount: string;
106
+ buyAmount: string;
107
+ receiver: string;
108
+ protocol?: string;
109
+ };
110
+
111
+ type MetadataProps = {
112
+ type: MetadataTypes,
113
+ encodedData: string;
114
+ version?: string;
115
+ };
116
+
117
+ interface ITokenPrice {
118
+ address: string;
119
+ chain_id: string;
120
+ name: string;
121
+ symbol: string;
122
+ decimals: number;
123
+ logo_url: string;
124
+ price: string;
125
+ coingecko_id: string;
126
+ sparkline_price_7d: number[];
127
+ }
128
+
39
129
  }
40
130
 
41
- type SignMetadataProps = {
42
- token: string;
43
- spender: string;
44
- amount: string;
45
- expiration: string;
46
- };
47
-
48
- type DappMetadataProps = {
49
- name: string;
50
- url: string;
51
- };
52
-
53
- type SendMetadataProps = {
54
- token: string;
55
- amount: string;
56
- receiver: string;
57
- };
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
-
73
- type UpgradeMetadataProps = {
74
- version: string;
75
- walletImpl: string;
76
- };
77
-
78
- type TopupMetadataProps = {
79
- amount: string;
80
- token: string;
81
- onBehalf: string;
82
- };
83
-
84
- type BridgeMetadataProps = {
85
- amount: string;
86
- receiver: string;
87
- fromToken: string;
88
- toToken: string;
89
- toChainId: string;
90
- bridgeFee: string;
91
- nativeToken: string;
92
- };
93
-
94
- type SwapMetadataProps = {
95
- sellToken: string;
96
- buyToken: string;
97
- sellAmount: string;
98
- buyAmount: string;
99
- receiver: string;
100
- protocol?: string;
101
- };
102
-
103
- type MetadataProps = {
104
- type:
105
- | "transfer"
106
- | "bridge"
107
- | "swap"
108
- | "multi"
109
- | "gas-topup"
110
- | "upgrade"
111
- | "dapp"
112
- | "deploy"
113
- | "permit2"
114
- | "cross-transfer"
115
- | "auth";
116
- encodedData: string;
117
- version?: string;
118
- };
131
+ export { }
132
+