@cartridge/controller 0.10.4 → 0.10.5
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/.turbo/turbo-build$colon$deps.log +14 -14
- package/.turbo/turbo-build.log +14 -14
- package/dist/index.js +2 -2
- package/dist/node/index.cjs +8 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +9 -2
- package/dist/node/index.js.map +1 -1
- package/dist/{provider-PftcmETC.js → provider-CznCrt4b.js} +2 -2
- package/dist/{provider-PftcmETC.js.map → provider-CznCrt4b.js.map} +1 -1
- package/dist/session.js +2 -2
- package/dist/stats.html +1 -1
- package/package.json +2 -2
- package/src/node/provider.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cartridge/controller",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Cartridge Controller",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"vite-plugin-node-polyfills": "^0.23.0",
|
|
51
51
|
"vite-plugin-top-level-await": "^1.4.4",
|
|
52
52
|
"vite-plugin-wasm": "^3.4.1",
|
|
53
|
-
"@cartridge/tsconfig": "0.10.
|
|
53
|
+
"@cartridge/tsconfig": "0.10.5"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build:deps": "pnpm build",
|
package/src/node/provider.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ec, stark, WalletAccount } from "starknet";
|
|
1
|
+
import { ec, encode, stark, WalletAccount } from "starknet";
|
|
2
2
|
import { SessionPolicies } from "@cartridge/presets";
|
|
3
3
|
import { AddStarknetChainParameters } from "@starknet-io/types-js";
|
|
4
|
+
import { signerToGuid } from "@cartridge/controller-wasm";
|
|
4
5
|
|
|
5
6
|
import SessionAccount from "./account";
|
|
6
7
|
import { KEYCHAIN_URL } from "../constants";
|
|
@@ -153,10 +154,16 @@ export default class SessionProvider extends BaseProvider {
|
|
|
153
154
|
const sessionData = await this._backend.waitForCallback();
|
|
154
155
|
if (sessionData) {
|
|
155
156
|
const sessionRegistration = JSON.parse(atob(sessionData));
|
|
157
|
+
const formattedPk = encode.addHexPrefix(publicKey);
|
|
156
158
|
// Ensure addresses are properly formatted
|
|
157
159
|
sessionRegistration.address = sessionRegistration.address.toLowerCase();
|
|
158
160
|
sessionRegistration.ownerGuid =
|
|
159
161
|
sessionRegistration.ownerGuid.toLowerCase();
|
|
162
|
+
sessionRegistration.guardianKeyGuid = "0x0";
|
|
163
|
+
sessionRegistration.metadataHash = "0x0";
|
|
164
|
+
sessionRegistration.sessionKeyGuid = signerToGuid({
|
|
165
|
+
starknet: { privateKey: formattedPk },
|
|
166
|
+
});
|
|
160
167
|
await this._backend.set("session", JSON.stringify(sessionRegistration));
|
|
161
168
|
return this.probe();
|
|
162
169
|
}
|