@paradex/sdk 0.8.1 → 0.10.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 CHANGED
@@ -25,7 +25,7 @@ import * as Paradex from '@paradex/sdk';
25
25
  import { ethers } from 'ethers';
26
26
 
27
27
  // 1. Fetch configuration for your environment
28
- const config = await Paradex.Config.fetch('testnet'); // or 'mainnet'
28
+ const config = await Paradex.Config.fetch('testnet'); // 'prod', 'testnet' or 'nightly'
29
29
 
30
30
  // 2. Connect to user's wallet
31
31
  const provider = new ethers.BrowserProvider(window.ethereum);
@@ -80,12 +80,96 @@ const client = await Paradex.Client.fromStarknetAccount({
80
80
  });
81
81
  ```
82
82
 
83
+ ### Account Address
84
+
85
+ The SDK gets the Paradex account address from the Paradex API (`GET /onboarding`), so it matches the account the Paradex app created for the same key, whichever account class it was created with. For a key with no account yet, it is the address a new account will be created at. The API matches the key as written, so when the key has no account the SDK also looks it up zero-padded to 64 hex digits, which finds an account onboarded with the padded key.
86
+
87
+ The API URL comes from the config returned by `Paradex.Config.fetch()`. If you build the config yourself, pass `apiUrl` (for example `https://api.testnet.paradex.trade/v1`):
88
+
89
+ ```typescript
90
+ const client = await Paradex.Client.fromEthSigner({
91
+ config,
92
+ signer,
93
+ apiUrl: 'https://api.testnet.paradex.trade/v1',
94
+ });
95
+ ```
96
+
97
+ If the request fails, creating the client throws. It never falls back to a locally computed address, which can belong to a different account.
98
+
99
+ To compute the address locally instead, with no request, pass `serverDeriveAddress: false`. That computes the address of an account created with the legacy proxy class, so use it only for such accounts. The same options are accepted by `Paradex.Client.fromStarknetAccount()`.
100
+
101
+ To look up an address and onboarding status directly from a Paradex public key (or, for an EVM-owned account, from its wallet with `ethAddress` instead of `publicKey`):
102
+
103
+ ```typescript
104
+ const info = await Paradex.Onboarding.fetch({
105
+ apiUrl: 'https://api.testnet.paradex.trade/v1',
106
+ publicKey: '0x...',
107
+ });
108
+ console.log(info.address, info.exists);
109
+ ```
110
+
111
+ ### Determinism guard (experimental)
112
+
113
+ A wallet derives its Paradex key from a signature, so a wallet that does not sign deterministically derives a different key each time. By default `fromEthSigner` asks for the signature twice and compares them. Set `determinismGuard` to check the derived key against the wallet's account instead:
114
+
115
+ ```typescript
116
+ const client = await Paradex.Client.fromEthSigner({
117
+ config,
118
+ signer,
119
+ determinismGuard: true,
120
+ });
121
+ ```
122
+
123
+ With the guard on, the SDK:
124
+
125
+ 1. Refuses a wallet that has contract code (a smart contract wallet), before asking for any signature. An EIP-7702 delegated EOA is allowed. A code lookup that fails or times out counts as no code.
126
+ 2. Asks for one signature and looks the derived public key up with `GET /onboarding`. If an account holds it, the key is accepted with that one signature.
127
+ 3. Otherwise, looks the wallet up. If the wallet already has an account, its key differs from the one just derived: the SDK throws a `DeterminismGuardError` with code `key_mismatch` (or `evm_owned_account` when the wallet's account is an EVM-owned one, which is used through `SessionConnector`). Do not onboard a new account in either case.
128
+ 4. Otherwise the account is new: it asks for a second signature and throws `non_deterministic` if the two differ.
129
+
130
+ Any failed lookup throws `lookup_failed`, so the guard never returns a key it could not check. The account address always comes from the Paradex API, as with `serverDeriveAddress: true`.
131
+
132
+ The guard needs the wallet address and a provider to read its code. `Paradex.Signer.fromEthers()` provides both when the ethers signer has a provider. Otherwise pass them, along with providers for any other chain the wallet might be a contract on:
133
+
134
+ ```typescript
135
+ const client = await Paradex.Client.fromEthSigner({
136
+ config,
137
+ signer,
138
+ determinismGuard: {
139
+ walletAddress: '0x...',
140
+ codeProviders: [mainnetProvider, arbitrumProvider, baseProvider],
141
+ // Called once the key is accepted, e.g. to record that a new wallet
142
+ // passed the two-signature test. The SDK keeps no state between calls.
143
+ onResult: ({ kind, signatures }) => console.log(kind, signatures),
144
+ },
145
+ });
146
+ ```
147
+
148
+ For a local private-key wallet with no provider, pass `contractCodeCheck: false`.
149
+
150
+ ```typescript
151
+ try {
152
+ await Paradex.Client.fromEthSigner({
153
+ config,
154
+ signer,
155
+ determinismGuard: true,
156
+ });
157
+ } catch (error) {
158
+ if (error instanceof Paradex.DeterminismGuardError) {
159
+ // 'contract_wallet' | 'key_mismatch' | 'evm_owned_account'
160
+ // | 'non_deterministic'
161
+ // | 'lookup_failed' | 'invalid_options'
162
+ console.error(error.code, error.message);
163
+ }
164
+ }
165
+ ```
166
+
83
167
  ### Configuration
84
168
 
85
169
  Fetch environment-specific configuration:
86
170
 
87
171
  ```typescript
88
- const config = await Paradex.Config.fetch('testnet'); // testnet, mainnet, or custom URL
172
+ const config = await Paradex.Config.fetch('testnet'); // 'prod', 'testnet' or 'nightly'
89
173
  ```
90
174
 
91
175
  ## Common Operations
@@ -211,6 +295,109 @@ const result = await provider.callContract({
211
295
  });
212
296
  ```
213
297
 
298
+ ### Session Grant Typed Data (experimental)
299
+
300
+ A session grant lets a wallet authorize a short-lived Stark session key to trade, within scopes and limits, without withdrawing. The SDK builds the grant and its typed data in both encodings: EIP-712 for EVM wallets, with domain `{ name: "Paradex Session", version: "1", chainId: <the wallet's current chain> }`, and SNIP-12 revision 1 for Stark owners.
301
+
302
+ > The server side of sessions is not released yet. These APIs may change.
303
+
304
+ ```typescript
305
+ const grant = Paradex.SessionTypedData.createGrant({
306
+ paradexChain: 'PRIVATE_SN_PARACLEAR_MAINNET',
307
+ environment: 'mainnet', // or 'testnet'
308
+ account: '0x...', // the owner's Paradex account
309
+ sessionKey: '0x...', // the session's Stark public key
310
+ scopes: ['trade'], // 'trade' | 'trade:rfq' | 'trade:block' | 'account:settings'
311
+ // limits defaults to every limit uncapped ('none', markets ['*']).
312
+ subaccounts: [], // sub-account addresses the session may also trade
313
+ });
314
+
315
+ const chainId = await window.ethereum.request({ method: 'eth_chainId' });
316
+ const typedData = Paradex.SessionTypedData.buildGrantEip712(grant, chainId);
317
+ const digest = Paradex.SessionTypedData.hashEip712(typedData);
318
+ ```
319
+
320
+ Every limit is stated: a positive decimal (USD; leverage as a multiple) or `"none"` for no cap, and `markets` is a list or `["*"]` for every market. A grant may only set a limit the server enforces. Until it enforces any, every limit must be `"none"` and `markets` `["*"]`, which is the default. When the server enforces some, list them in `enforcedLimits` (for example `['maxOrderNotional', 'markets']`), and only those may be set.
321
+
322
+ Grants are checked before signing. These throw a `SessionGrantError` with a `code`:
323
+
324
+ - reserved scopes (`withdraw:owner`, `trade:isolated`);
325
+ - more than 32 subaccounts;
326
+ - lifetimes past the server caps, less a 5-minute allowance for the client's clock running ahead (`clockSkewSeconds`; pass 0 when `issuedAt` comes from the server's clock);
327
+ - a limit that is empty, or set while the server doesn't enforce it (`LIMIT_INVALID`);
328
+ - builder grants asking for `trade:block` or `account:settings`;
329
+ - builder grants without a numeric `maxLoss`. Builder grants need a loss cap, so they're refused until the server enforces `maxLoss`.
330
+ - labels over 64 characters or outside printable ASCII;
331
+ - passkey ceilings with scopes the server refuses: a first-party passkey's ceiling may carry `trade`, `trade:rfq` and `account:settings`, a builder passkey's only `trade`. Ceilings with subaccounts are refused until the server enables them; pass `passkeySubaccounts: true` once it does.
332
+
333
+ `POST /v2/sessions` caps every grant at 30 days (7 with `trade:block` or `account:settings`). The `api` session type's 180-day cap is for IP-pinned API sessions, which that endpoint does not open; `SessionConnector.open()` always applies the 30-day cap.
334
+
335
+ A passkey opens a session by signing a `SessionMint`, whose WebAuthn challenge is `SessionTypedData.mintChallenge(mint)`. A mint names neither the account nor the passkey: the server finds the passkey by the assertion's credential id, so a page may pass an empty `allowCredentials` and let the user pick any passkey they hold. Its SNIP-12 hash is taken for account `0x0` (`MINT_HASH_ACCOUNT`). A mint may state `CEILING_LIMITS` (every amount `""` and `markets: []`) to take its passkey's ceiling, and `expiresAt: LONGEST_SESSION` (`0`) for the longest session the passkey allows. A stated `expiresAt` later than the passkey's own expiry is accepted, and the session ends when the passkey does; one past the ceiling's `maxSessionTtl` from now is refused.
336
+
337
+ `assertMintWithinCeiling` checks a mint against one `PasskeyGrant`, so it holds only when that grant's passkey signs. With an empty `allowCredentials` the user may pick another passkey, on another account or with another ceiling, and the server checks the mint against that one. A page that pre-checks against a grant, or shows the user limits taken from one, should pin `allowCredentials: [{ type: 'public-key', id: grant.passkey.credentialId }]` (the id decoded from base64url). A page that lets the user pick any passkey must compare the account in the server's response with the one it expected, and revoke the session it just opened if they differ.
338
+
339
+ `assertMintWithinCeiling` keeps a stated `expiresAt` the same 5 minutes inside the ceiling's `maxSessionTtl`; pass `clockSkewSeconds: 0` when `now` comes from the server's clock. For the same reason `validatePasskeyGrant` refuses a ceiling whose `maxSessionTtl` is 300 seconds or less, which would leave no time to mint; it takes the same `clockSkewSeconds` option.
340
+
341
+ Pass `limitCaps` to refuse limits above your own ceilings before the wallet is asked. Caps apply only to enforced limits; a cap on a limit the server doesn't enforce refuses every grant.
342
+
343
+ Show the owner what they are approving with `SessionTypedData.summarizeGrant(grant)`. Its first line states the risk plainly: _Cannot withdraw; can lose up to `maxLoss` USD by trading_, or, when `maxLoss` is `"none"`, _Cannot withdraw; trading losses are not capped by this session_.
344
+
345
+ ### Sessions: trade with a session key (experimental)
346
+
347
+ `SessionConnector` opens a session with **one** wallet prompt. A session cannot withdraw. Its trading losses are capped only by the grant's `maxLoss`, and while that is `"none"` (the default) they are not capped by the session. The Stark session key is generated in the page and stored encrypted under a non-extractable WebCrypto key; the private key is decrypted only while signing. The grant is registered with `POST /v2/sessions`.
348
+
349
+ A grant from a wallet with no Paradex account yet opens the account along with its first session; the account is deployed when it is first funded. Such a grant lists no subaccounts, and its `account` must be the address the server derives for the wallet, which `Paradex.Onboarding.fetch({ apiUrl, ethAddress })` returns (with `exists: false`; this `apiUrl` is the `/v1` base, such as `https://api.testnet.paradex.trade/v1`, not the connector's host root); any other address fails with `INVALID_SIGNATURE` after the wallet has signed. Pass `onboarding: { referralCode, marketingCode, utm, privyAccessToken }` to `open()` for this case: the fields are sent with the grant but not signed, and a grant naming a builder ignores them. Refusals, including the onboarding ones (`INSUFFICIENT_MIN_CHAIN_BALANCE`, `PARENT_ADDRESS_ALREADY_ONBOARDED`, `ONBOARDING_RATE_LIMITED`, `SESSIONS_DISABLED` and others), throw a `SessionApiError` whose `code` is typed as `SessionApiErrorCode`.
350
+
351
+ An EVM-owned account's sub-accounts can be listed before signing in with `connector.listSubaccounts(ethAddress)`. When the owner signer knows its address (`ownerSignerFromEip1193` does; pass `address` to `ownerSignerFromExternal`), `open()` checks a grant's `subaccounts` against that list before the wallet is asked to sign.
352
+
353
+ `SessionAccounts` then mints a JWT per account the grant lists (the main account and any `subaccounts`) through `POST /v1/auth/{session_public_key}` with `PARADEX-STARKNET-ACCOUNT`, each for at most 15 minutes and never past the grant's expiry. It keeps one websocket per account and routes requests by account. Sessions never use `on_behalf_of`. When the server refuses a session token or the session key, `SessionAccounts` checks `GET /v2/sessions/{grant_id}/status`. If the grant is revoked or expired, every account is dropped and `onDropped` is called; any other refusal is treated as transient. RFQ endpoints need `trade:rfq` in the grant, or they answer 403 `INVALID_TOKEN_SCOPE`. Create, execute and drafts are open to a session whose grant also caps nothing and names no builder, where the server has enabled RFQ for the account's sessions; otherwise they answer 403 `REQUEST_NOT_ALLOWED`. An account not yet deployed gets 400 `NOT_ONBOARDED`. None of these ends the session. A session may also deposit into its own account (`POST /v1/deposit-addresses`, and `POST /v1/bridges/layerswap/swaps` with `use_deposit_address` and no `source_address`), but never move funds out. `accounts.revoke()` revokes the grant itself and, by default, cancels the session's resting orders, TWAPs and untriggered stops on every account: once revoked, the key can no longer cancel them. This differs from the Paradex app's own sign-out, which keeps orders because they are the owner's own trading. With `accounts.revoke({ cancelOrders: false })` a grant without a builder signs out and its orders keep working; a builder grant still has its TWAPs and untriggered stops cancelled and keeps only its resting orders.
354
+
355
+ ```typescript
356
+ const connector = new Paradex.SessionConnector({
357
+ environment: 'testnet',
358
+ paradexChain: config.paradexChainId,
359
+ // Default: the injected wallet. For MPC providers, use
360
+ // Paradex.Session.ownerSignerFromExternal({ chainId, sign }).
361
+ owner: Paradex.Session.ownerSignerFromEip1193({ provider: window.ethereum }),
362
+ storage: Paradex.Session.indexedDbStorage(),
363
+ });
364
+
365
+ const [existing] = await connector.restore();
366
+ const session =
367
+ existing ??
368
+ (await connector.open({
369
+ account: '0x...',
370
+ subaccounts: ['0x...'],
371
+ scopes: ['trade'],
372
+ // limits defaults to every limit uncapped, as the server requires
373
+ // until it enforces limits (see enforcedLimits).
374
+ }));
375
+
376
+ // The environment and chain come from the grant.
377
+ const accounts = new Paradex.SessionAccounts({
378
+ session,
379
+ onDropped: (reason) => {
380
+ console.warn('Session ended:', reason.code);
381
+ // Delete the key so the next load does not restore the ended session.
382
+ void connector.forget(session);
383
+ },
384
+ });
385
+ await accounts.start();
386
+
387
+ await accounts.placeOrder('0x...', {
388
+ market: 'BTC-USD-PERP',
389
+ side: 'BUY',
390
+ type: 'LIMIT',
391
+ size: '0.01',
392
+ price: '60000',
393
+ });
394
+ const unsubscribe = await accounts.subscribe('0x...', 'orders.ALL', (data) =>
395
+ console.log(data),
396
+ );
397
+ ```
398
+
399
+ > `/v2/sessions` is experimental; its request and response shapes may change.
400
+
214
401
  ## Best Practices
215
402
 
216
403
  ### 1. Environment Variables
@@ -352,12 +539,34 @@ For a full React application example, see: [paradex-react-example](https://githu
352
539
  | ------------------- | ----------------------------------- | --------------- |
353
540
  | `Config.fetch(env)` | Fetch configuration for environment | `ParadexConfig` |
354
541
 
542
+ ### Onboarding
543
+
544
+ | Method | Description | Returns |
545
+ | ------------------------------------------ | ------------------------------------------------------- | ---------------- |
546
+ | `Onboarding.fetch({ apiUrl, publicKey })` | Get the account address and onboarding status for a key | `OnboardingInfo` |
547
+ | `Onboarding.fetch({ apiUrl, ethAddress })` | The same for an EVM wallet's EVM-owned account | `OnboardingInfo` |
548
+
355
549
  ### Signer
356
550
 
357
551
  | Method | Description | Returns |
358
552
  | --------------------------- | ---------------------------- | ---------------- |
359
553
  | `Signer.fromEthers(signer)` | Create signer from ethers.js | `EthereumSigner` |
360
554
 
555
+ ### SessionTypedData (experimental)
556
+
557
+ | Method | Description | Returns |
558
+ | ------------------------------------- | ------------------------------------------------ | ----------------- |
559
+ | `createGrant(params)` | Build a canonical, validated `SessionGrant` | `SessionGrant` |
560
+ | `buildGrantEip712(grant, chainId)` | EIP-712 typed data for an EVM wallet | `Eip712TypedData` |
561
+ | `buildGrantSnip12(grant)` | SNIP-12 rev 1 typed data for a Stark owner | `TypedData` |
562
+ | `buildPasskeyGrantEip712/Snip12(...)` | Typed data for `PasskeyGrant` | typed data |
563
+ | `buildMintEip712/Snip12(...)` | Typed data for `SessionMint` | typed data |
564
+ | `mintChallenge(mint)` | WebAuthn challenge for a `SessionMint` | `string` |
565
+ | `hashEip712(typedData)` | EIP-712 digest | `Hex` |
566
+ | `hashSnip12(typedData, account)` | SNIP-12 message hash | `Hex` |
567
+ | `validateGrant(grant)` | Check format rules and lifetime caps | `void` (throws) |
568
+ | `assertGrantActive(grant, now?)` | Throw `GRANT_EXPIRED` once the grant has expired | `void` (throws) |
569
+
361
570
  ## Support
362
571
 
363
572
  - **Discord:** [Join our Discord](https://discord.gg/paradex)
package/dist/account.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as Starknet from 'starknet';
2
2
  import type { ParadexConfig } from './config.js';
3
+ import { type DeterminismGuardOptions } from './determinism-guard.js';
3
4
  import * as ethereumSigner from './ethereum-signer.js';
4
5
  import type { Hex } from './types.js';
5
6
  export interface Account extends Starknet.Account {
@@ -12,9 +13,36 @@ export interface AccountCredentials {
12
13
  readonly address: Hex;
13
14
  readonly privateKey: Hex;
14
15
  }
15
- interface DeriveFromEthSignerParams {
16
+ /**
17
+ * Options controlling how the Paradex account address is resolved.
18
+ */
19
+ export interface AddressDerivationOptions {
20
+ /**
21
+ * Fetch the account address from the Paradex API (`GET /onboarding`).
22
+ * The API returns the stored address of an existing account of either
23
+ * account class, and the current-class address for a new one.
24
+ * Defaults to true.
25
+ *
26
+ * Pass false to compute the address locally from the class hashes in the
27
+ * config, with no request. That computes the legacy proxy-class address,
28
+ * which is only right for accounts created with the legacy class.
29
+ */
30
+ readonly serverDeriveAddress?: boolean;
31
+ /**
32
+ * Paradex REST API base URL used to fetch the address.
33
+ * Defaults to `config.paradexApiUrl`.
34
+ */
35
+ readonly apiUrl?: string;
36
+ }
37
+ interface DeriveFromEthSignerParams extends AddressDerivationOptions {
16
38
  readonly config: ParadexConfig;
17
39
  readonly signer: ethereumSigner.EthereumSigner;
40
+ /**
41
+ * Check the derived key against the wallet's existing account before
42
+ * trusting it. See `DeterminismGuardOptions`.
43
+ * @experimental
44
+ */
45
+ readonly determinismGuard?: boolean | DeterminismGuardOptions;
18
46
  }
19
47
  /**
20
48
  * Derives Paradex account credentials from an Ethereum wallet.
@@ -22,19 +50,21 @@ interface DeriveFromEthSignerParams {
22
50
  * @internal
23
51
  * @returns The account address and private key.
24
52
  */
25
- export declare function deriveFromEthSigner({ config, signer, }: DeriveFromEthSignerParams): Promise<AccountCredentials>;
26
- interface FromEthSignerParams {
53
+ export declare function deriveFromEthSigner({ config, signer, serverDeriveAddress, apiUrl, determinismGuard, }: DeriveFromEthSignerParams): Promise<AccountCredentials>;
54
+ interface FromEthSignerParams extends AddressDerivationOptions {
27
55
  readonly provider: Starknet.ProviderOptions | Starknet.ProviderInterface;
28
56
  readonly config: ParadexConfig;
29
57
  readonly signer: ethereumSigner.EthereumSigner;
58
+ /** @experimental See `DeterminismGuardOptions`. */
59
+ readonly determinismGuard?: boolean | DeterminismGuardOptions;
30
60
  }
31
61
  /**
32
62
  * Generates a Paradex account from an Ethereum wallet.
33
63
  * @deprecated Use deriveFromEthSigner() and pass credentials to DefaultProvider constructor
34
64
  * @returns The generated Paradex account.
35
65
  */
36
- export declare function fromEthSigner({ provider, config, signer, }: FromEthSignerParams): Promise<Account>;
37
- interface DeriveFromStarknetAccountParams {
66
+ export declare function fromEthSigner({ provider, config, signer, serverDeriveAddress, apiUrl, determinismGuard, }: FromEthSignerParams): Promise<Account>;
67
+ interface DeriveFromStarknetAccountParams extends AddressDerivationOptions {
38
68
  readonly config: ParadexConfig;
39
69
  readonly account: Starknet.AccountInterface;
40
70
  readonly starknetProvider?: Starknet.ProviderInterface;
@@ -46,8 +76,8 @@ interface DeriveFromStarknetAccountParams {
46
76
  * @internal
47
77
  * @returns The account address and private key.
48
78
  */
49
- export declare function deriveFromStarknetAccount({ config, account, starknetProvider, rpcUrl, }: DeriveFromStarknetAccountParams): Promise<AccountCredentials>;
50
- interface FromStarknetAccountParams {
79
+ export declare function deriveFromStarknetAccount({ config, account, starknetProvider, rpcUrl, serverDeriveAddress, apiUrl, }: DeriveFromStarknetAccountParams): Promise<AccountCredentials>;
80
+ interface FromStarknetAccountParams extends AddressDerivationOptions {
51
81
  /** Paradex chain provider */
52
82
  readonly provider: Starknet.ProviderOptions | Starknet.ProviderInterface;
53
83
  readonly config: ParadexConfig;
@@ -60,7 +90,48 @@ interface FromStarknetAccountParams {
60
90
  * @deprecated Use deriveFromStarknetAccount() and pass credentials to DefaultProvider constructor
61
91
  * @returns The generated Paradex account.
62
92
  */
63
- export declare function fromStarknetAccount({ provider, config, account, starknetProvider, rpcUrl, }: FromStarknetAccountParams): Promise<Account>;
93
+ export declare function fromStarknetAccount({ provider, config, account, starknetProvider, rpcUrl, serverDeriveAddress, apiUrl, }: FromStarknetAccountParams): Promise<Account>;
94
+ /**
95
+ * Class hash(es) the Paradex API used to derive an account address.
96
+ */
97
+ export interface OnboardingDerivationInfo {
98
+ readonly classHash: Hex;
99
+ /** Present only for accounts deployed behind the legacy proxy class. */
100
+ readonly proxyClassHash?: Hex;
101
+ }
102
+ /**
103
+ * Onboarding status of a Starknet public key, or of an EVM wallet's
104
+ * EVM-owned account, as reported by the Paradex API.
105
+ */
106
+ export interface OnboardingInfo {
107
+ /** The Paradex account address for the public key or wallet. */
108
+ readonly address: Hex;
109
+ /** Whether the account has already been onboarded. */
110
+ readonly exists: boolean;
111
+ readonly accountSignerType: string;
112
+ readonly derivationInfo?: OnboardingDerivationInfo;
113
+ }
114
+ type FetchOnboardingParams = {
115
+ /** Paradex REST API base URL, e.g. `https://api.testnet.paradex.trade/v1` */
116
+ readonly apiUrl: string;
117
+ } & ({
118
+ /** Paradex (Stark) public key in hex format */
119
+ readonly publicKey: Hex;
120
+ readonly ethAddress?: undefined;
121
+ } | {
122
+ /**
123
+ * The owner wallet of an EVM-owned (EIP-191) account. For a wallet with
124
+ * no account yet, the address is the one its first session grant opens.
125
+ */
126
+ readonly ethAddress: string;
127
+ readonly publicKey?: undefined;
128
+ });
129
+ /**
130
+ * Fetches the account address and onboarding status for a Starknet public key,
131
+ * or for the wallet of an EVM-owned account, from the Paradex API. Public
132
+ * endpoint, no authentication required.
133
+ */
134
+ export declare function fetchOnboarding(params: FetchOnboardingParams): Promise<OnboardingInfo>;
64
135
  /**
65
136
  * Checks if starknet signatures are equal.
66
137
  */