@tempoxyz/auth 0.0.0-pr-69.sha-43dc149 → 0.0.0-pr-67.sha-dfb1b91

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/Auth.d.ts CHANGED
@@ -86,7 +86,7 @@ export declare namespace RequestError {
86
86
  uri?: string | undefined;
87
87
  };
88
88
  /** Each refusal's stable name. `docs/errors.md` explains each one. */
89
- type Reason = 'already_decided' | 'approval_pending' | 'body_too_large' | 'cross_site_request' | 'device_code_expired' | 'duplicate_limit' | 'empty_limits' | 'empty_scopes' | 'expiry_exceeds_maximum' | 'expiry_passed' | 'foreign_account' | 'foreign_origin' | 'invalid_chain' | 'invalid_code' | 'invalid_expiry' | 'invalid_field' | 'invalid_origin' | 'invalid_period' | 'invalid_public_key' | 'limit_exceeds_maximum' | 'malformed_body' | 'missing_code_challenge' | 'missing_key' | 'missing_recipients' | 'polling_too_fast' | 'rate_limited' | 'rejected' | 'request_denied' | 'scope_without_limit' | 'session_required' | 'unexpected' | 'unknown_code' | 'unknown_endpoint' | 'unsupported_call' | 'unsupported_step' | 'unsupported_token' | 'upstream_unavailable' | 'webauthn_rejected' | 'webauthn_required';
89
+ type Reason = 'already_decided' | 'approval_pending' | 'body_too_large' | 'cross_site_request' | 'device_code_expired' | 'duplicate_limit' | 'empty_limits' | 'empty_scopes' | 'expiry_exceeds_maximum' | 'expiry_passed' | 'foreign_account' | 'foreign_origin' | 'invalid_chain' | 'invalid_code' | 'invalid_expiry' | 'invalid_field' | 'invalid_origin' | 'invalid_period' | 'invalid_public_key' | 'limit_exceeds_maximum' | 'malformed_body' | 'missing_code_challenge' | 'missing_key' | 'missing_recipients' | 'polling_too_fast' | 'rate_limited' | 'rejected' | 'request_denied' | 'scope_without_limit' | 'session_required' | 'unexpected' | 'unknown_code' | 'unknown_endpoint' | 'unsupported_call' | 'unsupported_step' | 'unsupported_token' | 'upstream_unavailable' | 'webauthn_rejected';
90
90
  }
91
91
  /** A client's {@link Account} read before a sign-in set it, or after sign-out emptied it. */
92
92
  export declare class SignedOutError extends Error {
@@ -6,19 +6,13 @@
6
6
  export type TempoAccount = {
7
7
  /** The account's address, the same on every Tempo chain. */
8
8
  address: `0x${string}`;
9
- /**
10
- * Who holds the account's owner key: a Privy wallet, which Tempo Auth signs with (`privy`), or a
11
- * passkey, which signs only on a Tempo Auth page (`webAuthn`). Treat another value as an owner
12
- * that may refuse a key authorization.
13
- */
14
- owner: 'privy' | 'webAuthn' | (string & {});
15
9
  };
16
10
  /**
17
11
  * Instantiates a {@link TempoAccount}.
18
12
  *
19
13
  * @example
20
14
  * ```ts
21
- * const tempoAccount = TempoAccount.from({ address: '0x…', owner: 'privy' })
15
+ * const tempoAccount = TempoAccount.from({ address: '0x…' })
22
16
  * ```
23
17
  */
24
18
  export declare function from(value: TempoAccount): TempoAccount;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @example
5
5
  * ```ts
6
- * const tempoAccount = TempoAccount.from({ address: '0x…', owner: 'privy' })
6
+ * const tempoAccount = TempoAccount.from({ address: '0x…' })
7
7
  * ```
8
8
  */
9
9
  export function from(value) {
@@ -12,7 +12,8 @@ import * as Api from '../internal/api.js';
12
12
  * ```
13
13
  */
14
14
  export async function create(auth) {
15
- return toTempoAccount(await Api.json(await Api.post(auth, '/v1/account/tempo', { json: {} })));
15
+ const { address } = await Api.json(await Api.post(auth, '/v1/account/tempo', { json: {} }));
16
+ return { address };
16
17
  }
17
18
  /**
18
19
  * Lists the signed-in user's Tempo Accounts, their default first.
@@ -26,12 +27,5 @@ export async function list(auth) {
26
27
  const { tempo } = await Api.json(await (auth.fetch ?? fetch)(new URL('/v1/account', auth.url), {
27
28
  credentials: 'include',
28
29
  }));
29
- return tempo.map(toTempoAccount);
30
- }
31
- /** Reads the account's address and the type of its owner, which the API lists first. */
32
- function toTempoAccount(account) {
33
- return {
34
- address: account.address,
35
- owner: account.config.owners[0].type,
36
- };
30
+ return tempo.map(({ address }) => ({ address }));
37
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempoxyz/auth",
3
- "version": "0.0.0-pr-69.sha-43dc149",
3
+ "version": "0.0.0-pr-67.sha-dfb1b91",
4
4
  "description": "Signs users in to Tempo through Tempo Auth, and returns Viem access key accounts on their Tempo Accounts.",
5
5
  "type": "module",
6
6
  "exports": {