Skip to content

Commit

Permalink
feat: add getAddress method
Browse files Browse the repository at this point in the history
  • Loading branch information
SukhachevN committed Aug 15, 2024
1 parent 81b7f91 commit 625aa52
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/site/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ const Index = () => {
: snapsDetected;

const handleSendHelloClick = async () => {
await invokeSnap({ method: 'hello' });
const result = await invokeSnap({ method: 'getAddress' });
console.log(result);
};

const installSnap = async () => {
Expand Down
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": "nomis",
"version": "0.1.3",
"version": "0.1.4",
"description": "Onchain Reputation and Decentralized Identity Protocol",
"repository": {
"type": "git",
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": "0.1.3",
"version": "0.1.4",
"description": "Onchain Reputation and Decentralized Identity Protocol",
"proposedName": "Nomis Protocol",
"repository": {
"type": "git",
"url": "https://github.com/Nomis-cc/nomis-snaps.git"
},
"source": {
"shasum": "xgurEG5jHmrFcnBO3CHBriCEkSOvJ8PdLRTWRtKoE7g=",
"shasum": "DGI3POjXiBCuVZmCbG2cciqSi+qJdpVBgZixWcs6Ph8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/snap/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { convertCAIP2ToHex, getAccount, getChainId } from './utils';

export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => {
switch (request.method) {
case 'getAddress':
return await getAccount();
default:
throw new Error('Method not found.');
}
Expand Down

0 comments on commit 625aa52

Please sign in to comment.