accounts 0.2.1 → 0.4.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.
Files changed (199) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +71 -71
  4. package/dist/core/AccessKey.d.ts +55 -0
  5. package/dist/core/AccessKey.d.ts.map +1 -0
  6. package/dist/core/AccessKey.js +69 -0
  7. package/dist/core/AccessKey.js.map +1 -0
  8. package/dist/core/Account.d.ts +91 -0
  9. package/dist/core/Account.d.ts.map +1 -0
  10. package/dist/core/Account.js +64 -0
  11. package/dist/core/Account.js.map +1 -0
  12. package/dist/core/Adapter.d.ts +187 -0
  13. package/dist/core/Adapter.d.ts.map +1 -0
  14. package/dist/core/Adapter.js +7 -0
  15. package/dist/core/Adapter.js.map +1 -0
  16. package/dist/core/Ceremony.d.ts +109 -0
  17. package/dist/core/Ceremony.d.ts.map +1 -0
  18. package/dist/core/Ceremony.js +104 -0
  19. package/dist/core/Ceremony.js.map +1 -0
  20. package/dist/core/Client.d.ts +16 -0
  21. package/dist/core/Client.d.ts.map +1 -0
  22. package/dist/core/Client.js +18 -0
  23. package/dist/core/Client.js.map +1 -0
  24. package/dist/core/Dialog.d.ts +52 -0
  25. package/dist/core/Dialog.d.ts.map +1 -0
  26. package/dist/core/Dialog.js +342 -0
  27. package/dist/core/Dialog.js.map +1 -0
  28. package/dist/core/Expiry.d.ts +15 -0
  29. package/dist/core/Expiry.d.ts.map +1 -0
  30. package/dist/core/Expiry.js +29 -0
  31. package/dist/core/Expiry.js.map +1 -0
  32. package/dist/core/Messenger.d.ts +86 -0
  33. package/dist/core/Messenger.d.ts.map +1 -0
  34. package/dist/core/Messenger.js +127 -0
  35. package/dist/core/Messenger.js.map +1 -0
  36. package/dist/core/Provider.d.ts +69 -0
  37. package/dist/core/Provider.d.ts.map +1 -0
  38. package/dist/core/Provider.js +401 -0
  39. package/dist/core/Provider.js.map +1 -0
  40. package/dist/core/Remote.d.ts +114 -0
  41. package/dist/core/Remote.d.ts.map +1 -0
  42. package/dist/core/Remote.js +116 -0
  43. package/dist/core/Remote.js.map +1 -0
  44. package/dist/core/Schema.d.ts +805 -0
  45. package/dist/core/Schema.d.ts.map +1 -0
  46. package/dist/core/Schema.js +43 -0
  47. package/dist/core/Schema.js.map +1 -0
  48. package/dist/core/Storage.d.ts +42 -0
  49. package/dist/core/Storage.d.ts.map +1 -0
  50. package/dist/core/Storage.js +173 -0
  51. package/dist/core/Storage.js.map +1 -0
  52. package/dist/core/Store.d.ts +58 -0
  53. package/dist/core/Store.d.ts.map +1 -0
  54. package/dist/core/Store.js +58 -0
  55. package/dist/core/Store.js.map +1 -0
  56. package/dist/core/adapters/dangerous_secp256k1.d.ts +30 -0
  57. package/dist/core/adapters/dangerous_secp256k1.d.ts.map +1 -0
  58. package/dist/core/adapters/dangerous_secp256k1.js +39 -0
  59. package/dist/core/adapters/dangerous_secp256k1.js.map +1 -0
  60. package/dist/core/adapters/dialog.d.ts +31 -0
  61. package/dist/core/adapters/dialog.d.ts.map +1 -0
  62. package/dist/core/adapters/dialog.js +306 -0
  63. package/dist/core/adapters/dialog.js.map +1 -0
  64. package/dist/core/adapters/local.d.ts +33 -0
  65. package/dist/core/adapters/local.d.ts.map +1 -0
  66. package/dist/core/adapters/local.js +227 -0
  67. package/dist/core/adapters/local.js.map +1 -0
  68. package/dist/core/adapters/webAuthn.d.ts +36 -0
  69. package/dist/core/adapters/webAuthn.d.ts.map +1 -0
  70. package/dist/core/adapters/webAuthn.js +93 -0
  71. package/dist/core/adapters/webAuthn.js.map +1 -0
  72. package/dist/core/internal/withDedupe.d.ts +12 -0
  73. package/dist/core/internal/withDedupe.d.ts.map +1 -0
  74. package/dist/core/internal/withDedupe.js +12 -0
  75. package/dist/core/internal/withDedupe.js.map +1 -0
  76. package/dist/core/zod/request.d.ts +31 -0
  77. package/dist/core/zod/request.d.ts.map +1 -0
  78. package/dist/core/zod/request.js +41 -0
  79. package/dist/core/zod/request.js.map +1 -0
  80. package/dist/core/zod/rpc.d.ts +603 -0
  81. package/dist/core/zod/rpc.d.ts.map +1 -0
  82. package/dist/core/zod/rpc.js +293 -0
  83. package/dist/core/zod/rpc.js.map +1 -0
  84. package/dist/core/zod/utils.d.ts +18 -0
  85. package/dist/core/zod/utils.d.ts.map +1 -0
  86. package/dist/core/zod/utils.js +21 -0
  87. package/dist/core/zod/utils.js.map +1 -0
  88. package/dist/index.d.ts +15 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.js +15 -0
  91. package/dist/index.js.map +1 -0
  92. package/dist/internal/types.d.ts +284 -0
  93. package/dist/internal/types.d.ts.map +1 -0
  94. package/dist/internal/types.js +2 -0
  95. package/dist/internal/types.js.map +1 -0
  96. package/dist/server/Handler.d.ts +257 -0
  97. package/dist/server/Handler.d.ts.map +1 -0
  98. package/dist/server/Handler.js +433 -0
  99. package/dist/server/Handler.js.map +1 -0
  100. package/dist/server/Kv.d.ts +16 -0
  101. package/dist/server/Kv.d.ts.map +1 -0
  102. package/dist/server/Kv.js +30 -0
  103. package/dist/server/Kv.js.map +1 -0
  104. package/dist/server/index.d.ts +3 -0
  105. package/dist/server/index.d.ts.map +1 -0
  106. package/dist/server/index.js +3 -0
  107. package/dist/server/index.js.map +1 -0
  108. package/dist/server/internal/requestListener.d.ts +124 -0
  109. package/dist/server/internal/requestListener.d.ts.map +1 -0
  110. package/dist/server/internal/requestListener.js +173 -0
  111. package/dist/server/internal/requestListener.js.map +1 -0
  112. package/dist/wagmi/Connector.d.ts +93 -0
  113. package/dist/wagmi/Connector.d.ts.map +1 -0
  114. package/dist/wagmi/Connector.js +238 -0
  115. package/dist/wagmi/Connector.js.map +1 -0
  116. package/dist/wagmi/index.d.ts +3 -0
  117. package/dist/wagmi/index.d.ts.map +1 -0
  118. package/dist/wagmi/index.js +3 -0
  119. package/dist/wagmi/index.js.map +1 -0
  120. package/package.json +103 -28
  121. package/src/core/AccessKey.test.ts +257 -0
  122. package/src/core/AccessKey.ts +123 -0
  123. package/src/core/Account.test.ts +309 -0
  124. package/src/core/Account.ts +152 -0
  125. package/src/core/Adapter.ts +238 -0
  126. package/src/core/Ceremony.browser.test.ts +239 -0
  127. package/src/core/Ceremony.test.ts +151 -0
  128. package/src/core/Ceremony.ts +203 -0
  129. package/src/core/Client.ts +36 -0
  130. package/src/core/Dialog.browser.test.ts +309 -0
  131. package/src/core/Dialog.test-d.ts +19 -0
  132. package/src/core/Dialog.ts +442 -0
  133. package/src/core/Expiry.ts +34 -0
  134. package/src/core/Messenger.ts +206 -0
  135. package/src/core/Provider.browser.test.ts +774 -0
  136. package/src/core/Provider.connect.browser.test.ts +415 -0
  137. package/src/core/Provider.test-d.ts +53 -0
  138. package/src/core/Provider.test.ts +1566 -0
  139. package/src/core/Provider.ts +559 -0
  140. package/src/core/Remote.ts +262 -0
  141. package/src/core/Schema.test-d.ts +211 -0
  142. package/src/core/Schema.ts +143 -0
  143. package/src/core/Storage.ts +213 -0
  144. package/src/core/Store.test.ts +287 -0
  145. package/src/core/Store.ts +129 -0
  146. package/src/core/adapters/dangerous_secp256k1.ts +53 -0
  147. package/src/core/adapters/dialog.ts +379 -0
  148. package/src/core/adapters/local.test.ts +97 -0
  149. package/src/core/adapters/local.ts +277 -0
  150. package/src/core/adapters/webAuthn.ts +129 -0
  151. package/src/core/internal/withDedupe.test.ts +116 -0
  152. package/src/core/internal/withDedupe.ts +20 -0
  153. package/src/core/mppx.test.ts +83 -0
  154. package/src/core/zod/request.test.ts +121 -0
  155. package/src/core/zod/request.ts +70 -0
  156. package/src/core/zod/rpc.ts +374 -0
  157. package/src/core/zod/utils.test.ts +69 -0
  158. package/src/core/zod/utils.ts +40 -0
  159. package/src/index.ts +14 -0
  160. package/src/internal/types.ts +378 -0
  161. package/src/server/Handler.test.ts +1014 -0
  162. package/src/server/Handler.ts +605 -0
  163. package/src/server/Kv.ts +46 -0
  164. package/src/server/index.ts +2 -0
  165. package/src/server/internal/requestListener.ts +273 -0
  166. package/src/tsconfig.json +9 -0
  167. package/src/wagmi/Connector.ts +287 -0
  168. package/src/wagmi/index.ts +2 -0
  169. package/lib/admin/hooks.js +0 -26
  170. package/lib/admin/index.js +0 -14
  171. package/lib/admin/methods.js +0 -6
  172. package/lib/app.js +0 -50
  173. package/lib/apps/helpers.js +0 -11
  174. package/lib/apps/hooks.js +0 -32
  175. package/lib/apps/index.js +0 -25
  176. package/lib/apps/methods.js +0 -23
  177. package/lib/apps/schemas.js +0 -49
  178. package/lib/fields/helpers.js +0 -8
  179. package/lib/fields/hooks.js +0 -30
  180. package/lib/fields/index.js +0 -26
  181. package/lib/fields/methods.js +0 -13
  182. package/lib/fields/schemas.js +0 -19
  183. package/lib/identities/helpers.js +0 -20
  184. package/lib/identities/hooks.js +0 -30
  185. package/lib/identities/index.js +0 -26
  186. package/lib/identities/methods.js +0 -61
  187. package/lib/identities/schemas.js +0 -137
  188. package/lib/index.js +0 -51
  189. package/lib/login.js +0 -61
  190. package/lib/options.js +0 -21
  191. package/lib/storage_bind.js +0 -96
  192. package/lib/user_profile.js +0 -44
  193. package/lib/users/helpers.js +0 -26
  194. package/lib/users/hooks.js +0 -30
  195. package/lib/users/index.js +0 -26
  196. package/lib/users/methods.js +0 -43
  197. package/lib/users/schemas.js +0 -112
  198. package/lib/utils.js +0 -18
  199. package/lib/validator.js +0 -46
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # accounts
2
+
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f257ccc: Initial release.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present weth, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,97 +1,97 @@
1
- # node-accounts
1
+ # Tempo Accounts SDK
2
2
 
