@instadapp/avocado-base 0.0.0-dev.c8c43bc → 0.0.0-dev.c8dd0df

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 (86) hide show
  1. package/abi/forwarder.json +1253 -149
  2. package/abi/multisigForwarder.json +697 -0
  3. package/app.vue +27 -0
  4. package/assets/images/icons/arrow-left.svg +5 -0
  5. package/assets/images/icons/arrow-right.svg +5 -0
  6. package/assets/images/icons/avocado.svg +4 -0
  7. package/assets/images/icons/bridge-2.svg +3 -0
  8. package/assets/images/icons/bridge.svg +7 -0
  9. package/assets/images/icons/calendar.svg +8 -0
  10. package/assets/images/icons/change-threshold.svg +4 -0
  11. package/assets/images/icons/check-circle.svg +4 -0
  12. package/assets/images/icons/chevron-down.svg +4 -0
  13. package/assets/images/icons/clipboard.svg +7 -0
  14. package/assets/images/icons/clock-circle.svg +5 -0
  15. package/assets/images/icons/copy.svg +5 -0
  16. package/assets/images/icons/cross-transfer.svg +7 -0
  17. package/assets/images/icons/dapp.svg +4 -0
  18. package/assets/images/icons/deploy.svg +12 -0
  19. package/assets/images/icons/error-circle.svg +6 -0
  20. package/assets/images/icons/exclamation-circle.svg +13 -0
  21. package/assets/images/icons/exclamation-octagon.svg +13 -0
  22. package/assets/images/icons/exclamation-triangle.svg +5 -0
  23. package/assets/images/icons/external-link.svg +6 -0
  24. package/assets/images/icons/eye.svg +4 -0
  25. package/assets/images/icons/flowers.svg +8 -0
  26. package/assets/images/icons/gas-emoji.svg +193 -0
  27. package/assets/images/icons/gas.svg +14 -0
  28. package/assets/images/icons/gift.svg +153 -0
  29. package/assets/images/icons/globe.svg +110 -0
  30. package/assets/images/icons/hamburger.svg +6 -0
  31. package/assets/images/icons/hammer.svg +5 -0
  32. package/assets/images/icons/info-2.svg +12 -0
  33. package/assets/images/icons/instadapp-pro.svg +4 -0
  34. package/assets/images/icons/logout.svg +3 -0
  35. package/assets/images/icons/moon.svg +3 -0
  36. package/assets/images/icons/multi-send.svg +7 -0
  37. package/assets/images/icons/network.svg +13 -0
  38. package/assets/images/icons/options.svg +5 -0
  39. package/assets/images/icons/permit-sign.svg +11 -0
  40. package/assets/images/icons/plus-circle.svg +6 -0
  41. package/assets/images/icons/plus.svg +5 -0
  42. package/assets/images/icons/power-off-bg.svg +24 -0
  43. package/assets/images/icons/power-off.svg +19 -0
  44. package/assets/images/icons/power-on.svg +19 -0
  45. package/assets/images/icons/qr.svg +20 -0
  46. package/assets/images/icons/question-circle.svg +14 -0
  47. package/assets/images/icons/refresh.svg +6 -0
  48. package/assets/images/icons/reject-proposal.svg +6 -0
  49. package/assets/images/icons/search.svg +12 -0
  50. package/assets/images/icons/sun.svg +3 -0
  51. package/assets/images/icons/transfer.svg +5 -0
  52. package/assets/images/icons/trash-2.svg +8 -0
  53. package/assets/images/icons/upgrade.svg +4 -0
  54. package/assets/images/icons/wave.svg +214 -0
  55. package/assets/images/icons/x.svg +5 -0
  56. package/components/ActionLogo.vue +40 -0
  57. package/components/ActionMetadata.vue +81 -0
  58. package/components/AuthorityAvatar.vue +38 -0
  59. package/components/ChainLogo.vue +14 -416
  60. package/components/CopyClipboard.vue +64 -0
  61. package/components/metadata/Bridge.vue +59 -0
  62. package/components/metadata/CrossTransfer.vue +71 -0
  63. package/components/metadata/GasTopup.vue +39 -0
  64. package/components/metadata/Permit2.vue +42 -0
  65. package/components/metadata/Signers.vue +63 -0
  66. package/components/metadata/Swap.vue +74 -0
  67. package/components/metadata/Transfer.vue +50 -0
  68. package/components.d.ts +13 -0
  69. package/contracts/Forwarder.ts +856 -2
  70. package/contracts/MultisigForwarder.ts +859 -0
  71. package/contracts/factories/Forwarder__factory.ts +816 -16
  72. package/contracts/factories/MultisigForwarder__factory.ts +721 -0
  73. package/contracts/factories/index.ts +1 -0
  74. package/contracts/index.ts +2 -0
  75. package/nuxt.config.ts +18 -2
  76. package/package.json +10 -4
  77. package/server/utils/index.ts +2 -0
  78. package/utils/avocado.ts +2 -0
  79. package/utils/bignumber.ts +51 -0
  80. package/utils/formatter.ts +94 -0
  81. package/utils/helper.ts +34 -0
  82. package/utils/metadata.ts +381 -135
  83. package/utils/network.ts +238 -92
  84. package/utils/services.ts +21 -0
  85. package/utils/utils.d.ts +124 -80
  86. package/utils/index.ts +0 -93
