@veridex/sdk 1.1.4 → 1.1.5

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/dist/index.d.mts CHANGED
@@ -3597,19 +3597,47 @@ declare function createMainnetSDK(chain?: ChainName, config?: Omit<SimpleSDKConf
3597
3597
  *
3598
3598
  * @example
3599
3599
  * ```typescript
3600
- * import { createSessionSDK, SessionManager } from '@veridex/sdk';
3600
+ * import {
3601
+ * createSessionSDK,
3602
+ * SessionManager,
3603
+ * EVMHubClientAdapter,
3604
+ * } from '@veridex/sdk';
3605
+ * import { JsonRpcProvider, Wallet, parseEther } from 'ethers';
3606
+ *
3607
+ * const sdk = createSessionSDK('base', { network: 'testnet' });
3608
+ * await sdk.passkey.register('user@example.com', 'My Wallet');
3601
3609
  *
3602
- * const sdk = createSessionSDK('base');
3603
- * const sessionManager = new SessionManager({ sdk });
3610
+ * // SessionManager is positional (credential, hubClient, passkeySign, config).
3611
+ * // The hub client needs an ethers signer because session registration is an
3612
+ * // on-chain transaction.
3613
+ * const provider = new JsonRpcProvider('https://sepolia.base.org');
3614
+ * const signer = new Wallet(process.env.PRIVATE_KEY!, provider);
3615
+ * const hubClient = new EVMHubClientAdapter(
3616
+ * sdk.getChainClient() as any,
3617
+ * signer as any,
3618
+ * );
3604
3619
  *
3605
- * // Create a session (one passkey auth)
3606
- * const session = await sessionManager.createSession({
3607
- * duration: 3600,
3608
- * maxValue: BigInt(1e18),
3609
- * });
3620
+ * const manager = new SessionManager(
3621
+ * sdk.getCredential()!,
3622
+ * hubClient,
3623
+ * (challenge) => sdk.passkey.sign(challenge),
3624
+ * { duration: 3600, maxValue: parseEther('0.05') },
3625
+ * );
3626
+ *
3627
+ * const session = await manager.createSession();
3610
3628
  *
3611
- * // Execute multiple transactions without prompts
3612
- * await sessionManager.executeWithSession(params, session);
3629
+ * // Sign and submit each action explicitly via the relayer.
3630
+ * const signed = await manager.signAction({
3631
+ * action: 'transfer',
3632
+ * targetChain: 10004,
3633
+ * payload,
3634
+ * nonce,
3635
+ * value,
3636
+ * });
3637
+ * await sdk.relayer!.submitSignedAction({
3638
+ * ...signed.action,
3639
+ * signature: signed.signature,
3640
+ * } as any);
3613
3641
  * ```
3614
3642
  */
3615
3643
  declare function createSessionSDK(chain?: ChainName, config?: SimpleSDKConfig): VeridexSDK;
package/dist/index.js CHANGED
@@ -15224,6 +15224,10 @@ init_presets();
15224
15224
  init_featureFlags();
15225
15225
  init_presets();
15226
15226
  init_featureFlags();
15227
+ var DEFAULT_PUBLIC_RELAYER_URLS = {
15228
+ testnet: "https://relayer.veridex.network"
15229
+ // mainnet: '<set when public mainnet relayer ships>',
15230
+ };
15227
15231
  function createChainClient(chain, network, customRpcUrl) {
15228
15232
  const preset = getChainPreset(chain);
15229
15233
  const config = preset[network];
@@ -15336,7 +15340,7 @@ function createSDK(chain, config = {}) {
15336
15340
  return new VeridexSDK({
15337
15341
  chain: chainClient,
15338
15342
  testnet: network === "testnet",
15339
- relayerUrl: config.relayerUrl,
15343
+ relayerUrl: config.relayerUrl ?? DEFAULT_PUBLIC_RELAYER_URLS[network],
15340
15344
  relayerApiKey: config.relayerApiKey,
15341
15345
  sponsorPrivateKey: config.sponsorPrivateKey,
15342
15346
  integratorSponsorKey: config.integratorSponsorKey,