@tempoxyz/auth 0.0.0-pr-27.sha-abd8f16 → 0.0.0-pr-28.sha-124bc38
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 +21 -26
- package/dist/Actions.d.ts +4 -4
- package/dist/Actions.js +2 -2
- package/dist/Permissions.d.ts +11 -4
- package/dist/actions/device.d.ts +3 -3
- package/dist/actions/device.js +1 -1
- package/dist/actions/email.d.ts +3 -3
- package/dist/actions/email.js +1 -1
- package/dist/actions/redirect.d.ts +8 -9
- package/dist/actions/redirect.js +4 -5
- package/dist/internal/request.d.ts +2 -2
- package/dist/internal/request.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,14 +50,14 @@ The CLI device grant needs neither. It signs in as Tempo Auth's own `tempo-cli`
|
|
|
50
50
|
|
|
51
51
|
## Access keys
|
|
52
52
|
|
|
53
|
-
Each sign-in creates a key for the app and asks Tempo Auth to authorize it on the user's Tempo Account. The `permissions` option says what the key may do, with viem's `Expiry` and `Scopes` helpers:
|
|
53
|
+
Each sign-in creates a key for the app and asks Tempo Auth to authorize it on the user's Tempo Account. The optional `permissions` option says what the key may do, with viem's `Expiry` and `Scopes` helpers. Tempo Auth fills every field it leaves out with the headless ceiling:
|
|
54
54
|
|
|
55
|
-
| Field | Meaning
|
|
56
|
-
| --------- |
|
|
57
|
-
| `chainId` |
|
|
58
|
-
| `expiry` | When the key expires, in Unix seconds, such as `Expiry.days(1)
|
|
59
|
-
| `limits` | One-time spending limits per token, such as `[{ limit: 10_000_000n, token }]` |
|
|
60
|
-
| `scopes` | The calls the key may make, such as `[Scopes.tip20(token).transfer()]
|
|
55
|
+
| Field | Meaning |
|
|
56
|
+
| --------- | ----------------------------------------------------------------------------------------------------------- |
|
|
57
|
+
| `chainId` | The chain the key acts on. Defaults to the instance's `chainId` |
|
|
58
|
+
| `expiry` | When the key expires, in Unix seconds, such as `Expiry.days(1)`. Defaults to a year |
|
|
59
|
+
| `limits` | One-time spending limits per token, such as `[{ limit: 10_000_000n, token }]`. Defaults to about $1,000 of each token the `scopes` call, or of every listed token |
|
|
60
|
+
| `scopes` | The calls the key may make, such as `[Scopes.tip20(token).transfer()]`. Defaults to transfers of each token the key limits |
|
|
61
61
|
|
|
62
62
|
In a browser, the key is a non-extractable WebCrypto P256 key, so no script can read its private key. A CLI, a native app, or a backend gets a secp256k1 key, which it stores as a string.
|
|
63
63
|
|
|
@@ -65,10 +65,10 @@ To authorize a key the app already holds, pass it as `accessKey`, a viem account
|
|
|
65
65
|
|
|
66
66
|
```ts
|
|
67
67
|
const accessKey = Account.fromWebCryptoP256(keyPair, { access: tempoAccount })
|
|
68
|
-
await Actions.authorize(auth, { accessKey
|
|
68
|
+
await Actions.authorize(auth, { accessKey })
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
Flows without a Tempo Auth page (`authorize`, `email.signIn`) must stay within Tempo Auth's ceiling
|
|
71
|
+
Flows without a Tempo Auth page (`authorize`, `email.signIn`) must stay within Tempo Auth's ceiling: about $1,000 per token, for at most a year. Flows with a page (`redirect.start`, `redirect.createUrl`, `device.authorize`) show the limits to the user, who approves them, so they may go beyond it.
|
|
72
72
|
|
|
73
73
|
The returned `account` attaches the key's authorization to its first transaction, which registers the key on chain.
|
|
74
74
|
|
|
@@ -80,11 +80,11 @@ For a browser app that renders its own email form. The page calls Tempo Auth wit
|
|
|
80
80
|
|
|
81
81
|
```ts
|
|
82
82
|
// A user already signed in to Tempo Auth, from any app, needs no form.
|
|
83
|
-
const authorization = await Actions.authorize(auth
|
|
83
|
+
const authorization = await Actions.authorize(auth)
|
|
84
84
|
|
|
85
85
|
// Otherwise, sign in with an emailed code.
|
|
86
86
|
await Actions.email.sendCode(auth, { email })
|
|
87
|
-
const result = await Actions.email.signIn(auth, { code, email
|
|
87
|
+
const result = await Actions.email.signIn(auth, { code, email })
|
|
88
88
|
|
|
89
89
|
// An address that requires SSO continues at its connection, and returns to this page.
|
|
90
90
|
if ('step' in result) Actions.provider.signIn(auth, { url: result.step.url })
|
|
@@ -102,7 +102,7 @@ Actions.provider.signIn(auth, { provider: 'google' })
|
|
|
102
102
|
For a browser app without its own sign-in UI. The browser leaves for Tempo Auth's sign-in page, which shows the key's limits, and returns with a code.
|
|
103
103
|
|
|
104
104
|
```ts
|
|
105
|
-
await Actions.redirect.start(auth
|
|
105
|
+
await Actions.redirect.start(auth)
|
|
106
106
|
|
|
107
107
|
// On the page the browser returns to, and on every load:
|
|
108
108
|
const authorization = await Actions.redirect.complete(auth)
|
|
@@ -125,12 +125,10 @@ const auth = Auth.create({
|
|
|
125
125
|
|
|
126
126
|
// Your own sign-in UI, as in a browser.
|
|
127
127
|
await Actions.email.sendCode(auth, { email })
|
|
128
|
-
const result = await Actions.email.signIn(auth, { code, email
|
|
128
|
+
const result = await Actions.email.signIn(auth, { code, email })
|
|
129
129
|
|
|
130
130
|
// Or Tempo Auth's pages, which also offer Google and SSO.
|
|
131
|
-
const { pending, url } = await Actions.redirect.createUrl(auth
|
|
132
|
-
permissions,
|
|
133
|
-
})
|
|
131
|
+
const { pending, url } = await Actions.redirect.createUrl(auth)
|
|
134
132
|
const session = await WebBrowser.openAuthSessionAsync(url, auth.redirectUri)
|
|
135
133
|
if (session.type === 'success')
|
|
136
134
|
authorization = await Actions.redirect.handleCallback(auth, {
|
|
@@ -150,7 +148,6 @@ const auth = Auth.create({ clientId, clientSecret, url })
|
|
|
150
148
|
|
|
151
149
|
// GET /auth/start
|
|
152
150
|
const { pending, url } = await Actions.redirect.createUrl(auth, {
|
|
153
|
-
permissions,
|
|
154
151
|
redirectUri: 'https://app.example/auth/callback',
|
|
155
152
|
})
|
|
156
153
|
// Keep `pending` in an encrypted, HttpOnly cookie, then redirect to `url`.
|
|
@@ -169,7 +166,6 @@ For a command-line tool. The user approves a code in any browser, and the CLI wa
|
|
|
169
166
|
```ts
|
|
170
167
|
const device = await Actions.device.authorize(auth, {
|
|
171
168
|
device: os.hostname(),
|
|
172
|
-
permissions,
|
|
173
169
|
})
|
|
174
170
|
console.log(
|
|
175
171
|
`Open ${device.verificationUriComplete} and confirm ${device.userCode}.`,
|
|
@@ -189,7 +185,6 @@ await Actions.authorize(auth, {
|
|
|
189
185
|
accessKey: Account.fromWebCryptoP256(keyPair, {
|
|
190
186
|
access: tempoAccount.address,
|
|
191
187
|
}),
|
|
192
|
-
permissions,
|
|
193
188
|
})
|
|
194
189
|
```
|
|
195
190
|
|
|
@@ -220,7 +215,7 @@ A request Tempo Auth refuses throws `Auth.RequestError`, with its `status` and `
|
|
|
220
215
|
|
|
221
216
|
```ts
|
|
222
217
|
try {
|
|
223
|
-
await Actions.email.signIn(auth, { code, email
|
|
218
|
+
await Actions.email.signIn(auth, { code, email })
|
|
224
219
|
} catch (error) {
|
|
225
220
|
if (error instanceof Auth.RequestError && error.status === 401)
|
|
226
221
|
showWrongCode()
|
|
@@ -244,22 +239,22 @@ try {
|
|
|
244
239
|
|
|
245
240
|
### `Actions`
|
|
246
241
|
|
|
247
|
-
Each sign-in flow has its own namespace. The actions every flow shares sit at the top level. Every action that
|
|
242
|
+
Each sign-in flow has its own namespace. The actions every flow shares sit at the top level. Every action that creates a key also takes optional `accessKey` and `permissions`.
|
|
248
243
|
|
|
249
244
|
| Action | Returns |
|
|
250
245
|
| -------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
251
|
-
| `authorize(auth
|
|
246
|
+
| `authorize(auth)` | An `Authorization` for a user already signed in, or `undefined` |
|
|
252
247
|
| `refresh(auth, { refreshToken })` | New `Tokens` |
|
|
253
248
|
| `signOut(auth)` | Nothing. The user's Tempo Auth session ends |
|
|
254
|
-
| `device.authorize(auth, { device
|
|
249
|
+
| `device.authorize(auth, { device })` | The code to show and a `wait()` that resolves with an `Authorization` |
|
|
255
250
|
| `email.sendCode(auth, { email })` | Nothing. Tempo Auth emails a code |
|
|
256
|
-
| `email.signIn(auth, { code, email
|
|
251
|
+
| `email.signIn(auth, { code, email })` | An `Authorization`, or the `step` the address requires first |
|
|
257
252
|
| `provider.list(auth)` | The OAuth providers Tempo Auth offers, as `{ id, name }` |
|
|
258
253
|
| `provider.signIn(auth, { provider } \| { url })` | Nothing. The browser leaves for the provider or SSO connection |
|
|
259
254
|
| `redirect.complete(auth, { accessKey })` | The `Authorization` when the page is a redirect's callback, or `undefined` |
|
|
260
|
-
| `redirect.createUrl(auth, {
|
|
255
|
+
| `redirect.createUrl(auth, { redirectUri })` | The `url` to send the browser to, and the `pending` state to keep |
|
|
261
256
|
| `redirect.handleCallback(auth, { pending, url })` | The `Authorization` for a redirect's callback |
|
|
262
|
-
| `redirect.start(auth
|
|
257
|
+
| `redirect.start(auth)` | Nothing. The browser leaves for Tempo Auth's pages |
|
|
263
258
|
| `tempoAccount.create(auth)` | Another Tempo Account for the signed-in user |
|
|
264
259
|
| `tempoAccount.list(auth)` | The signed-in user's Tempo Accounts, the default first |
|
|
265
260
|
|
package/dist/Actions.d.ts
CHANGED
|
@@ -20,11 +20,11 @@ export * as tempoAccount from './actions/tempoAccount.ts';
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```ts
|
|
23
|
-
* const authorization = await Actions.authorize(auth
|
|
23
|
+
* const authorization = await Actions.authorize(auth)
|
|
24
24
|
* if (!authorization) showSignIn()
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
export declare function authorize(auth: Auth, options
|
|
27
|
+
export declare function authorize(auth: Auth, options?: authorize.Options): Promise<authorize.ReturnType>;
|
|
28
28
|
export declare namespace authorize {
|
|
29
29
|
type Options = {
|
|
30
30
|
/**
|
|
@@ -32,8 +32,8 @@ export declare namespace authorize {
|
|
|
32
32
|
* defaults to the user's first. Defaults to a new key.
|
|
33
33
|
*/
|
|
34
34
|
accessKey?: Account.Account | undefined;
|
|
35
|
-
/** What the key may do. It must fit the headless ceiling. */
|
|
36
|
-
permissions
|
|
35
|
+
/** What the key may do. It must fit the headless ceiling, which fills what it leaves out. */
|
|
36
|
+
permissions?: Permissions | undefined;
|
|
37
37
|
};
|
|
38
38
|
/** The authorization, or `undefined` without a session. */
|
|
39
39
|
type ReturnType = Authorization | undefined;
|
package/dist/Actions.js
CHANGED
|
@@ -13,11 +13,11 @@ export * as tempoAccount from './actions/tempoAccount.js';
|
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
16
|
-
* const authorization = await Actions.authorize(auth
|
|
16
|
+
* const authorization = await Actions.authorize(auth)
|
|
17
17
|
* if (!authorization) showSignIn()
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export async function authorize(auth, options) {
|
|
20
|
+
export async function authorize(auth, options = {}) {
|
|
21
21
|
// Checking the session first answers a visitor without one with no failed request.
|
|
22
22
|
const session = await Api.json(await (auth.fetch ?? fetch)(new URL('/api/auth/session', auth.url), {
|
|
23
23
|
credentials: 'include',
|
package/dist/Permissions.d.ts
CHANGED
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
5
|
import type { KeyAuthorization } from 'ox/tempo';
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* What an app's access key may do, as viem's `accessKey.authorize` takes it. Tempo Auth fills what
|
|
8
|
+
* it leaves out with the headless ceiling.
|
|
9
|
+
*/
|
|
10
|
+
export type Permissions = {
|
|
8
11
|
/** The chain the key acts on, such as `tempoTestnet.id`. Defaults to the instance's `chainId`. */
|
|
9
12
|
chainId?: number | undefined;
|
|
10
|
-
/** Unix seconds. viem's `Expiry` builds one, such as `Expiry.days(1)`. */
|
|
11
|
-
expiry
|
|
13
|
+
/** Unix seconds. viem's `Expiry` builds one, such as `Expiry.days(1)`. Defaults to a year from now. */
|
|
14
|
+
expiry?: number | undefined;
|
|
15
|
+
/** How much of each token the key may spend. Defaults to about $1,000 of each token it calls, or of every listed token. */
|
|
16
|
+
limits?: KeyAuthorization.KeyAuthorization['limits'];
|
|
17
|
+
/** The calls the key may make. Defaults to transfers of each token it limits. */
|
|
18
|
+
scopes?: KeyAuthorization.KeyAuthorization['scopes'];
|
|
12
19
|
};
|
|
13
20
|
/**
|
|
14
21
|
* Instantiates a {@link Permissions}.
|
package/dist/actions/device.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { Permissions } from '../Permissions.ts';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* const device = await Actions.device.authorize(auth, { device: Os.hostname()
|
|
11
|
+
* const device = await Actions.device.authorize(auth, { device: Os.hostname() })
|
|
12
12
|
* console.log(`Open ${device.verificationUriComplete}`)
|
|
13
13
|
* const authorization = await device.wait()
|
|
14
14
|
* ```
|
|
@@ -23,8 +23,8 @@ export declare namespace authorize {
|
|
|
23
23
|
accessKey?: Account.Account | undefined;
|
|
24
24
|
/** The name the approval page shows, such as the machine's hostname. */
|
|
25
25
|
device: string;
|
|
26
|
-
/** What the CLI's key may do. The approval page shows it beside the device. */
|
|
27
|
-
permissions
|
|
26
|
+
/** What the CLI's key may do. The approval page shows it beside the device, and the headless ceiling fills what it leaves out. */
|
|
27
|
+
permissions?: Permissions | undefined;
|
|
28
28
|
};
|
|
29
29
|
type ReturnType = {
|
|
30
30
|
/** Seconds until the code expires. */
|
package/dist/actions/device.js
CHANGED
|
@@ -8,7 +8,7 @@ import { request } from '../internal/request.js';
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* const device = await Actions.device.authorize(auth, { device: Os.hostname()
|
|
11
|
+
* const device = await Actions.device.authorize(auth, { device: Os.hostname() })
|
|
12
12
|
* console.log(`Open ${device.verificationUriComplete}`)
|
|
13
13
|
* const authorization = await device.wait()
|
|
14
14
|
* ```
|
package/dist/actions/email.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare namespace sendCode {
|
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
31
|
-
* const result = await Actions.email.signIn(auth, { code, email
|
|
31
|
+
* const result = await Actions.email.signIn(auth, { code, email })
|
|
32
32
|
* if ('step' in result) Actions.provider.signIn(auth, { url: result.step.url })
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
@@ -44,8 +44,8 @@ export declare namespace signIn {
|
|
|
44
44
|
code: string;
|
|
45
45
|
/** The address the code was sent to. */
|
|
46
46
|
email: string;
|
|
47
|
-
/** What the key may do. It must fit the headless ceiling. */
|
|
48
|
-
permissions
|
|
47
|
+
/** What the key may do. It must fit the headless ceiling, which fills what it leaves out. */
|
|
48
|
+
permissions?: Permissions | undefined;
|
|
49
49
|
};
|
|
50
50
|
/** The authorization, or the step the address requires first. */
|
|
51
51
|
type ReturnType = Authorization | {
|
package/dist/actions/email.js
CHANGED
|
@@ -18,7 +18,7 @@ export async function sendCode(auth, options) {
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```ts
|
|
21
|
-
* const result = await Actions.email.signIn(auth, { code, email
|
|
21
|
+
* const result = await Actions.email.signIn(auth, { code, email })
|
|
22
22
|
* if ('step' in result) Actions.provider.signIn(auth, { url: result.step.url })
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
@@ -11,7 +11,7 @@ import type { Permissions } from '../Permissions.ts';
|
|
|
11
11
|
* ```ts
|
|
12
12
|
* const authorization =
|
|
13
13
|
* (await Actions.redirect.complete(auth)) ??
|
|
14
|
-
* (await Actions.authorize(auth
|
|
14
|
+
* (await Actions.authorize(auth))
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
export declare function complete(auth: Auth, options?: complete.Options): Promise<complete.ReturnType>;
|
|
@@ -31,14 +31,13 @@ export declare namespace complete {
|
|
|
31
31
|
* @example
|
|
32
32
|
* ```ts
|
|
33
33
|
* const { pending, url } = await Actions.redirect.createUrl(auth, {
|
|
34
|
-
* permissions,
|
|
35
34
|
* redirectUri: 'https://app.example/auth/callback',
|
|
36
35
|
* })
|
|
37
36
|
* await seal(c, 'oauth', pending)
|
|
38
37
|
* return c.redirect(url)
|
|
39
38
|
* ```
|
|
40
39
|
*/
|
|
41
|
-
export declare function createUrl(auth: Auth, options
|
|
40
|
+
export declare function createUrl(auth: Auth, options?: createUrl.Options): Promise<createUrl.ReturnType>;
|
|
42
41
|
export declare namespace createUrl {
|
|
43
42
|
type Options = {
|
|
44
43
|
/**
|
|
@@ -46,8 +45,8 @@ export declare namespace createUrl {
|
|
|
46
45
|
* defaults to the user's first. Defaults to a new key, whose material `pending` keeps.
|
|
47
46
|
*/
|
|
48
47
|
accessKey?: Account.Account | undefined;
|
|
49
|
-
/** What the key may do. Tempo Auth's pages show it, and the
|
|
50
|
-
permissions
|
|
48
|
+
/** What the key may do. Tempo Auth's pages show it, and the headless ceiling fills what it leaves out. */
|
|
49
|
+
permissions?: Permissions | undefined;
|
|
51
50
|
/** Where Tempo Auth redirects back to. Defaults to the instance's `redirectUri`. */
|
|
52
51
|
redirectUri?: string | undefined;
|
|
53
52
|
};
|
|
@@ -87,10 +86,10 @@ export declare namespace handleCallback {
|
|
|
87
86
|
*
|
|
88
87
|
* @example
|
|
89
88
|
* ```ts
|
|
90
|
-
* await Actions.redirect.start(auth
|
|
89
|
+
* await Actions.redirect.start(auth)
|
|
91
90
|
* ```
|
|
92
91
|
*/
|
|
93
|
-
export declare function start(auth: Auth, options
|
|
92
|
+
export declare function start(auth: Auth, options?: start.Options): Promise<void>;
|
|
94
93
|
export declare namespace start {
|
|
95
94
|
type Options = {
|
|
96
95
|
/**
|
|
@@ -98,7 +97,7 @@ export declare namespace start {
|
|
|
98
97
|
* key, which `storage` keeps until the browser returns.
|
|
99
98
|
*/
|
|
100
99
|
accessKey?: Account.Account | undefined;
|
|
101
|
-
/** What the key may do. Tempo Auth's pages show it, and the
|
|
102
|
-
permissions
|
|
100
|
+
/** What the key may do. Tempo Auth's pages show it, and the headless ceiling fills what it leaves out. */
|
|
101
|
+
permissions?: Permissions | undefined;
|
|
103
102
|
};
|
|
104
103
|
}
|
package/dist/actions/redirect.js
CHANGED
|
@@ -19,7 +19,7 @@ import * as Pending from '../Pending.js';
|
|
|
19
19
|
* ```ts
|
|
20
20
|
* const authorization =
|
|
21
21
|
* (await Actions.redirect.complete(auth)) ??
|
|
22
|
-
* (await Actions.authorize(auth
|
|
22
|
+
* (await Actions.authorize(auth))
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export function complete(auth, options = {}) {
|
|
@@ -53,14 +53,13 @@ export function complete(auth, options = {}) {
|
|
|
53
53
|
* @example
|
|
54
54
|
* ```ts
|
|
55
55
|
* const { pending, url } = await Actions.redirect.createUrl(auth, {
|
|
56
|
-
* permissions,
|
|
57
56
|
* redirectUri: 'https://app.example/auth/callback',
|
|
58
57
|
* })
|
|
59
58
|
* await seal(c, 'oauth', pending)
|
|
60
59
|
* return c.redirect(url)
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
|
-
export async function createUrl(auth, options) {
|
|
62
|
+
export async function createUrl(auth, options = {}) {
|
|
64
63
|
const redirectUri = options.redirectUri ?? auth.redirectUri ?? `${window.location.origin}/`;
|
|
65
64
|
const key = await AccessKey.resolve(options.accessKey);
|
|
66
65
|
const pending = Pending.from({
|
|
@@ -129,10 +128,10 @@ export async function handleCallback(auth, options) {
|
|
|
129
128
|
*
|
|
130
129
|
* @example
|
|
131
130
|
* ```ts
|
|
132
|
-
* await Actions.redirect.start(auth
|
|
131
|
+
* await Actions.redirect.start(auth)
|
|
133
132
|
* ```
|
|
134
133
|
*/
|
|
135
|
-
export async function start(auth, options) {
|
|
134
|
+
export async function start(auth, options = {}) {
|
|
136
135
|
const { pending, url } = await createUrl(auth, options);
|
|
137
136
|
await storage(auth).setItem(storageKey, pending);
|
|
138
137
|
window.location.assign(url);
|
|
@@ -7,14 +7,14 @@ import type { Permissions } from '../Permissions.ts';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function request(auth: Auth, options: {
|
|
9
9
|
accessKey: Account.Account;
|
|
10
|
-
permissions
|
|
10
|
+
permissions?: Permissions | undefined;
|
|
11
11
|
}): {
|
|
12
12
|
client_id: string;
|
|
13
13
|
keyAuthorization: {
|
|
14
14
|
account?: `0x${string}`;
|
|
15
15
|
address: `0x${string}`;
|
|
16
16
|
chainId: `0x${string}`;
|
|
17
|
-
expiry: number;
|
|
17
|
+
expiry: number | undefined;
|
|
18
18
|
keyType: "p256" | "secp256k1" | "webAuthn";
|
|
19
19
|
limits: {
|
|
20
20
|
limit: `0x${string}`;
|
package/dist/internal/request.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Hex } from 'ox';
|
|
|
9
9
|
* key account names its Tempo Account through `access`, and a plain key leaves it to Tempo Auth.
|
|
10
10
|
*/
|
|
11
11
|
export function request(auth, options) {
|
|
12
|
-
const { accessKey, permissions } = options;
|
|
12
|
+
const { accessKey, permissions = {} } = options;
|
|
13
13
|
return {
|
|
14
14
|
client_id: auth.clientId,
|
|
15
15
|
keyAuthorization: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempoxyz/auth",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-28.sha-124bc38",
|
|
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": {
|