@tinycloud/web-sdk 0.0.0-beta-20260401001229
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/README.md +151 -0
- package/dist/adapters/BrowserENSResolver.d.ts +10 -0
- package/dist/adapters/BrowserENSResolver.d.ts.map +1 -0
- package/dist/adapters/BrowserNotificationHandler.d.ts +11 -0
- package/dist/adapters/BrowserNotificationHandler.d.ts.map +1 -0
- package/dist/adapters/BrowserSessionStorage.d.ts +9 -0
- package/dist/adapters/BrowserSessionStorage.d.ts.map +1 -0
- package/dist/adapters/BrowserWalletSigner.d.ts +22 -0
- package/dist/adapters/BrowserWalletSigner.d.ts.map +1 -0
- package/dist/adapters/BrowserWasmBindings.d.ts +23 -0
- package/dist/adapters/BrowserWasmBindings.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/authorization/WebSpaceCreationHandler.d.ts +40 -0
- package/dist/authorization/WebSpaceCreationHandler.d.ts.map +1 -0
- package/dist/authorization/index.d.ts +10 -0
- package/dist/authorization/index.d.ts.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.LICENSE.txt +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.LICENSE.txt +21 -0
- package/dist/index.mjs.map +1 -0
- package/dist/modules/Storage/index.d.ts +2 -0
- package/dist/modules/Storage/index.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts +24 -0
- package/dist/modules/Storage/tinycloud/KVServiceAdapter.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/index.d.ts +3 -0
- package/dist/modules/Storage/tinycloud/index.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/module.d.ts +11 -0
- package/dist/modules/Storage/tinycloud/module.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/types.d.ts +64 -0
- package/dist/modules/Storage/tinycloud/types.d.ts.map +1 -0
- package/dist/modules/Storage/tinycloud/types.schema.d.ts +159 -0
- package/dist/modules/Storage/tinycloud/types.schema.d.ts.map +1 -0
- package/dist/modules/WasmInitializer.d.ts +26 -0
- package/dist/modules/WasmInitializer.d.ts.map +1 -0
- package/dist/modules/index.d.ts +5 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/keys/index.d.ts +6 -0
- package/dist/modules/keys/index.d.ts.map +1 -0
- package/dist/modules/registry/Registry.d.ts +59 -0
- package/dist/modules/registry/Registry.d.ts.map +1 -0
- package/dist/modules/tcw.d.ts +142 -0
- package/dist/modules/tcw.d.ts.map +1 -0
- package/dist/notifications/ErrorHandler.d.ts +32 -0
- package/dist/notifications/ErrorHandler.d.ts.map +1 -0
- package/dist/notifications/ModalManager.d.ts +15 -0
- package/dist/notifications/ModalManager.d.ts.map +1 -0
- package/dist/notifications/NodeSelectionModal.d.ts +29 -0
- package/dist/notifications/NodeSelectionModal.d.ts.map +1 -0
- package/dist/notifications/SpaceCreationModal.d.ts +28 -0
- package/dist/notifications/SpaceCreationModal.d.ts.map +1 -0
- package/dist/notifications/ToastContainer.d.ts +16 -0
- package/dist/notifications/ToastContainer.d.ts.map +1 -0
- package/dist/notifications/ToastElement.d.ts +22 -0
- package/dist/notifications/ToastElement.d.ts.map +1 -0
- package/dist/notifications/ToastManager.d.ts +36 -0
- package/dist/notifications/ToastManager.d.ts.map +1 -0
- package/dist/notifications/index.d.ts +9 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/types.d.ts +37 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/notifications/types.schema.d.ts +224 -0
- package/dist/notifications/types.schema.d.ts.map +1 -0
- package/dist/providers/config.d.ts +44 -0
- package/dist/providers/config.d.ts.map +1 -0
- package/dist/providers/extension.d.ts +64 -0
- package/dist/providers/extension.d.ts.map +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/types.d.ts +657 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/utils.d.ts +20 -0
- package/dist/providers/utils.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +9 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/multiaddr.d.ts +36 -0
- package/dist/utils/multiaddr.d.ts.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider utility functions.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import { ethers } from "ethers";
|
|
7
|
+
import { EnsData, RPCProvider } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* @param rpc - RPCProvider
|
|
10
|
+
* @returns an ethers provider based on the RPC configuration.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getProvider: (rpc?: RPCProvider) => ethers.providers.BaseProvider;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves ENS data supported by TCW.
|
|
15
|
+
* @param provider - Ethers provider.
|
|
16
|
+
* @param address - User address.
|
|
17
|
+
* @returns Object containing ENS data.
|
|
18
|
+
*/
|
|
19
|
+
export declare const resolveEns: (provider: ethers.providers.BaseProvider, address: string) => Promise<EnsData>;
|
|
20
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/providers/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAsB,MAAM,QAAQ,CAAC;AACpD,OAAO,EAaL,OAAO,EACP,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,WAAW,SAChB,WAAW,KAChB,MAAM,CAAC,SAAS,CAAC,YAyCnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,aACX,MAAM,CAAC,SAAS,CAAC,YAAY,WAE9B,MAAM,KACd,OAAO,CAAC,OAAO,CAqBjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,KAAK;mBACD,GAAG,EAAE;oBAKJ,GAAG,EAAE;qBAKJ,GAAG,EAAE;CAKvB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* This module allows easy conversion of Multiaddrs to string URIs.
|
|
5
|
+
*
|
|
6
|
+
* @example Converting multiaddrs to string URIs
|
|
7
|
+
*
|
|
8
|
+
* ```js
|
|
9
|
+
* import { multiaddrToUri } from '@multiformats/multiaddr-to-uri'
|
|
10
|
+
*
|
|
11
|
+
* console.log(multiaddrToUri('/dnsaddr/protocol.ai/https'))
|
|
12
|
+
* // -> https://protocol.ai
|
|
13
|
+
*
|
|
14
|
+
* console.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080'))
|
|
15
|
+
* // -> http://127.0.0.1:8080
|
|
16
|
+
*
|
|
17
|
+
* console.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080', { assumeHttp: false }))
|
|
18
|
+
* // -> tcp://127.0.0.1:8080
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Note:
|
|
22
|
+
*
|
|
23
|
+
* - When `/tcp` is the last (terminating) protocol HTTP is assumed by default (implicit `assumeHttp: true`)
|
|
24
|
+
* - this means produced URIs will start with `http://` instead of `tcp://`
|
|
25
|
+
* - passing `{ assumeHttp: false }` disables this behavior
|
|
26
|
+
* - Might be lossy - e.g. a DNSv6 multiaddr
|
|
27
|
+
* - Can throw if the passed multiaddr:
|
|
28
|
+
* - is not a valid multiaddr
|
|
29
|
+
* - is not supported as a URI e.g. circuit
|
|
30
|
+
*/
|
|
31
|
+
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
32
|
+
export interface MultiaddrToUriOpts {
|
|
33
|
+
assumeHttp?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function multiaddrToUri(input: Multiaddr | string | Uint8Array, opts?: MultiaddrToUriOpts): string;
|
|
36
|
+
//# sourceMappingURL=multiaddr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiaddr.d.ts","sourceRoot":"","sources":["../../src/utils/multiaddr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnE,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AA2KD,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAsCxG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tinycloud/web-sdk",
|
|
3
|
+
"version": "0.0.0-beta-20260401001229",
|
|
4
|
+
"description": "A set of tools and utilities to help you build your app with TinyCloud.",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"browser": "dist/index.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"browser": "./dist/index.mjs",
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.cjs",
|
|
15
|
+
"default": "./dist/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "ssh://git@github.com:TinyCloudLabs/web-sdk.git"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"author": "TinyCloud, Inc.",
|
|
25
|
+
"license": "EGPL",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "webpack --mode production --config webpack.config.cjs",
|
|
28
|
+
"dev": "webpack --watch --config webpack.config.cjs",
|
|
29
|
+
"watch": "webpack --watch --config webpack.config.cjs",
|
|
30
|
+
"doc": "bun run doc:extractor && bun run doc:documenter",
|
|
31
|
+
"doc:extractor": "api-extractor run --local --diagnostics",
|
|
32
|
+
"doc:documenter": "api-documenter markdown -i temp -o ../../documentation/docs/web-sdk/api",
|
|
33
|
+
"lint": "eslint --ext .ts src/ --fix",
|
|
34
|
+
"clean": "rimraf dist && rimraf temp",
|
|
35
|
+
"test": "jest"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@metamask/detect-provider": "^1.2.0",
|
|
39
|
+
"@multiformats/multiaddr": "^13.0.1",
|
|
40
|
+
"@multiformats/multiaddr-to-uri": "^12.0.0",
|
|
41
|
+
"@tinycloud/node-sdk": "workspace:*",
|
|
42
|
+
"@tinycloud/sdk-core": "workspace:*",
|
|
43
|
+
"@tinycloud/web-sdk-wasm": "workspace:*",
|
|
44
|
+
"assert": "^2.1.0",
|
|
45
|
+
"axios": "^1.7.9",
|
|
46
|
+
"browser": "^0.2.6",
|
|
47
|
+
"browserify-zlib": "^0.2.0",
|
|
48
|
+
"buffer": "^6.0.3",
|
|
49
|
+
"cross-env": "10.1.0",
|
|
50
|
+
"crypto-browserify": "^3.12.1",
|
|
51
|
+
"ethers": "^5.7.2",
|
|
52
|
+
"events": "^3.3.0",
|
|
53
|
+
"https-browserify": "^1.0.0",
|
|
54
|
+
"lodash.merge": "^4.6.2",
|
|
55
|
+
"os-browserify": "^0.3.0",
|
|
56
|
+
"path-browserify": "^1.0.1",
|
|
57
|
+
"process": "^0.11.10",
|
|
58
|
+
"siwe": "^2.3.2",
|
|
59
|
+
"stream-browserify": "^3.0.0",
|
|
60
|
+
"stream-http": "^3.2.0",
|
|
61
|
+
"url": "^0.11.4",
|
|
62
|
+
"viem": "^2.45.0",
|
|
63
|
+
"vm-browserify": "^1.1.2",
|
|
64
|
+
"zod": "^3.22.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@babel/preset-env": "^7.26.7",
|
|
68
|
+
"@microsoft/api-documenter": "^7.26.5",
|
|
69
|
+
"@microsoft/api-extractor": "^7.49.1",
|
|
70
|
+
"@types/jest": "^30.0.0",
|
|
71
|
+
"@types/lodash.merge": "^4.6.9",
|
|
72
|
+
"@types/node": "^18.19.74",
|
|
73
|
+
"@types/webpack": "^5.28.5",
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
75
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
76
|
+
"@webpack-cli/generators": "^3.0.7",
|
|
77
|
+
"babel-jest": "^28.1.3",
|
|
78
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
79
|
+
"copy-webpack-plugin": "^14.0.0",
|
|
80
|
+
"declaration-bundler-webpack-plugin": "^1.0.3",
|
|
81
|
+
"eslint": "^8.57.1",
|
|
82
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
83
|
+
"eslint-plugin-import": "^2.31.0",
|
|
84
|
+
"gh-pages": "^6.3.0",
|
|
85
|
+
"ts-loader": "^9.5.2",
|
|
86
|
+
"typescript": "^4.9.5",
|
|
87
|
+
"util": "^0.12.5",
|
|
88
|
+
"webpack": "^5.97.1",
|
|
89
|
+
"webpack-cli": "^7.0.0"
|
|
90
|
+
},
|
|
91
|
+
"files": [
|
|
92
|
+
"dist"
|
|
93
|
+
]
|
|
94
|
+
}
|