@chipi-stack/chipi-react 14.13.1 → 14.15.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.
@@ -1,6 +1,7 @@
1
- import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, ChainToken, GetTokenBalanceResponse, WalletType, WalletData, SessionKeyData, SessionDataResponse, CreateSessionKeyParams, SessionConfig, Call as Call$1, SpendingPolicyConfig, SpendingPolicyData, MigrateWalletToPasskeyParams, UpdateWalletEncryptionParams, UpdateWalletEncryptionResponse, TransferHookInput, ApproveHookInput, GetTransactionListQuery, PaginatedResponse, Transaction, TransactionStatusResponse, SyncOnChainTransfersParams, SyncOnChainTransfersResponse, CreateSkuPurchaseParams, GetSkuListQuery, Sku, CallAnyContractParams, SignTypedDataParams, RecordSendTransactionParams, GetTokenBalanceParams, AddSessionKeyParams, RevokeSessionKeyParams, GetSessionDataParams, ExecuteWithSessionParams, PaymentRequirement, PaymentPayload } from '@chipi-stack/types';
1
+ import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, ChainToken, GetTokenBalanceResponse, WalletType, WalletData, SessionKeyData, SessionDataResponse, CreateSessionKeyParams, SessionConfig, SessionSpendingPolicy, Call as Call$1, SpendingPolicyConfig, SpendingPolicyData, MigrateWalletToPasskeyParams, UpdateWalletEncryptionParams, UpdateWalletEncryptionResponse, TransferHookInput, ApproveHookInput, GetTransactionListQuery, PaginatedResponse, Transaction, TransactionStatusResponse, SyncOnChainTransfersParams, SyncOnChainTransfersResponse, CreateSkuPurchaseParams, GetSkuListQuery, Sku, CallAnyContractParams, SignTypedDataParams, RecordSendTransactionParams, GetTokenBalanceParams, AddSessionKeyParams, RevokeSessionKeyParams, GetSessionDataParams, ExecuteWithSessionParams, PaymentRequirement, PaymentPayload } from '@chipi-stack/types';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
4
+ import { SyntheticEvent } from 'react';
4
5
  import { MigrateChipiWalletToShhhParams, MigrationOutcome, Eip191Pubkey, WebAuthnPubkey, JwtAppleSubPubkey, NewOwnerInput, buildProposeAddOwnerCall, TIMELOCK_SECONDS, DEFAULT_OP_EXPIRY_SECONDS, ROLE_OWNER, ROLE_GUARDIAN, OP_ADD_OWNER, OP_REMOVE_OWNER, OP_ROTATE_OWNER, OP_SET_THRESHOLD, ShhhSignerKind, MIN_THRESHOLD_OWNERS } from '@chipi-stack/backend';
5
6
  import { Call as Call$2 } from 'starknet';
6
7
  import { TypedData, AccountDeploymentData } from '@starknet-io/types-js';
