From 77dedea8a7f73a534075a904f5bb886f9dc72f10 Mon Sep 17 00:00:00 2001 From: Nik Ho Date: Tue, 12 Mar 2024 00:50:49 +1100 Subject: [PATCH] PresetCurve --- packages/x-client/src/utils/stark/legacy/crypto/constants.ts | 5 ++++- packages/x-client/src/utils/stark/starkCurve.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/x-client/src/utils/stark/legacy/crypto/constants.ts b/packages/x-client/src/utils/stark/legacy/crypto/constants.ts index 6e4af9117f..466c15bc7b 100644 --- a/packages/x-client/src/utils/stark/legacy/crypto/constants.ts +++ b/packages/x-client/src/utils/stark/legacy/crypto/constants.ts @@ -26,9 +26,12 @@ const order = new BN( 16, ); +// eslint-disable-next-line @typescript-eslint/naming-convention +const { PresetCurve }: typeof elliptic.curves = elliptic.curves; + // eslint-disable-next-line new-cap const starkEc = new elliptic.ec( - new elliptic.curves.PresetCurve({ + new PresetCurve({ type: 'short', prime: null, p: prime as any, diff --git a/packages/x-client/src/utils/stark/starkCurve.ts b/packages/x-client/src/utils/stark/starkCurve.ts index a977dec789..b678a3a3dd 100644 --- a/packages/x-client/src/utils/stark/starkCurve.ts +++ b/packages/x-client/src/utils/stark/starkCurve.ts @@ -41,9 +41,12 @@ export const starkEcOrder = new BN( 16, ); +// eslint-disable-next-line @typescript-eslint/naming-convention +const { PresetCurve }: typeof elliptic.curves = elliptic.curves; + // eslint-disable-next-line new-cap export const starkEc = new elliptic.ec( - new elliptic.curves.PresetCurve({ + new PresetCurve({ type: 'short', prime: null, p: '08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001',