package/utils/index.ts DELETED
@@ -1,93 +0,0 @@
1
- import { BigNumber } from "bignumber.js";
2
- import { BigNumber as BN } from "ethers";
3
-
4
- export function shortenHash(hash: string, length: number = 4) {
5
- if (!hash) return;
6
- if (hash.length < 12) return hash;
7
- const beginningChars = hash.startsWith("0x") ? length + 2 : length;
8
- const shortened =
9
- hash.substr(0, beginningChars) + "..." + hash.substr(-length);
10
- return shortened;
11
- }
12
-
13
- export const toBN = (value: BigNumber.Value | BN) =>
14
- new BigNumber(BN.isBigNumber(value) ? value.toString() : value);
15
- export const isZero = (value: BigNumber.Value | BN) => toBN(value).isZero();
16
- export const times = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
17
- toBN(a).times(toBN(b));
18
- export const minus = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
19
- toBN(a).minus(toBN(b));
20
- export const plus = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
21
- toBN(a).plus(toBN(b));
22
- export const lte = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
23
- toBN(a).lte(toBN(b));
24
- export const gte = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
25
- toBN(a).gte(toBN(b));
26
- export const div = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
27
- toBN(a).div(toBN(b));
28
- export const lt = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
29
- toBN(a).lt(toBN(b));
30
- export const gt = (a: BigNumber.Value | BN, b: BigNumber.Value | BN) =>
31
- toBN(a).gt(toBN(b));
32
- export const ensureValue = (value: any) => {
33
- if (!value) return toBN("0");
34
- if (toBN(value).isNaN()) return toBN("0");
35
-
36
- return toBN(value);
37
- };
38
- export const max = (...args: BigNumber.Value[]) => {
39
- return BigNumber.max(...args);
40
- };
41
-
42
- export function onImageError(this: HTMLImageElement) {
43
- const parentElement = this.parentElement;
44
- this.onerror = null;
45
- this.remove();
46
-
47
- if (parentElement) {
48
- parentElement.classList.add("bg-gray-300");
49
- }
50
- }
51
-
52
- const locale = "en-US";
53
-
54
- export function formatUsd(value: any, fractionDigits = 2) {
55
- const formatter = new Intl.NumberFormat(locale, {
56
- style: "currency",
57
- currency: "USD",
58
- minimumFractionDigits: fractionDigits,
59
- maximumFractionDigits: fractionDigits,
60
- });
61
-
62
- return formatter.format(value);
63
- }
64
-
65
- export function cloneDeep<T>(value: T): T {
66
- return JSON.parse(JSON.stringify(value));
67
- }
68
-
69
- export function signedNumber(numb: string | number) {
70
- return new Intl.NumberFormat("en-US", {
71
- signDisplay: "exceptZero",
72
- }).format(toBN(numb).toNumber());
73
- }
74
-
75
- export function formatDecimal(value: string | number, decimalPlaces = 5) {
76
- if (!value) {
77
- value = "0";
78
- }
79
-
80
- return toBN(value).decimalPlaces(decimalPlaces).toFormat();
81
- }
82
-
83
- export function filterArray(array: any, filters: any) {
84
- const filterKeys = Object.keys(filters);
85
- return array.filter((item: any) => {
86
- // validates all filter criteria
87
- return filterKeys.every((key) => {
88
- // ignores non-function predicates
89
- if (typeof filters[key] !== "function") return true;
90
- return filters[key](item[key], item);
91
- });
92
- });
93
- }