@paradex/sdk 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,9 @@ export type { SignerInterface as Signer, TypedData, Signature };
5
5
  export declare function buildStarknetStarkKeyTypedData(starknetChainId: string): TypedData;
6
6
  type StarknetKeypair = [string, string];
7
7
  /**
8
- * This function borrows from starkware-crypto-utils's implementation
9
- * of `getPrivateKeyFromEthSignature()` where a deterministic
10
- * signature R segment, is hex encoded as the `keySeed` for
11
- * `grindKey()` along the Stark curve.
8
+ * Mirrors `getPrivateKeyFromEthSignature()` in `./key-derivation.ts`:
9
+ * the deterministic signature R segment, hex encoded, is the `keySeed`
10
+ * for `grindKey()` along the Stark curve.
12
11
  */
13
12
  export declare function getStarkKeypairFromStarknetSignature(signatureR: string): Promise<StarknetKeypair>;
14
13
  export declare function getAccountSupport(account: Starknet.AccountInterface, starknetProvider: Starknet.ProviderInterface): Promise<AccountSupport>;
@@ -1,6 +1,6 @@
1
- import { keyDerivation } from '@starkware-industries/starkware-crypto-utils';
2
1
  import * as Starknet from 'starknet';
3
2
  import { STARKNET_MAINNET_CHAIN_ID } from './constants.js';
3
+ import * as keyDerivation from './key-derivation.js';
4
4
  import { AccountSupport } from './starknet-account-support.js';
5
5
  export function buildStarknetStarkKeyTypedData(starknetChainId) {
6
6
  return {
@@ -24,18 +24,13 @@ export function buildStarknetStarkKeyTypedData(starknetChainId) {
24
24
  };
25
25
  }
26
26
  /**
27
- * This function borrows from starkware-crypto-utils's implementation
28
- * of `getPrivateKeyFromEthSignature()` where a deterministic
29
- * signature R segment, is hex encoded as the `keySeed` for
30
- * `grindKey()` along the Stark curve.
27
+ * Mirrors `getPrivateKeyFromEthSignature()` in `./key-derivation.ts`:
28
+ * the deterministic signature R segment, hex encoded, is the `keySeed`
29
+ * for `grindKey()` along the Stark curve.
31
30
  */
32
31
  export async function getStarkKeypairFromStarknetSignature(signatureR) {
33
- const curve = keyDerivation.StarkExEc;
34
- if (curve == null) {
35
- throw new Error('StarkExEc curve is not defined');
36
- }
37
32
  const r = signatureR.replace(/^0x/u, '');
38
- const privateKey = keyDerivation.grindKey(r, curve);
33
+ const privateKey = keyDerivation.grindKey(r);
39
34
  const publicKey = keyDerivation.privateToStarkKey(privateKey);
40
35
  return [privateKey, publicKey];
41
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paradex/sdk",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "JavaScript SDK for Paradex",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -28,13 +28,12 @@
28
28
  "url": "git+https://github.com/tradeparadex/paradex.js.git"
29
29
  },
30
30
  "dependencies": {
31
- "@starkware-industries/starkware-crypto-utils": "^0.2.1",
31
+ "@noble/hashes": "~1.6.0",
32
32
  "bignumber.js": "^9.3.1",
33
33
  "starknet": "^8.6.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
37
- "@types/elliptic": "^6.4.18",
38
37
  "@types/jest": "^29.5.14",
39
38
  "@typescript-eslint/eslint-plugin": "6.21.0",
40
39
  "@typescript-eslint/parser": "6.21.0",
@@ -45,6 +44,7 @@
45
44
  "eslint-plugin-n": "^16.6.2 ",
46
45
  "eslint-plugin-promise": "^6.0.0",
47
46
  "ethers": "^6.15.0",
47
+ "fake-indexeddb": "^6.2.5",
48
48
  "husky": "^9.1.7",
49
49
  "jest": "^29.7.0",
50
50
  "jest-ts-webcompat-resolver": "^1.0.1",
@@ -55,9 +55,9 @@
55
55
  "typescript": "~5.9.3"
56
56
  },
57
57
  "resolutions": {
58
- "brace-expansion": "^2.0.2",
59
- "js-yaml": "^4.1.1",
60
58
  "micromatch": "^4.0.8",
61
- "@babel/helpers": "^7.26.10"
59
+ "@babel/helpers": "^7.26.10",
60
+ "ethers/ws": "^8.21.0",
61
+ "**/@typescript-eslint/typescript-estree/minimatch": "^9.0.7"
62
62
  }
63
63
  }