@cartridge/controller 0.3.0 → 0.3.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/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 +1 -6
- package/lib/index.js +243 -157
- 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 +20 -0
- package/lib/utils.js +154 -3
- package/lib/utils.js.map +1 -1
- package/package.json +10 -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/account.js
DELETED
|
@@ -1,145 +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
|
-
const cuid_1 = __importDefault(require("cuid"));
|
|
16
|
-
const starknet_1 = require("starknet");
|
|
17
|
-
const query_string_1 = __importDefault(require("query-string"));
|
|
18
|
-
const signer_1 = require("./signer");
|
|
19
|
-
const constants_1 = require("starknet/constants");
|
|
20
|
-
class CartridgeAccount extends starknet_1.Account {
|
|
21
|
-
constructor(address, scopes = [], keychain, options) {
|
|
22
|
-
super(starknet_1.defaultProvider, address, new signer_1.Signer(keychain, options));
|
|
23
|
-
this.url = "https://x.cartridge.gg";
|
|
24
|
-
this.address = address;
|
|
25
|
-
this.keychain = keychain;
|
|
26
|
-
if (options === null || options === void 0 ? void 0 : options.url) {
|
|
27
|
-
this.url = options.url;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Deploys a given compiled contract (json) to starknet
|
|
32
|
-
*
|
|
33
|
-
* @param payload payload to be deployed containing:
|
|
34
|
-
* - compiled contract code
|
|
35
|
-
* - constructor calldata
|
|
36
|
-
* - address salt
|
|
37
|
-
* @param abi the abi of the contract
|
|
38
|
-
* @returns a confirmation of sending a transaction on the starknet contract
|
|
39
|
-
*/
|
|
40
|
-
deployContract(payload, abi) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const id = (0, cuid_1.default)();
|
|
43
|
-
window.open(`${this.url}/deploy?origin=${encodeURIComponent(window.origin)}&id=${id}`, "_blank", "height=650,width=400");
|
|
44
|
-
throw new Error("unimplemented");
|
|
45
|
-
// const response = await this.messenger.send<DeployContractResponse>({
|
|
46
|
-
// method: "deploy-contract",
|
|
47
|
-
// params: {
|
|
48
|
-
// id,
|
|
49
|
-
// payload,
|
|
50
|
-
// abi,
|
|
51
|
-
// },
|
|
52
|
-
// });
|
|
53
|
-
// if (response.error) {
|
|
54
|
-
// throw new Error(response.error as string);
|
|
55
|
-
// }
|
|
56
|
-
// return response.result!;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Estimate Fee for a method on starknet
|
|
61
|
-
*
|
|
62
|
-
* @param calls the invocation object containing:
|
|
63
|
-
* - contractAddress - the address of the contract
|
|
64
|
-
* - entrypoint - the entrypoint of the contract
|
|
65
|
-
* - calldata - (defaults to []) the calldata
|
|
66
|
-
* - signature - (defaults to []) the signature
|
|
67
|
-
*
|
|
68
|
-
* @returns response from addTransaction
|
|
69
|
-
*/
|
|
70
|
-
estimateFee(calls, details) {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
return this.keychain.estimateFee(calls, details);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Invoke execute function in account contract
|
|
77
|
-
*
|
|
78
|
-
* @param calls the invocation object or an array of them, containing:
|
|
79
|
-
* - contractAddress - the address of the contract
|
|
80
|
-
* - entrypoint - the entrypoint of the contract
|
|
81
|
-
* - calldata - (defaults to []) the calldata
|
|
82
|
-
* - signature - (defaults to []) the signature
|
|
83
|
-
* @param abis (optional) the abi of the contract for better displaying
|
|
84
|
-
*
|
|
85
|
-
* @returns response from addTransaction
|
|
86
|
-
*/
|
|
87
|
-
execute(calls, abis, transactionsDetail) {
|
|
88
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
if (!transactionsDetail) {
|
|
90
|
-
transactionsDetail = {};
|
|
91
|
-
}
|
|
92
|
-
if (!transactionsDetail.nonce) {
|
|
93
|
-
transactionsDetail.nonce = 0; //await this.getNonce();
|
|
94
|
-
}
|
|
95
|
-
if (!transactionsDetail.version) {
|
|
96
|
-
transactionsDetail.version = 1;
|
|
97
|
-
}
|
|
98
|
-
if (!transactionsDetail.maxFee) {
|
|
99
|
-
try {
|
|
100
|
-
transactionsDetail.maxFee = "100"; // (await this.estimateFee(calls, { nonce: transactionsDetail.nonce })).suggestedMaxFee
|
|
101
|
-
}
|
|
102
|
-
catch (e) {
|
|
103
|
-
console.error(e);
|
|
104
|
-
throw e;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
return yield this.keychain.execute(calls, abis, transactionsDetail);
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
if (e.message !== "missing scopes") {
|
|
112
|
-
console.error(e);
|
|
113
|
-
throw e;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
window.open(`${this.url}/execute?${query_string_1.default.stringify({
|
|
117
|
-
origin: window.origin,
|
|
118
|
-
calls: JSON.stringify(calls),
|
|
119
|
-
nonce: transactionsDetail.nonce,
|
|
120
|
-
version: transactionsDetail.version,
|
|
121
|
-
maxFee: transactionsDetail.maxFee,
|
|
122
|
-
chainId: constants_1.StarknetChainId.TESTNET,
|
|
123
|
-
})}`, "_blank", "height=650,width=400");
|
|
124
|
-
return this.keychain.execute(calls, abis, transactionsDetail, true);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Sign an JSON object for off-chain usage with the starknet private key and return the signature
|
|
129
|
-
* This adds a message prefix so it cant be interchanged with transactions
|
|
130
|
-
*
|
|
131
|
-
* @param json - JSON object to be signed
|
|
132
|
-
* @returns the signature of the JSON object
|
|
133
|
-
* @throws {Error} if the JSON object is not a valid JSON
|
|
134
|
-
*/
|
|
135
|
-
signMessage(typedData) {
|
|
136
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
window.open(`${this.url}/sign?${query_string_1.default.stringify({
|
|
138
|
-
typedData: JSON.stringify(typedData),
|
|
139
|
-
})}`, "_blank", "height=650,width=400");
|
|
140
|
-
return this.keychain.signMessage(typedData, this.address);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
exports.default = CartridgeAccount;
|
|
145
|
-
//# sourceMappingURL=account.js.map
|
package/lib/account.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,uCAakB;AAClB,gEAA8B;AAM9B,qCAAkC;AAElC,kDAAqD;AAErD,MAAM,gBAAiB,SAAQ,kBAAO;IAKpC,YACE,OAAe,EACf,SAAkB,EAAE,EACpB,QAAsC,EACtC,OAEC;QAED,KAAK,CAAC,0BAAe,EAAE,OAAO,EAAE,IAAI,eAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAVzD,QAAG,GAAW,wBAAwB,CAAC;QAW7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;SACxB;IACH,CAAC;IAED;;;;;;;;;OASG;IACG,cAAc,CAClB,OAA8B,EAC9B,GAAS;;YAET,MAAM,EAAE,GAAG,IAAA,cAAI,GAAE,CAAC;YAElB,MAAM,CAAC,IAAI,CACT,GAAG,IAAI,CAAC,GAAG,kBAAkB,kBAAkB,CAC7C,MAAM,CAAC,MAAM,CACd,OAAO,EAAE,EAAE,EACZ,QAAQ,EACR,sBAAsB,CACvB,CAAC;YAEF,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YAEjC,uEAAuE;YACvE,+BAA+B;YAC/B,cAAc;YACd,UAAU;YACV,eAAe;YACf,WAAW;YACX,OAAO;YACP,MAAM;YAEN,wBAAwB;YACxB,+CAA+C;YAC/C,IAAI;YAEJ,2BAA2B;QAC7B,CAAC;KAAA;IAED;;;;;;;;;;SAUK;IACC,WAAW,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AkB,CAAC,OAAO;gBACnC,MAAM,EAAE,kBAAkB,CAAC,MAAM;gBACjC,OAAO,EAAE,2BAAe,CAAC,OAAO;aACjC,CAAC,EAAE,EACJ,QAAQ,EACR,sBAAsB,CACvB,CAAC;YAEF,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;QACtE,CAAC;KAAA;IAED;;;;;;;OAOG;IACG,WAAW,CAAC,SAA8B;;YAC9C,MAAM,CAAC,IAAI,CACT,GAAG,IAAI,CAAC,GAAG,SAAS,sBAAE,CAAC,SAAS,CAAC;gBAC/B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;aACrC,CAAC,EAAE,EACJ,QAAQ,EACR,sBAAsB,CACvB,CAAC;YAEF,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF;AAED,kBAAe,gBAAgB,CAAC"}
|
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,CAAC,EAClB,MAAM,EACN,MAAM,EACN,IAAI,EAAE,EAAE,EAAE,EAAE,GACmB,EAAE,EAAE,CAAC,CAAC,QAAkB,EAAE,EAAE;YAC3D,IAAI,CAAC,MAAM,EAAE;gBACX,OAAM;aACP;YAED,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,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,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;YACnB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;YACf,CAAC,CACF,CAAC;KACH;IAED,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,MAAM,GAA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