3
- **accounts** is a simple User Management module for Node.js.
3
+ Accounts SDK for Tempo Wallets & Apps.
4
4
 
5
- Current version supports logins only with providers(Google, Yahoo, Facebook, etc.).
5
+ ## Install
6
+
7
+ ```sh
8
+ pnpm i accounts
9
+ ```
6
10
 
7
11
  ## Usage
8
12
 
9
- All you need to do is to create an application, and then use appId for managing users.
13
+ ### Vanilla JS
10
14
 
11
- #### Create a new app
12
- ```
13
- var Accounts = require('accounts')(storage, options);
14
- var appId;
15
-
16
- Accounts.apps.create({
17
- name: 'Test app'
18
- }).then(function(app) {
19
- appId = app.id;
20
- });
21
- ```
15
+ You can get set up with the Accounts SDK with pure JavaScript by using the
16
+ `Provider` instance.
22
17
 
23
- #### Provider login
24
- ```
25
- var Accounts = require('accounts')(storage);
26
- var appId = process.env.ACCOUNTS_APP_ID;
27
- var App = Accounts.app(appId);
28
-
29
- App.login('social', profile)
30
- .then(function(user) {
31
- if (user) {
32
- console.log(user);
33
- }
34
- else {
35
- console.log('login faild');
36
- }
37
- });
38
- ```
39
- Where `Profile` is a Passport [User Profile](http://passportjs.org/guide/profile/)
40
- ```
41
- var profile = {
42
- provider: 'facebook',
43
- id: '123124234235123',
44
- displayName: 'Dumitru K',
45
- accessData: {
46
- accessToken:'dsgsgs', refreshToken:'gerge'
47
- }
48
- };
49
- ```
18
+ Internally, the `Provider` utilizes [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) to inject it's provider instance into
19
+ the page so it can be picked up by wallet connection dialogs on external web applications.
50
20
 
51
- ## API
21
+ ```tsx
22
+ import { Provider } from 'accounts'
52
23
 
53
- ### (storage, options)
24
+ const provider = Provider.create()
54
25
 
55
- Creates a new Client.
26
+ const { accounts } = await provider.request({
27
+ method: 'wallet_connect',
28
+ })
29
+ ```
56
30
 
57
- ## Client API
31
+ ### Viem
58
32
 
59
- ### admin
33
+ The Provider provides a Viem Client instance via the `getClient` accessor.
60
34
 
61
- - **sync**() - Syncronize DB tables.
62
- - **drop**(secret) - Drop DB tables. Useful for tests.
35
+ ```tsx
36
+ import { Provider } from 'accounts'
63
37
 
64
- ### apps
38
+ const provider = Provider.create()
65
39
 
66
- - **create**(data) - Create a new application.
67
- - **getById**(id) - Get an application by id.
40
+ const client = provider.getClient()
41
+ ```
68
42
 
69
- ### app(appId)
43
+ ### Wagmi
70
44
 
71
- Creates a new Application Client for a given app id.
45
+ Use the `tempoWallet` Wagmi connector to allow your Wagmi application to enable the Tempo Wallet dialog.
72
46
 
73
- ## Application Client API
47
+ ```tsx
48
+ import { createConfig, http } from 'wagmi'
49
+ import { tempo } from 'wagmi/chains'
50
+ import { tempoWallet } from 'accounts/wagmi'
74
51
 
75
- ### login(type, data, options) - User login.
52
+ export const wagmiConfig = createConfig({
53
+ chains: [tempo],
54
+ connectors: [tempoWallet()],
55
+ transports: {
56
+ [tempo.id]: http(),
57
+ },
58
+ })
59
+ ```
76
60
 
77
- ### users
61
+ ## Adapters
62
+
63
+ | Adapter | Description |
64
+ | ------------------------ | ---------------------------------------------------------------------------------- |
65
+ | `dialog` / `tempoWallet` | Adapter for the Tempo Wallet dialog (an embedded iframe/popup dialog). |
66
+ | `webAuthn` | App-bound passkey accounts using WebAuthn registration and authentication flows. |
67
+ | `local` | Key agnostic adapter to define arbitrary account/key types and signing mechanisms. |
68
+
69
+ ## Development
70
+
71
+ ```sh
72
+ pnpm dev # start embed + embed-ref + playground dev servers
73
+ pnpm dev:embed # start Tempo Wallet embed only
74
+ pnpm dev:embed-ref # start reference embed implementation only (port 5174)
75
+ pnpm dev:playground # start playground app only
76
+ pnpm dev:hosts # start embed + playground instances on different TLDs
77
+ pnpm build # build library
78
+ pnpm check # lint + format
79
+ pnpm check:types # type checks
80
+ pnpm test # run tests
81
+ ```
78
82
 
79
- - **create**(data, options) - Create a new user.
80
- - **getById**(id, options) - Get an user object by id.
81
- - **update**(data, options) - Update user fields.
82
- - **deleteById**(id, options) - Delete an user by id.
83
+ > `pnpm dev:hosts` starts three dev servers on different domains for cross-origin testing:
84
+ >
85
+ > - `https://app.moderato.tempo.local:3001`
86
+ > - `https://playground.a:5173`
87
+ > - `https://playground.b:5175`
83
88
 
84
- ### identities
89
+ ### Embed Reference Implementation
85
90
 
86
- - **create**(data, options) - Create a new identity.
87
- - **getById**(id, options) - Get an user identity by id.
88
- - **findByUserId**(userId, options) - Find user identities by user id.
89
- - **update**(data, options) - Update an identity.
90
- - **deleteById**(id, options) - Delete an user identity by id.
91
- - **deleteByUserId**(userId, options) - Delete user identities by user id.
91
+ The `embed-ref/` directory contains a minimal, unstyled reference implementation of the embed dialog app. It demonstrates how to build a custom embed using the Account SDK's `Remote` API.
92
92
 
93
+ Select `dialogRefImpl` in the playground's adapter dropdown to test against it.
93
94
 
94
- ## Storages
95
+ ## License
95
96
 
96
- - DynamoDB: [dynamo-accounts](https://github.com/Mitica/dynamo-accounts);
97
- - MongoDB: [mongo-accounts](https://github.com/Mitica/mongo-accounts);
97
+ MIT
@@ -0,0 +1,55 @@
1
+ import { Address, WebCryptoP256 } from 'ox';
2
+ import { KeyAuthorization } from 'ox/tempo';
3
+ import { Account as TempoAccount } from 'viem/tempo';
4
+ import type * as Store from './Store.js';
5
+ /** Returns the pending key authorization for an access key account without removing it. */
6
+ export declare function getPending(account: TempoAccount.Account, options: {
7
+ store: Store.Store;
8
+ }): KeyAuthorization.Signed | undefined;
9
+ /** Generates a P256 key pair and access key account. */
10
+ export declare function generate(options?: generate.Options): Promise<generate.ReturnType>;
11
+ export declare namespace generate {
12
+ type Options = {
13
+ /** Root account to attach to the access key. */
14
+ account?: TempoAccount.Account | undefined;
15
+ };
16
+ type ReturnType = {
17
+ /** The generated access key account. */
18
+ accessKey: TempoAccount.AccessKeyAccount;
19
+ /** Generated key pair to pass to `authorizeAccessKey`. */
20
+ keyPair: Awaited<globalThis.ReturnType<typeof WebCryptoP256.createKeyPair>>;
21
+ };
22
+ }
23
+ /** Removes an access key entry for the given account from the store. */
24
+ export declare function remove(account: TempoAccount.Account, options: {
25
+ store: Store.Store;
26
+ }): void;
27
+ /** Permanently removes the pending key authorization for an access key account. */
28
+ export declare function removePending(account: TempoAccount.Account, options: {
29
+ store: Store.Store;
30
+ }): void;
31
+ /** Removes an access key from the store. */
32
+ export declare function revoke(options: revoke.Options): void;
33
+ export declare namespace revoke {
34
+ type Options = {
35
+ /** Root account address. */
36
+ address: Address.Address;
37
+ /** Reactive state store. */
38
+ store: Store.Store;
39
+ };
40
+ }
41
+ /** Saves an access key to the store with its one-time key authorization. */
42
+ export declare function save(options: save.Options): void;
43
+ export declare namespace save {
44
+ type Options = {
45
+ /** Root account address that owns this access key. */
46
+ address: Address.Address;
47
+ /** Signed key authorization to attach to the first transaction. */
48
+ keyAuthorization: KeyAuthorization.Signed;
49
+ /** The WebCrypto key pair backing the access key. Only present for locally-generated keys. */
50
+ keyPair?: Awaited<ReturnType<typeof WebCryptoP256.createKeyPair>> | undefined;
51
+ /** Reactive state store. */
52
+ store: Store.Store;
53
+ };
54
+ }
55
+ //# sourceMappingURL=AccessKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessKey.d.ts","sourceRoot":"","sources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,IAAI,CAWN;AAED,4CAA4C;AAC5C,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAMpD;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,KAAK,OAAO,GAAG;QACb,4BAA4B;QAC5B,OAAO,EAAE,OAAO,CAAC,OAAO,CAAA;QACxB,4BAA4B;QAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAA;KACnB,CAAA;CACF;AAED,4EAA4E;AAC5E,wBAAgB,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAiBhD;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,KAAK,OAAO,GAAG;QACb,sDAAsD;QACtD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAA;QACxB,mEAAmE;QACnE,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CAAA;QACzC,8FAA8F;QAC9F,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,aAAa,CAAC,CAAC,GAAG,SAAS,CAAA;QAC7E,4BAA4B;QAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAA;KACnB,CAAA;CACF"}
@@ -0,0 +1,69 @@
1
+ import { Address, WebCryptoP256 } from 'ox';
2
+ import { KeyAuthorization } from 'ox/tempo';
3
+ import { Account as TempoAccount } from 'viem/tempo';
4
+ /** Returns the pending key authorization for an access key account without removing it. */
5
+ export function getPending(account, options) {
6
+ if (account.source !== 'accessKey')
7
+ return undefined;
8
+ const { store } = options;
9
+ const accessKeyAddress = account.accessKeyAddress;
10
+ const { accessKeys } = store.getState();
11
+ const entry = accessKeys.find((a) => a.address?.toLowerCase() === accessKeyAddress.toLowerCase());
12
+ return entry?.keyAuthorization;
13
+ }
14
+ /** Generates a P256 key pair and access key account. */
15
+ export async function generate(options = {}) {
16
+ const { account } = options;
17
+ const keyPair = await WebCryptoP256.createKeyPair();
18
+ const accessKey = TempoAccount.fromWebCryptoP256(keyPair, account ? { access: account } : undefined);
19
+ return { accessKey, keyPair };
20
+ }
21
+ /** Removes an access key entry for the given account from the store. */
22
+ export function remove(account, options) {
23
+ if (account.source !== 'accessKey')
24
+ return;
25
+ const { store } = options;
26
+ const accessKeyAddress = account.accessKeyAddress;
27
+ store.setState((state) => ({
28
+ accessKeys: state.accessKeys.filter((a) => a.address?.toLowerCase() !== accessKeyAddress?.toLowerCase()),
29
+ }));
30
+ }
31
+ /** Permanently removes the pending key authorization for an access key account. */
32
+ export function removePending(account, options) {
33
+ if (account.source !== 'accessKey')
34
+ return;
35
+ const { store } = options;
36
+ const accessKeyAddress = account.accessKeyAddress;
37
+ store.setState((state) => ({
38
+ accessKeys: state.accessKeys.map((a) => a.address.toLowerCase() === accessKeyAddress.toLowerCase()
39
+ ? { ...a, keyAuthorization: undefined }
40
+ : a),
41
+ }));
42
+ }
43
+ /** Removes an access key from the store. */
44
+ export function revoke(options) {
45
+ const { address, store } = options;
46
+ const { accessKeys } = store.getState();
47
+ store.setState({
48
+ accessKeys: accessKeys.filter((a) => a.access.toLowerCase() !== address.toLowerCase()),
49
+ });
50
+ }
51
+ /** Saves an access key to the store with its one-time key authorization. */
52
+ export function save(options) {
53
+ const { address, keyAuthorization, keyPair, store } = options;
54
+ store.setState((state) => ({
55
+ accessKeys: [
56
+ {
57
+ address: keyAuthorization.address,
58
+ access: address,
59
+ expiry: keyAuthorization.expiry ?? undefined,
60
+ keyAuthorization,
61
+ keyType: keyAuthorization.type,
62
+ limits: keyAuthorization.limits,
63
+ ...(keyPair ? { keyPair } : {}),
64
+ },
65
+ ...state.accessKeys,
66
+ ],
67
+ }));
68
+ }
69
+ //# sourceMappingURL=AccessKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessKey.js","sourceRoot":"","sources":["../../src/core/AccessKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;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C;AAWD,4EAA4E;AAC5E,MAAM,UAAU,IAAI,CAAC,OAAqB;IACxC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;IAE7D,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACzB,UAAU,EAAE;YACV;gBACE,OAAO,EAAE,gBAAgB,CAAC,OAAO;gBACjC,MAAM,EAAE,OAAO;gBACf,MAAM,EAAE,gBAAgB,CAAC,MAAM,IAAI,SAAS;gBAC5C,gBAAgB;gBAChB,OAAO,EAAE,gBAAgB,CAAC,IAAI;gBAC9B,MAAM,EAAE,gBAAgB,CAAC,MAAiE;gBAC1F,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAChC;YACD,GAAG,KAAK,CAAC,UAAU;SACpB;KACF,CAAC,CAAC,CAAA;AACL,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { type WebCryptoP256 } from 'ox';
2
+ import { type KeyAuthorization } from 'ox/tempo';
3
+ import type { Hex } from 'viem';
4
+ import type { Address, JsonRpcAccount } from 'viem/accounts';
5
+ import { Account as TempoAccount } from 'viem/tempo';
6
+ import type { OneOf } from '../internal/types.js';
7
+ import type * as core_Store from './Store.js';
8
+ /** Account stored in the provider state. */
9
+ export type Store = {
10
+ /** Account address. */
11
+ address: Address;
12
+ } & OneOf<{} | Pick<TempoAccount.Account, 'keyType' | 'sign'> | {
13
+ keyType: 'secp256k1';
14
+ privateKey: Hex;
15
+ } | {
16
+ keyType: 'p256';
17
+ privateKey: Hex;
18
+ } | {
19
+ keyType: 'webAuthn';
20
+ credential: {
21
+ id: string;
22
+ publicKey: Hex;
23
+ rpId: string;
24
+ };
25
+ } | {
26
+ keyType: 'webCrypto';
27
+ keyPair: Awaited<ReturnType<typeof WebCryptoP256.createKeyPair>>;
28
+ } | {
29
+ keyType: 'webAuthn_headless';
30
+ privateKey: Hex;
31
+ rpId: string;
32
+ origin: string;
33
+ }>;
34
+ /** Access key entry stored alongside accounts. */
35
+ export type AccessKey = {
36
+ /** Access key address. */
37
+ address: Address;
38
+ /** Owner of the access key. */
39
+ access: Address;
40
+ /** Unix timestamp when the access key expires. */
41
+ expiry?: number | undefined;
42
+ /** Signed key authorization to attach to the first transaction. Consumed on use. */
43
+ keyAuthorization?: KeyAuthorization.Signed | undefined;
44
+ /** The WebCrypto key pair backing the access key. Only present for locally-generated keys. */
45
+ keyPair?: Awaited<ReturnType<typeof WebCryptoP256.createKeyPair>> | undefined;
46
+ /** Key type. */
47
+ keyType: 'secp256k1' | 'p256' | 'webAuthn' | 'webCrypto';
48
+ /** TIP-20 spending limits for the access key. */
49
+ limits?: {
50
+ token: Address;
51
+ limit: bigint;
52
+ }[] | undefined;
53
+ };
54
+ /** Resolves a viem Account from the store by address (or active account). */
55
+ export declare function find(options: find.Options & {
56
+ signable: true;
57
+ }): TempoAccount.Account;
58
+ export declare function find(options: find.Options): TempoAccount.Account | JsonRpcAccount;
59
+ export declare namespace find {
60
+ type Options = {
61
+ /** Whether to resolve an access key for this account. @default true */
62
+ accessKey?: boolean | undefined;
63
+ /** Address to resolve. Defaults to the active account. */
64
+ address?: Address | undefined;
65
+ /** Whether to hydrate signing capability. @default false */
66
+ signable?: boolean | undefined;
67
+ /** Reactive state store. */
68
+ store: core_Store.Store;
69
+ };
70
+ }
71
+ /** Overloaded signature for `find` without `store` (pre-bound by the provider). */
72
+ export type Find = {
73
+ (options: Omit<find.Options, 'store'> & {
74
+ signable: true;
75
+ }): TempoAccount.Account;
76
+ (options?: Omit<find.Options, 'store'>): TempoAccount.Account | JsonRpcAccount;
77
+ };
78
+ /** Hydrates an access key entry to a viem Account. Only works for locally-generated keys with a `keyPair`. */
79
+ export declare function hydrateAccessKey(accessKey: AccessKey): TempoAccount.Account;
80
+ /** Hydrates a store account to a viem Account. */
81
+ export declare function hydrate(account: Store, options: {
82
+ signable: true;
83
+ }): TempoAccount.Account;
84
+ export declare function hydrate(account: Store, options?: hydrate.Options): TempoAccount.Account | JsonRpcAccount;
85
+ export declare namespace hydrate {
86
+ type Options = {
87
+ /** Whether to hydrate signing capability. @default false */
88
+ signable?: boolean | undefined;
89
+ };
90
+ }
91
+ //# sourceMappingURL=Account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../src/core/Account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,IAAI,CAAA;AACjD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,KAAK,UAAU,MAAM,YAAY,CAAA;AAE7C,4CAA4C;AAC5C,MAAM,MAAM,KAAK,GAAG;IAClB,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,KAAK,CACL,EAAE,GACF,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC,GAC9C;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAAE,GACzC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAAE,GACpC;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,GAAG,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACjF;IACE,OAAO,EAAE,WAAW,CAAA;IACp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A0D;QAC1D,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QAC7B,4DAA4D;QAC5D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QAC9B,4BAA4B;QAC5B,KAAK,EAAE,UAAU,CAAC,KAAK,CAAA;KACxB,CAAA;CACF;AAED,mFAAmF;AACnF,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,GAAG,YAAY,CAAC,OAAO,CAAA;IACjF,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,GAAG,cAAc,CAAA;CAC/E,CAAA;AAED,8GAA8G;AAC9G,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAAC,OAAO,CAM3E;AAED,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAAG,YAAY,CAAC,OAAO,CAAA;AAC1F,wBAAgB,OAAO,CACrB,OAAO,EAAE,KAAK,EACd,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,GACxB,YAAY,CAAC,OAAO,GAAG,cAAc,CAAA;AAgCxC,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,KAAK,OAAO,GAAG;QACb,4DAA4D;QAC5D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAC/B,CAAA;CACF"}
@@ -0,0 +1,64 @@
1
+ import { Provider } from 'ox';
2
+ import {} from 'ox/tempo';
3
+ import { Account as TempoAccount } from 'viem/tempo';
4
+ export function find(options) {
5
+ const { accessKey = true, address, signable = false, store } = options;
6
+ const { accessKeys, accounts, activeAccount } = store.getState();
7
+ const activeAddr = accounts[activeAccount]?.address;
8
+ const root = address
9
+ ? accounts.find((a) => a.address === address)
10
+ : accounts.find((a) => a.address === activeAddr);
11
+ if (!root)
12
+ throw address
13
+ ? new Provider.UnauthorizedError({ message: `Account "${address}" not found.` })
14
+ : new Provider.DisconnectedError({ message: 'No active account.' });
15
+ // When accessKey is requested, prefer a locally-signable access key for this address.
16
+ if (accessKey) {
17
+ const key = accessKeys.find((a) => a.access.toLowerCase() === root.address.toLowerCase() && a.keyPair);
18
+ if (key) {
19
+ // Remove expired access keys.
20
+ if (key.expiry && key.expiry < Date.now() / 1000)
21
+ store.setState({ accessKeys: accessKeys.filter((a) => a !== key) });
22
+ else
23
+ return hydrateAccessKey(key);
24
+ }
25
+ }
26
+ return hydrate(root, { signable });
27
+ }
28
+ /** Hydrates an access key entry to a viem Account. Only works for locally-generated keys with a `keyPair`. */
29
+ export function hydrateAccessKey(accessKey) {
30
+ if (!accessKey.keyPair)
31
+ throw new Provider.UnauthorizedError({
32
+ message: 'External access key cannot be hydrated for signing.',
33
+ });
34
+ return TempoAccount.fromWebCryptoP256(accessKey.keyPair, { access: accessKey.access });
35
+ }
36
+ export function hydrate(account, options = {}) {
37
+ const { signable = false } = options;
38
+ if (!signable)
39
+ return { address: account.address, type: 'json-rpc' };
40
+ if ('sign' in account && typeof account.sign === 'function')
41
+ return account;
42
+ if (!account.keyType)
43
+ throw new Provider.UnauthorizedError({ message: `Account "${account.address}" cannot sign.` });
44
+ switch (account.keyType) {
45
+ case 'secp256k1':
46
+ return TempoAccount.fromSecp256k1(account.privateKey);
47
+ case 'p256':
48
+ return TempoAccount.fromP256(account.privateKey);
49
+ case 'webCrypto':
50
+ return TempoAccount.fromWebCryptoP256(account.keyPair);
51
+ case 'webAuthn':
52
+ return TempoAccount.fromWebAuthnP256(account.credential, {
53
+ rpId: account.credential.rpId,
54
+ });
55
+ case 'webAuthn_headless':
56
+ return TempoAccount.fromHeadlessWebAuthn(account.privateKey, {
57
+ rpId: account.rpId,
58
+ origin: account.origin,
59
+ });
60
+ default:
61
+ throw new Provider.UnauthorizedError({ message: 'Unknown key type.' });
62
+ }
63
+ }
64
+ //# sourceMappingURL=Account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Account.js","sourceRoot":"","sources":["../../src/core/Account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,IAAI,CAAA;AACjD,OAAO,EAAyB,MAAM,UAAU,CAAA;AAGhD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,YAAY,CAAA;AAgDpD,MAAM,UAAU,IAAI,CAAC,OAAqB;IACxC,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;IACtE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;IAEhE,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;IACnD,MAAM,IAAI,GAAG,OAAO;QAClB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC;QAC7C,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,CAAA;IAClD,IAAI,CAAC,IAAI;QACP,MAAM,OAAO;YACX,CAAC,CAAC,IAAI,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,YAAY,OAAO,cAAc,EAAE,CAAC;YAChF,CAAC,CAAC,IAAI,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAA;IAEvE,sFAAsF;IACtF,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CACzB,CA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