diff --git a/src/helpers/interfaces.ts b/src/helpers/interfaces.ts index fc39df55007..a59c8ac3cb3 100644 --- a/src/helpers/interfaces.ts +++ b/src/helpers/interfaces.ts @@ -18,6 +18,7 @@ interface StrategyExample { network: string; addresses: string[]; snapshot: number; + space?: string; } interface StrategySchema { diff --git a/src/views/PlaygroundView.vue b/src/views/PlaygroundView.vue index d117daa3d17..2e4a14dc5ad 100644 --- a/src/views/PlaygroundView.vue +++ b/src/views/PlaygroundView.vue @@ -34,11 +34,13 @@ const scores = ref(null); const searchInput = ref(''); const form = ref<{ params: Record; + space: string; network: string; snapshot: string; addresses: string[]; }>({ params: {}, + space: '', network: '1', snapshot: '', addresses: [] @@ -67,7 +69,7 @@ const scoresWithZeroBalanceAddresses = computed(() => { const strategyExample = computed(() => { if (queryParams.query) { try { - const { params, network, snapshot, addresses } = decodeJson( + const { params, network, snapshot, addresses, space } = decodeJson( queryParams.query ); return { @@ -75,6 +77,7 @@ const strategyExample = computed(() => { addresses: addresses || extendedStrategy.value?.examples?.[0].addresses, network, snapshot, + space, strategy: { params } }; } catch (e) { @@ -97,7 +100,7 @@ async function loadScores() { params: form.value.params }; scores.value = await getScores( - '', + form.value.space, [strategyParams], form.value.network, form.value.addresses, @@ -155,6 +158,7 @@ watch( () => { form.value.params = strategyExample.value?.strategy.params ?? defaultParams; form.value.network = strategyExample.value?.network ?? '1'; + form.value.space = strategyExample.value?.space ?? ''; form.value.addresses = strategyExample.value?.addresses ?? []; }, { immediate: true } @@ -221,6 +225,11 @@ function handleNetworkSelect(value) { :title="$t('snapshot')" @update:model-value="handleURLUpdate" /> +