Skip to content

Commit

Permalink
fix createIdentity types and rpc method
Browse files Browse the repository at this point in the history
  • Loading branch information
lukachi committed Nov 17, 2023
1 parent 5fd444c commit e9bec09
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/connector/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 4 additions & 1 deletion packages/connector/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const sendSnapMethod = async <T>(

export const createIdentity = async function (
this: MetamaskSnap,
): Promise<string> {
): Promise<{
identityIdString: string;
identityIdBigIntString: string;
}> {
return await sendSnapMethod(
{ method: RPCMethods.CreateIdentity },
this.snapId,
Expand Down
5 changes: 4 additions & 1 deletion packages/connector/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export enum RPCMethods {
}

export type SnapConnector = {
createIdentity(): Promise<string>;
createIdentity(): Promise<{
identityIdString: string;
identityIdBigIntString: string;
}>;
saveCredentials(
params: SaveCredentialsRequestParams,
): Promise<W3CCredential[]>;
Expand Down
2 changes: 1 addition & 1 deletion packages/connector/src/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.0.0-rc.0"
"version": "1.0.0-rc.1"
}
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"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": {
"type": "git",
"url": "https://github.com/rarimo/rarime.git"
},
"source": {
"shasum": "EFhWqoLj5z89DeEtaTEqQaqBZWvlqcAIIuZ1TlyfS8M=",
"shasum": "ah99UsqTvHP21FIQySuBSQlU/0JAKIIMnz2YhCnM5M4=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
6 changes: 5 additions & 1 deletion packages/snap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -117,6 +120,7 @@ export const onRpcRequest: OnRpcRequestHandler = async ({
await setItemInStore(StorageKeys.identity, {
privateKeyHex: identity.privateKeyHex,
did: identity.didString,
didBigInt: identity.identityIdBigIntString,
});

snap.request({
Expand Down

0 comments on commit e9bec09

Please sign in to comment.