Skip to content

Commit

Permalink
added copy capability in snap
Browse files Browse the repository at this point in the history
Signed-off-by: aritroCoder <[email protected]>
  • Loading branch information
aritroCoder committed Dec 10, 2023
1 parent eea8011 commit d8f662c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/template-snap-monorepo.git"
},
"source": {
"shasum": "YoKmyYOilAOCHHWdD7rLvEGM89tjQvAjitssnyIRFMU=",
"shasum": "KXUWUpOnKM55BwS0UbSTDZfeL2XpDMOOidcAPNAmKVE=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
14 changes: 9 additions & 5 deletions packages/snap/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { OnRpcRequestHandler } from '@metamask/snaps-types';
import { heading, panel, text } from '@metamask/snaps-ui';
import { copyable, heading, panel, text } from '@metamask/snaps-ui';

import createAccount from './utils/aptos/CreateAccount';
import transferCoin from './utils/aptos/TransferCoin';
Expand Down Expand Up @@ -101,7 +101,8 @@ export const onRpcRequest: OnRpcRequestHandler = async ({
type: 'confirmation',
content: panel([
heading('Transfer Coin'),
text(`To: **${to}**`),
text(`To:`),
copyable(`${to}`),
text(`Amount: **${amount}**`),
panel([
heading('Gas fee insights'),
Expand All @@ -126,9 +127,11 @@ export const onRpcRequest: OnRpcRequestHandler = async ({
type: 'alert',
content: panel([
heading('Amount transferred successfully.'),
text(`To: **${to}**`),
text(`To:`),
copyable(`${to}`),
text(`Amount: **${amount}**`),
text(`Transaction Hash: **${txHash.hash}**`),
text(`Transaction Hash:`),
copyable(`${txHash.hash}`),
]),
},
});
Expand All @@ -144,7 +147,8 @@ export const onRpcRequest: OnRpcRequestHandler = async ({
type: 'alert',
content: panel([
heading('Funded 1 APT successfully.'),
text(`Transaction Hash: **${txHash}**`),
text(`Transaction Hash:`),
copyable(`${txHash}`),
]),
},
});
Expand Down

0 comments on commit d8f662c

Please sign in to comment.