@latticexyz/id.place 2.2.23-4cbda5e6fa1d972d609a2d497e14fc84089b4e0c

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022-present Lattice Labs Ltd.
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 ADDED
@@ -0,0 +1,3 @@
1
+ # id.place
2
+
3
+ A place for your internet identity.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,33 @@
1
+ import { Mode, Porto, RpcSchema, Chains } from 'porto';
2
+ import { Connector, CreateConnectorFn } from 'wagmi';
3
+ import { Address, ProviderConnectInfo, ExactPartial } from 'viem';
4
+
5
+ declare const rp: {
6
+ id: string;
7
+ name: string;
8
+ };
9
+ declare const popupUrl = "https://id.place/popup/";
10
+
11
+ declare function mode({ host }?: {
12
+ host?: string;
13
+ }): Mode.Mode;
14
+
15
+ type Provider = ReturnType<typeof Porto.create>["provider"];
16
+ type Properties = {
17
+ connect(parameters?: {
18
+ chainId?: number | undefined;
19
+ isReconnecting?: boolean | undefined;
20
+ capabilities?: (RpcSchema.wallet_connect.Capabilities & {
21
+ force?: boolean | undefined;
22
+ }) | undefined;
23
+ }): Promise<{
24
+ accounts: readonly Address[];
25
+ chainId: number;
26
+ }>;
27
+ onConnect(connectInfo: ProviderConnectInfo): void;
28
+ };
29
+ type IdPlaceConnector = Connector<CreateConnectorFn<Provider, Properties>>;
30
+ declare function idPlace<const chains extends readonly [Chains.Chain, ...Chains.Chain[]]>(config?: ExactPartial<Porto.Config<chains>>): CreateConnectorFn<Provider, Properties>;
31
+ declare function isIdPlaceConnector(connector: Connector): connector is IdPlaceConnector;
32
+
33
+ export { type IdPlaceConnector, type Properties, type Provider, idPlace, isIdPlaceConnector, mode, popupUrl, rp };
@@ -0,0 +1,69 @@
1
+ // src/common.ts
2
+ var rp = {
3
+ id: "id.place",
4
+ name: "id.place"
5
+ };
6
+ var popupUrl = "https://id.place/popup/";
7
+
8
+ // src/mode.ts
9
+ import { Dialog, Mode } from "porto";
10
+ function mode({ host = popupUrl } = {}) {
11
+ return Mode.dialog({
12
+ host,
13
+ renderer: Dialog.popup({
14
+ size: { width: 400, height: 400 }
15
+ })
16
+ });
17
+ }
18
+
19
+ // src/wagmi/connector.ts
20
+ import { createConnector } from "wagmi";
21
+ import { porto } from "porto/wagmi";
22
+ function idPlace(config = {}) {
23
+ const createPortoConnector = porto({
24
+ ...config,
25
+ mode: config.mode ?? mode()
26
+ });
27
+ return createConnector((wagmiConfig) => {
28
+ return {
29
+ ...createPortoConnector(wagmiConfig),
30
+ id: rp.id,
31
+ name: rp.name,
32
+ icon: `data:image/svg+xml;base64,${btoa(icon)}`
33
+ };
34
+ });
35
+ }
36
+ function isIdPlaceConnector(connector) {
37
+ return connector.id === rp.id;
38
+ }
39
+ var icon = `
40
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60">
41
+ <rect width="100%" height="100%" fill="#e0e7ff" />
42
+
43
+ <svg
44
+ x="5"
45
+ y="5"
46
+ width="50"
47
+ height="50"
48
+ viewBox="-5 0 50 40"
49
+ >
50
+ <path
51
+ d="M5 0H0v5h5V0ZM5 5H0v5h5V5ZM5 10H0v5h5v-5ZM5 15H0v5h5v-5ZM5 20H0v5h5v-5ZM5 25H0v5h5v-5ZM5 30H0v5h5v-5ZM5 35H0v5h5v-5ZM10 35H5v5h5v-5ZM15 35h-5v5h5v-5ZM20 35h-5v5h5v-5ZM25 35h-5v5h5v-5ZM30 35h-5v5h5v-5ZM40 30h-5v5h5v-5ZM40 35h-5v5h5v-5ZM35 35h-5v5h5v-5ZM40 5h-5v5h5V5ZM10 0H5v5h5V0ZM15 0h-5v5h5V0ZM20 0h-5v5h5V0ZM25 0h-5v5h5V0ZM30 0h-5v5h5V0ZM35 0h-5v5h5V0ZM40 0h-5v5h5V0Z"
52
+ fill="#000"
53
+ />
54
+ <path
55
+ d="M30 10h-5v5h5v-5ZM30 15h-5v5h5v-5ZM30 20h-5v5h5v-5ZM30 25h-5v5h5v-5ZM35 10h-5v5h5v-5ZM35 25h-5v5h5v-5ZM45 10h-5v5h5v-5ZM45 15h-5v5h5v-5ZM45 20h-5v5h5v-5ZM45 25h-5v5h5v-5ZM40 10h-5v5h5v-5ZM40 25h-5v5h5v-5Z"
56
+ fill="#4f39f6"
57
+ />
58
+ </svg>
59
+
60
+ </svg>
61
+ `;
62
+ export {
63
+ idPlace,
64
+ isIdPlaceConnector,
65
+ mode,
66
+ popupUrl,
67
+ rp
68
+ };
69
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/common.ts","../src/mode.ts","../src/wagmi/connector.ts"],"sourcesContent":["// relying party for the passkey\nexport const rp = {\n id: \"id.place\",\n name: \"id.place\",\n} satisfies PublicKeyCredentialRpEntity;\n\n// must be a valid origin for the relying party\n// needs trailing slash while it's a Vite static site\nexport const popupUrl = \"https://id.place/popup/\";\n","import { Dialog, Mode } from \"porto\";\nimport { popupUrl } from \"./common\";\n\nexport function mode({ host = popupUrl }: { host?: string } = {}): Mode.Mode {\n return Mode.dialog({\n host,\n renderer: Dialog.popup({\n size: { width: 400, height: 400 },\n }),\n });\n}\n","import { type Connector, createConnector, CreateConnectorFn } from \"wagmi\";\nimport { Address, ExactPartial, ProviderConnectInfo } from \"viem\";\nimport { Chains, Porto, RpcSchema } from \"porto\";\nimport { porto } from \"porto/wagmi\";\nimport { rp } from \"../common\";\nimport { mode } from \"../mode\";\n\n// TODO: import from porto\nexport type Provider = ReturnType<typeof Porto.create>[\"provider\"];\nexport type Properties = {\n connect(parameters?: {\n chainId?: number | undefined;\n isReconnecting?: boolean | undefined;\n capabilities?:\n | (RpcSchema.wallet_connect.Capabilities & {\n force?: boolean | undefined;\n })\n | undefined;\n }): Promise<{\n accounts: readonly Address[];\n chainId: number;\n }>;\n onConnect(connectInfo: ProviderConnectInfo): void;\n};\n\nexport type IdPlaceConnector = Connector<CreateConnectorFn<Provider, Properties>>;\n\nexport function idPlace<const chains extends readonly [Chains.Chain, ...Chains.Chain[]]>(\n config: ExactPartial<Porto.Config<chains>> = {},\n): CreateConnectorFn<Provider, Properties> {\n const createPortoConnector = porto({\n ...config,\n mode: config.mode ?? mode(),\n });\n\n return createConnector<Provider, Properties>((wagmiConfig) => {\n return {\n ...createPortoConnector(wagmiConfig),\n id: rp.id,\n name: rp.name,\n icon: `data:image/svg+xml;base64,${btoa(icon)}`,\n };\n });\n}\n\nexport function isIdPlaceConnector(connector: Connector): connector is IdPlaceConnector {\n return connector.id === rp.id;\n}\n\n/* eslint-disable max-len */\nconst icon = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 60\">\n <rect width=\"100%\" height=\"100%\" fill=\"#e0e7ff\" />\n\n <svg\n x=\"5\"\n y=\"5\"\n width=\"50\"\n height=\"50\"\n viewBox=\"-5 0 50 40\"\n >\n <path\n d=\"M5 0H0v5h5V0ZM5 5H0v5h5V5ZM5 10H0v5h5v-5ZM5 15H0v5h5v-5ZM5 20H0v5h5v-5ZM5 25H0v5h5v-5ZM5 30H0v5h5v-5ZM5 35H0v5h5v-5ZM10 35H5v5h5v-5ZM15 35h-5v5h5v-5ZM20 35h-5v5h5v-5ZM25 35h-5v5h5v-5ZM30 35h-5v5h5v-5ZM40 30h-5v5h5v-5ZM40 35h-5v5h5v-5ZM35 35h-5v5h5v-5ZM40 5h-5v5h5V5ZM10 0H5v5h5V0ZM15 0h-5v5h5V0ZM20 0h-5v5h5V0ZM25 0h-5v5h5V0ZM30 0h-5v5h5V0ZM35 0h-5v5h5V0ZM40 0h-5v5h5V0Z\"\n fill=\"#000\"\n />\n <path\n d=\"M30 10h-5v5h5v-5ZM30 15h-5v5h5v-5ZM30 20h-5v5h5v-5ZM30 25h-5v5h5v-5ZM35 10h-5v5h5v-5ZM35 25h-5v5h5v-5ZM45 10h-5v5h5v-5ZM45 15h-5v5h5v-5ZM45 20h-5v5h5v-5ZM45 25h-5v5h5v-5ZM40 10h-5v5h5v-5ZM40 25h-5v5h5v-5Z\"\n fill=\"#4f39f6\"\n />\n </svg>\n\n </svg>\n`;\n/* eslint-enable max-len */\n"],"mappings":";AACO,IAAM,KAAK;AAAA,EAChB,IAAI;AAAA,EACJ,MAAM;AACR;AAIO,IAAM,WAAW;;;ACRxB,SAAS,QAAQ,YAAY;AAGtB,SAAS,KAAK,EAAE,OAAO,SAAS,IAAuB,CAAC,GAAc;AAC3E,SAAO,KAAK,OAAO;AAAA,IACjB;AAAA,IACA,UAAU,OAAO,MAAM;AAAA,MACrB,MAAM,EAAE,OAAO,KAAK,QAAQ,IAAI;AAAA,IAClC,CAAC;AAAA,EACH,CAAC;AACH;;;ACVA,SAAyB,uBAA0C;AAGnE,SAAS,aAAa;AAwBf,SAAS,QACd,SAA6C,CAAC,GACL;AACzC,QAAM,uBAAuB,MAAM;AAAA,IACjC,GAAG;AAAA,IACH,MAAM,OAAO,QAAQ,KAAK;AAAA,EAC5B,CAAC;AAED,SAAO,gBAAsC,CAAC,gBAAgB;AAC5D,WAAO;AAAA,MACL,GAAG,qBAAqB,WAAW;AAAA,MACnC,IAAI,GAAG;AAAA,MACP,MAAM,GAAG;AAAA,MACT,MAAM,6BAA6B,KAAK,IAAI,CAAC;AAAA,IAC/C;AAAA,EACF,CAAC;AACH;AAEO,SAAS,mBAAmB,WAAqD;AACtF,SAAO,UAAU,OAAO,GAAG;AAC7B;AAGA,IAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@latticexyz/id.place",
3
+ "version": "2.2.23-4cbda5e6fa1d972d609a2d497e14fc84089b4e0c",
4
+ "description": "A place for your internet identity",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/latticexyz/mud.git",
8
+ "directory": "packages/id.place"
9
+ },
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "exports": {
13
+ ".": "./dist/index.js",
14
+ "./internal": "./dist/internal.js"
15
+ },
16
+ "typesVersions": {
17
+ "*": {
18
+ "index": [
19
+ "./dist/index.d.ts"
20
+ ],
21
+ "internal": [
22
+ "./dist/internal.d.ts"
23
+ ]
24
+ }
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "dependencies": {
30
+ "debug": "^4.3.4",
31
+ "porto": "0.0.60"
32
+ },
33
+ "devDependencies": {
34
+ "@types/debug": "^4.1.7",
35
+ "viem": "2.30.6",
36
+ "wagmi": "2.15.5"
37
+ },
38
+ "peerDependencies": {
39
+ "viem": "2.x",
40
+ "wagmi": "2.x"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "scripts": {
46
+ "build": "tsup",
47
+ "clean": "shx rm -rf dist",
48
+ "dev": "tsup --watch",
49
+ "test": "tsc --noEmit && vitest --run",
50
+ "test:ci": "pnpm run test"
51
+ }
52
+ }