Skip to content

Commit

Permalink
add onUpdate hook
Browse files Browse the repository at this point in the history
  • Loading branch information
lukachi committed Mar 19, 2024
1 parent fb8ec6e commit 63fac32
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 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": "2.1.0-rc.13",
"version": "2.1.0-rc.14",
"description": "Facilitates interaction between a DApp and RariMe MetaMask snap",
"repository": {
"type": "git",
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": "2.1.0-rc.13"
"version": "2.1.0-rc.14"
}
2 changes: 1 addition & 1 deletion packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/rarime",
"version": "2.1.0-rc.13",
"version": "2.1.0-rc.14",
"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
7 changes: 4 additions & 3 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "2.1.0-rc.13",
"version": "2.1.0-rc.14",
"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": "ABVTZiQu17L4Wp76l5HtJdnF9Oy/QeqaFccW0pLykv0=",
"shasum": "1dF5D+8LILwbMHcVN5u0Nj8VvHNHSnOKJQbdRACrN0w=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand All @@ -33,7 +33,8 @@
"endowment:network-access": {},
"endowment:webassembly": {},
"endowment:ethereum-provider": {},
"snap_getEntropy": {}
"snap_getEntropy": {},
"endowment:lifecycle-hooks": {}
},
"manifestVersion": "0.1"
}
21 changes: 21 additions & 0 deletions packages/snap/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// eslint-disable-next-line import/no-unassigned-import
import './polyfill';

import type { OnUpdateHandler } from '@metamask/snaps-sdk';
import { heading, panel, text } from '@metamask/snaps-sdk';

Check failure on line 5 in packages/snap/src/index.ts

View workflow job for this annotation

GitHub Actions / build_and_test (18)

'heading' is defined but never used

Check failure on line 5 in packages/snap/src/index.ts

View workflow job for this annotation

GitHub Actions / build_and_test (18)

'heading' is defined but never used

Check failure on line 5 in packages/snap/src/index.ts

View workflow job for this annotation

GitHub Actions / publish (18)

'heading' is defined but never used

Check failure on line 5 in packages/snap/src/index.ts

View workflow job for this annotation

GitHub Actions / build_and_test (18)

'heading' is defined but never used
import type { JsonRpcRequest } from '@metamask/utils';
import { RPCMethods } from '@rarimo/rarime-connector';

Expand Down Expand Up @@ -98,3 +100,22 @@ export const onRpcRequest = async ({
throw new Error('Method not found.');
}
};

export const onUpdate: OnUpdateHandler = async (args: {
request: JsonRpcRequest;
}) => {
console.log('onUpdate', JSON.stringify(args));

await snap.request({
method: 'snap_dialog',
params: {
type: 'alert',
content: panel([
text('New features added in this version:'),
text('• Cosmos compatible wallet'),
text('• Import & Export identity'),
text('• Remove credentials'),
]),
},
});
};
2 changes: 1 addition & 1 deletion packages/zkp-iden3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rarimo/zkp-iden3",
"version": "2.1.0-rc.13",
"version": "2.1.0-rc.14",
"description": "Tools that generate zero-knowledge proofs for the Iden3 protocol.",
"repository": {
"type": "git",
Expand Down

0 comments on commit 63fac32

Please sign in to comment.