@mysten/zksend 0.7.2 → 0.8.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 (36) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/index.d.ts +2 -2
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/index.js.map +2 -2
  5. package/dist/cjs/{channel → wallet/channel}/events.d.ts +14 -14
  6. package/dist/cjs/{channel → wallet/channel}/events.js +13 -13
  7. package/dist/cjs/wallet/channel/events.js.map +7 -0
  8. package/dist/cjs/wallet/channel/index.d.ts +38 -0
  9. package/dist/cjs/{channel → wallet/channel}/index.js +16 -16
  10. package/dist/cjs/wallet/channel/index.js.map +7 -0
  11. package/dist/cjs/{wallet.d.ts → wallet/index.d.ts} +5 -5
  12. package/dist/cjs/{wallet.js → wallet/index.js} +19 -19
  13. package/dist/cjs/wallet/index.js.map +7 -0
  14. package/dist/esm/index.d.ts +2 -2
  15. package/dist/esm/index.js +2 -2
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/{channel → wallet/channel}/events.d.ts +14 -14
  18. package/dist/esm/{channel → wallet/channel}/events.js +13 -13
  19. package/dist/esm/wallet/channel/events.js.map +7 -0
  20. package/dist/esm/wallet/channel/index.d.ts +38 -0
  21. package/dist/esm/{channel → wallet/channel}/index.js +17 -17
  22. package/dist/esm/wallet/channel/index.js.map +7 -0
  23. package/dist/esm/{wallet.d.ts → wallet/index.d.ts} +5 -5
  24. package/dist/esm/{wallet.js → wallet/index.js} +20 -20
  25. package/dist/esm/wallet/index.js.map +7 -0
  26. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +1 -1
  29. package/dist/cjs/channel/events.js.map +0 -7
  30. package/dist/cjs/channel/index.d.ts +0 -38
  31. package/dist/cjs/channel/index.js.map +0 -7
  32. package/dist/cjs/wallet.js.map +0 -7
  33. package/dist/esm/channel/events.js.map +0 -7
  34. package/dist/esm/channel/index.d.ts +0 -38
  35. package/dist/esm/channel/index.js.map +0 -7
  36. package/dist/esm/wallet.js.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @mysten/zksend
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 807262f394: Update zkSend Wallet references to Stashed.
8
+
3
9
  ## 0.7.2
4
10
 
5
11
  ### Patch Changes
@@ -5,5 +5,5 @@ export { isClaimTransaction } from './links/utils.js';
5
5
  export { listCreatedLinks } from './links/list-created-links.js';
6
6
  export { getSentTransactionBlocksWithLinks } from './links/get-sent-transaction-blocks.js';
7
7
  export { MAINNET_CONTRACT_IDS } from './links/zk-bag.js';
8
- export * from './wallet.js';
9
- export * from './channel/index.js';
8
+ export * from './wallet/index.js';
9
+ export * from './wallet/channel/index.js';
package/dist/cjs/index.js CHANGED
@@ -35,6 +35,6 @@ var import_utils = require("./links/utils.js");
35
35
  var import_list_created_links = require("./links/list-created-links.js");
36
36
  var import_get_sent_transaction_blocks = require("./links/get-sent-transaction-blocks.js");
37
37
  var import_zk_bag2 = require("./links/zk-bag.js");
38
- __reExport(src_exports, require("./wallet.js"), module.exports);
39
- __reExport(src_exports, require("./channel/index.js"), module.exports);
38
+ __reExport(src_exports, require("./wallet/index.js"), module.exports);
39
+ __reExport(src_exports, require("./wallet/channel/index.js"), module.exports);
40
40
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport {\n\tZkSendLinkBuilder,\n\ttype ZkSendLinkBuilderOptions,\n\ttype CreateZkSendLinkOptions,\n} from './links/builder.js';\nexport { ZkSendLink, type ZkSendLinkOptions } from './links/claim.js';\nexport { type ZkBagContractOptions, ZkBag } from './links/zk-bag.js';\nexport { isClaimTransaction } from './links/utils.js';\nexport { listCreatedLinks } from './links/list-created-links.js';\nexport { getSentTransactionBlocksWithLinks } from './links/get-sent-transaction-blocks.js';\n\nexport { MAINNET_CONTRACT_IDS } from './links/zk-bag.js';\nexport * from './wallet.js';\nexport * from './channel/index.js';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAIO;AACP,mBAAmD;AACnD,oBAAiD;AACjD,mBAAmC;AACnC,gCAAiC;AACjC,yCAAkD;AAElD,IAAAA,iBAAqC;AACrC,wBAAc,wBAfd;AAgBA,wBAAc,+BAhBd;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport {\n\tZkSendLinkBuilder,\n\ttype ZkSendLinkBuilderOptions,\n\ttype CreateZkSendLinkOptions,\n} from './links/builder.js';\nexport { ZkSendLink, type ZkSendLinkOptions } from './links/claim.js';\nexport { type ZkBagContractOptions, ZkBag } from './links/zk-bag.js';\nexport { isClaimTransaction } from './links/utils.js';\nexport { listCreatedLinks } from './links/list-created-links.js';\nexport { getSentTransactionBlocksWithLinks } from './links/get-sent-transaction-blocks.js';\n\nexport { MAINNET_CONTRACT_IDS } from './links/zk-bag.js';\nexport * from './wallet/index.js';\nexport * from './wallet/channel/index.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAIO;AACP,mBAAmD;AACnD,oBAAiD;AACjD,mBAAmC;AACnC,gCAAiC;AACjC,yCAAkD;AAElD,IAAAA,iBAAqC;AACrC,wBAAc,8BAfd;AAgBA,wBAAc,sCAhBd;",
6
6
  "names": ["import_zk_bag"]
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import type { Output } from 'valibot';
2
- export declare const ZkSendRequestData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
2
+ export declare const StashedRequestData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
3
3
  type: import("valibot").LiteralSchema<"connect", "connect">;
4
4
  }, undefined, {
5
5
  type: "connect";
@@ -30,8 +30,8 @@ export declare const ZkSendRequestData: import("valibot").VariantSchema<"type",
30
30
  type: "sign-personal-message";
31
31
  bytes: string;
32
32
  }>;
33
- export type ZkSendRequestData = Output<typeof ZkSendRequestData>;
34
- export declare const ZkSendRequest: import("valibot").ObjectSchema<{
33
+ export type StashedRequestData = Output<typeof StashedRequestData>;
34
+ export declare const StashedRequest: import("valibot").ObjectSchema<{
35
35
  id: import("valibot").StringSchema<string>;
36
36
  origin: import("valibot").StringSchema<string>;
37
37
  name: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
@@ -82,8 +82,8 @@ export declare const ZkSendRequest: import("valibot").ObjectSchema<{
82
82
  };
83
83
  name?: string | undefined;
84
84
  }>;
85
- export type ZkSendRequest = Output<typeof ZkSendRequest>;
86
- export declare const ZkSendResponseData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
85
+ export type StashedRequest = Output<typeof StashedRequest>;
86
+ export declare const StashedResponseData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
87
87
  type: import("valibot").LiteralSchema<"connect", "connect">;
88
88
  address: import("valibot").StringSchema<string>;
89
89
  }, undefined, {
@@ -117,8 +117,8 @@ export declare const ZkSendResponseData: import("valibot").VariantSchema<"type",
117
117
  type: "sign-personal-message";
118
118
  bytes: string;
119
119
  }>;
