From e9bec09668eb53c237251cb68e5a232aa48246b1 Mon Sep 17 00:00:00 2001 From: lukachi Date: Fri, 17 Nov 2023 13:55:49 +0200 Subject: [PATCH] fix createIdentity types and rpc method --- packages/connector/package.json | 2 +- packages/connector/src/methods.ts | 5 ++++- packages/connector/src/types.ts | 5 ++++- packages/connector/src/version.json | 2 +- packages/site/package.json | 2 +- packages/snap/package.json | 4 ++-- packages/snap/snap.manifest.json | 4 ++-- packages/snap/src/index.ts | 6 +++++- 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/packages/connector/package.json b/packages/connector/package.json index 072f5cad..ec427283 100644 --- a/packages/connector/package.json +++ b/packages/connector/package.json @@ -1,6 +1,6 @@ { "name": "@rarimo/rarime-connector", - "version": "1.0.0-rc.0", + "version": "1.0.0-rc.1", "description": "Facilitates interaction between a DApp and RariMe MetaMask snap", "repository": { "type": "git", diff --git a/packages/connector/src/methods.ts b/packages/connector/src/methods.ts index 489038e9..0a334451 100644 --- a/packages/connector/src/methods.ts +++ b/packages/connector/src/methods.ts @@ -25,7 +25,10 @@ const sendSnapMethod = async ( export const createIdentity = async function ( this: MetamaskSnap, -): Promise { +): Promise<{ + identityIdString: string; + identityIdBigIntString: string; +}> { return await sendSnapMethod( { method: RPCMethods.CreateIdentity }, this.snapId, diff --git a/packages/connector/src/types.ts b/packages/connector/src/types.ts index 8cb46a76..4d0a7396 100644 --- a/packages/connector/src/types.ts +++ b/packages/connector/src/types.ts @@ -16,7 +16,10 @@ export enum RPCMethods { } export type SnapConnector = { - createIdentity(): Promise; + createIdentity(): Promise<{ + identityIdString: string; + identityIdBigIntString: string; + }>; saveCredentials( params: SaveCredentialsRequestParams, ): Promise; diff --git a/packages/connector/src/version.json b/packages/connector/src/version.json index 21082a5e..e7e91f28 100644 --- a/packages/connector/src/version.json +++ b/packages/connector/src/version.json @@ -1,3 +1,3 @@ { - "version": "1.0.0-rc.0" + "version": "1.0.0-rc.1" } diff --git a/packages/site/package.json b/packages/site/package.json index 40c5f0c7..95c8f73e 100644 --- a/packages/site/package.json +++ b/packages/site/package.json @@ -1,6 +1,6 @@ { "name": "site", - "version": "0.8.0", + "version": "1.0.0-rc.1", "private": true, "license": "(MIT-0 OR Apache-2.0)", "scripts": { diff --git a/packages/snap/package.json b/packages/snap/package.json index 8fd4cdea..e16c50a5 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -1,6 +1,6 @@ { "name": "@rarimo/rarime", - "version": "1.0.0-rc.0", + "version": "1.0.0-rc.1", "description": "RariMe is a MetaMask Snap that safely holds any of your credentials and allows you to prove your identity without revealing any personal data. Powered by Rarimo Protocol and Zero-Knowledge Proof technology.", "repository": { "type": "git", @@ -47,7 +47,7 @@ "@metamask/snaps-jest": "0.35.2-flask.1", "@metamask/snaps-types": "0.32.2", "@metamask/snaps-ui": "0.32.2", - "@rarimo/rarime-connector": "0.8.0", + "@rarimo/rarime-connector": "1.0.0-rc.1", "buffer": "6.0.3", "dids": "4.0.4", "ethers": "5.7.2", diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 94bfe0ce..bb571e36 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-rc.0", + "version": "1.0.0-rc.1", "description": "Securely store and manage all of your identity credentials. Use them across chains with ZK-protected privacy guarantees.", "proposedName": "RariMe", "repository": { @@ -7,7 +7,7 @@ "url": "https://github.com/rarimo/rarime.git" }, "source": { - "shasum": "EFhWqoLj5z89DeEtaTEqQaqBZWvlqcAIIuZ1TlyfS8M=", + "shasum": "ah99UsqTvHP21FIQySuBSQlU/0JAKIIMnz2YhCnM5M4=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.ts index dc769629..06a08a26 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.ts @@ -88,7 +88,10 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ case RPCMethods.CreateIdentity: { const identityStorage = await getItemFromStore(StorageKeys.identity); if (identityStorage) { - return identityStorage.did; + return { + did: identityStorage.did, + didBigInt: identityStorage.didBigInt, + }; } const res = await snap.request({ @@ -117,6 +120,7 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ await setItemInStore(StorageKeys.identity, { privateKeyHex: identity.privateKeyHex, did: identity.didString, + didBigInt: identity.identityIdBigIntString, }); snap.request({