@haneullabs/enoki-connect 0.1.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.
@@ -0,0 +1,24 @@
1
+ import { BaseModal } from './base-modal.js';
2
+ /**
3
+ * A modal component for displaying wallet operation request fallback UI.
4
+ *
5
+ * @element enoki-connect-modal
6
+ *
7
+ * @prop {string} walletName - The name of the wallet.
8
+ * @prop {string} dappName - The name of the dapp.
9
+ * @prop {boolean} disabled - Whether the modal is disabled.
10
+ * @prop {boolean} open - Whether the modal is open.
11
+ *
12
+ */
13
+ export declare class EnokiConnectModal extends BaseModal {
14
+ #private;
15
+ static styles: import("lit").CSSResult;
16
+ walletName: string;
17
+ dappName: string;
18
+ render(): import("lit").TemplateResult<1>;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'enoki-connect-modal': EnokiConnectModal;
23
+ }
24
+ }
@@ -0,0 +1,251 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __typeError = (msg) => {
4
+ throw TypeError(msg);
5
+ };
6
+ var __decorateClass = (decorators, target, key, kind) => {
7
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
8
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9
+ if (decorator = decorators[i])
10
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11
+ if (kind && result) __defProp(target, key, result);
12
+ return result;
13
+ };
14
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
15
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
16
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
17
+ var _EnokiConnectModal_instances, handleContinue_fn;
18
+ import { css, html } from "lit";
19
+ import { customElement, property } from "lit/decorators.js";
20
+ import { BaseModal } from "./base-modal.js";
21
+ let EnokiConnectModal = class extends BaseModal {
22
+ constructor() {
23
+ super(...arguments);
24
+ __privateAdd(this, _EnokiConnectModal_instances);
25
+ this.walletName = "";
26
+ this.dappName = "";
27
+ }
28
+ render() {
29
+ return html`<dialog
30
+ @click=${this.handleDialogClick}
31
+ @cancel=${this.handleCancel}
32
+ class="modal${this._isClosing ? " closing" : ""}"
33
+ @animationend=${this.handleAnimationEnd}
34
+ >
35
+ <div class="content" @click=${this.handleContentClick}>
36
+ <button
37
+ class="close"
38
+ @click=${this.handleCancel}
39
+ ?disabled=${this.disabled || this._isClosing}
40
+ >
41
+ <svg
42
+ xmlns="http://www.w3.org/2000/svg"
43
+ viewBox="0 0 24 24"
44
+ fill="none"
45
+ stroke="currentColor"
46
+ stroke-width="2"
47
+ stroke-linecap="round"
48
+ stroke-linejoin="round"
49
+ class="lucide lucide-x"
50
+ >
51
+ <path d="M18 6 6 18" />
52
+ <path d="m6 6 12 12" />
53
+ </svg>
54
+ </button>
55
+ <h1 class="title capitalize">${this.walletName} Operation Request</h1>
56
+ <p class="description">
57
+ <span class="capitalize bold">${this.dappName}</span> requested a wallet operation. Click
58
+ continue to open <span class="wallet-name bold">${this.walletName}</span> (in a new tab)
59
+ and review the request.
60
+ </p>
61
+ <div class="footer">
62
+ <button
63
+ class="btn secondary"
64
+ @click=${this.handleCancel}
65
+ ?disabled=${this.disabled || this._isClosing}
66
+ >
67
+ Cancel
68
+ </button>
69
+ <button
70
+ class="btn primary"
71
+ @click=${__privateMethod(this, _EnokiConnectModal_instances, handleContinue_fn)}
72
+ ?disabled=${this.disabled || this._isClosing}
73
+ >
74
+ Continue
75
+ </button>
76
+ </div>
77
+ </div>
78
+ </dialog>`;
79
+ }
80
+ };
81
+ _EnokiConnectModal_instances = new WeakSet();
82
+ handleContinue_fn = function() {
83
+ this.dispatchEvent(new CustomEvent("approved"));
84
+ };
85
+ EnokiConnectModal.styles = css`
86
+ :host {
87
+ --modal-font-family: var(
88
+ --font-family,
89
+ ui-sans-serif,
90
+ system-ui,
91
+ -apple-system,
92
+ BlinkMacSystemFont,
93
+ 'Segoe UI',
94
+ Roboto,
95
+ 'Helvetica Neue',
96
+ Arial,
97
+ 'Noto Sans',
98
+ sans-serif,
99
+ 'Apple Color Emoji',
100
+ 'Segoe UI Emoji',
101
+ 'Segoe UI Symbol',
102
+ 'Noto Color Emoji'
103
+ );
104
+ --modal-radius: var(--radius, 0.625rem);
105
+ --modal-background: var(--popover, oklch(1 0 0));
106
+ --modal-foreground: var(--popover-foreground, oklch(0.145 0 0));
107
+ --modal-backdrop: oklch(from var(--modal-background) l c h / 0.4);
108
+ --modal-box-shadow: 0 1px 10px oklch(from var(--modal-foreground) l c h / 0.01);
109
+ --modal-primary: var(--primary, oklch(0.205 0 0));
110
+ --modal-primary-foreground: var(--primary-foreground, oklch(0.985 0 0));
111
+ --modal-primary-hover: color-mix(in oklch, var(--modal-primary) 85%, white);
112
+ --modal-secondary: var(--secondary, oklch(0.97 0 0));
113
+ --modal-secondary-foreground: var(--secondary-foreground, oklch(0.205 0 0));
114
+ --modal-secondary-hover: color-mix(in oklch, var(--modal-secondary) 85%, white);
115
+ --modal-muted-foreground: var(--muted-foreground, oklch(0.556 0 0));
116
+ --modal-accent: var(--accent, oklch(0.97 0 0));
117
+ --modal-accent-foreground: var(--accent-foreground, oklch(0.205 0 0));
118
+ }
119
+ .modal {
120
+ color: var(--modal-foreground);
121
+ border: none;
122
+ animation: fadeIn 250ms ease-in-out forwards;
123
+ max-width: 320px;
124
+ background-color: var(--modal-background);
125
+ border-radius: var(--modal-radius);
126
+ box-shadow: var(--modal-box-shadow);
127
+ padding: 0;
128
+ font-family: var(--modal-font-family);
129
+ }
130
+ .modal::backdrop {
131
+ background-color: var(--modal-backdrop);
132
+ }
133
+ .content {
134
+ padding: 20px;
135
+ display: flex;
136
+ flex-direction: column;
137
+ gap: 10px;
138
+ }
139
+ .capitalize {
140
+ text-transform: capitalize;
141
+ }
142
+ .bold {
143
+ font-weight: 800;
144
+ }
145
+ .title {
146
+ font-size: 16px;
147
+ font-weight: 600;
148
+ line-height: 1.5;
149
+ color: var(--modal-foreground);
150
+ margin: 0;
151
+ }
152
+ .description {
153
+ font-size: 14px;
154
+ line-height: 1.5;
155
+ color: var(--modal-muted-foreground);
156
+ margin: 0;
157
+ }
158
+ .footer {
159
+ display: flex;
160
+ justify-content: flex-end;
161
+ align-items: center;
162
+ gap: 10px;
163
+ }
164
+ .btn {
165
+ border: none;
166
+ border-radius: 6px;
167
+ padding: 8px 14px;
168
+ cursor: pointer;
169
+ transition: background 0.2s;
170
+ font-size: 13px;
171
+ font-weight: 600;
172
+ }
173
+ .btn.primary {
174
+ background: var(--modal-primary);
175
+ color: var(--modal-primary-foreground);
176
+ }
177
+ .btn.primary:hover,
178
+ .btn.primary:focus,
179
+ .btn.primary:active {
180
+ background: var(--modal-primary-hover);
181
+ }
182
+ .btn.secondary {
183
+ background: var(--modal-secondary);
184
+ color: var(--modal-secondary-foreground);
185
+ }
186
+ .btn.secondary:hover,
187
+ .btn.secondary:focus,
188
+ .btn.secondary:active {
189
+ background: var(--modal-secondary-hover);
190
+ }
191
+ button:disabled {
192
+ opacity: 0.5;
193
+ cursor: default;
194
+ }
195
+ .close {
196
+ all: unset;
197
+ position: absolute;
198
+ top: 5px;
199
+ right: 5px;
200
+ background: transparent;
201
+ color: var(--modal-muted-foreground);
202
+ border: none;
203
+ cursor: pointer;
204
+ width: 18px;
205
+ height: 18px;
206
+ border-radius: var(--modal-radius);
207
+ padding: 3px;
208
+ transition: background 0.2s;
209
+ }
210
+ .close:hover,
211
+ .close:focus,
212
+ .close:active {
213
+ background: var(--modal-accent);
214
+ color: var(--modal-accent-foreground);
215
+ }
216
+ .modal.closing {
217
+ animation: fadeOut 250ms ease-in-out forwards;
218
+ }
219
+
220
+ @keyframes fadeIn {
221
+ from {
222
+ transform: translateY(-20px) scale(0.8);
223
+ opacity: 0;
224
+ }
225
+ to {
226
+ opacity: 1;
227
+ }
228
+ }
229
+ @keyframes fadeOut {
230
+ from {
231
+ opacity: 1;
232
+ }
233
+ to {
234
+ transform: translateY(20px) scale(0.8);
235
+ opacity: 0;
236
+ }
237
+ }
238
+ `;
239
+ __decorateClass([
240
+ property()
241
+ ], EnokiConnectModal.prototype, "walletName", 2);
242
+ __decorateClass([
243
+ property()
244
+ ], EnokiConnectModal.prototype, "dappName", 2);
245
+ EnokiConnectModal = __decorateClass([
246
+ customElement("enoki-connect-modal")
247
+ ], EnokiConnectModal);
248
+ export {
249
+ EnokiConnectModal
250
+ };
251
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/modal.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { BaseModal } from './base-modal.js';\n\n/**\n * A modal component for displaying wallet operation request fallback UI.\n *\n * @element enoki-connect-modal\n *\n * @prop {string} walletName - The name of the wallet.\n * @prop {string} dappName - The name of the dapp.\n * @prop {boolean} disabled - Whether the modal is disabled.\n * @prop {boolean} open - Whether the modal is open.\n *\n */\n@customElement('enoki-connect-modal')\nexport class EnokiConnectModal extends BaseModal {\n\tstatic styles = css`\n\t\t:host {\n\t\t\t--modal-font-family: var(\n\t\t\t\t--font-family,\n\t\t\t\tui-sans-serif,\n\t\t\t\tsystem-ui,\n\t\t\t\t-apple-system,\n\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t'Segoe UI',\n\t\t\t\tRoboto,\n\t\t\t\t'Helvetica Neue',\n\t\t\t\tArial,\n\t\t\t\t'Noto Sans',\n\t\t\t\tsans-serif,\n\t\t\t\t'Apple Color Emoji',\n\t\t\t\t'Segoe UI Emoji',\n\t\t\t\t'Segoe UI Symbol',\n\t\t\t\t'Noto Color Emoji'\n\t\t\t);\n\t\t\t--modal-radius: var(--radius, 0.625rem);\n\t\t\t--modal-background: var(--popover, oklch(1 0 0));\n\t\t\t--modal-foreground: var(--popover-foreground, oklch(0.145 0 0));\n\t\t\t--modal-backdrop: oklch(from var(--modal-background) l c h / 0.4);\n\t\t\t--modal-box-shadow: 0 1px 10px oklch(from var(--modal-foreground) l c h / 0.01);\n\t\t\t--modal-primary: var(--primary, oklch(0.205 0 0));\n\t\t\t--modal-primary-foreground: var(--primary-foreground, oklch(0.985 0 0));\n\t\t\t--modal-primary-hover: color-mix(in oklch, var(--modal-primary) 85%, white);\n\t\t\t--modal-secondary: var(--secondary, oklch(0.97 0 0));\n\t\t\t--modal-secondary-foreground: var(--secondary-foreground, oklch(0.205 0 0));\n\t\t\t--modal-secondary-hover: color-mix(in oklch, var(--modal-secondary) 85%, white);\n\t\t\t--modal-muted-foreground: var(--muted-foreground, oklch(0.556 0 0));\n\t\t\t--modal-accent: var(--accent, oklch(0.97 0 0));\n\t\t\t--modal-accent-foreground: var(--accent-foreground, oklch(0.205 0 0));\n\t\t}\n\t\t.modal {\n\t\t\tcolor: var(--modal-foreground);\n\t\t\tborder: none;\n\t\t\tanimation: fadeIn 250ms ease-in-out forwards;\n\t\t\tmax-width: 320px;\n\t\t\tbackground-color: var(--modal-background);\n\t\t\tborder-radius: var(--modal-radius);\n\t\t\tbox-shadow: var(--modal-box-shadow);\n\t\t\tpadding: 0;\n\t\t\tfont-family: var(--modal-font-family);\n\t\t}\n\t\t.modal::backdrop {\n\t\t\tbackground-color: var(--modal-backdrop);\n\t\t}\n\t\t.content {\n\t\t\tpadding: 20px;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 10px;\n\t\t}\n\t\t.capitalize {\n\t\t\ttext-transform: capitalize;\n\t\t}\n\t\t.bold {\n\t\t\tfont-weight: 800;\n\t\t}\n\t\t.title {\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: var(--modal-foreground);\n\t\t\tmargin: 0;\n\t\t}\n\t\t.description {\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: var(--modal-muted-foreground);\n\t\t\tmargin: 0;\n\t\t}\n\t\t.footer {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t}\n\t\t.btn {\n\t\t\tborder: none;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 8px 14px;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.2s;\n\t\t\tfont-size: 13px;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.btn.primary {\n\t\t\tbackground: var(--modal-primary);\n\t\t\tcolor: var(--modal-primary-foreground);\n\t\t}\n\t\t.btn.primary:hover,\n\t\t.btn.primary:focus,\n\t\t.btn.primary:active {\n\t\t\tbackground: var(--modal-primary-hover);\n\t\t}\n\t\t.btn.secondary {\n\t\t\tbackground: var(--modal-secondary);\n\t\t\tcolor: var(--modal-secondary-foreground);\n\t\t}\n\t\t.btn.secondary:hover,\n\t\t.btn.secondary:focus,\n\t\t.btn.secondary:active {\n\t\t\tbackground: var(--modal-secondary-hover);\n\t\t}\n\t\tbutton:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: default;\n\t\t}\n\t\t.close {\n\t\t\tall: unset;\n\t\t\tposition: absolute;\n\t\t\ttop: 5px;\n\t\t\tright: 5px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--modal-muted-foreground);\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\twidth: 18px;\n\t\t\theight: 18px;\n\t\t\tborder-radius: var(--modal-radius);\n\t\t\tpadding: 3px;\n\t\t\ttransition: background 0.2s;\n\t\t}\n\t\t.close:hover,\n\t\t.close:focus,\n\t\t.close:active {\n\t\t\tbackground: var(--modal-accent);\n\t\t\tcolor: var(--modal-accent-foreground);\n\t\t}\n\t\t.modal.closing {\n\t\t\tanimation: fadeOut 250ms ease-in-out forwards;\n\t\t}\n\n\t\t@keyframes fadeIn {\n\t\t\tfrom {\n\t\t\t\ttransform: translateY(-20px) scale(0.8);\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tto {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\t\t@keyframes fadeOut {\n\t\t\tfrom {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\tto {\n\t\t\t\ttransform: translateY(20px) scale(0.8);\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t}\n\t`;\n\n\t@property()\n\twalletName: string = '';\n\t@property()\n\tdappName: string = '';\n\n\t#handleContinue() {\n\t\tthis.dispatchEvent(new CustomEvent('approved'));\n\t}\n\n\toverride render() {\n\t\treturn html`<dialog\n\t\t\t@click=${this.handleDialogClick}\n\t\t\t@cancel=${this.handleCancel}\n\t\t\tclass=\"modal${this._isClosing ? ' closing' : ''}\"\n\t\t\t@animationend=${this.handleAnimationEnd}\n\t\t>\n\t\t\t<div class=\"content\" @click=${this.handleContentClick}>\n\t\t\t\t<button\n\t\t\t\t\tclass=\"close\"\n\t\t\t\t\t@click=${this.handleCancel}\n\t\t\t\t\t?disabled=${this.disabled || this._isClosing}\n\t\t\t\t>\n\t\t\t\t\t<svg\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\tclass=\"lucide lucide-x\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M18 6 6 18\" />\n\t\t\t\t\t\t<path d=\"m6 6 12 12\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</button>\n\t\t\t\t<h1 class=\"title capitalize\">${this.walletName} Operation Request</h1>\n\t\t\t\t<p class=\"description\">\n\t\t\t\t\t<span class=\"capitalize bold\">${this.dappName}</span> requested a wallet operation. Click\n\t\t\t\t\tcontinue to open <span class=\"wallet-name bold\">${this.walletName}</span> (in a new tab)\n\t\t\t\t\tand review the request.\n\t\t\t\t</p>\n\t\t\t\t<div class=\"footer\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"btn secondary\"\n\t\t\t\t\t\t@click=${this.handleCancel}\n\t\t\t\t\t\t?disabled=${this.disabled || this._isClosing}\n\t\t\t\t\t>\n\t\t\t\t\t\tCancel\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"btn primary\"\n\t\t\t\t\t\t@click=${this.#handleContinue}\n\t\t\t\t\t\t?disabled=${this.disabled || this._isClosing}\n\t\t\t\t\t>\n\t\t\t\t\t\tContinue\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</dialog>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'enoki-connect-modal': EnokiConnectModal;\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAEA,SAAS,KAAK,YAAY;AAC1B,SAAS,eAAe,gBAAgB;AACxC,SAAS,iBAAiB;AAcnB,IAAM,oBAAN,cAAgC,UAAU;AAAA,EAA1C;AAAA;AAAA;AA6JN,sBAAqB;AAErB,oBAAmB;AAAA;AAAA,EAMV,SAAS;AACjB,WAAO;AAAA,YACG,KAAK,iBAAiB;AAAA,aACrB,KAAK,YAAY;AAAA,iBACb,KAAK,aAAa,aAAa,EAAE;AAAA,mBAC/B,KAAK,kBAAkB;AAAA;AAAA,iCAET,KAAK,kBAAkB;AAAA;AAAA;AAAA,cAG1C,KAAK,YAAY;AAAA,iBACd,KAAK,YAAY,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAgBd,KAAK,UAAU;AAAA;AAAA,qCAEb,KAAK,QAAQ;AAAA,uDACK,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAMvD,KAAK,YAAY;AAAA,kBACd,KAAK,YAAY,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAMnC,sBAAK,gDAAe;AAAA,kBACjB,KAAK,YAAY,KAAK,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjD;AACD;AAzNO;AAiKN,oBAAe,WAAG;AACjB,OAAK,cAAc,IAAI,YAAY,UAAU,CAAC;AAC/C;AAnKY,kBACL,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4JhB;AAAA,EADC,SAAS;AAAA,GA5JE,kBA6JZ;AAEA;AAAA,EADC,SAAS;AAAA,GA9JE,kBA+JZ;AA/JY,oBAAN;AAAA,EADN,cAAc,qBAAqB;AAAA,GACvB;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export { EnokiConnectWallet, registerEnokiConnectWallets, type SupportedNetwork, } from './wallet/index.js';
@@ -0,0 +1,9 @@
1
+ import {
2
+ EnokiConnectWallet,
3
+ registerEnokiConnectWallets
4
+ } from "./wallet/index.js";
5
+ export {
6
+ EnokiConnectWallet,
7
+ registerEnokiConnectWallets
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport {\n\tEnokiConnectWallet,\n\tregisterEnokiConnectWallets,\n\ttype SupportedNetwork,\n} from './wallet/index.js';\n"],
5
+ "mappings": "AAGA;AAAA,EACC;AAAA,EACA;AAAA,OAEM;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "private": true,
3
+ "type": "module"
4
+ }
@@ -0,0 +1,55 @@
1
+ import type { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, HaneulSignAndExecuteTransactionFeature, HaneulSignPersonalMessageFeature, HaneulSignTransactionBlockFeature, HaneulSignTransactionFeature, Wallet, WalletIcon } from '@haneullabs/wallet-standard';
2
+ import { ReadonlyWalletAccount } from '@haneullabs/wallet-standard';
3
+ import '../components/modal.js';
4
+ export type SupportedNetwork = 'mainnet' | 'testnet' | 'devnet';
5
+ export declare class EnokiConnectWallet implements Wallet {
6
+ #private;
7
+ readonly id: string;
8
+ get name(): string;
9
+ get icon(): `data:image/svg+xml;base64,${string}` | `data:image/webp;base64,${string}` | `data:image/png;base64,${string}` | `data:image/gif;base64,${string}`;
10
+ get version(): "1.0.0";
11
+ get chains(): readonly ["haneul:mainnet", "haneul:testnet", "haneul:devnet"];
12
+ get accounts(): ReadonlyWalletAccount[];
13
+ get features(): StandardConnectFeature & StandardDisconnectFeature & StandardEventsFeature & HaneulSignTransactionBlockFeature & HaneulSignTransactionFeature & HaneulSignPersonalMessageFeature & HaneulSignAndExecuteTransactionFeature;
14
+ constructor({ publicAppSlug, walletName, dappName, hostOrigin, icon, network, }: {
15
+ publicAppSlug: string;
16
+ walletName: string;
17
+ dappName: string;
18
+ network: SupportedNetwork;
19
+ hostOrigin: string;
20
+ icon: WalletIcon;
21
+ });
22
+ }
23
+ /**
24
+ * Registers Enoki Connect wallets for your dApp.
25
+ *
26
+ * This function fetches wallet metadata for the provided public app slugs and registers
27
+ * them with the wallet standard. It returns the registered wallet instances and an
28
+ * `unregister` function to remove them if needed.
29
+ *
30
+ * @param publicAppSlugs - An array of public app slugs to register. You can obtain these slugs from the wallet developer.
31
+ * @param dappName - The display name of your dApp. This will be shown to users in wallet UIs.
32
+ * @param network - (Optional) The default Haneul network to use for wallet operations (when chain is not specified in the wallet method). Accepts 'mainnet', 'testnet', or 'devnet'. Defaults to 'mainnet' if not specified.
33
+ * @param enokiApiUrl - (Optional) The Enoki API endpoint to use for fetching wallet metadata. Defaults to the public Enoki API at 'https://api.enoki.haneullabs.com'. (Override this if you are running a local or custom Enoki API instance.)
34
+ *
35
+ * @returns An object containing:
36
+ * - `wallets`: The array of registered EnokiConnectWallet instances.
37
+ * - `unregister`: A function to unregister all registered wallets.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const { wallets, unregister } = await registerEnokiConnectWallets({
42
+ * publicAppSlugs: ['an-app-slug'],
43
+ * dappName: 'My Dapp',
44
+ * });
45
+ * ```
46
+ */
47
+ export declare function registerEnokiConnectWallets({ publicAppSlugs, dappName, network, enokiApiUrl, }: {
48
+ publicAppSlugs: string[];
49
+ dappName: string;
50
+ network?: SupportedNetwork;
51
+ enokiApiUrl?: string;
52
+ }): Promise<{
53
+ wallets: EnokiConnectWallet[];
54
+ unregister: () => void;
55
+ }>;