@cartridge/controller 0.1.47 → 0.1.50
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/lib/account.js +100 -189
- package/lib/account.js.map +1 -1
- package/lib/index.d.ts +6 -2
- package/lib/index.js +80 -145
- package/lib/index.js.map +1 -1
- package/lib/messenger.js +29 -47
- package/lib/messenger.js.map +1 -1
- package/lib/signer.js +49 -93
- package/lib/signer.js.map +1 -1
- package/lib/types.d.ts +6 -2
- package/lib/utils.js +2 -13
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/lib/account.d.ts +0 -58
- package/lib/messenger.d.ts +0 -17
- package/lib/signer.d.ts +0 -38
- package/lib/utils.d.ts +0 -2
- package/lib/webauthn.d.ts +0 -16
- package/lib/webauthn.js +0 -197
- package/lib/webauthn.js.map +0 -1
package/lib/account.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -23,56 +8,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
9
|
});
|
|
25
10
|
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
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;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
13
|
};
|
|
56
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
_this.messenger = messenger;
|
|
71
|
-
_this._scopes = scopes;
|
|
15
|
+
const cuid_1 = __importDefault(require("cuid"));
|
|
16
|
+
const starknet_1 = require("starknet");
|
|
17
|
+
const number_1 = require("starknet/utils/number");
|
|
18
|
+
const query_string_1 = __importDefault(require("query-string"));
|
|
19
|
+
const signer_1 = require("./signer");
|
|
20
|
+
class CartridgeAccount extends starknet_1.Account {
|
|
21
|
+
constructor(address, scopes = [], messenger, options) {
|
|
22
|
+
super(starknet_1.defaultProvider, address, new signer_1.Signer(messenger, options));
|
|
23
|
+
this.url = "https://x.cartridge.gg";
|
|
24
|
+
this._scopes = [];
|
|
25
|
+
this.address = address;
|
|
26
|
+
this.messenger = messenger;
|
|
27
|
+
this._scopes = scopes;
|
|
72
28
|
if (options === null || options === void 0 ? void 0 : options.url) {
|
|
73
|
-
|
|
29
|
+
this.url = options.url;
|
|
74
30
|
}
|
|
75
|
-
return _this;
|
|
76
31
|
}
|
|
77
32
|
/**
|
|
78
33
|
* Deploys a given compiled contract (json) to starknet
|
|
@@ -84,32 +39,24 @@ var CartridgeAccount = /** @class */ (function (_super) {
|
|
|
84
39
|
* @param abi the abi of the contract
|
|
85
40
|
* @returns a confirmation of sending a transaction on the starknet contract
|
|
86
41
|
*/
|
|
87
|
-
|
|
88
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
id: id,
|
|
99
|
-
payload: payload,
|
|
100
|
-
abi: abi,
|
|
101
|
-
},
|
|
102
|
-
})];
|
|
103
|
-
case 1:
|
|
104
|
-
response = _a.sent();
|
|
105
|
-
if (response.error) {
|
|
106
|
-
throw new Error(response.error);
|
|
107
|
-
}
|
|
108
|
-
return [2 /*return*/, response.result];
|
|
109
|
-
}
|
|
42
|
+
deployContract(payload, abi) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const id = (0, cuid_1.default)();
|
|
45
|
+
window.open(`${this.url}/deploy?origin=${encodeURIComponent(window.origin)}&id=${id}`, "_blank", "height=650,width=400");
|
|
46
|
+
const response = yield this.messenger.send({
|
|
47
|
+
method: "deploy-contract",
|
|
48
|
+
params: {
|
|
49
|
+
id,
|
|
50
|
+
payload,
|
|
51
|
+
abi,
|
|
52
|
+
},
|
|
110
53
|
});
|
|
54
|
+
if (response.error) {
|
|
55
|
+
throw new Error(response.error);
|
|
56
|
+
}
|
|
57
|
+
return response.result;
|
|
111
58
|
});
|
|
112
|
-
}
|
|
59
|
+
}
|
|
113
60
|
/**
|
|
114
61
|
* Estimate Fee for a method on starknet
|
|
115
62
|
*
|
|
@@ -121,41 +68,23 @@ var CartridgeAccount = /** @class */ (function (_super) {
|
|
|
121
68
|
*
|
|
122
69
|
* @returns response from addTransaction
|
|
123
70
|
*/
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return [3 /*break*/, 3];
|
|
135
|
-
case 1: return [4 /*yield*/, this.getNonce()];
|
|
136
|
-
case 2:
|
|
137
|
-
_d = (_e.sent());
|
|
138
|
-
_e.label = 3;
|
|
139
|
-
case 3:
|
|
140
|
-
nonce = _c.apply(void 0, [_d]);
|
|
141
|
-
return [4 /*yield*/, this.messenger.send({
|
|
142
|
-
method: "estimate-fee",
|
|
143
|
-
params: {
|
|
144
|
-
calls: calls,
|
|
145
|
-
nonce: nonce,
|
|
146
|
-
blockIdentifier: blockIdentifier,
|
|
147
|
-
},
|
|
148
|
-
})];
|
|
149
|
-
case 4:
|
|
150
|
-
response = _e.sent();
|
|
151
|
-
if (response.error) {
|
|
152
|
-
throw new Error(response.error);
|
|
153
|
-
}
|
|
154
|
-
return [2 /*return*/, response.result];
|
|
155
|
-
}
|
|
71
|
+
estimateFee(calls, { nonce: providedNonce, blockIdentifier } = {}) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const nonce = (0, number_1.toBN)(providedNonce !== null && providedNonce !== void 0 ? providedNonce : (yield this.getNonce()));
|
|
74
|
+
const response = yield this.messenger.send({
|
|
75
|
+
method: "estimate-fee",
|
|
76
|
+
params: {
|
|
77
|
+
calls,
|
|
78
|
+
nonce,
|
|
79
|
+
blockIdentifier,
|
|
80
|
+
},
|
|
156
81
|
});
|
|
82
|
+
if (response.error) {
|
|
83
|
+
throw new Error(response.error);
|
|
84
|
+
}
|
|
85
|
+
return response.result;
|
|
157
86
|
});
|
|
158
|
-
}
|
|
87
|
+
}
|
|
159
88
|
/**
|
|
160
89
|
* Invoke execute function in account contract
|
|
161
90
|
*
|
|
@@ -168,52 +97,43 @@ var CartridgeAccount = /** @class */ (function (_super) {
|
|
|
168
97
|
*
|
|
169
98
|
* @returns response from addTransaction
|
|
170
99
|
*/
|
|
171
|
-
|
|
172
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
abis: abis,
|
|
181
|
-
transactionsDetail: transactionsDetail,
|
|
182
|
-
},
|
|
183
|
-
})];
|
|
184
|
-
case 1:
|
|
185
|
-
response = _a.sent();
|
|
186
|
-
if (response.result) {
|
|
187
|
-
return [2 /*return*/, response.result];
|
|
188
|
-
}
|
|
189
|
-
if (response.error && response.error !== "missing scopes") {
|
|
190
|
-
throw new Error(response.error);
|
|
191
|
-
}
|
|
192
|
-
id = (0, cuid_1.default)();
|
|
193
|
-
window.open("".concat(this.url, "/execute?").concat(query_string_1.default.stringify({
|
|
194
|
-
id: id,
|
|
195
|
-
origin: window.origin,
|
|
196
|
-
calls: JSON.stringify(calls),
|
|
197
|
-
})), "_blank", "height=650,width=400");
|
|
198
|
-
return [4 /*yield*/, this.messenger.send({
|
|
199
|
-
method: "execute",
|
|
200
|
-
params: {
|
|
201
|
-
id: id,
|
|
202
|
-
calls: calls,
|
|
203
|
-
abis: abis,
|
|
204
|
-
transactionsDetail: transactionsDetail,
|
|
205
|
-
},
|
|
206
|
-
})];
|
|
207
|
-
case 2:
|
|
208
|
-
response = _a.sent();
|
|
209
|
-
if (response.error) {
|
|
210
|
-
throw new Error(response.error);
|
|
211
|
-
}
|
|
212
|
-
return [2 /*return*/, response.result];
|
|
213
|
-
}
|
|
100
|
+
execute(calls, abis, transactionsDetail) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
let response = yield this.messenger.send({
|
|
103
|
+
method: "execute",
|
|
104
|
+
params: {
|
|
105
|
+
calls,
|
|
106
|
+
abis,
|
|
107
|
+
transactionsDetail,
|
|
108
|
+
},
|
|
214
109
|
});
|
|
110
|
+
if (response.result) {
|
|
111
|
+
return response.result;
|
|
112
|
+
}
|
|
113
|
+
if (response.error && response.error !== "missing scopes") {
|
|
114
|
+
throw new Error(response.error);
|
|
115
|
+
}
|
|
116
|
+
const id = (0, cuid_1.default)();
|
|
117
|
+
window.open(`${this.url}/execute?${query_string_1.default.stringify({
|
|
118
|
+
id,
|
|
119
|
+
origin: window.origin,
|
|
120
|
+
calls: JSON.stringify(calls),
|
|
121
|
+
})}`, "_blank", "height=650,width=400");
|
|
122
|
+
response = yield this.messenger.send({
|
|
123
|
+
method: "execute",
|
|
124
|
+
params: {
|
|
125
|
+
id,
|
|
126
|
+
calls,
|
|
127
|
+
abis,
|
|
128
|
+
transactionsDetail,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
if (response.error) {
|
|
132
|
+
throw new Error(response.error);
|
|
133
|
+
}
|
|
134
|
+
return response.result;
|
|
215
135
|
});
|
|
216
|
-
}
|
|
136
|
+
}
|
|
217
137
|
/**
|
|
218
138
|
* Sign an JSON object for off-chain usage with the starknet private key and return the signature
|
|
219
139
|
* This adds a message prefix so it cant be interchanged with transactions
|
|
@@ -222,36 +142,27 @@ var CartridgeAccount = /** @class */ (function (_super) {
|
|
|
222
142
|
* @returns the signature of the JSON object
|
|
223
143
|
* @throws {Error} if the JSON object is not a valid JSON
|
|
224
144
|
*/
|
|
225
|
-
|
|
226
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
params: {
|
|
240
|
-
id: id,
|
|
241
|
-
typedData: typedData,
|
|
242
|
-
},
|
|
243
|
-
})];
|
|
244
|
-
case 1:
|
|
245
|
-
response = _a.sent();
|
|
246
|
-
if (response.error) {
|
|
247
|
-
throw new Error(response.error);
|
|
248
|
-
}
|
|
249
|
-
return [2 /*return*/, response.result];
|
|
250
|
-
}
|
|
145
|
+
signMessage(typedData) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const id = (0, cuid_1.default)();
|
|
148
|
+
window.open(`${this.url}/sign?${query_string_1.default.stringify({
|
|
149
|
+
id,
|
|
150
|
+
origin: window.origin,
|
|
151
|
+
typedData: JSON.stringify(typedData),
|
|
152
|
+
})}`, "_blank", "height=650,width=400");
|
|
153
|
+
const response = yield this.messenger.send({
|
|
154
|
+
method: "sign-message",
|
|
155
|
+
params: {
|
|
156
|
+
id,
|
|
157
|
+
typedData,
|
|
158
|
+
},
|
|
251
159
|
});
|
|
160
|
+
if (response.error) {
|
|
161
|
+
throw new Error(response.error);
|
|
162
|
+
}
|
|
163
|
+
return response.result;
|
|
252
164
|
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
}(starknet_1.Account));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
256
167
|
exports.default = CartridgeAccount;
|
|
257
168
|
//# sourceMappingURL=account.js.map
|
package/lib/account.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,uCAakB;AAClB,kDAA6C;AAC7C,gEAA8B;AAY9B,qCAAkC;AAElC,MAAM,gBAAiB,SAAQ,kBAAO;IAMpC,YACE,OAAe,EACf,SAAkB,EAAE,EACpB,SAAoB,EACpB,OAEC;QAED,KAAK,CAAC,0BAAe,EAAE,OAAO,EAAE,IAAI,eAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QAX1D,QAAG,GAAW,wBAAwB,CAAC;QACvC,YAAO,GAAY,EAAE,CAAC;QAW5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;SACxB;IACH,CAAC;IAED;;;;;;;;;OASG;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E;gBACF,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;aACrC,CAAC,EAAE,EACJ,QAAQ,EACR,sBAAsB,CACvB,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAsB;gBAC9D,MAAM,EAAE,cAAc;gBACtB,MAAM,EAAE;oBACN,EAAE;oBACF,SAAS;iBACV;aACF,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,KAAK,EAAE;gBAClB,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAe,CAAC,CAAC;aAC3C;YAED,OAAO,QAAQ,CAAC,MAAO,CAAC;QAC1B,CAAC;KAAA;CACF;AAED,kBAAe,gBAAgB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AccountInterface } from "starknet";
|
|
2
|
+
import { BigNumberish } from "starknet/utils/number";
|
|
2
3
|
import Messenger, { Message } from "./messenger";
|
|
3
4
|
import { Scope } from "./types";
|
|
4
5
|
declare class Controller {
|
|
@@ -15,8 +16,11 @@ declare class Controller {
|
|
|
15
16
|
});
|
|
16
17
|
ready(): Promise<boolean | undefined>;
|
|
17
18
|
probe(): Promise<AccountInterface | undefined>;
|
|
18
|
-
register(
|
|
19
|
-
|
|
19
|
+
register(username: string, credential: {
|
|
20
|
+
x: BigNumberish;
|
|
21
|
+
y: BigNumberish;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
address: string;
|
|
20
24
|
}>;
|
|
21
25
|
connect(): Promise<AccountInterface | null>;
|
|
22
26
|
}
|