@cartridge/controller 0.1.0 → 0.1.2

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/dist/index.es.js DELETED
@@ -1,686 +0,0 @@
1
- import cuid from 'cuid';
2
- import { Provider } from 'starknet';
3
- import qs from 'query-string';
4
-
5
- /*! *****************************************************************************
6
- Copyright (c) Microsoft Corporation.
7
-
8
- Permission to use, copy, modify, and/or distribute this software for any
9
- purpose with or without fee is hereby granted.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
- PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */
19
- /* global Reflect, Promise */
20
-
21
- var extendStatics = function(d, b) {
22
- extendStatics = Object.setPrototypeOf ||
23
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
24
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
25
- return extendStatics(d, b);
26
- };
27
-
28
- function __extends(d, b) {
29
- if (typeof b !== "function" && b !== null)
30
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __awaiter(thisArg, _arguments, P, generator) {
48
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
49
- return new (P || (P = Promise))(function (resolve, reject) {
50
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
51
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
52
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
53
- step((generator = generator.apply(thisArg, _arguments || [])).next());
54
- });
55
- }
56
-
57
- function __generator(thisArg, body) {
58
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
59
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
60
- function verb(n) { return function (v) { return step([n, v]); }; }
61
- function step(op) {
62
- if (f) throw new TypeError("Generator is already executing.");
63
- while (_) try {
64
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
65
- if (y = 0, t) op = [op[0] & 2, t.value];
66
- switch (op[0]) {
67
- case 0: case 1: t = op; break;
68
- case 4: _.label++; return { value: op[1], done: false };
69
- case 5: _.label++; y = op[1]; op = [0]; continue;
70
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
71
- default:
72
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
73
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
74
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
75
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
76
- if (t[2]) _.ops.pop();
77
- _.trys.pop(); continue;
78
- }
79
- op = body.call(thisArg, _);
80
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
81
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
82
- }
83
- }
84
-
85
- var Signer = /** @class */ (function () {
86
- function Signer(messenger, options) {
87
- this.url = "https://cartridge.gg";
88
- this.messenger = messenger;
89
- if (options === null || options === void 0 ? void 0 : options.url) {
90
- this.url = options.url;
91
- }
92
- }
93
- /**
94
- * Method to get the public key of the signer
95
- *
96
- * @returns public key of signer as hex string with 0x prefix
97
- */
98
- Signer.prototype.getPubKey = function () {
99
- return Promise.resolve("");
100
- };
101
- /**
102
- * Sign an JSON object for off-chain usage with the starknet private key and return the signature
103
- * This adds a message prefix so it cant be interchanged with transactions
104
- *
105
- * @param typedData - JSON object to be signed
106
- * @param accountAddress - account
107
- * @returns the signature of the JSON object
108
- * @throws {Error} if the JSON object is not a valid JSON
109
- */
110
- Signer.prototype.signMessage = function (typedData, account) {
111
- return __awaiter(this, void 0, void 0, function () {
112
- var id, response;
113
- return __generator(this, function (_a) {
114
- switch (_a.label) {
115
- case 0:
116
- id = cuid();
117
- window.open("".concat(this.url, "/sign?").concat(qs.stringify({
118
- id: id,
119
- origin: window.origin,
120
- message: JSON.stringify(typedData.message),
121
- })), "_blank", "height=650,width=400");
122
- return [4 /*yield*/, this.messenger.send({
123
- method: "sign-message",
124
- params: {
125
- id: id,
126
- account: account,
127
- typedData: typedData,
128
- },
129
- })];
130
- case 1:
131
- response = _a.sent();
132
- if (response.error) {
133
- throw new Error(response.error);
134
- }
135
- return [2 /*return*/, response.result];
136
- }
137
- });
138
- });
139
- };
140
- /**
141
- * Signs a transaction with the starknet private key and returns the signature
142
- *
143
- * @param invocation the invocation object containing:
144
- * - contractAddress - the address of the contract
145
- * - entrypoint - the entrypoint of the contract
146
- * - calldata - (defaults to []) the calldata
147
- * - signature - (defaults to []) the signature
148
- * @param abi (optional) the abi of the contract for better displaying
149
- *
150
- * @returns signature
151
- */
152
- Signer.prototype.signTransaction = function (transactions, transactionsDetail, abis) {
153
- return __awaiter(this, void 0, void 0, function () {
154
- var id, calls, response;
155
- return __generator(this, function (_a) {
156
- switch (_a.label) {
157
- case 0:
158
- id = cuid();
159
- calls = Array.isArray(transactions) ? transactions : [transactions];
160
- window.open("".concat(this.url, "/sign?").concat(qs.stringify({
161
- id: id,
162
- origin: window.origin,
163
- calls: JSON.stringify(calls),
164
- })), "_blank", "height=650,width=400");
165
- return [4 /*yield*/, this.messenger.send({
166
- method: "sign-transaction",
167
- params: {
168
- id: id,
169
- transactions: transactions,
170
- abis: abis,
171
- transactionsDetail: transactionsDetail,
172
- },
173
- })];
174
- case 1:
175
- response = _a.sent();
176
- if (response.error) {
177
- throw new Error(response.error);
178
- }
179
- return [2 /*return*/, response.result];
180
- }
181
- });
182
- });
183
- };
184
- return Signer;
185
- }());
186
-
187
- var Account = /** @class */ (function (_super) {
188
- __extends(Account, _super);
189
- function Account(address, scopes, messenger, options) {
190
- if (scopes === void 0) { scopes = []; }
191
- var _this = _super.call(this) || this;
192
- _this.url = "https://cartridge.gg";
193
- _this._scopes = [];
194
- _this.address = address;
195
- _this.messenger = messenger;
196
- _this._scopes = scopes;
197
- _this.signer = new Signer(messenger, options);
198
- if (options === null || options === void 0 ? void 0 : options.url) {
199
- _this.url = options.url;
200
- }
201
- return _this;
202
- }
203
- /**
204
- * Deploys a given compiled contract (json) to starknet
205
- *
206
- * @param payload payload to be deployed containing:
207
- * - compiled contract code
208
- * - constructor calldata
209
- * - address salt
210
- * @param abi the abi of the contract
211
- * @returns a confirmation of sending a transaction on the starknet contract
212
- */
213
- Account.prototype.deployContract = function (payload, abi) {
214
- return __awaiter(this, void 0, void 0, function () {
215
- var id, response;
216
- return __generator(this, function (_a) {
217
- switch (_a.label) {
218
- case 0:
219
- id = cuid();
220
- window.open("".concat(this.url, "/deploy?origin=").concat(encodeURIComponent(window.origin), "&id=").concat(id), "_blank", "height=650,width=400");
221
- return [4 /*yield*/, this.messenger.send({
222
- method: "deploy-contract",
223
- params: {
224
- id: id,
225
- payload: payload,
226
- abi: abi,
227
- },
228
- })];
229
- case 1:
230
- response = _a.sent();
231
- if (response.error) {
232
- throw new Error(response.error);
233
- }
234
- return [2 /*return*/, response.result];
235
- }
236
- });
237
- });
238
- };
239
- /**
240
- * Estimate Fee for a method on starknet
241
- *
242
- * @param invocation the invocation object containing:
243
- * - contractAddress - the address of the contract
244
- * - entrypoint - the entrypoint of the contract
245
- * - calldata - (defaults to []) the calldata
246
- * - signature - (defaults to []) the signature
247
- *
248
- * @returns response from addTransaction
249
- */
250
- Account.prototype.estimateFee = function (invocation) {
251
- return __awaiter(this, void 0, void 0, function () {
252
- var response;
253
- return __generator(this, function (_a) {
254
- switch (_a.label) {
255
- case 0: return [4 /*yield*/, this.messenger.send({
256
- method: "estimate-fee",
257
- params: {
258
- invocation: invocation,
259
- },
260
- })];
261
- case 1:
262
- response = _a.sent();
263
- if (response.error) {
264
- throw new Error(response.error);
265
- }
266
- return [2 /*return*/, response.result];
267
- }
268
- });
269
- });
270
- };
271
- /**
272
- * Invoke execute function in account contract
273
- *
274
- * @param transactions the invocation object or an array of them, containing:
275
- * - contractAddress - the address of the contract
276
- * - entrypoint - the entrypoint of the contract
277
- * - calldata - (defaults to []) the calldata
278
- * - signature - (defaults to []) the signature
279
- * @param abi (optional) the abi of the contract for better displaying
280
- *
281
- * @returns response from addTransaction
282
- */
283
- Account.prototype.execute = function (transactions, abis, transactionsDetail) {
284
- return __awaiter(this, void 0, void 0, function () {
285
- var response, id, calls;
286
- return __generator(this, function (_a) {
287
- switch (_a.label) {
288
- case 0: return [4 /*yield*/, this.messenger.send({
289
- method: "execute",
290
- params: {
291
- transactions: transactions,
292
- abis: abis,
293
- transactionsDetail: transactionsDetail,
294
- },
295
- })];
296
- case 1:
297
- response = _a.sent();
298
- if (response.result) {
299
- return [2 /*return*/, response.result];
300
- }
301
- if (response.error && response.error !== "missing scopes") {
302
- throw new Error(response.error);
303
- }
304
- id = cuid();
305
- calls = Array.isArray(transactions) ? transactions : [transactions];
306
- window.open("".concat(this.url, "/execute?").concat(qs.stringify({
307
- id: id,
308
- origin: window.origin,
309
- calls: JSON.stringify(calls),
310
- })), "_blank", "height=650,width=400");
311
- return [4 /*yield*/, this.messenger.send({
312
- method: "execute",
313
- params: {
314
- id: id,
315
- transactions: transactions,
316
- abis: abis,
317
- transactionsDetail: transactionsDetail,
318
- },
319
- })];
320
- case 2:
321
- response = _a.sent();
322
- if (response.error) {
323
- throw new Error(response.error);
324
- }
325
- return [2 /*return*/, response.result];
326
- }
327
- });
328
- });
329
- };
330
- /**
331
- * Sign an JSON object for off-chain usage with the starknet private key and return the signature
332
- * This adds a message prefix so it cant be interchanged with transactions
333
- *
334
- * @param json - JSON object to be signed
335
- * @returns the signature of the JSON object
336
- * @throws {Error} if the JSON object is not a valid JSON
337
- */
338
- Account.prototype.signMessage = function (typedData) {
339
- return __awaiter(this, void 0, void 0, function () {
340
- var id, response;
341
- return __generator(this, function (_a) {
342
- switch (_a.label) {
343
- case 0:
344
- id = cuid();
345
- window.open("".concat(this.url, "/sign?").concat(qs.stringify({
346
- id: id,
347
- origin: window.origin,
348
- typedData: JSON.stringify(typedData),
349
- })), "_blank", "height=650,width=400");
350
- return [4 /*yield*/, this.messenger.send({
351
- method: "sign-message",
352
- params: {
353
- id: id,
354
- typedData: typedData,
355
- },
356
- })];
357
- case 1:
358
- response = _a.sent();
359
- if (response.error) {
360
- throw new Error(response.error);
361
- }
362
- return [2 /*return*/, response.result];
363
- }
364
- });
365
- });
366
- };
367
- /**
368
- * Hash a JSON object with pederson hash and return the hash
369
- * This adds a message prefix so it cant be interchanged with transactions
370
- *
371
- * @param json - JSON object to be hashed
372
- * @returns the hash of the JSON object
373
- * @throws {Error} if the JSON object is not a valid JSON
374
- */
375
- Account.prototype.hashMessage = function (typedData) {
376
- return __awaiter(this, void 0, void 0, function () {
377
- var response;
378
- return __generator(this, function (_a) {
379
- switch (_a.label) {
380
- case 0: return [4 /*yield*/, this.messenger.send({
381
- method: "hash-message",
382
- params: {
383
- typedData: typedData,
384
- },
385
- })];
386
- case 1:
387
- response = _a.sent();
388
- if (response.error) {
389
- throw new Error(response.error);
390
- }
391
- return [2 /*return*/, response.result];
392
- }
393
- });
394
- });
395
- };
396
- /**
397
- * Verify a signature of a JSON object
398
- *
399
- * @param json - JSON object to be verified
400
- * @param signature - signature of the JSON object
401
- * @returns true if the signature is valid, false otherwise
402
- * @throws {Error} if the JSON object is not a valid JSON or the signature is not a valid signature
403
- */
404
- Account.prototype.verifyMessage = function (typedData, signature) {
405
- return __awaiter(this, void 0, void 0, function () {
406
- var response;
407
- return __generator(this, function (_a) {
408
- switch (_a.label) {
409
- case 0: return [4 /*yield*/, this.messenger.send({
410
- method: "verify-message",
411
- params: {
412
- typedData: typedData,
413
- signature: signature,
414
- },
415
- })];
416
- case 1:
417
- response = _a.sent();
418
- if (response.error) {
419
- throw new Error(response.error);
420
- }
421
- return [2 /*return*/, response.result];
422
- }
423
- });
424
- });
425
- };
426
- /**
427
- * Verify a signature of a given hash
428
- * @warning This method is not recommended, use verifyMessage instead
429
- *
430
- * @param hash - hash to be verified
431
- * @param signature - signature of the hash
432
- * @returns true if the signature is valid, false otherwise
433
- * @throws {Error} if the signature is not a valid signature
434
- */
435
- Account.prototype.verifyMessageHash = function (hash, signature) {
436
- return __awaiter(this, void 0, void 0, function () {
437
- var response;
438
- return __generator(this, function (_a) {
439
- switch (_a.label) {
440
- case 0: return [4 /*yield*/, this.messenger.send({
441
- method: "verify-message-hash",
442
- params: {
443
- hash: hash,
444
- signature: signature,
445
- },
446
- })];
447
- case 1:
448
- response = _a.sent();
449
- if (response.error) {
450
- throw new Error(response.error);
451
- }
452
- return [2 /*return*/, response.result];
453
- }
454
- });
455
- });
456
- };
457
- Account.prototype.getNonce = function () {
458
- return __awaiter(this, void 0, void 0, function () {
459
- var response;
460
- return __generator(this, function (_a) {
461
- switch (_a.label) {
462
- case 0: return [4 /*yield*/, this.messenger.send({
463
- method: "get-nonce",
464
- })];
465
- case 1:
466
- response = _a.sent();
467
- if (response.error) {
468
- throw new Error(response.error);
469
- }
470
- return [2 /*return*/, response.result];
471
- }
472
- });
473
- });
474
- };
475
- return Account;
476
- }(Provider));
477
-
478
- var Messenger = /** @class */ (function () {
479
- function Messenger(target, origin) {
480
- if (origin === void 0) { origin = "https://cartridge.gg"; }
481
- var _this = this;
482
- this.pending = [];
483
- this.defaultHandler = function (e) {
484
- if (e.data.target === "cartridge" &&
485
- e.data.type === "request") {
486
- _this.pending.push(e);
487
- }
488
- };
489
- this.target = target;
490
- this.origin = origin;
491
- if (typeof document !== "undefined" &&
492
- document.body.getAttribute("cartridge") !== "true") {
493
- document.body.setAttribute("cartridge", "true");
494
- }
495
- window.addEventListener("message", this.defaultHandler);
496
- }
497
- Messenger.prototype.onRequest = function (cb) {
498
- window.removeEventListener("message", this.defaultHandler);
499
- var onResponse = function (_a) {
500
- var origin = _a.origin, source = _a.source, id = _a.data.id;
501
- return function (response) {
502
- source.postMessage({
503
- id: id,
504
- target: "cartridge",
505
- type: "response",
506
- payload: __assign({ origin: window.origin }, response),
507
- }, { targetOrigin: origin });
508
- };
509
- };
510
- for (var i = 0; i < this.pending.length; i++) {
511
- var payload = this.pending[i].data.payload;
512
- cb(payload, onResponse(this.pending[i]));
513
- }
514
- window.addEventListener("message", function (e) {
515
- var _a = e.data, type = _a.type, target = _a.target, payload = _a.payload;
516
- if (target === "cartridge" &&
517
- type === "request") {
518
- cb(payload, onResponse(e));
519
- }
520
- });
521
- };
522
- Messenger.prototype.send = function (request) {
523
- var id = cuid();
524
- if (!this.target) {
525
- throw new Error("read only");
526
- }
527
- this.target.postMessage({
528
- id: id,
529
- target: "cartridge",
530
- type: "request",
531
- payload: __assign({ origin: window.origin }, request),
532
- }, this.origin);
533
- return new Promise(function (resolve, reject) {
534
- var handler = function (_a) {
535
- var data = _a.data;
536
- if (data.target === "cartridge" &&
537
- data.type === "response" &&
538
- id === data.id) {
539
- resolve(data.payload);
540
- window.removeEventListener("message", handler);
541
- }
542
- };
543
- window.addEventListener("message", handler);
544
- });
545
- };
546
- return Messenger;
547
- }());
548
-
549
- var Cartridge = /** @class */ (function () {
550
- function Cartridge(scopes, options) {
551
- var _this = this;
552
- this.selector = "cartridge-messenger";
553
- this.scopes = [];
554
- this.url = "https://cartridge.gg";
555
- this.origin = "https://cartridge.gg";
556
- this.loading = true;
557
- if (scopes) {
558
- this.scopes = scopes;
559
- }
560
- if (options === null || options === void 0 ? void 0 : options.url) {
561
- this.url = options.url;
562
- }
563
- if (options === null || options === void 0 ? void 0 : options.origin) {
564
- this.origin = options.origin;
565
- }
566
- if (typeof document !== "undefined") {
567
- this.ready_ = new Promise(function (resolve, reject) {
568
- window.addEventListener("message", function (e) { return __awaiter(_this, void 0, void 0, function () {
569
- return __generator(this, function (_a) {
570
- switch (_a.label) {
571
- case 0:
572
- if (!(e.data.target === "cartridge" &&
573
- e.data.payload.method === "ready")) return [3 /*break*/, 2];
574
- return [4 /*yield*/, this.probe()];
575
- case 1:
576
- _a.sent();
577
- this.loading = false;
578
- resolve(true);
579
- _a.label = 2;
580
- case 2: return [2 /*return*/];
581
- }
582
- });
583
- }); });
584
- });
585
- }
586
- if (typeof document !== "undefined" && !this.messenger) {
587
- var iframe = document.getElementById(this.selector);
588
- if (!!iframe) {
589
- if (!this.messenger) {
590
- this.messenger = new Messenger(iframe.contentWindow, this.origin);
591
- }
592
- }
593
- else {
594
- iframe = document.createElement("iframe");
595
- iframe.id = this.selector;
596
- iframe.src = "".concat(this.url, "/iframe");
597
- iframe.style.opacity = "0";
598
- iframe.style.height = "0";
599
- iframe.style.width = "0";
600
- iframe.sandbox.add("allow-scripts");
601
- iframe.sandbox.add("allow-same-origin");
602
- if (!!document.hasStorageAccess) {
603
- iframe.sandbox.add("allow-storage-access-by-user-activation");
604
- }
605
- document.body.appendChild(iframe);
606
- this.messenger = new Messenger(iframe.contentWindow, this.origin);
607
- }
608
- }
609
- }
610
- Cartridge.prototype.ready = function () {
611
- return __awaiter(this, void 0, void 0, function () {
612
- return __generator(this, function (_a) {
613
- if (!this.loading)
614
- return [2 /*return*/, Promise.resolve(true)];
615
- return [2 /*return*/, this.ready_];
616
- });
617
- });
618
- };
619
- Cartridge.prototype.probe = function () {
620
- var _a;
621
- return __awaiter(this, void 0, void 0, function () {
622
- var prob;
623
- return __generator(this, function (_b) {
624
- switch (_b.label) {
625
- case 0: return [4 /*yield*/, this.messenger.send({
626
- method: "probe",
627
- })];
628
- case 1:
629
- prob = _b.sent();
630
- if ((_a = prob.result) === null || _a === void 0 ? void 0 : _a.address) {
631
- this.account = new Account(prob.result.address, prob.result.scopes, this.messenger, {
632
- url: this.url,
633
- });
634
- return [2 /*return*/, this.account];
635
- }
636
- return [2 /*return*/];
637
- }
638
- });
639
- });
640
- };
641
- Cartridge.prototype.connect = function () {
642
- return __awaiter(this, void 0, void 0, function () {
643
- var id, ok, response;
644
- return __generator(this, function (_a) {
645
- switch (_a.label) {
646
- case 0:
647
- id = cuid();
648
- if (this.account) {
649
- return [2 /*return*/, this.account];
650
- }
651
- if (!!!document.hasStorageAccess) return [3 /*break*/, 3];
652
- return [4 /*yield*/, document.hasStorageAccess()];
653
- case 1:
654
- ok = _a.sent();
655
- if (!!ok) return [3 /*break*/, 3];
656
- return [4 /*yield*/, document.requestStorageAccess()];
657
- case 2:
658
- _a.sent();
659
- _a.label = 3;
660
- case 3:
661
- window.open("".concat(this.url, "/connect?").concat(qs.stringify({
662
- id: id,
663
- origin: window.origin,
664
- scopes: JSON.stringify(this.scopes),
665
- })), "_blank", "height=650,width=400");
666
- return [4 /*yield*/, this.messenger.send({
667
- method: "connect",
668
- params: {
669
- id: id,
670
- scopes: this.scopes,
671
- },
672
- })];
673
- case 4:
674
- response = _a.sent();
675
- this.account = new Account(response.result.address, response.result.scopes, this.messenger, {
676
- url: this.url,
677
- });
678
- return [2 /*return*/, this.account];
679
- }
680
- });
681
- });
682
- };
683
- return Cartridge;
684
- }());
685
-
686
- export { Cartridge, Messenger };