+
+
+ Confirm
+
diff --git a/src/components/Tune/TuneButton.vue b/src/components/Tune/TuneButton.vue
new file mode 100644
index 000000000..2de47bd6c
--- /dev/null
+++ b/src/components/Tune/TuneButton.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneButtonSelect.story.vue b/src/components/Tune/TuneButtonSelect.story.vue
new file mode 100644
index 000000000..f325e7130
--- /dev/null
+++ b/src/components/Tune/TuneButtonSelect.story.vue
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/components/Tune/TuneButtonSelect.vue b/src/components/Tune/TuneButtonSelect.vue
new file mode 100644
index 000000000..9631d2931
--- /dev/null
+++ b/src/components/Tune/TuneButtonSelect.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
+ {{ label || definition.title }}
+
+
+
+ {{ modelValue }}
+
+
+
+
+
diff --git a/src/components/Tune/TuneCheckbox.story.vue b/src/components/Tune/TuneCheckbox.story.vue
new file mode 100644
index 000000000..ffe968ac4
--- /dev/null
+++ b/src/components/Tune/TuneCheckbox.story.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneCheckbox.vue b/src/components/Tune/TuneCheckbox.vue
new file mode 100644
index 000000000..96b18af19
--- /dev/null
+++ b/src/components/Tune/TuneCheckbox.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+ {{ hint || definition.description }}
+
+
+
+
+
diff --git a/src/components/Tune/TuneCombobox.story.vue b/src/components/Tune/TuneCombobox.story.vue
new file mode 100644
index 000000000..9ebd64e0c
--- /dev/null
+++ b/src/components/Tune/TuneCombobox.story.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneCombobox.vue b/src/components/Tune/TuneCombobox.vue
new file mode 100644
index 000000000..c869379a3
--- /dev/null
+++ b/src/components/Tune/TuneCombobox.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+ {{ label || definition.title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneComboboxMultiple.story.vue b/src/components/Tune/TuneComboboxMultiple.story.vue
new file mode 100644
index 000000000..e56e5192e
--- /dev/null
+++ b/src/components/Tune/TuneComboboxMultiple.story.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneComboboxMultiple.vue b/src/components/Tune/TuneComboboxMultiple.vue
new file mode 100644
index 000000000..349b87c68
--- /dev/null
+++ b/src/components/Tune/TuneComboboxMultiple.vue
@@ -0,0 +1,157 @@
+
+
+
+
+
+ {{ label || definition.title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneErrorInput.story.vue b/src/components/Tune/TuneErrorInput.story.vue
new file mode 100644
index 000000000..a57a936a9
--- /dev/null
+++ b/src/components/Tune/TuneErrorInput.story.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneErrorInput.vue b/src/components/Tune/TuneErrorInput.vue
new file mode 100644
index 000000000..4bb0b19b6
--- /dev/null
+++ b/src/components/Tune/TuneErrorInput.vue
@@ -0,0 +1,11 @@
+
+
+
+
+ {{ error }}
+
+
diff --git a/src/components/Tune/TuneForm.story.vue b/src/components/Tune/TuneForm.story.vue
new file mode 100644
index 000000000..9f2140e4c
--- /dev/null
+++ b/src/components/Tune/TuneForm.story.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+ Show errors
+
+
+
diff --git a/src/components/Tune/TuneForm.vue b/src/components/Tune/TuneForm.vue
new file mode 100644
index 000000000..bfe54edd3
--- /dev/null
+++ b/src/components/Tune/TuneForm.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneIconHint.story.vue b/src/components/Tune/TuneIconHint.story.vue
new file mode 100644
index 000000000..335d2da5a
--- /dev/null
+++ b/src/components/Tune/TuneIconHint.story.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneIconHint.vue b/src/components/Tune/TuneIconHint.vue
new file mode 100644
index 000000000..aa054952d
--- /dev/null
+++ b/src/components/Tune/TuneIconHint.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneInput.story.vue b/src/components/Tune/TuneInput.story.vue
new file mode 100644
index 000000000..087f829b5
--- /dev/null
+++ b/src/components/Tune/TuneInput.story.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneInput.vue b/src/components/Tune/TuneInput.vue
new file mode 100644
index 000000000..17f0d401a
--- /dev/null
+++ b/src/components/Tune/TuneInput.vue
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+ {{ label || definition.title }}
+
+
+
+
+
diff --git a/src/components/Tune/TuneInputDuration.story.vue b/src/components/Tune/TuneInputDuration.story.vue
new file mode 100644
index 000000000..c64761ba4
--- /dev/null
+++ b/src/components/Tune/TuneInputDuration.story.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneInputDuration.vue b/src/components/Tune/TuneInputDuration.vue
new file mode 100644
index 000000000..51ba42812
--- /dev/null
+++ b/src/components/Tune/TuneInputDuration.vue
@@ -0,0 +1,135 @@
+
+
+
+
+
+ {{ label || definition?.title }}
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneInputSocial.vue b/src/components/Tune/TuneInputSocial.vue
new file mode 100644
index 000000000..68493ba11
--- /dev/null
+++ b/src/components/Tune/TuneInputSocial.vue
@@ -0,0 +1,44 @@
+
+
+
+ emit('update:modelValue', value)"
+ >
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneInputUrl.vue b/src/components/Tune/TuneInputUrl.vue
new file mode 100644
index 000000000..62d2849b5
--- /dev/null
+++ b/src/components/Tune/TuneInputUrl.vue
@@ -0,0 +1,42 @@
+
+
+
+ emit('update:modelValue', input)"
+ >
+
+
+
+
+
diff --git a/src/components/Tune/TuneLabelInput.story.vue b/src/components/Tune/TuneLabelInput.story.vue
new file mode 100644
index 000000000..dfffc09e0
--- /dev/null
+++ b/src/components/Tune/TuneLabelInput.story.vue
@@ -0,0 +1,12 @@
+
+
+
+
+
+ Label
+
+
+
diff --git a/src/components/Tune/TuneLabelInput.vue b/src/components/Tune/TuneLabelInput.vue
new file mode 100644
index 000000000..c494640d7
--- /dev/null
+++ b/src/components/Tune/TuneLabelInput.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+ {{ sublabel }}
+
+
+
diff --git a/src/components/Tune/TuneListbox.story.vue b/src/components/Tune/TuneListbox.story.vue
new file mode 100644
index 000000000..3bce8875d
--- /dev/null
+++ b/src/components/Tune/TuneListbox.story.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneListbox.vue b/src/components/Tune/TuneListbox.vue
new file mode 100644
index 000000000..f4a2c6239
--- /dev/null
+++ b/src/components/Tune/TuneListbox.vue
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+ {{ label || definition?.title }}
+
+
+
+
+
+
+
+ {{ selectedItem?.name || selectedItem?.value }}
+
+ Select
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item?.name || item.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneListboxMultiple.story.vue b/src/components/Tune/TuneListboxMultiple.story.vue
new file mode 100644
index 000000000..16cf1f586
--- /dev/null
+++ b/src/components/Tune/TuneListboxMultiple.story.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneListboxMultiple.vue b/src/components/Tune/TuneListboxMultiple.vue
new file mode 100644
index 000000000..16736f3fa
--- /dev/null
+++ b/src/components/Tune/TuneListboxMultiple.vue
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+ {{ label || definition?.title }}
+
+
+
+
+
+ {{ placeholder || definition?.examples?.[0] }}
+
+
+
+
+
+ {{ selectedItems.map(item => item?.name || item.value).join(', ') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item?.name || item.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneLoadingSpinner.story.vue b/src/components/Tune/TuneLoadingSpinner.story.vue
new file mode 100644
index 000000000..c1d568388
--- /dev/null
+++ b/src/components/Tune/TuneLoadingSpinner.story.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneLoadingSpinner.vue b/src/components/Tune/TuneLoadingSpinner.vue
new file mode 100644
index 000000000..818b31f28
--- /dev/null
+++ b/src/components/Tune/TuneLoadingSpinner.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneMenu.story.vue b/src/components/Tune/TuneMenu.story.vue
new file mode 100644
index 000000000..9b2770ab9
--- /dev/null
+++ b/src/components/Tune/TuneMenu.story.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneMenu.vue b/src/components/Tune/TuneMenu.vue
new file mode 100644
index 000000000..d38009c18
--- /dev/null
+++ b/src/components/Tune/TuneMenu.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+ {{ selected }}
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneModal.story.vue b/src/components/Tune/TuneModal.story.vue
new file mode 100644
index 000000000..2a3633a89
--- /dev/null
+++ b/src/components/Tune/TuneModal.story.vue
@@ -0,0 +1,38 @@
+
+
+
+
+ Open modal
+
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio illo
+ expedita libero, eaque iste aliquam praesentium necessitatibus ipsum
+ impedit hic temporibus officia omnis deleniti, at sint, doloremque atque
+ sit id?
+
+
+
+
+
+# TuneModal
+
+The TuneModal component provides a modal dialog box that appears on top of the current page, dimming the background content and prompting the user for an action. This component uses the @headlessui/vue package for creating accessible dialogs and transitions.
+
+### Props
+
+- **open**: a boolean value that determines whether the modal should be shown or hidden. When true, the modal is displayed; otherwise, it is hidden. This property is required.
+- **title**: a string value that specifies the title of the modal dialog box.
+
+### Slots
+
+The TuneModal component provides two slots for inserting content:
+
+- **Default slot**: Use this slot to add the main content of the modal dialog box. You can include any valid HTML markup, such as text, images, forms, or other components.
+
+- **Footer slot**: Use this slot to add any additional buttons, links, or other UI elements to the bottom of the modal dialog box.
+
+### Emits
+
+- **close**: an event emitted when the user closes the modal dialog box. This event does not contain any data.
+
diff --git a/src/components/Tune/TuneModal.vue b/src/components/Tune/TuneModal.vue
new file mode 100644
index 000000000..3455ddd88
--- /dev/null
+++ b/src/components/Tune/TuneModal.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Close
+
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TunePopover.story.vue b/src/components/Tune/TunePopover.story.vue
new file mode 100644
index 000000000..b91d41b28
--- /dev/null
+++ b/src/components/Tune/TunePopover.story.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet
+ aperiam vitae eveniet vel ex praesentium nam quis deserunt porro
+ harum. Magni maiores ipsa ea? Rem, quidem. Quas sunt ducimus rerum.
+
+
+
+
+
+
diff --git a/src/components/Tune/TunePopover.vue b/src/components/Tune/TunePopover.vue
new file mode 100644
index 000000000..ef9cb79dc
--- /dev/null
+++ b/src/components/Tune/TunePopover.vue
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneRadio.story.vue b/src/components/Tune/TuneRadio.story.vue
new file mode 100644
index 000000000..a58e3e13e
--- /dev/null
+++ b/src/components/Tune/TuneRadio.story.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneRadio.vue b/src/components/Tune/TuneRadio.vue
new file mode 100644
index 000000000..a872301df
--- /dev/null
+++ b/src/components/Tune/TuneRadio.vue
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+ {{ hint || definition.description }}
+
+
+
+
+
diff --git a/src/components/Tune/TuneSelect.vue b/src/components/Tune/TuneSelect.vue
new file mode 100644
index 000000000..8d4cecf3a
--- /dev/null
+++ b/src/components/Tune/TuneSelect.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+ {{ item.label }}
+
+
+
diff --git a/src/components/Tune/TuneSwitch.story.vue b/src/components/Tune/TuneSwitch.story.vue
new file mode 100644
index 000000000..c044d4afc
--- /dev/null
+++ b/src/components/Tune/TuneSwitch.story.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneSwitch.vue b/src/components/Tune/TuneSwitch.vue
new file mode 100644
index 000000000..eef25202a
--- /dev/null
+++ b/src/components/Tune/TuneSwitch.vue
@@ -0,0 +1,94 @@
+
+
+
+
+
emit('update:modelValue', value)"
+ >
+
+ {{ label || definition?.title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ label || definition?.title }}
+
+
+
diff --git a/src/components/Tune/TuneTag.story.vue b/src/components/Tune/TuneTag.story.vue
new file mode 100644
index 000000000..790c7360d
--- /dev/null
+++ b/src/components/Tune/TuneTag.story.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneTag.vue b/src/components/Tune/TuneTag.vue
new file mode 100644
index 000000000..affe14c59
--- /dev/null
+++ b/src/components/Tune/TuneTag.vue
@@ -0,0 +1,11 @@
+
+
+
+
+ {{ label }}
+
+
diff --git a/src/components/Tune/TuneTextarea.story.vue b/src/components/Tune/TuneTextarea.story.vue
new file mode 100644
index 000000000..9a4033801
--- /dev/null
+++ b/src/components/Tune/TuneTextarea.story.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneTextarea.vue b/src/components/Tune/TuneTextarea.vue
new file mode 100644
index 000000000..e769dae11
--- /dev/null
+++ b/src/components/Tune/TuneTextarea.vue
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+ {{ label || definition?.title }}
+
+
+
+
+
diff --git a/src/components/Tune/TuneTextareaArray.story.vue b/src/components/Tune/TuneTextareaArray.story.vue
new file mode 100644
index 000000000..8e7a5c788
--- /dev/null
+++ b/src/components/Tune/TuneTextareaArray.story.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneTextareaArray.vue b/src/components/Tune/TuneTextareaArray.vue
new file mode 100644
index 000000000..ff4bb84c2
--- /dev/null
+++ b/src/components/Tune/TuneTextareaArray.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
diff --git a/src/components/Tune/TuneTextareaJson.story.vue b/src/components/Tune/TuneTextareaJson.story.vue
new file mode 100644
index 000000000..6d0214a49
--- /dev/null
+++ b/src/components/Tune/TuneTextareaJson.story.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/src/components/Tune/TuneTextareaJson.vue b/src/components/Tune/TuneTextareaJson.vue
new file mode 100644
index 000000000..18624a6a6
--- /dev/null
+++ b/src/components/Tune/TuneTextareaJson.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
diff --git a/src/components/Tune/_Form/FormArray.vue b/src/components/Tune/_Form/FormArray.vue
new file mode 100644
index 000000000..169fb0533
--- /dev/null
+++ b/src/components/Tune/_Form/FormArray.vue
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ definition?.title }}
+
+
+
Add
+
+
diff --git a/src/components/Tune/_Form/FormBoolean.vue b/src/components/Tune/_Form/FormBoolean.vue
new file mode 100644
index 000000000..1596b96aa
--- /dev/null
+++ b/src/components/Tune/_Form/FormBoolean.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/src/components/Tune/_Form/FormNumber.vue b/src/components/Tune/_Form/FormNumber.vue
new file mode 100644
index 000000000..2753209c8
--- /dev/null
+++ b/src/components/Tune/_Form/FormNumber.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
diff --git a/src/components/Tune/_Form/FormString.vue b/src/components/Tune/_Form/FormString.vue
new file mode 100644
index 000000000..e4f892b0d
--- /dev/null
+++ b/src/components/Tune/_Form/FormString.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
diff --git a/src/components/Ui/Collapsible.vue b/src/components/Ui/UiCollapsible.vue
similarity index 100%
rename from src/components/Ui/Collapsible.vue
rename to src/components/Ui/UiCollapsible.vue
diff --git a/src/components/Ui/CollapsibleContent.vue b/src/components/Ui/UiCollapsibleContent.vue
similarity index 100%
rename from src/components/Ui/CollapsibleContent.vue
rename to src/components/Ui/UiCollapsibleContent.vue
diff --git a/src/components/Ui/CollapsibleText.vue b/src/components/Ui/UiCollapsibleText.vue
similarity index 100%
rename from src/components/Ui/CollapsibleText.vue
rename to src/components/Ui/UiCollapsibleText.vue
diff --git a/src/components/Ui/Input.vue b/src/components/Ui/UiInput.vue
similarity index 100%
rename from src/components/Ui/Input.vue
rename to src/components/Ui/UiInput.vue
diff --git a/src/components/Ui/Select.vue b/src/components/Ui/UiSelect.vue
similarity index 100%
rename from src/components/Ui/Select.vue
rename to src/components/Ui/UiSelect.vue
diff --git a/src/composables/useNetworksFilter.ts b/src/composables/useNetworksFilter.ts
index 664bcefa0..e3242c978 100644
--- a/src/composables/useNetworksFilter.ts
+++ b/src/composables/useNetworksFilter.ts
@@ -30,16 +30,7 @@ export function useNetworksFilter() {
(a, b) => (a.key === q ? -1 : b.key === q ? 1 : 0)
);
- const networksArrayTestnetworksLast = networksArrayByExactKeyMatch.sort(
- (a, b) =>
- a.name.toLowerCase().includes('testnet')
- ? 1
- : b.name.toLowerCase().includes('testnet')
- ? -1
- : 0
- );
-
- return networksArrayTestnetworksLast;
+ return networksArrayByExactKeyMatch;
};
const { apolloQuery } = useApolloQuery();
diff --git a/src/composables/useProposalVotes.ts b/src/composables/useProposalVotes.ts
index 60b212278..6ea84d6ac 100644
--- a/src/composables/useProposalVotes.ts
+++ b/src/composables/useProposalVotes.ts
@@ -32,7 +32,7 @@ export function useProposalVotes(proposal: Proposal, loadBy = 6) {
});
async function _fetchVotes(queryParams: QueryParams, skip = 0) {
- return apolloQuery(
+ const response = await apolloQuery(
{
query: VOTES_QUERY,
variables: {
@@ -47,10 +47,13 @@ export function useProposalVotes(proposal: Proposal, loadBy = 6) {
},
'votes'
);
+
+ loadProfiles(response.map(vote => vote.voter));
+ return response;
}
async function _fetchVote(queryParams: QueryParams) {
- return apolloQuery(
+ const response = await apolloQuery(
{
query: VOTES_QUERY,
variables: {
@@ -60,6 +63,9 @@ export function useProposalVotes(proposal: Proposal, loadBy = 6) {
},
'votes'
);
+
+ loadProfiles(response.map(vote => vote.voter));
+ return response;
}
function formatProposalVotes(votes: Vote[]) {
@@ -77,7 +83,6 @@ export function useProposalVotes(proposal: Proposal, loadBy = 6) {
loadingVotes.value = true;
try {
const response = await _fetchVotes(filter);
-
votes.value = formatProposalVotes(response);
} catch (e) {
console.log(e);
@@ -107,7 +112,6 @@ export function useProposalVotes(proposal: Proposal, loadBy = 6) {
loadingMoreVotes.value = true;
try {
const response = await _fetchVotes(filter, votes.value.length);
-
votes.value = votes.value.concat(formatProposalVotes(response));
} catch (e) {
console.log(e);
@@ -125,10 +129,6 @@ export function useProposalVotes(proposal: Proposal, loadBy = 6) {
}
}
- watch(userPrioritizedVotes, () => {
- loadProfiles(userPrioritizedVotes.value.map(vote => vote.voter));
- });
-
return {
votes,
userPrioritizedVotes,
diff --git a/src/composables/useResolveName.ts b/src/composables/useResolveName.ts
index 957dc776b..1d0b8c7e4 100644
--- a/src/composables/useResolveName.ts
+++ b/src/composables/useResolveName.ts
@@ -1,9 +1,7 @@
import { isAddress } from '@ethersproject/address';
-import { resolveEns, resolveLens } from '@/helpers/utils';
+import { resolveHandle } from '@/helpers/utils';
export function useResolveName() {
- const { isValidEnsDomain } = useEns();
-
async function resolveName(value: string): Promise
{
let address = value;
@@ -11,11 +9,7 @@ export function useResolveName() {
return address.toLowerCase();
}
- if (isValidEnsDomain(value)) {
- address = await resolveEns(value);
- } else if (value?.endsWith('.lens')) {
- address = await resolveLens(value);
- }
+ address = await resolveHandle(value);
return isAddress(address) ? address.toLowerCase() : null;
}
diff --git a/src/helpers/constants.ts b/src/helpers/constants.ts
index 4ba2a3d4e..6b5de9d8d 100644
--- a/src/helpers/constants.ts
+++ b/src/helpers/constants.ts
@@ -10,3 +10,5 @@ export const SNAPSHOT_BREAKPOINTS = {
xl: '1280px',
'2xl': '1536px'
};
+
+export const KNOWN_HOSTS = ['app.safe.global', 'pilot.gnosisguild.org'];
diff --git a/src/helpers/lensResolver.ts b/src/helpers/lensResolver.ts
deleted file mode 100644
index 57ec415d5..000000000
--- a/src/helpers/lensResolver.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-import getProvider from '@snapshot-labs/snapshot.js/src/utils/provider';
-import Multicaller from '@snapshot-labs/snapshot.js/src/utils/multicaller';
-import { getAddress } from '@ethersproject/address';
-import { BigNumber } from '@ethersproject/bignumber';
-
-type Handle = string;
-type Address = string;
-type ProfileId = number;
-
-const network = '137';
-const abi: string[] = [
- 'function balanceOf(address owner) view returns (uint256)',
- 'function tokenOfOwnerByIndex(address owner, uint256 index) view returns (uint256)',
- 'function getHandle(uint256 profileId) view returns (string)'
-];
-const contractAddress = '0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d';
-
-class LensResolver {
- _multicaller!: Multicaller;
-
- get multi() {
- if (!this._multicaller) {
- const broviderUrl = import.meta.env.VITE_BROVIDER_URL;
- const provider = getProvider(network, { broviderUrl });
- this._multicaller = new Multicaller(network, provider, abi);
- }
- return this._multicaller;
- }
-
- async getAvailableHandleMapping(addresses: Address[]): Promise {
- if (!addresses.length) return [];
- addresses.forEach(address => {
- address = getAddress(address).toString();
- this.multi.call(address, contractAddress, 'balanceOf', [address]);
- });
-
- const balances: Record = await this.multi.execute();
- return Object.entries(balances)
- .map(([addr, bal]): [Address, number] => [addr, bal.toNumber()])
- .filter(([addr, bal]) => !!bal && addr !== 'undefined')
- .map(([addr]) => addr);
- }
-
- async getTokensMapping(
- addresses: Address[]
- ): Promise<[Address, ProfileId][]> {
- if (!addresses.length) return [];
- addresses.forEach(address => {
- address = getAddress(address).toString();
- this.multi.call(address, contractAddress, 'tokenOfOwnerByIndex', [
- address,
- 0
- ]);
- });
-
- const tokens: Record = await this.multi.execute();
-
- return Object.entries(tokens).map(([address, token]) => [
- address,
- token.toNumber()
- ]);
- }
-
- async getHandleMapping(
- tokenMapping: [Address, ProfileId][]
- ): Promise> {
- if (!tokenMapping.length) return {};
- tokenMapping.forEach(([address, token]) => {
- this.multi.call(address, contractAddress, 'getHandle', [token]);
- });
-
- const handles: Record = await this.multi.execute();
-
- return Object.entries(handles)
- .filter(([address]) => address !== 'undefined')
- .map(([address, handle]) => [address, handle.toString()])
- .reduce((acc, [address, handle]) => {
- acc[address] = handle;
- return acc;
- }, {});
- }
-
- async resolveAddresses(
- addresses: Address[]
- ): Promise> {
- const addressesWithHandles =
- await this.getAvailableHandleMapping(addresses);
- const tokenMapping = await this.getTokensMapping(addressesWithHandles);
- return this.getHandleMapping(tokenMapping);
- }
-}
-
-export const resolveLensAddresses = async (addresses: Address[]) => {
- try {
- const resolver = new LensResolver();
- return await resolver.resolveAddresses(addresses);
- } catch (e) {
- console.log(e);
- return {};
- }
-};
diff --git a/src/helpers/queries.ts b/src/helpers/queries.ts
index 2560e80b2..17be5f908 100644
--- a/src/helpers/queries.ts
+++ b/src/helpers/queries.ts
@@ -379,6 +379,7 @@ export const SPACES_RANKING_QUERY = gql`
items {
id
name
+ avatar
private
verified
categories
diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts
index f07d3cc75..e72e9a3f7 100644
--- a/src/helpers/utils.ts
+++ b/src/helpers/utils.ts
@@ -4,7 +4,6 @@ import { BigNumber } from '@ethersproject/bignumber';
import networks from '@snapshot-labs/snapshot.js/src/networks.json';
import voting from '@snapshot-labs/snapshot.js/src/voting';
import { getUrl } from '@snapshot-labs/snapshot.js/src/utils';
-import getProvider from '@snapshot-labs/snapshot.js/src/utils/provider';
export function shortenAddress(str = '') {
return `${str.slice(0, 6)}...${str.slice(str.length - 4)}`;
@@ -121,47 +120,19 @@ export async function clearStampCache(id: string, type = 'space') {
return await fetch(`https://cdn.stamp.fyi/clear/avatar/eth:${id}`);
}
-export async function resolveEns(handle: string) {
+export async function resolveHandle(handle: string) {
try {
- const broviderUrl = import.meta.env.VITE_BROVIDER_URL;
- const provider = getProvider('1', { broviderUrl });
- const addressResolved = await provider.resolveName(handle);
- if (!addressResolved) throw new Error('Invalid ENS name');
- return addressResolved;
- } catch (error) {
- console.error('Error in resolveEns:', error);
- return null;
- }
-}
-
-export async function resolveLens(handle: string) {
- try {
- const response = await fetch('https://api.lens.dev/', {
+ const results = await fetch(import.meta.env.VITE_STAMP_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
- body: JSON.stringify({
- query: `
- query Profiles {
- profiles(request: { handles: ["${handle}"], limit: 1 }) {
- items {
- ownedBy
- }
- }
- }
- `
- })
+ body: JSON.stringify({ method: 'resolve_names', params: [handle] })
});
- if (!response.ok) {
- throw new Error(`HTTP error ${response.status}`);
- }
-
- const result = await response.json();
- return result.data?.profiles?.items?.[0]?.ownedBy;
- } catch (error) {
- console.error('Error in resolveLens:', error);
+ return (await results.json()).result?.[handle];
+ } catch (e) {
+ console.error('Error resolving handle:', handle, e);
return null;
}
}
@@ -169,16 +140,27 @@ export async function resolveLens(handle: string) {
export async function lookupAddress(
addresses: string[]
): Promise> {
+ if (addresses.length === 0) {
+ return {};
+ }
+
try {
- const results = await fetch(import.meta.env.VITE_STAMP_URL, {
+ const response = await fetch(import.meta.env.VITE_STAMP_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
- body: JSON.stringify({ method: 'lookup_addresses', params: addresses })
+ body: JSON.stringify({
+ method: 'lookup_addresses',
+ params: addresses.slice(0, 50)
+ })
});
- return (await results.json()).result;
+ const results = (await response.json()).result;
+
+ return Object.fromEntries(
+ addresses.map(address => [address, results[address] || ''])
+ );
} catch (e) {
console.error('Error resolving addresses:', e);
return {};
diff --git a/src/helpers/validation.ts b/src/helpers/validation.ts
index 5f72b1612..814bba601 100644
--- a/src/helpers/validation.ts
+++ b/src/helpers/validation.ts
@@ -6,9 +6,11 @@ import { isAddress } from '@ethersproject/address';
import networks from '@snapshot-labs/snapshot.js/src/networks.json';
const networksIds = Object.keys(networks);
-// const mainnetNetworkIds = Object.keys(networks).filter(
-// id => !networks[id].testnet
-// );
+const mainnetNetworkIds = Object.keys(networks).filter(
+ id => !networks[id].testnet
+);
+
+const { env } = useApp();
function getErrorMessage(errorObject: ErrorObject): string {
if (!errorObject.message) return 'Invalid field.';
@@ -85,12 +87,11 @@ export function validateForm(
ajv.addKeyword({
keyword: 'snapshotNetwork',
validate: function (schema, data) {
- // const snapshotEnv = 'default';
- // if (snapshotEnv === 'production') return mainnetNetworkIds.includes(data);
+ if (env === 'production') return mainnetNetworkIds.includes(data);
return networksIds.includes(data);
},
error: {
- message: 'not valid network'
+ message: 'testnet not allowed'
}
});
@@ -131,6 +132,7 @@ function transformAjvErrors(ajv: Ajv): ValidationErrorOutput {
output,
path
);
+
targetObject[path[path.length - 1]] = getErrorMessage(error);
return output;
},
diff --git a/src/helpers/vitePlugins.ts b/src/helpers/vitePlugins.ts
new file mode 100644
index 000000000..85d582e22
--- /dev/null
+++ b/src/helpers/vitePlugins.ts
@@ -0,0 +1,51 @@
+import vue from '@vitejs/plugin-vue';
+import ViteComponents from 'unplugin-vue-components/vite';
+import visualizer from 'rollup-plugin-visualizer';
+import Icons from 'unplugin-icons/vite';
+import IconsResolver from 'unplugin-icons/resolver';
+import { FileSystemIconLoader } from 'unplugin-icons/loaders';
+import { sentryVitePlugin } from '@sentry/vite-plugin';
+import AutoImport from 'unplugin-auto-import/vite';
+
+export const getPlugins = () => [
+ vue({ reactivityTransform: true }),
+ AutoImport({
+ dts: true,
+ imports: ['vue', 'vue-router'],
+ dirs: ['./src/composables'],
+ eslintrc: {
+ enabled: true
+ }
+ }),
+ ViteComponents({
+ globs: ['src/components/**/*.vue', '!src/components/Tune/_Form/*.vue'],
+ resolvers: [
+ IconsResolver({
+ customCollections: ['s'],
+ alias: {
+ ho: 'heroicons-outline'
+ }
+ })
+ ]
+ }),
+ visualizer({
+ filename: './dist/stats.html',
+ template: 'sunburst',
+ gzipSize: true
+ }),
+ Icons({
+ compiler: 'vue3',
+ customCollections: {
+ s: FileSystemIconLoader('./src/assets/icons', svg =>
+ svg.replace(/^ (env === 'production' ? !n.testnet : true);
const items = computed(() => {
const q = route.query.q || '';
if (isStrategies.value) return filterStrategies(q);
- if (isNetworks.value) return filterNetworks(q);
+ if (isNetworks.value) return filterNetworks(q).filter(onlyMainnetNetworks);
if (isPlugins.value) return filterPlugins(q);
return [];
});
diff --git a/src/views/SpaceSettings.vue b/src/views/SpaceSettings.vue
index e7e3c75b8..d4c6d8255 100644
--- a/src/views/SpaceSettings.vue
+++ b/src/views/SpaceSettings.vue
@@ -113,7 +113,7 @@ const settingsPages = computed(() => [
async function handleDelete() {
modalDeleteSpaceConfirmation.value = '';
- const result = await send(props.space, 'delete-space', null);
+ const result = await send(props.space, 'delete-space', {});
console.log(':handleDelete result', result);
if (result && result.id) {
@@ -289,6 +289,7 @@ onBeforeRouteLeave(async () => {
context="settings"
:space="space"
:is-view-only="isViewOnly"
+ :error="validationErrors.treasuries"
/>
import path from 'path';
-import { defineConfig } from 'vite';
-import vue from '@vitejs/plugin-vue';
-import ViteComponents from 'unplugin-vue-components/vite';
-import visualizer from 'rollup-plugin-visualizer';
-import Icons from 'unplugin-icons/vite';
-import IconsResolver from 'unplugin-icons/resolver';
-import { FileSystemIconLoader } from 'unplugin-icons/loaders';
-import { sentryVitePlugin } from '@sentry/vite-plugin';
-import AutoImport from 'unplugin-auto-import/vite';
+import { defineConfig } from 'vitest/config';
+import { getPlugins } from './src/helpers/vitePlugins';
export default defineConfig({
define: {
'process.env': process.env
},
- plugins: [
- vue({ reactivityTransform: true }),
- AutoImport({
- dts: true,
- imports: ['vue', 'vue-router'],
- dirs: ['./src/composables'],
- eslintrc: {
- enabled: true
- }
- }),
- ViteComponents({
- directoryAsNamespace: true,
- resolvers: [
- IconsResolver({
- customCollections: ['s'],
- alias: {
- ho: 'heroicons-outline'
- }
- }),
- componentName => {
- if (componentName.startsWith('Tune'))
- return { name: componentName, from: '@snapshot-labs/tune' };
- }
- ]
- }),
- visualizer({
- filename: './dist/stats.html',
- template: 'sunburst',
- gzipSize: true
- }),
- Icons({
- compiler: 'vue3',
- customCollections: {
- // key as the collection name
- s: FileSystemIconLoader('./src/assets/icons', svg =>
- svg.replace(/^=0.13.0, vue-demi@>=0.14.6, vue-demi@^0.14.6:
resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.6.tgz#dc706582851dc1cdc17a0054f4fec2eb6df74c92"
integrity sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==
-vue-demi@^0.13.11:
- version "0.13.11"
- resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.13.11.tgz#7d90369bdae8974d87b1973564ad390182410d99"
- integrity sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==
-
vue-eslint-parser@^7.10.0:
version "7.11.0"
resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-7.11.0.tgz#214b5dea961007fcffb2ee65b8912307628d0daf"
@@ -7620,14 +7579,14 @@ vue-router@^4.2.5:
dependencies:
"@vue/devtools-api" "^6.5.0"
-vue-tippy@^6.0.0, vue-tippy@^6.3.1:
+vue-tippy@^6.3.1:
version "6.3.1"
resolved "https://registry.yarnpkg.com/vue-tippy/-/vue-tippy-6.3.1.tgz#8d0e03294dad862d71f3a90e486721720cff832c"
integrity sha512-U2jpGwmwg+u/a36/XDnGlOF+W944xHGlVELsrTNWmZ0nUi2E/VW0c/buBkzntFUwRh6BHwFWcKL8BHcyG2mogQ==
dependencies:
tippy.js "^6.3.7"
-vue@^3.2.47, vue@^3.3.8:
+vue@^3.3.8:
version "3.3.8"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.8.tgz#532ff071af24f6a69e5ecc53a66858a9ee874ffc"
integrity sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w==