From 1bb63d9a3ecec00196f272b39ab2b6fccf07659e Mon Sep 17 00:00:00 2001 From: Asgeir Date: Tue, 14 Nov 2023 15:59:19 +0100 Subject: [PATCH] [delegate-registry-v2] Add optional v1 support --- src/strategies/delegate-registry-v2/examples.json | 1 + src/strategies/delegate-registry-v2/index.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/strategies/delegate-registry-v2/examples.json b/src/strategies/delegate-registry-v2/examples.json index 930f4c022..137011c88 100644 --- a/src/strategies/delegate-registry-v2/examples.json +++ b/src/strategies/delegate-registry-v2/examples.json @@ -5,6 +5,7 @@ "name": "delegate-registry-v2", "params": { "backendUrl": "https://delegate-registry-backend.vercel.app", + "delegationV1VChainIds": [1, 100], "strategies": [ { "name": "erc20-balance-of", diff --git a/src/strategies/delegate-registry-v2/index.ts b/src/strategies/delegate-registry-v2/index.ts index 6304fee96..6567b099e 100644 --- a/src/strategies/delegate-registry-v2/index.ts +++ b/src/strategies/delegate-registry-v2/index.ts @@ -12,6 +12,7 @@ const DEFAULT_BACKEND_URL = 'https://delegate-registry-backend.vercel.app'; type Params = { backendUrl: string; strategies: Strategy[]; + delegationV1VChainIds?: number[]; // add this to include v1 delegations }; /* @@ -42,8 +43,11 @@ export async function strategy( 'Content-Type': 'application/json' }, body: JSON.stringify({ - addresses: addresses, - strategies: options.strategies + spaceParams: { + ...options, + mainChainId: Number(network) + }, + addresses }) } );