@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.
- package/README.md +204 -0
- package/dist/account.d.ts +79 -8
- package/dist/account.js +298 -12
- package/dist/client.d.ts +12 -4
- package/dist/client.js +11 -3
- package/dist/config.d.ts +6 -1
- package/dist/config.js +3 -2
- package/dist/determinism-guard.d.ts +102 -0
- package/dist/determinism-guard.js +62 -0
- package/dist/eip712.d.ts +40 -0
- package/dist/eip712.js +162 -0
- package/dist/ethereum-signer.d.ts +13 -2
- package/dist/ethereum-signer.js +14 -1
- package/dist/index.d.ts +61 -0
- package/dist/index.js +51 -0
- package/dist/key-derivation.d.ts +19 -0
- package/dist/key-derivation.js +83 -0
- package/dist/session-accounts.d.ts +206 -0
- package/dist/session-accounts.js +747 -0
- package/dist/session-auth.d.ts +31 -0
- package/dist/session-auth.js +115 -0
- package/dist/session-connector.d.ts +132 -0
- package/dist/session-connector.js +304 -0
- package/dist/session-key.d.ts +68 -0
- package/dist/session-key.js +187 -0
- package/dist/session-owner-signer.d.ts +68 -0
- package/dist/session-owner-signer.js +64 -0
- package/dist/session-transport.d.ts +48 -0
- package/dist/session-transport.js +56 -0
- package/dist/session-typed-data.d.ts +346 -0
- package/dist/session-typed-data.js +984 -0
- package/dist/starknet-signer.d.ts +3 -4
- package/dist/starknet-signer.js +5 -10
- package/package.json +6 -6
|
@@ -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
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
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>;
|
package/dist/starknet-signer.js
CHANGED
|
@@ -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
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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
|
|
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.
|
|
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
|
-
"@
|
|
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
|
}
|