@tinycloudlabs/web-core 0.2.1 → 1.0.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.
- package/LICENSE.md +320 -0
- package/dist/client/types.d.ts +23 -23
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.schema.d.ts +1853 -0
- package/dist/client/types.schema.d.ts.map +1 -0
- package/dist/client/types.schema.js +250 -0
- package/dist/client/types.schema.js.map +1 -0
- package/dist/types.d.ts +61 -61
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +83 -83
- package/dist/types.js.map +1 -1
- package/dist/types.schema.d.ts +594 -0
- package/dist/types.schema.d.ts.map +1 -0
- package/dist/types.schema.js +377 -0
- package/dist/types.schema.js.map +1 -0
- package/dist/utils/utils.d.ts +4 -4
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +16 -16
- package/dist/utils/utils.js.map +1 -1
- package/package.json +5 -4
package/LICENSE.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# TinyCloud Ecosystem General Public License (EGPL) v1.5
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2026 TinyCloud Labs. Based on the Ethereum General Public License v1.5.
|
|
4
|
+
Original EGPL copyright © 2025 [Lighthouse Labs](https://lighthouse.cx). All rights reserved.
|
|
5
|
+
|
|
6
|
+
## Parameters
|
|
7
|
+
|
|
8
|
+
**Licensor:** TinyCloud Labs
|
|
9
|
+
|
|
10
|
+
**Licensed Work:** TinyCloud Protocol
|
|
11
|
+
The Licensed Work is © 2026 TinyCloud Labs
|
|
12
|
+
|
|
13
|
+
**Additional Use Grant:** Integration testing and development use
|
|
14
|
+
|
|
15
|
+
**Transition Date:** 2030-01-01, or if not specified, the fourth anniversary of the first publicly available distribution of this version
|
|
16
|
+
|
|
17
|
+
**Transition License:** AGPL-3.0-or-later
|
|
18
|
+
|
|
19
|
+
**TinyCloud Network:** The TinyCloud ecosystem encompasses decentralized storage protocols,
|
|
20
|
+
user-owned data namespace systems, and platforms utilizing decentralized
|
|
21
|
+
identifiers (DIDs), delegation chains, and object capability (OCAP)
|
|
22
|
+
authorization models for secure, user-controlled data management.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
**TinyCloud-Aligned:** Any system that stores data within TinyCloud namespaces, uses TinyCloud's
|
|
26
|
+
DID-based authentication, or integrates with TinyCloud's delegation and
|
|
27
|
+
capability system for authorization.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Core Terms
|
|
31
|
+
|
|
32
|
+
The Licensor grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work for any purpose.
|
|
33
|
+
|
|
34
|
+
Before the Transition Date, production use is permitted only:
|
|
35
|
+
|
|
36
|
+
- By the Licensor;
|
|
37
|
+
- By parties explicitly authorized in writing by the Licensor;
|
|
38
|
+
- As specified in the Additional Use Grant above; or
|
|
39
|
+
- Under a separate commercial license from the Licensor.
|
|
40
|
+
|
|
41
|
+
On the Transition Date, the Licensed Work automatically becomes available under the Transition License. Additionally, production use on the TinyCloud Network and TinyCloud-Aligned Networks becomes freely permitted (subject to copyleft requirements in Section 3).
|
|
42
|
+
|
|
43
|
+
At all times (before and after the Transition Date), production use on Non-TinyCloud-Aligned Networks (networks that do not meet the TinyCloud-Aligned criteria) requires a separate commercial license from the Licensor.
|
|
44
|
+
|
|
45
|
+
Production use generating more than 100000 USD in annual recurring revenue requires a commercial license from the Licensor, regardless of TinyCloud alignment status.
|
|
46
|
+
|
|
47
|
+
All copies and derivative works must retain this License. If you deploy the Licensed Work where third parties can interact with it over a network, you must make the complete source code available under this License.
|
|
48
|
+
|
|
49
|
+
Any use in violation of this License automatically terminates your rights for all versions of the Licensed Work.
|
|
50
|
+
|
|
51
|
+
This License does not grant rights to trademarks, logos, or tokens associated with the Licensor or TinyCloud.
|
|
52
|
+
|
|
53
|
+
**TO THE EXTENT PERMITTED BY LAW, THE LICENSED WORK IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, AND THE LICENSOR SHALL NOT BE LIABLE FOR ANY DAMAGES ARISING FROM USE OF THE LICENSED WORK.**
|
|
54
|
+
|
|
55
|
+
## Detailed Provisions
|
|
56
|
+
|
|
57
|
+
### 1. Definitions
|
|
58
|
+
|
|
59
|
+
**"Licensed Work"** means the software (source code and object code) and documentation specified in the Parameters section above, made available under this License.
|
|
60
|
+
|
|
61
|
+
**"Licensor"** means the copyright holder specified in the Parameters section.
|
|
62
|
+
|
|
63
|
+
**"TinyCloud Network"** means The TinyCloud ecosystem encompasses decentralized storage protocols,
|
|
64
|
+
user-owned data namespace systems, and platforms utilizing decentralized
|
|
65
|
+
identifiers (DIDs), delegation chains, and object capability (OCAP)
|
|
66
|
+
authorization models for secure, user-controlled data management.
|
|
67
|
+
.
|
|
68
|
+
|
|
69
|
+
**"TinyCloud-Aligned Network"** means Any system that stores data within TinyCloud namespaces, uses TinyCloud's
|
|
70
|
+
DID-based authentication, or integrates with TinyCloud's delegation and
|
|
71
|
+
capability system for authorization.
|
|
72
|
+
.
|
|
73
|
+
|
|
74
|
+
**"Non-TinyCloud-Aligned Network"** means Systems that provide similar functionality for decentralized storage,
|
|
75
|
+
namespace management, or DID-based authorization that do not integrate
|
|
76
|
+
with or contribute to the TinyCloud ecosystem.
|
|
77
|
+
.
|
|
78
|
+
|
|
79
|
+
**"Production Use"** means any use of the Licensed Work to:
|
|
80
|
+
|
|
81
|
+
- Provide services to third parties
|
|
82
|
+
- Validate or execute transactions on a public network
|
|
83
|
+
- Operate publicly accessible infrastructure
|
|
84
|
+
- Generate revenue or operate in a live commercial environment
|
|
85
|
+
- Deploy smart contracts, validators, nodes, or applications that external parties interact with or rely upon
|
|
86
|
+
|
|
87
|
+
**Non-Production Use** includes internal testing, development, security auditing, academic research, or experimentation not made available to third parties and not used for revenue generation.
|
|
88
|
+
|
|
89
|
+
**"Transition Date"** means the date specified in the Parameters section, or if none is specified, the fourth anniversary of the first publicly available distribution of this specific version of the Licensed Work. Each version may have its own Transition Date, which may be updated by the Licensor to an earlier date but not a later date beyond four years from initial release.
|
|
90
|
+
|
|
91
|
+
**"Transition License"** means the license specified in the Parameters section (typically AGPL-3.0-or-later) that will govern the Licensed Work on and after the Transition Date.
|
|
92
|
+
|
|
93
|
+
**"Additional Use Grant"** means any specific production uses explicitly permitted before the Transition Date, as defined in the Parameters section or in a separate document referenced therein.
|
|
94
|
+
|
|
95
|
+
### 2. Grant of Rights
|
|
96
|
+
|
|
97
|
+
#### 2.1 Non-Production Rights
|
|
98
|
+
|
|
99
|
+
Subject to compliance with this License, the Licensor grants you a worldwide, royalty-free, non-exclusive license to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work in any environment or on any network.
|
|
100
|
+
|
|
101
|
+
#### 2.2 Production Use Before Transition Date
|
|
102
|
+
|
|
103
|
+
Before the Transition Date, Production Use of the Licensed Work is permitted only if you meet one of the following conditions:
|
|
104
|
+
|
|
105
|
+
- You are the Licensor; or
|
|
106
|
+
- You have written authorization from the Licensor explicitly granting you Production Use rights; or
|
|
107
|
+
- Your use falls within the Additional Use Grant specified in the Parameters section; or
|
|
108
|
+
- You have obtained a commercial license from the Licensor for such Production Use.
|
|
109
|
+
|
|
110
|
+
Any Production Use not meeting these conditions before the Transition Date is prohibited and constitutes a material breach of this License.
|
|
111
|
+
|
|
112
|
+
#### 2.3 Additional Use Grant Mechanism
|
|
113
|
+
|
|
114
|
+
The Licensor may specify an Additional Use Grant in the Parameters section to permit certain limited production uses before the Transition Date without requiring individual authorization. Such grants might include:
|
|
115
|
+
|
|
116
|
+
- Non-commercial production use on TinyCloud or aligned networks
|
|
117
|
+
- Production use by specified categories of users (e.g., researchers, non-profits)
|
|
118
|
+
- Beta testing by approved testers
|
|
119
|
+
- Use by ecosystem partners or grant recipients
|
|
120
|
+
- Other uses defined at a URL, ENS name, or in a separate document
|
|
121
|
+
|
|
122
|
+
If the Additional Use Grant field states "None," no additional production uses are permitted beyond those authorized directly by the Licensor.
|
|
123
|
+
|
|
124
|
+
#### 2.4 Rights Upon Transition Date
|
|
125
|
+
|
|
126
|
+
Effective on the Transition Date:
|
|
127
|
+
|
|
128
|
+
- **Transition License Applies:** The Licensed Work becomes available under the Transition License specified in the Parameters section, and you may exercise all rights granted by that license.
|
|
129
|
+
- **TinyCloud-Aligned Production Use:** You may make Production Use of the Licensed Work on the TinyCloud Network and TinyCloud-Aligned Networks without restriction, royalty, or commercial license, subject to the copyleft requirements in Section 3.
|
|
130
|
+
- **Prior Restrictions Lifted:** The early-stage production restrictions in Section 2.2 cease to apply, except as noted in Sections 2.5 and 2.6.
|
|
131
|
+
|
|
132
|
+
#### 2.5 Non-TinyCloud-Aligned Network Restriction (Permanent)
|
|
133
|
+
|
|
134
|
+
At all times, both before and after the Transition Date, Production Use on Non-TinyCloud-Aligned Networks requires a separate commercial license from the Licensor.
|
|
135
|
+
|
|
136
|
+
The Transition Date conversion does not grant rights to deploy the Licensed Work on Non-TinyCloud-Aligned Networks. Such use requires explicit commercial licensing regardless of when it occurs.
|
|
137
|
+
|
|
138
|
+
#### 2.6 Revenue Threshold
|
|
139
|
+
|
|
140
|
+
Production use generating more than 100000 USD in annual recurring revenue requires a commercial license from the Licensor, regardless of TinyCloud alignment status.
|
|
141
|
+
|
|
142
|
+
#### 2.7 Version-Specific Licensing
|
|
143
|
+
|
|
144
|
+
This License applies separately to each version of the Licensed Work released by the Licensor. Different versions may have different Transition Dates, Additional Use Grants, or other terms as specified in their respective Parameters sections. The Transition Date for one version does not affect the license terms for other versions.
|
|
145
|
+
|
|
146
|
+
### 3. Copyleft and Source Code Requirements
|
|
147
|
+
|
|
148
|
+
#### 3.1 License Preservation
|
|
149
|
+
|
|
150
|
+
All copies, modifications, and derivative works of the Licensed Work must be distributed under this License (before the Transition Date) or the Transition License (after the Transition Date). You must retain all copyright, license, and attribution notices present in the Licensed Work.
|
|
151
|
+
|
|
152
|
+
#### 3.2 Network Use as Distribution
|
|
153
|
+
|
|
154
|
+
Making the Licensed Work available for third parties to interact with over a network constitutes distribution under this License, even if no copy is directly transferred. This includes deploying smart contracts, operating blockchain nodes, running validators, or providing network services based on the Licensed Work.
|
|
155
|
+
|
|
156
|
+
#### 3.3 Source Code Disclosure
|
|
157
|
+
|
|
158
|
+
Whenever you distribute or deploy the Licensed Work (including through network deployment), you must make the complete corresponding source code available to all users/recipients under this License's terms. The source code must be:
|
|
159
|
+
|
|
160
|
+
- **Complete:** Include all source files, build scripts, configuration, and dependencies needed to compile and run the software
|
|
161
|
+
- **Accessible:** Published in a readily accessible location (e.g., public repository)
|
|
162
|
+
- **Timely:** Available simultaneously with or before the deployment
|
|
163
|
+
- **Unobfuscated:** Not protected by technical measures that prevent study or modification
|
|
164
|
+
- **Under This License:** Available under this License's terms (before Transition Date) or Transition License terms (after Transition Date)
|
|
165
|
+
|
|
166
|
+
Failure to provide source code as required is a material breach resulting in immediate license termination.
|
|
167
|
+
|
|
168
|
+
#### 3.4 Modifications and Derivative Works
|
|
169
|
+
|
|
170
|
+
Any modifications or derivative works you create must also be licensed under this License (or the Transition License after the Transition Date). You may not distribute or deploy modified versions under proprietary or incompatible terms.
|
|
171
|
+
|
|
172
|
+
You are encouraged (though not required before the Transition Date) to contribute improvements back to the original project or the TinyCloud community.
|
|
173
|
+
|
|
174
|
+
### 4. Transition Date and License Transition
|
|
175
|
+
|
|
176
|
+
#### 4.1 Automatic Conversion
|
|
177
|
+
|
|
178
|
+
On the Transition Date specified in the Parameters section, the Licensed Work automatically becomes available under the Transition License. From that date forward, the Transition License governs use of the Licensed Work, and the production restrictions in Section 2.2 cease to apply.
|
|
179
|
+
|
|
180
|
+
The Non-TinyCloud-Aligned Network restriction in Section 2.5 and the Revenue Threshold in Section 2.6 persist as separate commercial licensing arrangements at the Licensor's discretion.
|
|
181
|
+
|
|
182
|
+
#### 4.2 No Retroactive Effect
|
|
183
|
+
|
|
184
|
+
Conversion to the Transition License does not retroactively excuse violations that occurred before the Transition Date. The Licensor retains all rights to pursue remedies for prior breaches.
|
|
185
|
+
|
|
186
|
+
#### 4.3 Earlier Transition Date
|
|
187
|
+
|
|
188
|
+
The Licensor may specify an earlier Transition Date at any time by updating the Parameters section or publishing a notice at a referenced URL/ENS name. The Licensor cannot extend the Transition Date beyond four years from initial release.
|
|
189
|
+
|
|
190
|
+
### 5. Patent Grant
|
|
191
|
+
|
|
192
|
+
#### 5.1 License Grant
|
|
193
|
+
|
|
194
|
+
The Licensor grants you a worldwide, royalty-free, non-exclusive patent license under the Licensor's patent claims that are necessarily infringed by using or modifying the Licensed Work as permitted by this License.
|
|
195
|
+
|
|
196
|
+
#### 5.2 Patent Retaliation
|
|
197
|
+
|
|
198
|
+
If you initiate patent litigation against the Licensor, any contributor to the Licensed Work, or any user of the Licensed Work alleging that the Licensed Work infringes your patents, all patent licenses granted to you under this License immediately terminate.
|
|
199
|
+
|
|
200
|
+
### 6. Termination
|
|
201
|
+
|
|
202
|
+
#### 6.1 Automatic Termination
|
|
203
|
+
|
|
204
|
+
Your rights under this License automatically terminate immediately if you:
|
|
205
|
+
|
|
206
|
+
- Make Production Use before the Transition Date without authorization (Section 2.2)
|
|
207
|
+
- Deploy on a Non-TinyCloud-Aligned Network without a commercial license (Section 2.5)
|
|
208
|
+
- Exceed the Revenue Threshold without a commercial license (Section 2.6)
|
|
209
|
+
- Fail to provide source code as required (Section 3.3)
|
|
210
|
+
- Violate any other material term of this License
|
|
211
|
+
|
|
212
|
+
Termination applies to all versions of the Licensed Work licensed to you.
|
|
213
|
+
|
|
214
|
+
#### 6.2 No Cure Period
|
|
215
|
+
|
|
216
|
+
Terminated rights are not automatically restored. Restoration requires explicit written reinstatement from the Licensor. Ceasing the violation does not restore your rights.
|
|
217
|
+
|
|
218
|
+
#### 6.3 Downstream Recipients
|
|
219
|
+
|
|
220
|
+
Your termination does not affect rights of downstream recipients who are in compliance with the License, as they receive their license directly from the Licensor.
|
|
221
|
+
|
|
222
|
+
### 7. Warranty Disclaimer
|
|
223
|
+
|
|
224
|
+
THE LICENSED WORK IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE LICENSOR DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
|
|
225
|
+
|
|
226
|
+
You use the Licensed Work at your own risk and are solely responsible for determining its appropriateness for your purposes.
|
|
227
|
+
|
|
228
|
+
### 8. Limitation of Liability
|
|
229
|
+
|
|
230
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE LICENSOR SHALL NOT BE LIABLE FOR ANY DAMAGES (INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL, OR EXEMPLARY DAMAGES) ARISING FROM THIS LICENSE OR USE OF THE LICENSED WORK, even if advised of possible damages.
|
|
231
|
+
|
|
232
|
+
This includes but is not limited to: loss of profits, data, funds, tokens, or digital assets; business interruption; security vulnerabilities; or regulatory consequences.
|
|
233
|
+
|
|
234
|
+
Some jurisdictions do not allow liability exclusions; in such cases, liability is limited to the fullest extent permitted by law.
|
|
235
|
+
|
|
236
|
+
### 9. Indemnification
|
|
237
|
+
|
|
238
|
+
You agree to indemnify and hold harmless the Licensor and contributors from all claims, damages, and expenses (including attorneys' fees) arising from:
|
|
239
|
+
|
|
240
|
+
- Your use, modification, or distribution of the Licensed Work
|
|
241
|
+
- Your violation of this License
|
|
242
|
+
- Your violation of third-party rights
|
|
243
|
+
|
|
244
|
+
### 10. Miscellaneous
|
|
245
|
+
|
|
246
|
+
#### 10.1 No Trademark Rights
|
|
247
|
+
|
|
248
|
+
This License does not grant rights to use trademarks, logos, or brand names of the Licensor or TinyCloud. You may not imply endorsement by the Licensor or the TinyCloud community.
|
|
249
|
+
|
|
250
|
+
This License does not grant rights to any tokens or cryptocurrencies associated with the Licensed Work or TinyCloud.
|
|
251
|
+
|
|
252
|
+
#### 10.2 No Sublicensing
|
|
253
|
+
|
|
254
|
+
You may not sublicense the Licensed Work. Recipients receive their license directly from the Licensor under this License's terms.
|
|
255
|
+
|
|
256
|
+
#### 10.3 Entire Agreement
|
|
257
|
+
|
|
258
|
+
This License (together with any commercial license you obtain) constitutes the entire agreement regarding the Licensed Work.
|
|
259
|
+
|
|
260
|
+
#### 10.4 Severability
|
|
261
|
+
|
|
262
|
+
If any provision is unenforceable, it shall be reformed to the minimum extent necessary, and all other provisions remain in effect.
|
|
263
|
+
|
|
264
|
+
#### 10.5 No Waiver
|
|
265
|
+
|
|
266
|
+
Failure to enforce any provision does not waive future enforcement rights. Waivers must be in writing signed by the Licensor.
|
|
267
|
+
|
|
268
|
+
#### 10.6 Governing Law
|
|
269
|
+
|
|
270
|
+
This License is governed by the laws of the jurisdiction in which the Licensor is incorporated, without regard to conflicts of law principles.
|
|
271
|
+
|
|
272
|
+
#### 10.7 Export Compliance
|
|
273
|
+
|
|
274
|
+
You are responsible for complying with all export laws and regulations. You represent that you are not in a jurisdiction where export is prohibited.
|
|
275
|
+
|
|
276
|
+
#### 10.8 Conspicuous Display
|
|
277
|
+
|
|
278
|
+
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work from a third party, this License applies to your use of that work.
|
|
279
|
+
|
|
280
|
+
#### 10.9 License Text Reuse
|
|
281
|
+
|
|
282
|
+
Others may use this License text for their own works, provided they:
|
|
283
|
+
|
|
284
|
+
- Do not alter the substantive terms, alignment provisions, or copyleft requirements
|
|
285
|
+
- Replace Parameters section placeholders with their own details
|
|
286
|
+
- Specify an OSI-approved Transition License and a Transition Date within four years
|
|
287
|
+
- Use an appropriate name that reflects the ecosystem they are targeting
|
|
288
|
+
|
|
289
|
+
## Covenants of Licensor
|
|
290
|
+
|
|
291
|
+
In consideration of the right to use this License text, Licensor covenants to all recipients of the Licensed Work:
|
|
292
|
+
|
|
293
|
+
- To specify as the Transition License either AGPL-3.0-or-later or another OSI-approved license compatible with AGPL v3, where "compatible" means software under the Transition License can be combined with software under AGPL v3 or later versions.
|
|
294
|
+
- To either: (a) specify an Additional Use Grant that does not impose restrictions beyond this License, or (b) specify "None" if no additional production uses are granted before the Transition Date.
|
|
295
|
+
- To specify a Transition Date within four years of initial release.
|
|
296
|
+
- Not to modify the substantive protections, requirements, or structure of this License in ways that would defeat its purpose of protecting ecosystem alignment while ensuring eventual open-source release.
|
|
297
|
+
|
|
298
|
+
## Notice
|
|
299
|
+
|
|
300
|
+
This License is not an Open Source license as defined by the Open Source Initiative (OSI) during its initial term before the Transition Date. However, the Licensed Work will automatically become available under an Open Source license (the Transition License) on the Transition Date, as stated in this License.
|
|
301
|
+
|
|
302
|
+
This License is designed to protect software development for the TinyCloud ecosystem from parasitic use and commercial extraction by non-aligned networks, while ensuring the software eventually enters the open commons for all to use freely.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
**END OF LICENSE**
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Attribution
|
|
311
|
+
|
|
312
|
+
This software is licensed under the TinyCloud Ecosystem General Public License (EGPL),
|
|
313
|
+
based on the Ethereum General Public License by Lighthouse Labs.
|
|
314
|
+
See LICENSE.md for full terms.
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
This license is derived from the Ethereum General Public License (EGPL) v1.5 by Lighthouse Labs.
|
|
318
|
+
Original EGPL: Ethereum General Public License (EGPL) v1.5
|
|
319
|
+
|
|
320
|
+
For more information, visit [Lighthouse Labs](https://lighthouse.cx).
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { tcwSession } from '@tinycloudlabs/web-sdk-wasm';
|
|
2
2
|
import { AxiosInstance } from 'axios';
|
|
3
3
|
import { ethers } from 'ethers';
|
|
4
|
-
import {
|
|
4
|
+
import { EnsData, RPCProvider, ServerRoutes } from '../types';
|
|
5
5
|
/** Core config for TCW. */
|
|
6
|
-
export interface
|
|
6
|
+
export interface ClientConfig {
|
|
7
7
|
/** Connection to a cryptographic keypair and/or network. */
|
|
8
|
-
providers?:
|
|
8
|
+
providers?: ClientProviders;
|
|
9
9
|
/** Optional session configuration for the SIWE message. */
|
|
10
10
|
siweConfig?: SiweConfig;
|
|
11
11
|
/** Whether or not ENS resolution is enabled. True means resolve all on client. */
|
|
12
12
|
resolveEns?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/** Representation of an active TCWSession. */
|
|
15
|
-
export type
|
|
15
|
+
export type ClientSession = {
|
|
16
16
|
/** User address */
|
|
17
17
|
address: string;
|
|
18
18
|
/** User address without delegation */
|
|
@@ -25,18 +25,18 @@ export type TCWClientSession = {
|
|
|
25
25
|
/** The signature of the siwe message */
|
|
26
26
|
signature: string;
|
|
27
27
|
/** ENS data supported by TCW */
|
|
28
|
-
ens?:
|
|
28
|
+
ens?: EnsData;
|
|
29
29
|
};
|
|
30
30
|
/** The URL of the server running tcw-server. Providing this field enables SIWE server communication */
|
|
31
|
-
export type
|
|
31
|
+
export type ServerHost = string;
|
|
32
32
|
/** The tcw-powered server configuration settings */
|
|
33
|
-
export type
|
|
34
|
-
host:
|
|
33
|
+
export type ProviderServer = {
|
|
34
|
+
host: ServerHost;
|
|
35
35
|
/** Optional configuration for the server's routes. */
|
|
36
|
-
routes?:
|
|
36
|
+
routes?: ServerRoutes;
|
|
37
37
|
};
|
|
38
38
|
/** Web3 provider configuration settings */
|
|
39
|
-
export interface
|
|
39
|
+
export interface ProviderWeb3 {
|
|
40
40
|
/**
|
|
41
41
|
* window.ethereum for Metamask;
|
|
42
42
|
* web3modal.connect() for Web3Modal;
|
|
@@ -45,14 +45,14 @@ export interface TCWProviderWeb3 {
|
|
|
45
45
|
driver: any;
|
|
46
46
|
}
|
|
47
47
|
/** TCW web3 configuration settings */
|
|
48
|
-
export interface
|
|
48
|
+
export interface ClientProviders {
|
|
49
49
|
/** Web3 wallet provider */
|
|
50
|
-
web3?:
|
|
50
|
+
web3?: ProviderWeb3;
|
|
51
51
|
/** JSON RPC provider configurations */
|
|
52
|
-
rpc?:
|
|
52
|
+
rpc?: RPCProvider;
|
|
53
53
|
/** Optional reference to server running tcw-server.
|
|
54
54
|
* Providing this field enables communication with tcw-server */
|
|
55
|
-
server?:
|
|
55
|
+
server?: ProviderServer;
|
|
56
56
|
}
|
|
57
57
|
/** Optional session configuration for the SIWE message. */
|
|
58
58
|
export interface SiweConfig extends Partial<tcwSession.SiweConfig> {
|
|
@@ -64,13 +64,13 @@ export type ConfigOverrides = {
|
|
|
64
64
|
siwe?: SiweConfig;
|
|
65
65
|
};
|
|
66
66
|
/** Interface to an intermediate TCW state: connected, but not signed-in. */
|
|
67
|
-
export interface
|
|
67
|
+
export interface IConnected {
|
|
68
68
|
/** Instance of TCWSessionManager. */
|
|
69
69
|
builder: tcwSession.TCWSessionManager;
|
|
70
70
|
/** TCWConfig object. */
|
|
71
|
-
config:
|
|
71
|
+
config: ClientConfig;
|
|
72
72
|
/** List of enabled extensions. */
|
|
73
|
-
extensions:
|
|
73
|
+
extensions: Extension[];
|
|
74
74
|
/** Web3 provider. */
|
|
75
75
|
provider: ethers.providers.Web3Provider;
|
|
76
76
|
/** Promise that is initialized on construction to run the "afterConnect" methods of extensions. */
|
|
@@ -82,14 +82,14 @@ export interface ITCWConnected {
|
|
|
82
82
|
/** Method to apply the "afterConnect" methods and the delegated capabilities of the extensions. */
|
|
83
83
|
applyExtensions: () => Promise<void>;
|
|
84
84
|
/** Method to apply the "afterSignIn" methods of the extensions. */
|
|
85
|
-
afterSignIn: (session:
|
|
85
|
+
afterSignIn: (session: ClientSession) => Promise<void>;
|
|
86
86
|
/** Method to request the user to sign in. */
|
|
87
|
-
signIn: () => Promise<
|
|
87
|
+
signIn: () => Promise<ClientSession>;
|
|
88
88
|
/** Method to request the user to sign out. */
|
|
89
|
-
signOut: (session:
|
|
89
|
+
signOut: (session: ClientSession) => Promise<void>;
|
|
90
90
|
}
|
|
91
91
|
/** Interface for an extension to TCW. */
|
|
92
|
-
export interface
|
|
92
|
+
export interface Extension {
|
|
93
93
|
/** [recap] Capability namespace. */
|
|
94
94
|
namespace?: string;
|
|
95
95
|
/** [recap] Default delegated actions in capability namespace. */
|
|
@@ -103,8 +103,8 @@ export interface TCWExtension {
|
|
|
103
103
|
/** Hook to run after TCW has connected to the user's wallet.
|
|
104
104
|
* This can return an object literal to override the session configuration before the user
|
|
105
105
|
* signs in. */
|
|
106
|
-
afterConnect?(tcw:
|
|
106
|
+
afterConnect?(tcw: IConnected): Promise<ConfigOverrides>;
|
|
107
107
|
/** Hook to run after TCW has signed in. */
|
|
108
|
-
afterSignIn?(session:
|
|
108
|
+
afterSignIn?(session: ClientSession): Promise<void>;
|
|
109
109
|
}
|
|
110
110
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,2BAA2B;AAC3B,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,8CAA8C;AAC9C,MAAM,MAAM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