@cartridge/controller 0.3.0 → 0.3.1
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/constants.d.ts +31 -0
- package/lib/constants.js +38 -0
- package/lib/constants.js.map +1 -0
- package/lib/device.js +130 -50
- package/lib/device.js.map +1 -1
- package/lib/errors.js +24 -6
- package/lib/errors.js.map +1 -1
- package/lib/generated/graphql.d.ts +3484 -0
- package/lib/generated/graphql.js +242 -0
- package/lib/generated/graphql.js.map +1 -0
- package/lib/generated/introspection.d.ts +7 -0
- package/lib/generated/introspection.js +48 -0
- package/lib/generated/introspection.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +302 -153
- package/lib/index.js.map +1 -1
- package/lib/inject.d.ts +9 -2
- package/lib/inject.js +85 -41
- package/lib/inject.js.map +1 -1
- package/lib/signer.js +48 -12
- package/lib/signer.js.map +1 -1
- package/lib/utils.d.ts +13 -0
- package/lib/utils.js +54 -3
- package/lib/utils.js.map +1 -1
- package/package.json +9 -4
- package/lib/account.d.ts +0 -57
- package/lib/account.js +0 -145
- package/lib/account.js.map +0 -1
- package/lib/messenger.js +0 -74
- package/lib/messenger.js.map +0 -1
- package/lib/webauthn.d.ts +0 -24
- package/lib/webauthn.js +0 -153
- package/lib/webauthn.js.map +0 -1
package/lib/messenger.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const cuid_1 = __importDefault(require("cuid"));
|
|
7
|
-
class Messenger {
|
|
8
|
-
constructor(target, origin = "https://x.cartridge.gg") {
|
|
9
|
-
this.pending = [];
|
|
10
|
-
this.defaultHandler = (e) => {
|
|
11
|
-
if (e.data.target === "cartridge" &&
|
|
12
|
-
e.data.type === "request") {
|
|
13
|
-
this.pending.push(e);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
this.target = target;
|
|
17
|
-
this.origin = origin;
|
|
18
|
-
if (typeof document !== "undefined" &&
|
|
19
|
-
document.body.getAttribute("cartridge") !== "true") {
|
|
20
|
-
document.body.setAttribute("cartridge", "true");
|
|
21
|
-
}
|
|
22
|
-
window.addEventListener("message", this.defaultHandler);
|
|
23
|
-
}
|
|
24
|
-
onRequest(cb) {
|
|
25
|
-
window.removeEventListener("message", this.defaultHandler);
|
|
26
|
-
const onResponse = ({ origin, source, data: { id }, }) => (response) => {
|
|
27
|
-
if (!source) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
source.postMessage({
|
|
31
|
-
id,
|
|
32
|
-
target: "cartridge",
|
|
33
|
-
type: "response",
|
|
34
|
-
payload: Object.assign({ origin: window.origin }, response),
|
|
35
|
-
}, { targetOrigin: origin });
|
|
36
|
-
};
|
|
37
|
-
for (let i = 0; i < this.pending.length; i++) {
|
|
38
|
-
const { data: { payload }, } = this.pending[i];
|
|
39
|
-
cb(payload, onResponse(this.pending[i]));
|
|
40
|
-
}
|
|
41
|
-
window.addEventListener("message", (e) => {
|
|
42
|
-
const { data: { type, target, payload }, } = e;
|
|
43
|
-
if (target === "cartridge" &&
|
|
44
|
-
type === "request") {
|
|
45
|
-
cb(payload, onResponse(e));
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
send(request) {
|
|
50
|
-
const id = (0, cuid_1.default)();
|
|
51
|
-
if (!this.target) {
|
|
52
|
-
throw new Error("read only");
|
|
53
|
-
}
|
|
54
|
-
this.target.postMessage({
|
|
55
|
-
id,
|
|
56
|
-
target: "cartridge",
|
|
57
|
-
type: "request",
|
|
58
|
-
payload: Object.assign({ origin: window.origin }, request),
|
|
59
|
-
}, this.origin);
|
|
60
|
-
return new Promise((resolve, reject) => {
|
|
61
|
-
const handler = ({ data }) => {
|
|
62
|
-
if (data.target === "cartridge" &&
|
|
63
|
-
data.type === "response" &&
|
|
64
|
-
id === data.id) {
|
|
65
|
-
resolve(data.payload);
|
|
66
|
-
window.removeEventListener("message", handler);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
window.addEventListener("message", handler);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.default = Messenger;
|
|
74
|
-
//# sourceMappingURL=messenger.js.map
|
package/lib/messenger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messenger.js","sourceRoot":"","sources":["../src/messenger.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAWxB,MAAM,SAAS;IAcb,YAAY,MAAqB,EAAE,SAAiB,wBAAwB;QAXpE,YAAO,GAAqC,EAAE,CAAA;QAE9C,mBAAc,GAAG,CAAC,CAAiC,EAAE,EAAE;YAC7D,IACE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;gBAC7B,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,EACzB;gBACA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;aACrB;QACH,CAAC,CAAA;QAGC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IACE,OAAO,QAAQ,KAAK,WAAW;YAC/B,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,MAAM,EAClD;YACA,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;SACjD;QAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IACzD,CAAC;IAED,SAAS,CACP,EAAmE;QAEnE,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;QAE1D,MAAM,UAAU,GAAG,C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AAW,CACrB;YACE,EAAE;YACF,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,SAAS;YACf,OAAO,kBACL,MAAM,EAAE,MAAM,CAAC,MAAM,IAClB,OAAO,CACX;SACF,EACD,IAAI,CAAC,MAAM,CACZ,CAAC;QAEF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAA4B,EAAE,EAAE;gBACrD,IACE,IAAI,CAAC,MAAM,KAAK,WAAW;oBAC3B,IAAI,CAAC,IAAI,KAAK,UAAU;oBACxB,EAAE,KAAK,IAAI,CAAC,EAAE,EACd;oBACA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACtB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;iBAChD;YACH,CAAC,CAAC;YACF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,kBAAe,SAAS,CAAC"}
|
package/lib/webauthn.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Abi, Call, InvocationsSignerDetails, Signature, SignerInterface, typedData, Account, DeclareSignerDetails } from "starknet";
|
|
2
|
-
export declare type Assertion = PublicKeyCredential & {
|
|
3
|
-
response: AuthenticatorAssertionResponse;
|
|
4
|
-
};
|
|
5
|
-
export declare class WebauthnSigner implements SignerInterface {
|
|
6
|
-
private credentialId;
|
|
7
|
-
private publicKey;
|
|
8
|
-
private rpId;
|
|
9
|
-
constructor(credentialId: string, publicKey: string, rpId?: string);
|
|
10
|
-
getPubKey(): Promise<string>;
|
|
11
|
-
sign(challenge: BufferSource): Promise<Assertion>;
|
|
12
|
-
hashTransaction(transactions: Call[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): string;
|
|
13
|
-
signTransaction(calls: Call[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise<Signature>;
|
|
14
|
-
signMessage(td: typedData.TypedData, accountAddress: string): Promise<Signature>;
|
|
15
|
-
signDeclareTransaction({ classHash, senderAddress, chainId, maxFee, version, nonce }: DeclareSignerDetails): Promise<Signature>;
|
|
16
|
-
}
|
|
17
|
-
declare class WebauthnAccount extends Account {
|
|
18
|
-
signer: WebauthnSigner;
|
|
19
|
-
constructor(address: string, credentialId: string, publicKey: string, options: {
|
|
20
|
-
rpId?: string;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
export declare function formatAssertion(assertion: Assertion): Signature;
|
|
24
|
-
export default WebauthnAccount;
|
package/lib/webauthn.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.formatAssertion = exports.WebauthnSigner = void 0;
|
|
16
|
-
const starknet_1 = require("starknet");
|
|
17
|
-
const base64url_1 = __importDefault(require("base64url"));
|
|
18
|
-
const _1 = require(".");
|
|
19
|
-
const hash_1 = require("starknet/dist/utils/hash");
|
|
20
|
-
function convertUint8ArrayToWordArray(u8Array) {
|
|
21
|
-
var words = [], i = 0, len = u8Array.length;
|
|
22
|
-
while (i < len) {
|
|
23
|
-
words.push(((u8Array[i++] << 24) |
|
|
24
|
-
(u8Array[i++] << 16) |
|
|
25
|
-
(u8Array[i++] << 8) |
|
|
26
|
-
u8Array[i++]) >>>
|
|
27
|
-
0);
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
sigBytes: words.length * 4,
|
|
31
|
-
words: words,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
class WebauthnSigner {
|
|
35
|
-
constructor(credentialId, publicKey, rpId = "cartridge.gg") {
|
|
36
|
-
this.credentialId = credentialId;
|
|
37
|
-
this.publicKey = publicKey;
|
|
38
|
-
this.rpId = rpId;
|
|
39
|
-
}
|
|
40
|
-
getPubKey() {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
return this.publicKey;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
sign(challenge) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
return (yield navigator.credentials.get({
|
|
48
|
-
publicKey: {
|
|
49
|
-
challenge,
|
|
50
|
-
timeout: 60000,
|
|
51
|
-
rpId: this.rpId,
|
|
52
|
-
allowCredentials: [
|
|
53
|
-
{
|
|
54
|
-
type: "public-key",
|
|
55
|
-
id: base64url_1.default.toBuffer(this.credentialId),
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
userVerification: "required",
|
|
59
|
-
},
|
|
60
|
-
}));
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
hashTransaction(transactions, transactionsDetail, abis) {
|
|
64
|
-
if (abis && abis.length !== transactions.length) {
|
|
65
|
-
throw new Error("ABI must be provided for each transaction or no transaction");
|
|
66
|
-
}
|
|
67
|
-
// now use abi to display decoded data somewhere, but as this signer is headless, we can't do that
|
|
68
|
-
const calldata = starknet_1.transaction.fromCallsToExecuteCalldataWithNonce(transactions, transactionsDetail.nonce);
|
|
69
|
-
return starknet_1.hash.calculateTransactionHash(transactionsDetail.walletAddress, transactionsDetail.version, [starknet_1.hash.getSelectorFromName("__execute__")].concat(calldata), transactionsDetail.maxFee, transactionsDetail.chainId, transactionsDetail.nonce);
|
|
70
|
-
}
|
|
71
|
-
signTransaction(calls, transactionsDetail, abis) {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
if (abis && abis.length !== calls.length) {
|
|
74
|
-
throw new Error("ABI must be provided for each transaction or no transaction");
|
|
75
|
-
}
|
|
76
|
-
// now use abi to display decoded data somewhere, but as this signer is headless, we can't do that
|
|
77
|
-
const calldata = starknet_1.transaction.fromCallsToExecuteCalldataWithNonce(calls, transactionsDetail.nonce);
|
|
78
|
-
const msgHash = starknet_1.hash.calculateTransactionHash(transactionsDetail.walletAddress, transactionsDetail.version, [starknet_1.hash.getSelectorFromName("__execute__")].concat(calldata), transactionsDetail.maxFee, transactionsDetail.chainId, transactionsDetail.nonce);
|
|
79
|
-
const challenge = Buffer.from(msgHash.slice(2).padStart(64, "0").slice(0, 64), "hex");
|
|
80
|
-
const assertion = yield this.sign(challenge);
|
|
81
|
-
return formatAssertion(assertion);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
signMessage(td, accountAddress) {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
const msgHash = starknet_1.typedData.getMessageHash(td, accountAddress);
|
|
87
|
-
const challenge = Buffer.from(msgHash.slice(2).padStart(64, "0").slice(0, 64), "hex");
|
|
88
|
-
const assertion = yield this.sign(challenge);
|
|
89
|
-
return formatAssertion(assertion);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
signDeclareTransaction(
|
|
93
|
-
// contractClass: ContractClass, // Should be used once class hash is present in ContractClass
|
|
94
|
-
{ classHash, senderAddress, chainId, maxFee, version, nonce }) {
|
|
95
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
const msgHash = (0, hash_1.calculateDeclareTransactionHash)(classHash, senderAddress, version, maxFee, chainId, nonce);
|
|
97
|
-
const challenge = Buffer.from(msgHash.slice(2).padStart(64, "0").slice(0, 64), "hex");
|
|
98
|
-
const assertion = yield this.sign(challenge);
|
|
99
|
-
return formatAssertion(assertion);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports.WebauthnSigner = WebauthnSigner;
|
|
104
|
-
class WebauthnAccount extends starknet_1.Account {
|
|
105
|
-
constructor(address, credentialId, publicKey, options) {
|
|
106
|
-
const signer = new WebauthnSigner(credentialId, publicKey, options.rpId);
|
|
107
|
-
super(starknet_1.defaultProvider, address, signer);
|
|
108
|
-
this.signer = signer;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function formatAssertion(assertion) {
|
|
112
|
-
var authenticatorDataBytes = new Uint8Array(assertion.response.authenticatorData);
|
|
113
|
-
let authenticatorDataRem = 4 - (authenticatorDataBytes.length % 4);
|
|
114
|
-
if (authenticatorDataRem == 4) {
|
|
115
|
-
authenticatorDataRem = 0;
|
|
116
|
-
}
|
|
117
|
-
const authenticatorDataWords = convertUint8ArrayToWordArray(authenticatorDataBytes).words;
|
|
118
|
-
var clientDataJSONBytes = new Uint8Array(assertion.response.clientDataJSON);
|
|
119
|
-
let clientDataJSONRem = 4 - (clientDataJSONBytes.length % 4);
|
|
120
|
-
if (clientDataJSONRem == 4) {
|
|
121
|
-
clientDataJSONRem = 0;
|
|
122
|
-
}
|
|
123
|
-
const clientDataWords = convertUint8ArrayToWordArray(clientDataJSONBytes).words;
|
|
124
|
-
// Convert signature from ASN.1 sequence to "raw" format
|
|
125
|
-
const usignature = new Uint8Array(assertion.response.signature);
|
|
126
|
-
const rStart = usignature[4] === 0 ? 5 : 4;
|
|
127
|
-
const rEnd = rStart + 32;
|
|
128
|
-
const sStart = usignature[rEnd + 2] === 0 ? rEnd + 3 : rEnd + 2;
|
|
129
|
-
const r = starknet_1.number.toBN("0x" + Buffer.from(usignature.slice(rStart, rEnd)).toString("hex"));
|
|
130
|
-
const s = starknet_1.number.toBN("0x" + Buffer.from(usignature.slice(sStart)).toString("hex"));
|
|
131
|
-
const { x: r0, y: r1, z: r2 } = (0, _1.split)(r);
|
|
132
|
-
const { x: s0, y: s1, z: s2 } = (0, _1.split)(s);
|
|
133
|
-
return [
|
|
134
|
-
"0",
|
|
135
|
-
r0.toString(),
|
|
136
|
-
r1.toString(),
|
|
137
|
-
r2.toString(),
|
|
138
|
-
s0.toString(),
|
|
139
|
-
s1.toString(),
|
|
140
|
-
s2.toString(),
|
|
141
|
-
"9",
|
|
142
|
-
"0",
|
|
143
|
-
`${clientDataWords.length}`,
|
|
144
|
-
`${clientDataJSONRem}`,
|
|
145
|
-
...clientDataWords.map((word) => `${word}`),
|
|
146
|
-
`${authenticatorDataWords.length}`,
|
|
147
|
-
`${authenticatorDataRem}`,
|
|
148
|
-
...authenticatorDataWords.map((word) => `${word}`),
|
|
149
|
-
];
|
|
150
|
-
}
|
|
151
|
-
exports.formatAssertion = formatAssertion;
|
|
152
|
-
exports.default = WebauthnAccount;
|
|
153
|
-
//# sourceMappingURL=webauthn.js.map
|
package/lib/webauthn.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webauthn.js","sourceRoot":"","sources":["../src/webauthn.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAakB;AAClB,0DAAkC;AAClC,wBAA0B;AAC1B,mDAA2E;AAM3E,SAAS,4BAA4B,CAAC,OAAmB;IACvD,IAAI,KAAK,GAAG,EAAE,EACZ,CAAC,GAAG,CAAC,EACL,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAEvB,OAAO,CAAC,GAAG,GAAG,EAAE;QACd,KAAK,CAAC,IAAI,CACR,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;YACnB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;YACpB,CAAC,OA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