@@ -344,10 +345,25 @@ interface SessionWallet extends WalletData {
344
345
  * Configuration for useChipiSession hook
345
346
  */
346
347
  interface UseChipiSessionConfig {
347
- /** Wallet data (must be a CHIPI wallet for session support) */
348
+ /** Wallet data (CHIPI, or SHHH with a STARK / ED25519 signer) */
348
349
  wallet: SessionWallet | null | undefined;
349
- /** Encryption key (user's PIN) for signing operations */
350
- encryptKey: string;
350
+ /**
351
+ * Encryption key for signing operations (a PIN, or a key you already hold).
352
+ * Optional when `getEncryptKey` is given.
353
+ */
354
+ encryptKey?: string;
355
+ /**
356
+ * Resolve the encryption key only when an action needs it, e.g. a passkey:
357
+ * `getEncryptKey: () => getWalletEncryptKey(credentialId)`. Used when
358
+ * `encryptKey` is not set. It runs before `getBearerToken`, so the token is
359
+ * fetched after the biometric prompt and is not stale.
360
+ *
361
+ * Every action that needs the key resolves it again: `createSession` and
362
+ * `executeWithSession` included, so with a passkey each browser-side session
363
+ * execution prompts too. For prompt-free execution, keep the session on your
364
+ * server and execute it there (register it here with `sessionPublicKey`).
365
+ */
366
+ getEncryptKey?: () => Promise<string | null | undefined>;
351
367
  /** Function to get the bearer token for API calls */
352
368
  getBearerToken: () => Promise<string | null | undefined>;
353
369
  /** Previously stored session data (from Clerk metadata, database, etc.) */
@@ -361,6 +377,13 @@ interface UseChipiSessionConfig {
361
377
  /** Whether to auto-check session status on mount */
362
378
  autoCheckStatus?: boolean;
363
379
  }
380
+ /**
381
+ * Options for `registerSession`.
382
+ */
383
+ type RegisterSessionConfig = Partial<SessionConfig> & {
384
+ /** Caps set in the same transaction as the registration (one signature). */
385
+ spendingPolicies?: SessionSpendingPolicy[];
386
+ };
364
387
  /**
365
388
  * Session lifecycle state
366
389
  */
@@ -381,14 +404,23 @@ interface UseChipiSessionReturn {
381
404
  isSessionExpired: boolean;
382
405
  /** Remaining calls available for the session */
383
406
  remainingCalls: number | undefined;
384
- /** Whether the wallet supports sessions (CHIPI wallet) */
407
+ /** Whether the wallet supports sessions (CHIPI, or SHHH with a STARK / ED25519 signer) */
385
408
  supportsSession: boolean;
386
409
  /** Create a new session keypair locally (does NOT register on-chain) */
387
410
  createSession: (config?: Partial<CreateSessionKeyParams>) => Promise<SessionKeyData>;
388
- /** Register the current session on the blockchain */
389
- registerSession: (config?: Partial<SessionConfig>) => Promise<string>;
390
- /** Revoke the current session from the blockchain */
391
- revokeSession: () => Promise<string>;
411
+ /**
412
+ * Register a session on the blockchain. Defaults to the current session; pass
413
+ * `sessionPublicKey` + `validUntil` to register one created elsewhere (e.g. on
414
+ * your server). With `spendingPolicies`, the session and its caps are set in
415
+ * one owner-signed transaction.
416
+ *
417
+ * `sessionState` and `remainingCalls` track the local session only. For a key
418
+ * registered from elsewhere, read its state where it lives (on your server,
419
+ * `sdk.sessions.getSessionData`).
420
+ */
421
+ registerSession: (config?: RegisterSessionConfig) => Promise<string>;
422
+ /** Revoke a session from the blockchain. Defaults to the current session. */
423
+ revokeSession: (sessionPublicKey?: string | SyntheticEvent) => Promise<string>;
392
424
  /** Execute calls using the session key (no owner signature needed) */
393
425
  executeWithSession: (calls: Call$1[]) => Promise<string>;
394
426
  /** Clear the current session from local state */
@@ -1207,7 +1239,7 @@ type SyncOnChainInput = SyncOnChainTransfersParams & {
1207
1239
  bearerToken: string;
1208
1240
  };
1209
1241
  /**
1210
- * Hook for syncing on-chain transfers from Voyager into the DB.
1242
+ * Hook for syncing on-chain transfers (Starknet Transfer events, read by the backend) into the DB.
1211
1243
  *
1212
1244
  * Discovers transactions not made through the SDK (e.g., external USDC receives
1213
1245
  * from Argent X or other wallets). After sync, useGetTransactionList returns
@@ -2858,4 +2890,4 @@ declare function usePrivateBalance(input: PrivateBalanceInput): {
2858
2890
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, bigint>, Error>>;
2859
2891
  };
2860
2892
 
2861
- export { derivePrivacyAccount as $, useCallAnyContract as A, useSignTypedData as B, type ChipiWindowObjectDeps as C, useChipiWalletObject as D, useRecordSendTransaction as E, useGetTokenBalance as F, useCreateSessionKey as G, useAddSessionKeyToContract as H, useRevokeSessionKey as I, useGetSessionData as J, useExecuteWithSession as K, useX402Payment as L, type UseX402PaymentConfig as M, type UseX402PaymentReturn as N, useShhhSigner as O, type UseShhhSignerReturn as P, useGuardianRecovery as Q, type UseGuardianRecoveryReturn as R, type SessionState as S, useThresholdSign as T, type UseChipiWalletObjectConfig as U, type UseThresholdSignReturn as V, type UseThresholdSignOptions as W, type ThresholdSignState as X, useShield as Y, useUnshield as Z, usePrivateBalance as _, type ChipiApprovalRequest as a, netPrivateBalance as a0, type PrivacyConfig as a1, type PrivacyKeys as a2, type PrivacyStep as a3, type ShieldHookInput as a4, type PrivacyLedgerEvent as a5, type PrivateBalanceInput as a6, type ChipiSessionPolicy as b, useGetWallet as c, useChipiWallet as d, type UseChipiWalletConfig as e, type UseChipiWalletReturn as f, type ChipiWalletData as g, useChipiSession as h, type UseChipiSessionConfig as i, type UseChipiSessionReturn as j, type SessionWallet as k, useMigrateWalletToPasskey as l, useUpdateWalletEncryption as m, useMigrateWalletToShhh as n, useTransfer as o, type UseTransferConfig as p, useApprove as q, useGetTransactionList as r, useGetTransaction as s, useGetTransactionStatus as t, useCreateWallet as u, useSyncOnChainTransfers as v, usePurchaseSku as w, useGetSkuPurchase as x, useGetSkuList as y, useGetSku as z };
2893
+ export { usePrivateBalance as $, useCallAnyContract as A, useSignTypedData as B, type ChipiWindowObjectDeps as C, useChipiWalletObject as D, useRecordSendTransaction as E, useGetTokenBalance as F, useCreateSessionKey as G, useAddSessionKeyToContract as H, useRevokeSessionKey as I, useGetSessionData as J, useExecuteWithSession as K, useX402Payment as L, type UseX402PaymentConfig as M, type UseX402PaymentReturn as N, useShhhSigner as O, type UseShhhSignerReturn as P, useGuardianRecovery as Q, type RegisterSessionConfig as R, type SessionState as S, type UseGuardianRecoveryReturn as T, type UseChipiWalletObjectConfig as U, useThresholdSign as V, type UseThresholdSignReturn as W, type UseThresholdSignOptions as X, type ThresholdSignState as Y, useShield as Z, useUnshield as _, type ChipiApprovalRequest as a, derivePrivacyAccount as a0, netPrivateBalance as a1, type PrivacyConfig as a2, type PrivacyKeys as a3, type PrivacyStep as a4, type ShieldHookInput as a5, type PrivacyLedgerEvent as a6, type PrivateBalanceInput as a7, type ChipiSessionPolicy as b, useGetWallet as c, useChipiWallet as d, type UseChipiWalletConfig as e, type UseChipiWalletReturn as f, type ChipiWalletData as g, useChipiSession as h, type UseChipiSessionConfig as i, type UseChipiSessionReturn as j, type SessionWallet as k, useMigrateWalletToPasskey as l, useUpdateWalletEncryption as m, useMigrateWalletToShhh as n, useTransfer as o, type UseTransferConfig as p, useApprove as q, useGetTransactionList as r, useGetTransaction as s, useGetTransactionStatus as t, useCreateWallet as u, useSyncOnChainTransfers as v, usePurchaseSku as w, useGetSkuPurchase as x, useGetSkuList as y, useGetSku as z };
@@ -1,6 +1,7 @@
1
- import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, ChainToken, GetTokenBalanceResponse, WalletType, WalletData, SessionKeyData, SessionDataResponse, CreateSessionKeyParams, SessionConfig, Call as Call$1, SpendingPolicyConfig, SpendingPolicyData, MigrateWalletToPasskeyParams, UpdateWalletEncryptionParams, UpdateWalletEncryptionResponse, TransferHookInput, ApproveHookInput, GetTransactionListQuery, PaginatedResponse, Transaction, TransactionStatusResponse, SyncOnChainTransfersParams, SyncOnChainTransfersResponse, CreateSkuPurchaseParams, GetSkuListQuery, Sku, CallAnyContractParams, SignTypedDataParams, RecordSendTransactionParams, GetTokenBalanceParams, AddSessionKeyParams, RevokeSessionKeyParams, GetSessionDataParams, ExecuteWithSessionParams, PaymentRequirement, PaymentPayload } from '@chipi-stack/types';
1
+ import { CreateWalletParams, CreateWalletResponse, GetWalletParams, GetWalletResponse, ChainToken, GetTokenBalanceResponse, WalletType, WalletData, SessionKeyData, SessionDataResponse, CreateSessionKeyParams, SessionConfig, SessionSpendingPolicy, Call as Call$1, SpendingPolicyConfig, SpendingPolicyData, MigrateWalletToPasskeyParams, UpdateWalletEncryptionParams, UpdateWalletEncryptionResponse, TransferHookInput, ApproveHookInput, GetTransactionListQuery, PaginatedResponse, Transaction, TransactionStatusResponse, SyncOnChainTransfersParams, SyncOnChainTransfersResponse, CreateSkuPurchaseParams, GetSkuListQuery, Sku, CallAnyContractParams, SignTypedDataParams, RecordSendTransactionParams, GetTokenBalanceParams, AddSessionKeyParams, RevokeSessionKeyParams, GetSessionDataParams, ExecuteWithSessionParams, PaymentRequirement, PaymentPayload } from '@chipi-stack/types';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
4
+ import { SyntheticEvent } from 'react';
4
5
  import { MigrateChipiWalletToShhhParams, MigrationOutcome, Eip191Pubkey, WebAuthnPubkey, JwtAppleSubPubkey, NewOwnerInput, buildProposeAddOwnerCall, TIMELOCK_SECONDS, DEFAULT_OP_EXPIRY_SECONDS, ROLE_OWNER, ROLE_GUARDIAN, OP_ADD_OWNER, OP_REMOVE_OWNER, OP_ROTATE_OWNER, OP_SET_THRESHOLD, ShhhSignerKind, MIN_THRESHOLD_OWNERS } from '@chipi-stack/backend';
5
6
  import { Call as Call$2 } from 'starknet';
6
7
  import { TypedData, AccountDeploymentData } from '@starknet-io/types-js';
@@ -344,10 +345,25 @@ interface SessionWallet extends WalletData {
344
345
  * Configuration for useChipiSession hook
345
346
  */
346
347
  interface UseChipiSessionConfig {
347
- /** Wallet data (must be a CHIPI wallet for session support) */
348
+ /** Wallet data (CHIPI, or SHHH with a STARK / ED25519 signer) */
348
349
  wallet: SessionWallet | null | undefined;
349
- /** Encryption key (user's PIN) for signing operations */
350
- encryptKey: string;
350
+ /**
351
+ * Encryption key for signing operations (a PIN, or a key you already hold).
352
+ * Optional when `getEncryptKey` is given.
353
+ */
354
+ encryptKey?: string;
355
+ /**
356
+ * Resolve the encryption key only when an action needs it, e.g. a passkey:
357
+ * `getEncryptKey: () => getWalletEncryptKey(credentialId)`. Used when
358
+ * `encryptKey` is not set. It runs before `getBearerToken`, so the token is
359
+ * fetched after the biometric prompt and is not stale.
360
+ *
361
+ * Every action that needs the key resolves it again: `createSession` and
362
+ * `executeWithSession` included, so with a passkey each browser-side session
363
+ * execution prompts too. For prompt-free execution, keep the session on your
364
+ * server and execute it there (register it here with `sessionPublicKey`).
365
+ */
366
+ getEncryptKey?: () => Promise<string | null | undefined>;
351
367
  /** Function to get the bearer token for API calls */
352
368
  getBearerToken: () => Promise<string | null | undefined>;
353
369
  /** Previously stored session data (from Clerk metadata, database, etc.) */
@@ -361,6 +377,13 @@ interface UseChipiSessionConfig {
361
377
  /** Whether to auto-check session status on mount */
362
378
  autoCheckStatus?: boolean;
363
379
  }
380
+ /**
381
+ * Options for `registerSession`.
382
+ */
383
+ type RegisterSessionConfig = Partial<SessionConfig> & {
384
+ /** Caps set in the same transaction as the registration (one signature). */
385
+ spendingPolicies?: SessionSpendingPolicy[];
386
+ };
364
387
  /**
365
388
  * Session lifecycle state
366
389
  */
@@ -381,14 +404,23 @@ interface UseChipiSessionReturn {
381
404
  isSessionExpired: boolean;
382
405
  /** Remaining calls available for the session */
383
406
  remainingCalls: number | undefined;
384
- /** Whether the wallet supports sessions (CHIPI wallet) */
407
+ /** Whether the wallet supports sessions (CHIPI, or SHHH with a STARK / ED25519 signer) */
385
408
  supportsSession: boolean;
386
409
  /** Create a new session keypair locally (does NOT register on-chain) */
387
410
  createSession: (config?: Partial<CreateSessionKeyParams>) => Promise<SessionKeyData>;
388
- /** Register the current session on the blockchain */
389
- registerSession: (config?: Partial<SessionConfig>) => Promise<string>;
390
- /** Revoke the current session from the blockchain */
391
- revokeSession: () => Promise<string>;
411
+ /**
412
+ * Register a session on the blockchain. Defaults to the current session; pass
413
+ * `sessionPublicKey` + `validUntil` to register one created elsewhere (e.g. on
414
+ * your server). With `spendingPolicies`, the session and its caps are set in
415
+ * one owner-signed transaction.
416
+ *
417
+ * `sessionState` and `remainingCalls` track the local session only. For a key
418
+ * registered from elsewhere, read its state where it lives (on your server,
419
+ * `sdk.sessions.getSessionData`).
420
+ */
421
+ registerSession: (config?: RegisterSessionConfig) => Promise<string>;
422
+ /** Revoke a session from the blockchain. Defaults to the current session. */
423
+ revokeSession: (sessionPublicKey?: string | SyntheticEvent) => Promise<string>;
392
424
  /** Execute calls using the session key (no owner signature needed) */
393
425
  executeWithSession: (calls: Call$1[]) => Promise<string>;
394
426
  /** Clear the current session from local state */
@@ -1207,7 +1239,7 @@ type SyncOnChainInput = SyncOnChainTransfersParams & {
1207
1239
  bearerToken: string;
1208
1240
  };
1209
1241
  /**
1210
- * Hook for syncing on-chain transfers from Voyager into the DB.
1242
+ * Hook for syncing on-chain transfers (Starknet Transfer events, read by the backend) into the DB.
1211
1243
  *
1212
1244
  * Discovers transactions not made through the SDK (e.g., external USDC receives
1213
1245
  * from Argent X or other wallets). After sync, useGetTransactionList returns
@@ -2858,4 +2890,4 @@ declare function usePrivateBalance(input: PrivateBalanceInput): {
2858
2890
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<Record<string, bigint>, Error>>;
2859
2891
  };
2860
2892
 
2861
- export { derivePrivacyAccount as $, useCallAnyContract as A, useSignTypedData as B, type ChipiWindowObjectDeps as C, useChipiWalletObject as D, useRecordSendTransaction as E, useGetTokenBalance as F, useCreateSessionKey as G, useAddSessionKeyToContract as H, useRevokeSessionKey as I, useGetSessionData as J, useExecuteWithSession as K, useX402Payment as L, type UseX402PaymentConfig as M, type UseX402PaymentReturn as N, useShhhSigner as O, type UseShhhSignerReturn as P, useGuardianRecovery as Q, type UseGuardianRecoveryReturn as R, type SessionState as S, useThresholdSign as T, type UseChipiWalletObjectConfig as U, type UseThresholdSignReturn as V, type UseThresholdSignOptions as W, type ThresholdSignState as X, useShield as Y, useUnshield as Z, usePrivateBalance as _, type ChipiApprovalRequest as a, netPrivateBalance as a0, type PrivacyConfig as a1, type PrivacyKeys as a2, type PrivacyStep as a3, type ShieldHookInput as a4, type PrivacyLedgerEvent as a5, type PrivateBalanceInput as a6, type ChipiSessionPolicy as b, useGetWallet as c, useChipiWallet as d, type UseChipiWalletConfig as e, type UseChipiWalletReturn as f, type ChipiWalletData as g, useChipiSession as h, type UseChipiSessionConfig as i, type UseChipiSessionReturn as j, type SessionWallet as k, useMigrateWalletToPasskey as l, useUpdateWalletEncryption as m, useMigrateWalletToShhh as n, useTransfer as o, type UseTransferConfig as p, useApprove as q, useGetTransactionList as r, useGetTransaction as s, useGetTransactionStatus as t, useCreateWallet as u, useSyncOnChainTransfers as v, usePurchaseSku as w, useGetSkuPurchase as x, useGetSkuList as y, useGetSku as z };
2893
+ export { usePrivateBalance as $, useCallAnyContract as A, useSignTypedData as B, type ChipiWindowObjectDeps as C, useChipiWalletObject as D, useRecordSendTransaction as E, useGetTokenBalance as F, useCreateSessionKey as G, useAddSessionKeyToContract as H, useRevokeSessionKey as I, useGetSessionData as J, useExecuteWithSession as K, useX402Payment as L, type UseX402PaymentConfig as M, type UseX402PaymentReturn as N, useShhhSigner as O, type UseShhhSignerReturn as P, useGuardianRecovery as Q, type RegisterSessionConfig as R, type SessionState as S, type UseGuardianRecoveryReturn as T, type UseChipiWalletObjectConfig as U, useThresholdSign as V, type UseThresholdSignReturn as W, type UseThresholdSignOptions as X, type ThresholdSignState as Y, useShield as Z, useUnshield as _, type ChipiApprovalRequest as a, derivePrivacyAccount as a0, netPrivateBalance as a1, type PrivacyConfig as a2, type PrivacyKeys as a3, type PrivacyStep as a4, type ShieldHookInput as a5, type PrivacyLedgerEvent as a6, type PrivateBalanceInput as a7, type ChipiSessionPolicy as b, useGetWallet as c, useChipiWallet as d, type UseChipiWalletConfig as e, type UseChipiWalletReturn as f, type ChipiWalletData as g, useChipiSession as h, type UseChipiSessionConfig as i, type UseChipiSessionReturn as j, type SessionWallet as k, useMigrateWalletToPasskey as l, useUpdateWalletEncryption as m, useMigrateWalletToShhh as n, useTransfer as o, type UseTransferConfig as p, useApprove as q, useGetTransactionList as r, useGetTransaction as s, useGetTransactionStatus as t, useCreateWallet as u, useSyncOnChainTransfers as v, usePurchaseSku as w, useGetSkuPurchase as x, useGetSkuList as y, useGetSku as z };
package/dist/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { ReactNode } from 'react';
3
3
  import { ChipiSDK, NewOwnerInput } from '@chipi-stack/backend';
4
- import { ChipiSDKConfig } from '@chipi-stack/types';
4
+ import { ChipiSDKConfig, WalletType } from '@chipi-stack/types';
5
5
  export * from '@chipi-stack/types';
6
6
  export { Chain, ChainToken } from '@chipi-stack/types';
7
- import { C as ChipiWindowObjectDeps, U as UseChipiWalletObjectConfig } from './index-D9-uVlda.mjs';
8
- export { a as ChipiApprovalRequest, b as ChipiSessionPolicy, g as ChipiWalletData, a1 as PrivacyConfig, a2 as PrivacyKeys, a5 as PrivacyLedgerEvent, a3 as PrivacyStep, a6 as PrivateBalanceInput, S as SessionState, k as SessionWallet, a4 as ShieldHookInput, X as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, f as UseChipiWalletReturn, R as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, W as UseThresholdSignOptions, V as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, $ as derivePrivacyAccount, a0 as netPrivateBalance, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, _ as usePrivateBalance, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, Y as useShield, B as useSignTypedData, v as useSyncOnChainTransfers, T as useThresholdSign, o as useTransfer, Z as useUnshield, m as useUpdateWalletEncryption, L as useX402Payment } from './index-D9-uVlda.mjs';
7
+ import { C as ChipiWindowObjectDeps, U as UseChipiWalletObjectConfig } from './index-B8OIdrOX.mjs';
8
+ export { a as ChipiApprovalRequest, b as ChipiSessionPolicy, g as ChipiWalletData, a2 as PrivacyConfig, a3 as PrivacyKeys, a6 as PrivacyLedgerEvent, a4 as PrivacyStep, a7 as PrivateBalanceInput, R as RegisterSessionConfig, S as SessionState, k as SessionWallet, a5 as ShieldHookInput, Y as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, f as UseChipiWalletReturn, T as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, X as UseThresholdSignOptions, W as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, a0 as derivePrivacyAccount, a1 as netPrivateBalance, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, $ as usePrivateBalance, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, Z as useShield, B as useSignTypedData, v as useSyncOnChainTransfers, V as useThresholdSign, o as useTransfer, _ as useUnshield, m as useUpdateWalletEncryption, L as useX402Payment } from './index-B8OIdrOX.mjs';
9
9
  import { StarknetWindowObject } from '@starknet-io/types-js';
10
10
  import '@tanstack/react-query';
11
11
  import 'starknet';
@@ -41,6 +41,20 @@ declare function ChipiProvider({ children, config, passkeyAdapter }: ChipiProvid
41
41
  */
42
42
  declare function useChipiContext(): ChipiContextValue;
43
43
 
44
+ /**
45
+ * Whether a wallet can register and use SNIP-163 session keys through the SDK.
46
+ *
47
+ * CHIPI (v29+) and SHHH V8.4 both embed the sessions component. For SHHH the
48
+ * owner signature is built by the SDK only for STARK and ED25519 signers
49
+ * (`executeShhhSponsoredRaw`); a missing `signerKind` means STARK, the default
50
+ * for SDK-created SHHH wallets, including passkey-encrypted ones. READY (Argent
51
+ * X) has no sessions component.
52
+ */
53
+ declare function walletSupportsSessions(wallet: {
54
+ walletType?: WalletType | string | null;
55
+ signerKind?: string | null;
56
+ } | null | undefined): boolean;
57
+
44
58
  /**
45
59
  * Build a standards-compliant Starknet `StarknetWindowObject` backed by a Chipi
46
60
  * wallet. Framework-agnostic: all signing/execution/approval is injected via
@@ -115,9 +129,40 @@ declare function ChipiInjector({ children, ...config }: ChipiInjectorProps): Rea
115
129
  * (MetaMask connect, passkey enrollment, Apple Sign In) is intentionally
116
130
  * out of scope: caller computes `newOwner` upstream and passes it in.
117
131
  */
132
+ /**
133
+ * Every user-facing string `<Recover />` renders. The built-in defaults are
134
+ * English developer copy — **not** end-user-ready (they say "timelock",
135
+ * "add-owner", etc.). Consumer apps MUST override these with their own
136
+ * localized, jargon-free copy (e.g. via next-intl). Pass a partial; unset
137
+ * fields fall back to `DEFAULT_RECOVER_LABELS`.
138
+ */
139
+ interface RecoverLabels {
140
+ proposeAddDevice: string;
141
+ proposeRecovery: string;
142
+ executeAddDevice: string;
143
+ executeRecovery: string;
144
+ timelockAddDevice: string;
145
+ timelockRecovery: string;
146
+ submitting: string;
147
+ /** Formats the live countdown. Receives whole seconds remaining. */
148
+ secondsRemaining: (secondsRemaining: number) => string;
149
+ cancel: string;
150
+ timelockElapsed: string;
151
+ cancelling: string;
152
+ doneAddDevice: string;
153
+ doneRecovery: string;
154
+ }
155
+ /** Developer-facing English defaults. Override for real users. */
156
+ declare const DEFAULT_RECOVER_LABELS: RecoverLabels;
118
157
  interface RecoverProps {
119
158
  /** Which flow this component renders. */
120
159
  mode: "add-device" | "guardian-recovery";
160
+ /**
161
+ * Override any/all user-facing strings. The defaults are developer English
162
+ * with protocol jargon and are unsuitable for end users — supply localized,
163
+ * job-named copy here (see `RecoverLabels`).
164
+ */
165
+ labels?: Partial<RecoverLabels>;
121
166
  /** The SHHH wallet being modified. */
122
167
  walletAddress: bigint | string;
123
168
  /**
@@ -170,4 +215,4 @@ interface RecoverProps {
170
215
  }
171
216
  declare function Recover(props: RecoverProps): React.ReactElement;
172
217
 
173
- export { ChipiInjector, type ChipiInjectorProps, ChipiProvider, ChipiWindowObjectDeps, type InjectedChipiWallet, type PasskeyAdapter, Recover, type RecoverProps, UseChipiWalletObjectConfig, createChipiWindowObject, injectChipiWallet, useChipiContext };
218
+ export { ChipiInjector, type ChipiInjectorProps, ChipiProvider, ChipiWindowObjectDeps, DEFAULT_RECOVER_LABELS, type InjectedChipiWallet, type PasskeyAdapter, Recover, type RecoverLabels, type RecoverProps, UseChipiWalletObjectConfig, createChipiWindowObject, injectChipiWallet, useChipiContext, walletSupportsSessions };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { ReactNode } from 'react';
3
3
  import { ChipiSDK, NewOwnerInput } from '@chipi-stack/backend';
4
- import { ChipiSDKConfig } from '@chipi-stack/types';
4
+ import { ChipiSDKConfig, WalletType } from '@chipi-stack/types';
5
5
  export * from '@chipi-stack/types';
6
6
  export { Chain, ChainToken } from '@chipi-stack/types';
7
- import { C as ChipiWindowObjectDeps, U as UseChipiWalletObjectConfig } from './index-D9-uVlda.js';
8
- export { a as ChipiApprovalRequest, b as ChipiSessionPolicy, g as ChipiWalletData, a1 as PrivacyConfig, a2 as PrivacyKeys, a5 as PrivacyLedgerEvent, a3 as PrivacyStep, a6 as PrivateBalanceInput, S as SessionState, k as SessionWallet, a4 as ShieldHookInput, X as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, f as UseChipiWalletReturn, R as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, W as UseThresholdSignOptions, V as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, $ as derivePrivacyAccount, a0 as netPrivateBalance, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, _ as usePrivateBalance, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, Y as useShield, B as useSignTypedData, v as useSyncOnChainTransfers, T as useThresholdSign, o as useTransfer, Z as useUnshield, m as useUpdateWalletEncryption, L as useX402Payment } from './index-D9-uVlda.js';
7
+ import { C as ChipiWindowObjectDeps, U as UseChipiWalletObjectConfig } from './index-B8OIdrOX.js';
8
+ export { a as ChipiApprovalRequest, b as ChipiSessionPolicy, g as ChipiWalletData, a2 as PrivacyConfig, a3 as PrivacyKeys, a6 as PrivacyLedgerEvent, a4 as PrivacyStep, a7 as PrivateBalanceInput, R as RegisterSessionConfig, S as SessionState, k as SessionWallet, a5 as ShieldHookInput, Y as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, f as UseChipiWalletReturn, T as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, X as UseThresholdSignOptions, W as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, a0 as derivePrivacyAccount, a1 as netPrivateBalance, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, $ as usePrivateBalance, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, Z as useShield, B as useSignTypedData, v as useSyncOnChainTransfers, V as useThresholdSign, o as useTransfer, _ as useUnshield, m as useUpdateWalletEncryption, L as useX402Payment } from './index-B8OIdrOX.js';
9
9
  import { StarknetWindowObject } from '@starknet-io/types-js';
10
10
  import '@tanstack/react-query';
11
11
  import 'starknet';
@@ -41,6 +41,20 @@ declare function ChipiProvider({ children, config, passkeyAdapter }: ChipiProvid
41
41
  */
42
42
  declare function useChipiContext(): ChipiContextValue;
43
43
 
44
+ /**
45
+ * Whether a wallet can register and use SNIP-163 session keys through the SDK.
46
+ *
47
+ * CHIPI (v29+) and SHHH V8.4 both embed the sessions component. For SHHH the
48
+ * owner signature is built by the SDK only for STARK and ED25519 signers
49
+ * (`executeShhhSponsoredRaw`); a missing `signerKind` means STARK, the default
50
+ * for SDK-created SHHH wallets, including passkey-encrypted ones. READY (Argent
51
+ * X) has no sessions component.
52
+ */
53
+ declare function walletSupportsSessions(wallet: {
54
+ walletType?: WalletType | string | null;
55
+ signerKind?: string | null;
56
+ } | null | undefined): boolean;
57
+
44
58
  /**
45
59
  * Build a standards-compliant Starknet `StarknetWindowObject` backed by a Chipi
46
60
  * wallet. Framework-agnostic: all signing/execution/approval is injected via
@@ -115,9 +129,40 @@ declare function ChipiInjector({ children, ...config }: ChipiInjectorProps): Rea
115
129
  * (MetaMask connect, passkey enrollment, Apple Sign In) is intentionally
116
130
  * out of scope: caller computes `newOwner` upstream and passes it in.
117
131
  */
132
+ /**
133
+ * Every user-facing string `<Recover />` renders. The built-in defaults are
134
+ * English developer copy — **not** end-user-ready (they say "timelock",
135
+ * "add-owner", etc.). Consumer apps MUST override these with their own
136
+ * localized, jargon-free copy (e.g. via next-intl). Pass a partial; unset
137
+ * fields fall back to `DEFAULT_RECOVER_LABELS`.
138
+ */
139
+ interface RecoverLabels {
140
+ proposeAddDevice: string;
141
+ proposeRecovery: string;
142
+ executeAddDevice: string;
143
+ executeRecovery: string;
144
+ timelockAddDevice: string;
145
+ timelockRecovery: string;
146
+ submitting: string;
147
+ /** Formats the live countdown. Receives whole seconds remaining. */
148
+ secondsRemaining: (secondsRemaining: number) => string;
149
+ cancel: string;
150
+ timelockElapsed: string;
151
+ cancelling: string;
152
+ doneAddDevice: string;
153
+ doneRecovery: string;
154
+ }
155
+ /** Developer-facing English defaults. Override for real users. */
156
+ declare const DEFAULT_RECOVER_LABELS: RecoverLabels;
118
157
  interface RecoverProps {
119
158
  /** Which flow this component renders. */
120
159
  mode: "add-device" | "guardian-recovery";
160
+ /**
161
+ * Override any/all user-facing strings. The defaults are developer English
162
+ * with protocol jargon and are unsuitable for end users — supply localized,
163
+ * job-named copy here (see `RecoverLabels`).
164
+ */
165
+ labels?: Partial<RecoverLabels>;
121
166
  /** The SHHH wallet being modified. */
122
167
  walletAddress: bigint | string;
123
168
  /**
@@ -170,4 +215,4 @@ interface RecoverProps {
170
215
  }
171
216
  declare function Recover(props: RecoverProps): React.ReactElement;
172
217
 
173
- export { ChipiInjector, type ChipiInjectorProps, ChipiProvider, ChipiWindowObjectDeps, type InjectedChipiWallet, type PasskeyAdapter, Recover, type RecoverProps, UseChipiWalletObjectConfig, createChipiWindowObject, injectChipiWallet, useChipiContext };
218
+ export { ChipiInjector, type ChipiInjectorProps, ChipiProvider, ChipiWindowObjectDeps, DEFAULT_RECOVER_LABELS, type InjectedChipiWallet, type PasskeyAdapter, Recover, type RecoverLabels, type RecoverProps, UseChipiWalletObjectConfig, createChipiWindowObject, injectChipiWallet, useChipiContext, walletSupportsSessions };