From 606b96bd5f0e82733b5394c52ec8b10c7ded7ce3 Mon Sep 17 00:00:00 2001 From: alessandrokonrad Date: Wed, 29 Jan 2025 13:50:15 +0100 Subject: [PATCH] allow only positive index --- src/lucid/lucid.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lucid/lucid.ts b/src/lucid/lucid.ts index 34640666..e81675b5 100644 --- a/src/lucid/lucid.ts +++ b/src/lucid/lucid.ts @@ -401,6 +401,7 @@ export class Lucid { }, ): Lucid { const index = options?.index || 0; + if (index < 0) throw new Error("Index cannot be negative"); const paymentDetails = Crypto.seedToDetails(seed, index, "Payment"); const delegationDetails = options?.addressType === "Enterprise" ? null