120
- export type ZkSendResponseData = Output<typeof ZkSendResponseData>;
121
- export declare const ZkSendResponsePayload: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
120
+ export type StashedResponseData = Output<typeof StashedResponseData>;
121
+ export declare const StashedResponsePayload: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
122
122
  type: import("valibot").LiteralSchema<"reject", "reject">;
123
123
  }, undefined, {
124
124
  type: "reject";
@@ -189,8 +189,8 @@ export declare const ZkSendResponsePayload: import("valibot").VariantSchema<"typ
189
189
  bytes: string;
190
190
  };
191
191
  }>;
192
- export type ZkSendResponsePayload = Output<typeof ZkSendResponsePayload>;
193
- export declare const ZkSendResponse: import("valibot").ObjectSchema<{
192
+ export type StashedResponsePayload = Output<typeof StashedResponsePayload>;
193
+ export declare const StashedResponse: import("valibot").ObjectSchema<{
194
194
  id: import("valibot").StringSchema<string>;
195
195
  source: import("valibot").LiteralSchema<"zksend-channel", "zksend-channel">;
196
196
  payload: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
@@ -285,10 +285,10 @@ export declare const ZkSendResponse: import("valibot").ObjectSchema<{
285
285
  };
286
286
  source: "zksend-channel";
287
287
  }>;
288
- export type ZkSendResponse = Output<typeof ZkSendResponse>;
289
- export type ZkSendRequestTypes = Record<string, any> & {
290
- [P in ZkSendRequestData as P['type']]: P;
288
+ export type StashedResponse = Output<typeof StashedResponse>;
289
+ export type StashedRequestTypes = Record<string, any> & {
290
+ [P in StashedRequestData as P['type']]: P;
291
291
  };
292
- export type ZkSendResponseTypes = {
293
- [P in ZkSendResponseData as P['type']]: P;
292
+ export type StashedResponseTypes = {
293
+ [P in StashedResponseData as P['type']]: P;
294
294
  };
@@ -18,15 +18,15 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var events_exports = {};
20
20
  __export(events_exports, {
21
- ZkSendRequest: () => ZkSendRequest,
22
- ZkSendRequestData: () => ZkSendRequestData,
23
- ZkSendResponse: () => ZkSendResponse,
24
- ZkSendResponseData: () => ZkSendResponseData,
25
- ZkSendResponsePayload: () => ZkSendResponsePayload
21
+ StashedRequest: () => StashedRequest,
22
+ StashedRequestData: () => StashedRequestData,
23
+ StashedResponse: () => StashedResponse,
24
+ StashedResponseData: () => StashedResponseData,
25
+ StashedResponsePayload: () => StashedResponsePayload
26
26
  });
27
27
  module.exports = __toCommonJS(events_exports);
28
28
  var import_valibot = require("valibot");
29
- const ZkSendRequestData = (0, import_valibot.variant)("type", [
29
+ const StashedRequestData = (0, import_valibot.variant)("type", [
30
30
  (0, import_valibot.object)({
31
31
  type: (0, import_valibot.literal)("connect")
32
32
  }),
@@ -41,13 +41,13 @@ const ZkSendRequestData = (0, import_valibot.variant)("type", [
41
41
  address: (0, import_valibot.string)("`address` is required")
42
42
  })
43
43
  ]);
44
- const ZkSendRequest = (0, import_valibot.object)({
44
+ const StashedRequest = (0, import_valibot.object)({
45
45
  id: (0, import_valibot.string)("`id` is required", [(0, import_valibot.uuid)()]),
46
46
  origin: (0, import_valibot.string)([(0, import_valibot.url)("`origin` must be a valid URL")]),
47
47
  name: (0, import_valibot.optional)((0, import_valibot.string)()),
48
- payload: ZkSendRequestData
48
+ payload: StashedRequestData
49
49
  });
50
- const ZkSendResponseData = (0, import_valibot.variant)("type", [
50
+ const StashedResponseData = (0, import_valibot.variant)("type", [
51
51
  (0, import_valibot.object)({
52
52
  type: (0, import_valibot.literal)("connect"),
53
53
  address: (0, import_valibot.string)()
@@ -63,18 +63,18 @@ const ZkSendResponseData = (0, import_valibot.variant)("type", [
63
63
  signature: (0, import_valibot.string)()
64
64
  })
65
65
  ]);
66
- const ZkSendResponsePayload = (0, import_valibot.variant)("type", [
66
+ const StashedResponsePayload = (0, import_valibot.variant)("type", [
67
67
  (0, import_valibot.object)({
68
68
  type: (0, import_valibot.literal)("reject")
69
69
  }),
70
70
  (0, import_valibot.object)({
71
71
  type: (0, import_valibot.literal)("resolve"),
72
- data: ZkSendResponseData
72
+ data: StashedResponseData
73
73
  })
74
74
  ]);
75
- const ZkSendResponse = (0, import_valibot.object)({
75
+ const StashedResponse = (0, import_valibot.object)({
76
76
  id: (0, import_valibot.string)([(0, import_valibot.uuid)()]),
77
77
  source: (0, import_valibot.literal)("zksend-channel"),
78
- payload: ZkSendResponsePayload
78
+ payload: StashedResponsePayload
79
79
  });
80
80
  //# sourceMappingURL=events.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/wallet/channel/events.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Output } from 'valibot';\nimport { literal, object, optional, string, url, uuid, variant } from 'valibot';\n\nexport const StashedRequestData = variant('type', [\n\tobject({\n\t\ttype: literal('connect'),\n\t}),\n\tobject({\n\t\ttype: literal('sign-transaction-block'),\n\t\tdata: string('`data` is required'),\n\t\taddress: string('`address` is required'),\n\t}),\n\tobject({\n\t\ttype: literal('sign-personal-message'),\n\t\tbytes: string('`bytes` is required'),\n\t\taddress: string('`address` is required'),\n\t}),\n]);\nexport type StashedRequestData = Output<typeof StashedRequestData>;\n\nexport const StashedRequest = object({\n\tid: string('`id` is required', [uuid()]),\n\torigin: string([url('`origin` must be a valid URL')]),\n\tname: optional(string()),\n\tpayload: StashedRequestData,\n});\n\nexport type StashedRequest = Output<typeof StashedRequest>;\n\nexport const StashedResponseData = variant('type', [\n\tobject({\n\t\ttype: literal('connect'),\n\t\taddress: string(),\n\t}),\n\tobject({\n\t\ttype: literal('sign-transaction-block'),\n\t\tbytes: string(),\n\t\tsignature: string(),\n\t}),\n\tobject({\n\t\ttype: literal('sign-personal-message'),\n\t\tbytes: string(),\n\t\tsignature: string(),\n\t}),\n]);\nexport type StashedResponseData = Output<typeof StashedResponseData>;\n\nexport const StashedResponsePayload = variant('type', [\n\tobject({\n\t\ttype: literal('reject'),\n\t}),\n\tobject({\n\t\ttype: literal('resolve'),\n\t\tdata: StashedResponseData,\n\t}),\n]);\nexport type StashedResponsePayload = Output<typeof StashedResponsePayload>;\n\nexport const StashedResponse = object({\n\tid: string([uuid()]),\n\tsource: literal('zksend-channel'),\n\tpayload: StashedResponsePayload,\n});\nexport type StashedResponse = Output<typeof StashedResponse>;\n\nexport type StashedRequestTypes = Record<string, any> & {\n\t[P in StashedRequestData as P['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AQ,QAAQ;AAAA,EACvB,CAAC;AAAA,MACD,uBAAO;AAAA,IACN,UAAM,wBAAQ,SAAS;AAAA,IACvB,MAAM;AAAA,EACP,CAAC;AACF,CAAC;AAGM,MAAM,sBAAkB,uBAAO;AAAA,EACrC,QAAI,uBAAO,KAAC,qBAAK,CAAC,CAAC;AAAA,EACnB,YAAQ,wBAAQ,gBAAgB;AAAA,EAChC,SAAS;AACV,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ import type { Output } from 'valibot';
2
+ import type { StashedRequestData, StashedResponsePayload, StashedResponseTypes } from './events.js';
3
+ import { StashedRequest, StashedResponse } from './events.js';
4
+ export declare const DEFAULT_STASHED_ORIGIN = "https://getstashed.com";
5
+ export { StashedRequest, StashedResponse };
6
+ interface StashedPopupOptions {
7
+ origin?: string;
8
+ name: string;
9
+ }
10
+ export declare class StashedPopup {
11
+ #private;
12
+ constructor({ origin, name }: StashedPopupOptions);
13
+ createRequest<T extends StashedRequestData>(request: T): Promise<StashedResponseTypes[T['type']]>;
14
+ close(): void;
15
+ }
16
+ export declare class StashedHost {
17
+ #private;
18
+ constructor(request: Output<typeof StashedRequest>);
19
+ static fromUrl(url?: string): StashedHost;
20
+ getRequestData(): {
21
+ id: string;
22
+ origin: string;
23
+ payload: {
24
+ type: "connect";
25
+ } | {
26
+ address: string;
27
+ type: "sign-transaction-block";
28
+ data: string;
29
+ } | {
30
+ address: string;
31
+ type: "sign-personal-message";
32
+ bytes: string;
33
+ };
34
+ name?: string | undefined;
35
+ };
36
+ sendMessage(payload: StashedResponsePayload): void;
37
+ close(payload?: StashedResponsePayload): void;
38
+ }
@@ -36,20 +36,20 @@ var __privateSet = (obj, member, value, setter) => {
36
36
  };
37
37
  var channel_exports = {};
38
38
  __export(channel_exports, {
39
- DEFAULT_ZKSEND_ORIGIN: () => DEFAULT_ZKSEND_ORIGIN,
40
- ZkSendHost: () => ZkSendHost,
41
- ZkSendPopup: () => ZkSendPopup,
42
- ZkSendRequest: () => import_events.ZkSendRequest,
43
- ZkSendResponse: () => import_events.ZkSendResponse
39
+ DEFAULT_STASHED_ORIGIN: () => DEFAULT_STASHED_ORIGIN,
40
+ StashedHost: () => StashedHost,
41
+ StashedPopup: () => StashedPopup,
42
+ StashedRequest: () => import_events.StashedRequest,
43
+ StashedResponse: () => import_events.StashedResponse
44
44
  });
45
45
  module.exports = __toCommonJS(channel_exports);
46
46
  var import_valibot = require("valibot");
47
- var import_withResolvers = require("../utils/withResolvers.js");
47
+ var import_withResolvers = require("../../utils/withResolvers.js");
48
48
  var import_events = require("./events.js");
49
49
  var _id, _origin, _name, _close, _request;
50
- const DEFAULT_ZKSEND_ORIGIN = "https://zksend.com";
51
- class ZkSendPopup {
52
- constructor({ origin = DEFAULT_ZKSEND_ORIGIN, name }) {
50
+ const DEFAULT_STASHED_ORIGIN = "https://getstashed.com";
51
+ class StashedPopup {
52
+ constructor({ origin = DEFAULT_STASHED_ORIGIN, name }) {
53
53
  __privateAdd(this, _id, void 0);
54
54
  __privateAdd(this, _origin, void 0);
55
55
  __privateAdd(this, _name, void 0);
@@ -75,7 +75,7 @@ class ZkSendPopup {
75
75
  if (event.origin !== __privateGet(this, _origin)) {
76
76
  return;
77
77
  }
78
- const { success, output } = (0, import_valibot.safeParse)(import_events.ZkSendResponse, event.data);
78
+ const { success, output } = (0, import_valibot.safeParse)(import_events.StashedResponse, event.data);
79
79
  if (!success || output.id !== __privateGet(this, _id))
80
80
  return;
81
81
  cleanup();
@@ -102,7 +102,7 @@ class ZkSendPopup {
102
102
  try {
103
103
  if (popup?.closed) {
104
104
  cleanup();
105
- reject(new Error("User closed the zkSend window"));
105
+ reject(new Error("User closed the Stashed window"));
106
106
  }
107
107
  } catch {
108
108
  }
@@ -118,12 +118,12 @@ _id = new WeakMap();
118
118
  _origin = new WeakMap();
119
119
  _name = new WeakMap();
120
120
  _close = new WeakMap();
121
- const _ZkSendHost = class {
121
+ const _StashedHost = class {
122
122
  constructor(request) {
123
123
  __privateAdd(this, _request, void 0);
124
124
  if (typeof window === "undefined" || !window.opener) {
125
125
  throw new Error(
126
- "ZkSendHost can only be used in a window opened through `window.open`. `window.opener` is not available."
126
+ "StashedHost can only be used in a window opened through `window.open`. `window.opener` is not available."
127
127
  );
128
128
  }
129
129
  __privateSet(this, _request, request);
@@ -136,7 +136,7 @@ const _ZkSendHost = class {
136
136
  value.replace(/ /g, "+")
137
137
  ])
138
138
  ) : {};
139
- const request = (0, import_valibot.parse)(import_events.ZkSendRequest, {
139
+ const request = (0, import_valibot.parse)(import_events.StashedRequest, {
140
140
  id: parsed.searchParams.get("id"),
141
141
  origin: parsed.searchParams.get("origin"),
142
142
  name: parsed.searchParams.get("name"),
@@ -145,7 +145,7 @@ const _ZkSendHost = class {
145
145
  ...urlHashData
146
146
  }
147
147
  });
148
- return new _ZkSendHost(request);
148
+ return new _StashedHost(request);
149
149
  }
150
150
  getRequestData() {
151
151
  return __privateGet(this, _request);
@@ -167,6 +167,6 @@ const _ZkSendHost = class {
167
167
  window.close();
168
168
  }
169
169
  };
170
- let ZkSendHost = _ZkSendHost;
170
+ let StashedHost = _StashedHost;
171
171
  _request = new WeakMap();
172
172
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/wallet/channel/index.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Output } from 'valibot';\nimport { parse, safeParse } from 'valibot';\n\nimport { withResolvers } from '../../utils/withResolvers.js';\nimport type { StashedRequestData, StashedResponsePayload, StashedResponseTypes } from './events.js';\nimport { StashedRequest, StashedResponse } from './events.js';\n\nexport const DEFAULT_STASHED_ORIGIN = 'https://getstashed.com';\n\nexport { StashedRequest, StashedResponse };\n\ninterface StashedPopupOptions {\n\torigin?: string;\n\tname: string;\n}\n\nexport class StashedPopup {\n\t#id: string;\n\t#origin: string;\n\t#name: string;\n\n\t#close?: () => void;\n\n\tconstructor({ origin = DEFAULT_STASHED_ORIGIN, name }: StashedPopupOptions) {\n\t\tthis.#id = crypto.randomUUID();\n\t\tthis.#origin = origin;\n\t\tthis.#name = name;\n\t}\n\n\tasync createRequest<T extends StashedRequestData>(\n\t\trequest: T,\n\t): Promise<StashedResponseTypes[T['type']]> {\n\t\tconst popup = window.open('about:blank', '_blank');\n\n\t\tif (!popup) {\n\t\t\tthrow new Error('Failed to open new window');\n\t\t}\n\n\t\tconst { promise, resolve, reject } = withResolvers<StashedResponseTypes[T['type']]>();\n\n\t\tlet interval: NodeJS.Timer | null = null;\n\n\t\tfunction cleanup() {\n\t\t\tif (interval) {\n\t\t\t\tclearInterval(interval);\n\t\t\t}\n\t\t\twindow.removeEventListener('message', listener);\n\t\t}\n\n\t\tconst listener = (event: MessageEvent) => {\n\t\t\tif (event.origin !== this.#origin) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { success, output } = safeParse(StashedResponse, event.data);\n\t\t\tif (!success || output.id !== this.#id) return;\n\n\t\t\tcleanup();\n\n\t\t\tif (output.payload.type === 'reject') {\n\t\t\t\treject(new Error('User rejected the request'));\n\t\t\t} else if (output.payload.type === 'resolve') {\n\t\t\t\tresolve(output.payload.data as StashedResponseTypes[T['type']]);\n\t\t\t}\n\t\t};\n\n\t\tthis.#close = () => {\n\t\t\tcleanup();\n\t\t\tpopup?.close();\n\t\t};\n\n\t\twindow.addEventListener('message', listener);\n\n\t\tconst { type, ...data } = request;\n\n\t\tpopup?.location.assign(\n\t\t\t`${this.#origin}/dapp/${type}?${new URLSearchParams({\n\t\t\t\tid: this.#id,\n\t\t\t\torigin: window.origin,\n\t\t\t\tname: this.#name,\n\t\t\t})}${data ? `#${new URLSearchParams(data as Record<string, string>)}` : ''}`,\n\t\t);\n\n\t\tinterval = setInterval(() => {\n\t\t\ttry {\n\t\t\t\tif (popup?.closed) {\n\t\t\t\t\tcleanup();\n\t\t\t\t\treject(new Error('User closed the Stashed window'));\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// This can error during the login flow, but that's fine.\n\t\t\t}\n\t\t}, 1000);\n\n\t\treturn promise;\n\t}\n\n\tclose() {\n\t\tthis.#close?.();\n\t}\n}\n\nexport class StashedHost {\n\t#request: Output<typeof StashedRequest>;\n\n\tconstructor(request: Output<typeof StashedRequest>) {\n\t\tif (typeof window === 'undefined' || !window.opener) {\n\t\t\tthrow new Error(\n\t\t\t\t'StashedHost can only be used in a window opened through `window.open`. `window.opener` is not available.',\n\t\t\t);\n\t\t}\n\n\t\tthis.#request = request;\n\t}\n\n\tstatic fromUrl(url: string = window.location.href) {\n\t\tconst parsed = new URL(url);\n\n\t\tconst urlHashData = parsed.hash\n\t\t\t? Object.fromEntries(\n\t\t\t\t\t[...new URLSearchParams(parsed.hash.slice(1))].map(([key, value]) => [\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue.replace(/ /g, '+'),\n\t\t\t\t\t]),\n\t\t\t )\n\t\t\t: {};\n\n\t\tconst request = parse(StashedRequest, {\n\t\t\tid: parsed.searchParams.get('id'),\n\t\t\torigin: parsed.searchParams.get('origin'),\n\t\t\tname: parsed.searchParams.get('name'),\n\t\t\tpayload: {\n\t\t\t\ttype: parsed.pathname.split('/').pop(),\n\t\t\t\t...urlHashData,\n\t\t\t},\n\t\t});\n\n\t\treturn new StashedHost(request);\n\t}\n\n\tgetRequestData() {\n\t\treturn this.#request;\n\t}\n\n\tsendMessage(payload: StashedResponsePayload) {\n\t\twindow.opener.postMessage(\n\t\t\t{\n\t\t\t\tid: this.#request.id,\n\t\t\t\tsource: 'zksend-channel',\n\t\t\t\tpayload,\n\t\t\t} satisfies StashedResponse,\n\t\t\tthis.#request.origin,\n\t\t);\n\t}\n\n\tclose(payload?: StashedResponsePayload) {\n\t\tif (payload) {\n\t\t\tthis.sendMessage(payload);\n\t\t}\n\t\twindow.close();\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,IACD,CAAC;AAED,WAAO,IAAI,aAAY,OAAO;AAAA,EAC/B;AAAA,EAEA,iBAAiB;AAChB,WAAO,mBAAK;AAAA,EACb;AAAA,EAEA,YAAY,SAAiC;AAC5C,WAAO,OAAO;AAAA,MACb;AAAA,QACC,IAAI,mBAAK,UAAS;AAAA,QAClB,QAAQ;AAAA,QACR;AAAA,MACD;AAAA,MACA,mBAAK,UAAS;AAAA,IACf;AAAA,EACD;AAAA,EAEA,MAAM,SAAkC;AACvC,QAAI,SAAS;AACZ,WAAK,YAAY,OAAO;AAAA,IACzB;AACA,WAAO,MAAM;AAAA,EACd;AACD;AA3DO,IAAM,cAAN;AACN;",
6
+ "names": []
7
+ }
@@ -1,9 +1,9 @@
1
1
  import type { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, SuiSignPersonalMessageFeature, SuiSignTransactionBlockFeature, Wallet } from '@mysten/wallet-standard';
2
2
  import { ReadonlyWalletAccount } from '@mysten/wallet-standard';
3
- export declare const ZKSEND_WALLET_NAME: "zkSend";
4
- export declare class ZkSendWallet implements Wallet {
3
+ export declare const STASHED_WALLET_NAME: "Stashed";
4
+ export declare class StashedWallet implements Wallet {
5
5
  #private;
6
- get name(): "zkSend";
6
+ get name(): "Stashed";
7
7
  get icon(): "data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjMyIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHdpZHRoPSIzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGNsaXBQYXRoIGlkPSJhIj48cmVjdCBoZWlnaHQ9IjMyIiByeD0iMiIgd2lkdGg9IjMyIi8+PC9jbGlwUGF0aD48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxyZWN0IGZpbGw9IiNmZmYiIGhlaWdodD0iMzIiIHJ4PSIyIiB3aWR0aD0iMzIiLz48cGF0aCBkPSJtMCAwaDMydjMyaC0zMnoiIGZpbGw9IiNkNDA1NTEiLz48cGF0aCBkPSJtNS42NjgyNSAyNS4yNDkxYy0uNzgyNjMtLjc4MjctLjc4MDgxLTIuMDUyMS4wMDQwNi0yLjgzMjVsMTYuNjA1MjktMTYuNTEwNDdjLjc4MTctLjc3NzIzIDIuMDQ0OS0uNzc1NDMgMi44MjQzLjAwNDA0bC44Mzg3LjgzODYyYy43ODI1Ljc4MjUxLjc4MDggMi4wNTE3NC0uMDAzOCAyLjgzMjE4bC0xNi42MDE4OCAxNi41MTM4M2MtLjc4MTY1Ljc3NzUtMi4wNDUwOC43NzU4LTIuODI0NjYtLjAwMzd6bTUuNDQzMzUtMTUuOTExNjZjLTEuODA5NzIuMDUzNjctMi43NTM3MS0yLjEzMzA5LTEuNDczNDctMy40MTMzM2wuODM4MzctLjgzODMyYy4zNzUtLjM3NTA4Ljg4MzctLjU4NTc5IDEuNDE0Mi0uNTg1NzloMTMuNDc5N2MxLjEwNDYgMCAyIC44OTU0MyAyIDJ2MTMuNDc5N2MwIC41MzA1LS4yMTA3IDEuMDM5Mi0uNTg1OCAxLjQxNDJsLS44MjY5LjgyN2MtMS4yODE4IDEuMjgxOC0zLjQ3MDkuMzMzOS0zLjQxMzItMS40Nzc5bC4zMDY2LTkuNjI5OWMuMDM2Ny0xLjE1MjI3LS45MDU5LTIuMDk2OS0yLjA1ODMtMi4wNjI3M3oiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+";
8
8
  get version(): "1.0.0";
9
9
  get chains(): readonly ["sui:mainnet"];
@@ -15,10 +15,10 @@ export declare class ZkSendWallet implements Wallet {
15
15
  name: string;
16
16
  });
17
17
  }
18
- export declare function registerZkSendWallet(name: string, { origin, }: {
18
+ export declare function registerStashedWallet(name: string, { origin, }: {
19
19
  origin?: string;
20
20
  }): {
21
- wallet: ZkSendWallet;
21
+ wallet: StashedWallet;
22
22
  unregister: () => void;
23
23
  addressFromRedirect: string | null;
24
24
  };
@@ -50,9 +50,9 @@ var __privateMethod = (obj, member, method) => {
50
50
  };
51
51
  var wallet_exports = {};
52
52
  __export(wallet_exports, {
53
- ZKSEND_WALLET_NAME: () => ZKSEND_WALLET_NAME,
54
- ZkSendWallet: () => ZkSendWallet,
55
- registerZkSendWallet: () => registerZkSendWallet
53
+ STASHED_WALLET_NAME: () => STASHED_WALLET_NAME,
54
+ StashedWallet: () => StashedWallet,
55
+ registerStashedWallet: () => registerStashedWallet
56
56
  });
57
57
  module.exports = __toCommonJS(wallet_exports);
58
58
  var import_bcs = require("@mysten/sui.js/bcs");
@@ -61,13 +61,13 @@ var import_wallet_standard = require("@mysten/wallet-standard");
61
61
  var import_mitt = __toESM(require("mitt"));
62
62
  var import_channel = require("./channel/index.js");
63
63
  var _events, _accounts, _origin, _name, _signTransactionBlock, _signPersonalMessage, _on, _setAccount, setAccount_fn, _connect, _disconnect;
64
- const ZKSEND_RECENT_ADDRESS_KEY = "zksend:recentAddress";
65
- const ZKSEND_WALLET_NAME = "zkSend";
66
- class ZkSendWallet {
64
+ const STASHED_RECENT_ADDRESS_KEY = "stashed:recentAddress";
65
+ const STASHED_WALLET_NAME = "Stashed";
66
+ class StashedWallet {
67
67
  constructor({
68
68
  name,
69
69
  address,
70
- origin = import_channel.DEFAULT_ZKSEND_ORIGIN
70
+ origin = import_channel.DEFAULT_STASHED_ORIGIN
71
71
  }) {
72
72
  __privateAdd(this, _setAccount);
73
73
  __privateAdd(this, _events, void 0);
@@ -77,7 +77,7 @@ class ZkSendWallet {
77
77
  __privateAdd(this, _signTransactionBlock, async ({ transactionBlock, account }) => {
78
78
  transactionBlock.setSenderIfNotSet(account.address);
79
79
  const data = transactionBlock.serialize();
80
- const popup = new import_channel.ZkSendPopup({ name: __privateGet(this, _name), origin: __privateGet(this, _origin) });
80
+ const popup = new import_channel.StashedPopup({ name: __privateGet(this, _name), origin: __privateGet(this, _origin) });
81
81
  const response = await popup.createRequest({
82
82
  type: "sign-transaction-block",
83
83
  data,
@@ -90,7 +90,7 @@ class ZkSendWallet {
90
90
  });
91
91
  __privateAdd(this, _signPersonalMessage, async ({ message, account }) => {
92
92
  const bytes = (0, import_utils.toB64)(import_bcs.bcs.vector(import_bcs.bcs.u8()).serialize(message).toBytes());
93
- const popup = new import_channel.ZkSendPopup({ name: __privateGet(this, _name), origin: __privateGet(this, _origin) });
93
+ const popup = new import_channel.StashedPopup({ name: __privateGet(this, _name), origin: __privateGet(this, _origin) });
94
94
  const response = await popup.createRequest({
95
95
  type: "sign-personal-message",
96
96
  bytes,
@@ -107,13 +107,13 @@ class ZkSendWallet {
107
107
  });
108
108
  __privateAdd(this, _connect, async (input) => {
109
109
  if (input?.silent) {
110
- const address = localStorage.getItem(ZKSEND_RECENT_ADDRESS_KEY);
110
+ const address = localStorage.getItem(STASHED_RECENT_ADDRESS_KEY);
111
111
  if (address) {
112
112
  __privateMethod(this, _setAccount, setAccount_fn).call(this, address);
113
113
  }
114
114
  return { accounts: this.accounts };
115
115
  }
116
- const popup = new import_channel.ZkSendPopup({ name: __privateGet(this, _name), origin: __privateGet(this, _origin) });
116
+ const popup = new import_channel.StashedPopup({ name: __privateGet(this, _name), origin: __privateGet(this, _origin) });
117
117
  const response = await popup.createRequest({
118
118
  type: "connect"
119
119
  });
@@ -124,7 +124,7 @@ class ZkSendWallet {
124
124
  return { accounts: this.accounts };
125
125
  });
126
126
  __privateAdd(this, _disconnect, async () => {
127
- localStorage.removeItem(ZKSEND_RECENT_ADDRESS_KEY);
127
+ localStorage.removeItem(STASHED_RECENT_ADDRESS_KEY);
128
128
  __privateMethod(this, _setAccount, setAccount_fn).call(this);
129
129
  });
130
130
  __privateSet(this, _accounts, []);
@@ -136,7 +136,7 @@ class ZkSendWallet {
136
136
  }
137
137
  }
138
138
  get name() {
139
- return ZKSEND_WALLET_NAME;
139
+ return STASHED_WALLET_NAME;
140
140
  }
141
141
  get icon() {
142
142
  return "data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZW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LjE1MjI3LS45MDU5LTIuMDk2OS0yLjA1ODMtMi4wNjI3M3oiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+";
@@ -190,11 +190,11 @@ setAccount_fn = function(address) {
190
190
  address,
191
191
  chains: [import_wallet_standard.SUI_MAINNET_CHAIN],
192
192
  features: ["sui:signTransactionBlock", "sui:signPersonalMessage"],
193
- // NOTE: zkSend doesn't support getting public keys, and zkLogin accounts don't have meaningful public keys anyway
193
+ // NOTE: Stashed doesn't support getting public keys, and zkLogin accounts don't have meaningful public keys anyway
194
194
  publicKey: new Uint8Array()
195
195
  })
196
196
  ]);
197
- localStorage.setItem(ZKSEND_RECENT_ADDRESS_KEY, address);
197
+ localStorage.setItem(STASHED_RECENT_ADDRESS_KEY, address);
198
198
  } else {
199
199
  __privateSet(this, _accounts, []);
200
200
  }
@@ -202,17 +202,17 @@ setAccount_fn = function(address) {
202
202
  };
203
203
  _connect = new WeakMap();
204
204
  _disconnect = new WeakMap();
205
- function registerZkSendWallet(name, {
205
+ function registerStashedWallet(name, {
206
206
  origin
207
207
  }) {
208
208
  const wallets = (0, import_wallet_standard.getWallets)();
209
209
  let addressFromRedirect = null;
210
210
  try {
211
211
  const params = new URLSearchParams(window.location.search);
212
- addressFromRedirect = params.get("zksend_address");
212
+ addressFromRedirect = params.get("stashed_address") || params.get("zksend_address");
213
213
  } catch {
214
214
  }
215
- const wallet = new ZkSendWallet({
215
+ const wallet = new StashedWallet({
216
216
  name,
217
217
  origin,
218
218
  address: addressFromRedirect
@@ -224,4 +224,4 @@ function registerZkSendWallet(name, {
224
224
  addressFromRedirect
225
225
  };
226
226
  }
227
- //# sourceMappingURL=wallet.js.map
227
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/wallet/index.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/sui.js/bcs';\nimport { toB64 } from '@mysten/sui.js/utils';\nimport type {\n\tStandardConnectFeature,\n\tStandardConnectMethod,\n\tStandardDisconnectFeature,\n\tStandardDisconnectMethod,\n\tStandardEventsFeature,\n\tStandardEventsListeners,\n\tStandardEventsOnMethod,\n\tSuiSignPersonalMessageFeature,\n\tSuiSignPersonalMessageMethod,\n\tSuiSignTransactionBlockFeature,\n\tSuiSignTransactionBlockMethod,\n\tWallet,\n} from '@mysten/wallet-standard';\nimport { getWallets, ReadonlyWalletAccount, SUI_MAINNET_CHAIN } from '@mysten/wallet-standard';\nimport type { Emitter } from 'mitt';\nimport mitt from 'mitt';\n\nimport { DEFAULT_STASHED_ORIGIN, StashedPopup } from './channel/index.js';\n\ntype WalletEventsMap = {\n\t[E in keyof StandardEventsListeners]: Parameters<StandardEventsListeners[E]>[0];\n};\n\nconst STASHED_RECENT_ADDRESS_KEY = 'stashed:recentAddress';\n\nexport const STASHED_WALLET_NAME = 'Stashed' as const;\n\nexport class StashedWallet implements Wallet {\n\t#events: Emitter<WalletEventsMap>;\n\t#accounts: ReadonlyWalletAccount[];\n\t#origin: string;\n\t#name: string;\n\n\tget name() {\n\t\treturn STASHED_WALLET_NAME;\n\t}\n\n\tget icon() {\n\t\treturn 'data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjMyIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHdpZHRoPSIzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGNsaXBQYXRoIGlkPSJhIj48cmVjdCBoZWlnaHQ9IjMyIiByeD0iMiIgd2lkdGg9IjMyIi8+PC9jbGlwUGF0aD48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxyZWN0IGZpbGw9IiNmZmYiIGhlaWdodD0iMzIiIHJ4PSIyIiB3aWR0aD0iMzIiLz48cGF0aCBkPSJtMCAwaDMydjMyaC0zMnoiIGZpbGw9IiNkNDA1NTEiLz48cGF0aCBkPSJtNS42NjgyNSAyNS4yNDkxYy0uNzgyNjMtLjc4MjctLjc4MDgxLTIuMDUyMS4wMDQwNi0yLjgzMjVsMTYuNjA1MjktMTYuNTEwNDdjLjc4MTctLjc3NzIzIDIuMDQ0OS0uNzc1NDMgMi44MjQzLjAwNDA0bC44Mzg3LjgzODYyYy43ODI1Ljc4MjUxLjc4MDggMi4wNTE3NC0uMDAzOCAyLjgzMjE4bC0xNi42MDE4OCAxNi41MTM4M2MtLjc4MTY1Ljc3NzUtMi4wNDUwOC43NzU4LTIuODI0NjYtLjAwMzd6bTUuNDQzMzUtMTUuOTExNjZjLTEuODA5NzIuMDUzNjctMi43NTM3MS0yLjEzMzA5LTEuNDczNDctMy40MTMzM2wuODM4MzctLjgzODMyYy4zNzUtLjM3NTA4Ljg4MzctLjU4NTc5IDEuNDE0Mi0uNTg1NzloMTMuNDc5N2MxLjEwNDYgMCAyIC44OTU0MyAyIDJ2MTMuNDc5N2MwIC41MzA1LS4yMTA3IDEuMDM5Mi0uNTg1OCAxLjQxNDJsLS44MjY5LjgyN2MtMS4yODE4IDEuMjgxOC0zLjQ3MDkuMzMzOS0zLjQxMzItMS40Nzc5bC4zMDY2LTkuNjI5OWMuMDM2Ny0xLjE1MjI3LS45MDU5LTIuMDk2OS0yLjA1ODMtMi4wNjI3M3oiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+' as const;\n\t}\n\n\tget version() {\n\t\treturn '1.0.0' as const;\n\t}\n\n\tget chains() {\n\t\treturn [SUI_MAINNET_CHAIN] as const;\n\t}\n\n\tget accounts() {\n\t\treturn this.#accounts;\n\t}\n\n\tget features(): StandardConnectFeature &\n\t\tStandardDisconnectFeature &\n\t\tStandardEventsFeature &\n\t\tSuiSignTransactionBlockFeature &\n\t\tSuiSignPersonalMessageFeature {\n\t\treturn {\n\t\t\t'standard:connect': {\n\t\t\t\tversion: '1.0.0',\n\t\t\t\tconnect: this.#connect,\n\t\t\t},\n\t\t\t'standard:disconnect': {\n\t\t\t\tversion: '1.0.0',\n\t\t\t\tdisconnect: this.#disconnect,\n\t\t\t},\n\t\t\t'standard:events': {\n\t\t\t\tversion: '1.0.0',\n\t\t\t\ton: this.#on,\n\t\t\t},\n\t\t\t'sui:signTransactionBlock': {\n\t\t\t\tversion: '1.0.0',\n\t\t\t\tsignTransactionBlock: this.#signTransactionBlock,\n\t\t\t},\n\t\t\t'sui:signPersonalMessage': {\n\t\t\t\tversion: '1.0.0',\n\t\t\t\tsignPersonalMessage: this.#signPersonalMessage,\n\t\t\t},\n\t\t};\n\t}\n\n\tconstructor({\n\t\tname,\n\t\taddress,\n\t\torigin = DEFAULT_STASHED_ORIGIN,\n\t}: {\n\t\torigin?: string;\n\t\taddress?: string | null;\n\t\tname: string;\n\t}) {\n\t\tthis.#accounts = [];\n\t\tthis.#events = mitt();\n\t\tthis.#origin = origin;\n\t\tthis.#name = name;\n\n\t\tif (address) {\n\t\t\tthis.#setAccount(address);\n\t\t}\n\t}\n\n\t#signTransactionBlock: SuiSignTransactionBlockMethod = async ({ transactionBlock, account }) => {\n\t\ttransactionBlock.setSenderIfNotSet(account.address);\n\n\t\tconst data = transactionBlock.serialize();\n\n\t\tconst popup = new StashedPopup({ name: this.#name, origin: this.#origin });\n\t\tconst response = await popup.createRequest({\n\t\t\ttype: 'sign-transaction-block',\n\t\t\tdata,\n\t\t\taddress: account.address,\n\t\t});\n\n\t\treturn {\n\t\t\ttransactionBlockBytes: response.bytes,\n\t\t\tsignature: response.signature,\n\t\t};\n\t};\n\n\t#signPersonalMessage: SuiSignPersonalMessageMethod = async ({ message, account }) => {\n\t\tconst bytes = toB64(bcs.vector(bcs.u8()).serialize(message).toBytes());\n\t\tconst popup = new StashedPopup({ name: this.#name, origin: this.#origin });\n\t\tconst response = await popup.createRequest({\n\t\t\ttype: 'sign-personal-message',\n\t\t\tbytes,\n\t\t\taddress: account.address,\n\t\t});\n\n\t\treturn {\n\t\t\tbytes,\n\t\t\tsignature: response.signature,\n\t\t};\n\t};\n\n\t#on: StandardEventsOnMethod = (event, listener) => {\n\t\tthis.#events.on(event, listener);\n\t\treturn () => this.#events.off(event, listener);\n\t};\n\n\t#setAccount(address?: string) {\n\t\tif (address) {\n\t\t\tthis.#accounts = [\n\t\t\t\tnew ReadonlyWalletAccount({\n\t\t\t\t\taddress,\n\t\t\t\t\tchains: [SUI_MAINNET_CHAIN],\n\t\t\t\t\tfeatures: ['sui:signTransactionBlock', 'sui:signPersonalMessage'],\n\t\t\t\t\t// NOTE: Stashed doesn't support getting public keys, and zkLogin accounts don't have meaningful public keys anyway\n\t\t\t\t\tpublicKey: new Uint8Array(),\n\t\t\t\t}),\n\t\t\t];\n\n\t\t\tlocalStorage.setItem(STASHED_RECENT_ADDRESS_KEY, address);\n\t\t} else {\n\t\t\tthis.#accounts = [];\n\t\t}\n\n\t\tthis.#events.emit('change', { accounts: this.accounts });\n\t}\n\n\t#connect: StandardConnectMethod = async (input) => {\n\t\tif (input?.silent) {\n\t\t\tconst address = localStorage.getItem(STASHED_RECENT_ADDRESS_KEY);\n\n\t\t\tif (address) {\n\t\t\t\tthis.#setAccount(address);\n\t\t\t}\n\n\t\t\treturn { accounts: this.accounts };\n\t\t}\n\n\t\tconst popup = new StashedPopup({ name: this.#name, origin: this.#origin });\n\t\tconst response = await popup.createRequest({\n\t\t\ttype: 'connect',\n\t\t});\n\t\tif (!('address' in response)) {\n\t\t\tthrow new Error('Unexpected response');\n\t\t}\n\n\t\tthis.#setAccount(response.address);\n\n\t\treturn { accounts: this.accounts };\n\t};\n\n\t#disconnect: StandardDisconnectMethod = async () => {\n\t\tlocalStorage.removeItem(STASHED_RECENT_ADDRESS_KEY);\n\t\tthis.#setAccount();\n\t};\n}\n\nexport function registerStashedWallet(\n\tname: string,\n\t{\n\t\torigin,\n\t}: {\n\t\torigin?: string;\n\t},\n) {\n\tconst wallets = getWallets();\n\n\tlet addressFromRedirect: string | null = null;\n\ttry {\n\t\tconst params = new URLSearchParams(window.location.search);\n\t\taddressFromRedirect = params.get('stashed_address') || params.get('zksend_address');\n\t} catch {\n\t\t// Ignore errors\n\t}\n\n\tconst wallet = new StashedWallet({\n\t\tname,\n\t\torigin,\n\t\taddress: addressFromRedirect,\n\t});\n\n\tconst unregister = wallets.register(wallet);\n\n\treturn {\n\t\twallet,\n\t\tunregister,\n\t\taddressFromRedirect,\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAoB;AACpB,mBAAsB;AAetB,6BAAqE;AAErE,kBAAiB;AAEjB,qBAAqD;AAvBrD;AA6BA,MAAM,6BAA6B;AAE5B,MAAM,sBAAsB;AAE5B,MAAM,cAAgC;AAAA,EAuD5C,YAAY;AAAA,IACX;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACV,GAIG;AAiDH;AA/GA;AACA;AACA;AACA;AAsEA,8CAAuD,OAAO,EAAE,kBAAkB,QAAQ,MAAM;AAC/F,uBAAiB,kBAAkB,QAAQ,OAAO;AAElD,YAAM,OAAO,iBAAiB,UAAU;AAExC,YAAM,QAAQ,IAAI,4BAAa,EAAE,MAAM,mBAAK,QAAO,QAAQ,mBAAK,SAAQ,CAAC;AACzE,YAAM,WAAW,MAAM,MAAM,cAAc;AAAA,QAC1C,MAAM;AAAA,QACN;AAAA,QACA,SAAS,QAAQ;AAAA,MAClB,CAAC;AAED,aAAO;AAAA,QACN,uBAAuB,SAAS;AAAA,QAChC,WAAW,SAAS;AAAA,MACrB;AAAA,IACD;AAEA,6CAAqD,OAAO,EAAE,SAAS,QAAQ,MAAM;AACpF,YAAM,YAAQ,oBAAM,eAAI,OAAO,eAAI,GAAG,CAAC,EAAE,UAAU,OAAO,EAAE,QAAQ,CAAC;AACrE,YAAM,QAAQ,IAAI,4BAAa,EAAE,MAAM,mBAAK,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AO,IAAI,gBAAgB;AAAA,EACnF,QAAE;AAAA,EAEF;AAEA,QAAM,SAAS,IAAI,cAAc;AAAA,IAChC;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACV,CAAC;AAED,QAAM,aAAa,QAAQ,SAAS,MAAM;AAE1C,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
6
+ "names": ["mitt"]
7
+ }
@@ -5,5 +5,5 @@ export { isClaimTransaction } from './links/utils.js';
5
5
  export { listCreatedLinks } from './links/list-created-links.js';
6
6
  export { getSentTransactionBlocksWithLinks } from './links/get-sent-transaction-blocks.js';
7
7
  export { MAINNET_CONTRACT_IDS } from './links/zk-bag.js';
8
- export * from './wallet.js';
9
- export * from './channel/index.js';
8
+ export * from './wallet/index.js';
9
+ export * from './wallet/channel/index.js';
package/dist/esm/index.js CHANGED
@@ -7,8 +7,8 @@ import { isClaimTransaction } from "./links/utils.js";
7
7
  import { listCreatedLinks } from "./links/list-created-links.js";
8
8
  import { getSentTransactionBlocksWithLinks } from "./links/get-sent-transaction-blocks.js";
9
9
  import { MAINNET_CONTRACT_IDS } from "./links/zk-bag.js";
10
- export * from "./wallet.js";
11
- export * from "./channel/index.js";
10
+ export * from "./wallet/index.js";
11
+ export * from "./wallet/channel/index.js";
12
12
  export {
13
13
  MAINNET_CONTRACT_IDS,
14
14
  ZkBag,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport {\n\tZkSendLinkBuilder,\n\ttype ZkSendLinkBuilderOptions,\n\ttype CreateZkSendLinkOptions,\n} from './links/builder.js';\nexport { ZkSendLink, type ZkSendLinkOptions } from './links/claim.js';\nexport { type ZkBagContractOptions, ZkBag } from './links/zk-bag.js';\nexport { isClaimTransaction } from './links/utils.js';\nexport { listCreatedLinks } from './links/list-created-links.js';\nexport { getSentTransactionBlocksWithLinks } from './links/get-sent-transaction-blocks.js';\n\nexport { MAINNET_CONTRACT_IDS } from './links/zk-bag.js';\nexport * from './wallet.js';\nexport * from './channel/index.js';\n"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport {\n\tZkSendLinkBuilder,\n\ttype ZkSendLinkBuilderOptions,\n\ttype CreateZkSendLinkOptions,\n} from './links/builder.js';\nexport { ZkSendLink, type ZkSendLinkOptions } from './links/claim.js';\nexport { type ZkBagContractOptions, ZkBag } from './links/zk-bag.js';\nexport { isClaimTransaction } from './links/utils.js';\nexport { listCreatedLinks } from './links/list-created-links.js';\nexport { getSentTransactionBlocksWithLinks } from './links/get-sent-transaction-blocks.js';\n\nexport { MAINNET_CONTRACT_IDS } from './links/zk-bag.js';\nexport * from './wallet/index.js';\nexport * from './wallet/channel/index.js';\n"],
5
5
  "mappings": "AAGA;AAAA,EACC;AAAA,OAGM;AACP,SAAS,kBAA0C;AACnD,SAAoC,aAAa;AACjD,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,yCAAyC;AAElD,SAAS,4BAA4B;AACrC,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import type { Output } from 'valibot';
2
- export declare const ZkSendRequestData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
2
+ export declare const StashedRequestData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
3
3
  type: import("valibot").LiteralSchema<"connect", "connect">;
4
4
  }, undefined, {
5
5
  type: "connect";
@@ -30,8 +30,8 @@ export declare const ZkSendRequestData: import("valibot").VariantSchema<"type",
30
30
  type: "sign-personal-message";
31
31
  bytes: string;
32
32
  }>;
33
- export type ZkSendRequestData = Output<typeof ZkSendRequestData>;
34
- export declare const ZkSendRequest: import("valibot").ObjectSchema<{
33
+ export type StashedRequestData = Output<typeof StashedRequestData>;
34
+ export declare const StashedRequest: import("valibot").ObjectSchema<{
35
35
  id: import("valibot").StringSchema<string>;
36
36
  origin: import("valibot").StringSchema<string>;
37
37
  name: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
@@ -82,8 +82,8 @@ export declare const ZkSendRequest: import("valibot").ObjectSchema<{
82
82
  };
83
83
  name?: string | undefined;
84
84
  }>;
85
- export type ZkSendRequest = Output<typeof ZkSendRequest>;
86
- export declare const ZkSendResponseData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
85
+ export type StashedRequest = Output<typeof StashedRequest>;
86
+ export declare const StashedResponseData: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
87
87
  type: import("valibot").LiteralSchema<"connect", "connect">;
88
88
  address: import("valibot").StringSchema<string>;
89
89
  }, undefined, {
@@ -117,8 +117,8 @@ export declare const ZkSendResponseData: import("valibot").VariantSchema<"type",
117
117
  type: "sign-personal-message";
118
118
  bytes: string;
119
119
  }>;
120
- export type ZkSendResponseData = Output<typeof ZkSendResponseData>;
121
- export declare const ZkSendResponsePayload: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
120
+ export type StashedResponseData = Output<typeof StashedResponseData>;
121
+ export declare const StashedResponsePayload: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
122
122
  type: import("valibot").LiteralSchema<"reject", "reject">;
123
123
  }, undefined, {
124
124
  type: "reject";
@@ -189,8 +189,8 @@ export declare const ZkSendResponsePayload: import("valibot").VariantSchema<"typ
189
189
  bytes: string;
190
190
  };
191
191
  }>;
192
- export type ZkSendResponsePayload = Output<typeof ZkSendResponsePayload>;
193
- export declare const ZkSendResponse: import("valibot").ObjectSchema<{
192
+ export type StashedResponsePayload = Output<typeof StashedResponsePayload>;
193
+ export declare const StashedResponse: import("valibot").ObjectSchema<{
194
194
  id: import("valibot").StringSchema<string>;
195
195
  source: import("valibot").LiteralSchema<"zksend-channel", "zksend-channel">;
196
196
  payload: import("valibot").VariantSchema<"type", [import("valibot").ObjectSchema<{
@@ -285,10 +285,10 @@ export declare const ZkSendResponse: import("valibot").ObjectSchema<{
285
285
  };
286
286
  source: "zksend-channel";
287
287
  }>;
288
- export type ZkSendResponse = Output<typeof ZkSendResponse>;
289
- export type ZkSendRequestTypes = Record<string, any> & {
290
- [P in ZkSendRequestData as P['type']]: P;
288
+ export type StashedResponse = Output<typeof StashedResponse>;
289
+ export type StashedRequestTypes = Record<string, any> & {
290
+ [P in StashedRequestData as P['type']]: P;
291
291
  };
292
- export type ZkSendResponseTypes = {
293
- [P in ZkSendResponseData as P['type']]: P;
292
+ export type StashedResponseTypes = {
293
+ [P in StashedResponseData as P['type']]: P;
294
294
  };