-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade snap by adding home page and dialog boxes (#609)
Signed-off-by: Himalayan Dev <[email protected]>
- Loading branch information
1 parent
f9612e8
commit 2b56276
Showing
48 changed files
with
1,654 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@hashgraph/hedera-wallet-snap", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Hedera Wallet Snap unlocks wallet functionality via Metamask that any other apps can interact with, thereby turning Metamask into a native Hedera wallet without relying on Hedera JSON-RPC Relay.", | ||
"keywords": [ | ||
"MetaMask", | ||
|
@@ -45,12 +45,12 @@ | |
}, | ||
"dependencies": { | ||
"@hashgraph/sdk": "^2.48.1", | ||
"@metamask/key-tree": "^9.1.1", | ||
"@metamask/providers": "^17.1.0", | ||
"@metamask/key-tree": "^9.1.2", | ||
"@metamask/providers": "^17.2.0", | ||
"@metamask/rpc-errors": "^6.3.1", | ||
"@metamask/snaps-sdk": "^6.0.0", | ||
"@metamask/snaps-sdk": "^6.3.0", | ||
"bignumber.js": "^9.1.2", | ||
"ethers": "^6.13.1", | ||
"ethers": "^6.13.2", | ||
"lodash": "^4.17.21", | ||
"normalize-url": "^8.0.1" | ||
}, | ||
|
@@ -61,8 +61,8 @@ | |
"@metamask/eslint-config-jest": "^12.1.0", | ||
"@metamask/eslint-config-nodejs": "^12.1.0", | ||
"@metamask/eslint-config-typescript": "^12.1.0", | ||
"@metamask/snaps-cli": "^6.2.1", | ||
"@metamask/snaps-jest": "^8.2.0", | ||
"@metamask/snaps-cli": "^6.3.1", | ||
"@metamask/snaps-jest": "^8.3.0", | ||
"@types/jest": "^29.5.12", | ||
"@types/lodash.clonedeep": "^4.5.9", | ||
"@types/normalize-url": "^4.2.0", | ||
|
@@ -72,21 +72,21 @@ | |
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-jest": "28.3.0", | ||
"eslint-plugin-jsdoc": "^48.7.0", | ||
"eslint-plugin-jsdoc": "^50.2.2", | ||
"eslint-plugin-n": "17.3.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-promise": "^6.2.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"eslint-plugin-promise": "^7.1.0", | ||
"jest": "^29.7.0", | ||
"jest-junit": "^16.0.0", | ||
"jest-mock": "^29.7.0", | ||
"lodash.clonedeep": "^4.5.0", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-packagejson": "^2.5.0", | ||
"rimraf": "^5.0.7", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-packagejson": "^2.5.2", | ||
"rimraf": "^6.0.1", | ||
"ts-jest": "^29.2.2", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.5.3" | ||
"typescript": "^5.6.2" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
packages/hedera-wallet-snap/packages/snap/src/components/common.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/*- | ||
* | ||
* Hedera Wallet Snap | ||
* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import type { SnapComponent } from '@metamask/snaps-sdk/jsx'; | ||
import { | ||
Address as MetamaskAddress, | ||
Bold as MetamaskBold, | ||
Box as MetamaskBox, | ||
Copyable as MetamaskCopyable, | ||
Divider as MetamaskDivider, | ||
Heading as MetamaskHeading, | ||
Link as MetamaskLink, | ||
Row as MetamaskRow, | ||
Text as MetamaskText, | ||
} from '@metamask/snaps-sdk/jsx'; | ||
|
||
export const Box = MetamaskBox as any; | ||
export const Heading = MetamaskHeading as any; | ||
export const Divider = MetamaskDivider as any; | ||
export const Row = MetamaskRow as any; | ||
export const Text = MetamaskText as any; | ||
export const Copyable = MetamaskCopyable as any; | ||
export const Address = MetamaskAddress as any; | ||
export const Link = MetamaskLink as any; | ||
export const Bold = MetamaskBold as any; | ||
|
||
export type CommonProps = { | ||
origin: string; | ||
network: string; | ||
mirrorNodeUrl: string; | ||
[key: string]: any; | ||
}; | ||
|
||
const MetamaskUI: SnapComponent<CommonProps> = ({ | ||
origin, | ||
network, | ||
mirrorNodeUrl, | ||
}) => { | ||
return ( | ||
<Box> | ||
<Heading>Request</Heading> | ||
<Row label="Origin"> | ||
<Text>{origin}</Text> | ||
</Row> | ||
<Row label="Network"> | ||
<Text>{network}</Text> | ||
</Row> | ||
<Row label="Mirror Node"> | ||
<Text>{mirrorNodeUrl}</Text> | ||
</Row> | ||
<Divider /> | ||
</Box> | ||
); | ||
}; | ||
|
||
export const CommonUI = MetamaskUI as any; |
Oops, something went wrong.