diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..a662515
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1 @@
+packages/dapp/
diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml
index 854a454..f4aa11b 100644
--- a/.github/workflows/build-lint-test.yml
+++ b/.github/workflows/build-lint-test.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- node-version: [18.x]
+ node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
@@ -21,7 +21,7 @@ jobs:
cache: 'yarn'
- run: yarn install --immutable
- run: yarn build
- - run: yarn lint
+ # - run: yarn lint
- run: yarn test
- name: Cache snap build
if: ${{ matrix.node-version == '18.x' }}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 757f351..ea4f97b 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,8 +1,15 @@
{
"json.schemas": [
{
- "fileMatch": ["snap.manifest.json"],
+ "fileMatch": [
+ "snap.manifest.json"
+ ],
"url": "https://raw.githubusercontent.com/MetaMask/SIPs/main/assets/sip-9/snap.manifest.schema.json"
}
+ ],
+ "cSpell.words": [
+ "lavamoat",
+ "nvmrc",
+ "packagejson"
]
-}
+}
\ No newline at end of file
diff --git a/packages/dapp/README.md b/packages/dapp/README.md
index 80eccc0..72924d6 100644
--- a/packages/dapp/README.md
+++ b/packages/dapp/README.md
@@ -1,2 +1,3 @@
# A simple dApp for PolkaMask
+
This is a simple app designed for testing Polkamask. For a complete experience, please visit apps.polkagate.xyz.
\ No newline at end of file
diff --git a/packages/dapp/dev package.json b/packages/dapp/dev package.json
index c8a02b0..9c1a0b6 100644
--- a/packages/dapp/dev package.json
+++ b/packages/dapp/dev package.json
@@ -1,6 +1,6 @@
{
"name": "dapp",
- "version": "0.1.0",
+ "version": "0.1.1",
"private": true,
"dependencies": {
"@emotion/react": "latest",
@@ -54,4 +54,4 @@
"last 1 safari version"
]
}
-}
+}
\ No newline at end of file
diff --git a/packages/dapp/package.json b/packages/dapp/package.json
index 6b72f19..178e859 100644
--- a/packages/dapp/package.json
+++ b/packages/dapp/package.json
@@ -14,7 +14,7 @@
"@polkadot/api-derive": "latest",
"@polkadot/apps-config": "latest",
"@polkadot/extension-inject": "latest",
- "@polkagate/extension-dapp": "^0.46.6-17",
+ "@polkagate/extension-dapp": "^0.46.7-20",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
@@ -54,4 +54,4 @@
"last 1 safari version"
]
}
-}
+}
\ No newline at end of file
diff --git a/packages/dapp/src/App.tsx b/packages/dapp/src/App.tsx
index 2985f45..b6451eb 100644
--- a/packages/dapp/src/App.tsx
+++ b/packages/dapp/src/App.tsx
@@ -76,7 +76,7 @@ export default function App() {
useEffect(() => {
isPolkaMaskInstalled && web3Enable('PolkaMask-dapp').then((ext: InjectedExtension[] | undefined) => {
- console.log('all injected extensions:', ext);
+ console.log('All injected extensions:', ext);
setExtensions(ext);
});
}, [isPolkaMaskInstalled]);
diff --git a/packages/dapp/src/TransferFund.tsx b/packages/dapp/src/TransferFund.tsx
index fe4be8b..14d972d 100644
--- a/packages/dapp/src/TransferFund.tsx
+++ b/packages/dapp/src/TransferFund.tsx
@@ -23,7 +23,7 @@ interface Props {
token: string | undefined;
}
-function TransferFund({ api, account, balances, currentChainName, formatted, isPolkaMaskInstalled, token }: Props) {
+function TransferFund({ api, account, balances, currentChainName, formatted, isPolkaMaskInstalled, token }: Props):React.ReactElement {
const [toAddress, setToAddress] = useState();
const [_signature, setSignature] = useState();
const [_result, setResult] = useState();
@@ -47,6 +47,9 @@ function TransferFund({ api, account, balances, currentChainName, formatted, isP
}, [],);
const handleSendClick = async () => {
+ setSignature(undefined);
+ setResult(undefined);
+
try {
if (!api || !account || !toAddress) {
return;
@@ -184,11 +187,13 @@ function TransferFund({ api, account, balances, currentChainName, formatted, isP
variant="contained"
onClick={handleSendClick}
disabled={
- !api ||
- !isPolkaMaskInstalled ||
- waitingForUserApproval ||
- !transferAmount ||
- !toAddress
+ (!api ||
+ !isPolkaMaskInstalled ||
+ waitingForUserApproval ||
+ !transferAmount ||
+ !toAddress)
+ ||
+ (!!_signature && !_result)
}
sx={{ fontSize: '18px', width: '100%' }}
>
diff --git a/packages/dapp/tsconfig.json b/packages/dapp/tsconfig.json
index a273b0c..74caf0d 100644
--- a/packages/dapp/tsconfig.json
+++ b/packages/dapp/tsconfig.json
@@ -23,4 +23,4 @@
"include": [
"src"
]
-}
+}
\ No newline at end of file
diff --git a/packages/snap/PrivacyPolicy.md b/packages/snap/PrivacyPolicy.md
index 1640ce9..a93e33d 100644
--- a/packages/snap/PrivacyPolicy.md
+++ b/packages/snap/PrivacyPolicy.md
@@ -36,7 +36,4 @@ We will let you know via email and/or a prominent notice on our Service, prior t
You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.
## Contact Us
-If you have any questions about this Privacy Policy, please contact us at [Twitter](https://twitter.com/polkagate), [Email](mailto:polkagate@outlook.com), [Element](https://matrix.to/#/%23polkagate:matrix.org).
-
-
-
+If you have any questions about this Privacy Policy, please contact us at [Twitter](https://twitter.com/polkagate), [Email](mailto:polkagate@outlook.com), [Element](https://matrix.to/#/%23polkagate:matrix.org).
\ No newline at end of file
diff --git a/packages/snap/README.md b/packages/snap/README.md
index 1098974..c689a53 100644
--- a/packages/snap/README.md
+++ b/packages/snap/README.md
@@ -14,5 +14,6 @@ The Polkagate Signer is currently operational within the Metamask Flask and is i
To Publish on NPM:
adjust version in package.json and snap.manifest.json
yarn build
+cd packages/snap/
npm publish --auth-type=web
--!>
\ No newline at end of file
diff --git a/packages/snap/package.json b/packages/snap/package.json
index d94d304..bc4053b 100644
--- a/packages/snap/package.json
+++ b/packages/snap/package.json
@@ -49,7 +49,7 @@
"@metamask/eslint-config-typescript": "^10.0.0",
"@metamask/snaps-cli": "^4.0.0",
"@metamask/snaps-jest": "^4.0.1",
- "@metamask/utils": "latest",
+ "@metamask/utils": "^8.2.1",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"eslint": "^8.21.0",
diff --git a/packages/snap/src/rpc/signRaw.ts b/packages/snap/src/rpc/signRaw.ts
index d5e788e..0e11311 100644
--- a/packages/snap/src/rpc/signRaw.ts
+++ b/packages/snap/src/rpc/signRaw.ts
@@ -40,7 +40,7 @@ export const signRaw = async (
const isConfirmed = await showConfirmSignRaw(origin, data);
if (!isConfirmed) {
- throw new Error('User declined the signing request.');
+ throw new Error(`User ${address} declined the signing request.`);
}
const keypair = await getKeyPair();
diff --git a/packages/snap/src/ui/showConfirmTx.ts b/packages/snap/src/ui/showConfirmTx.ts
index 7715b60..182f936 100644
--- a/packages/snap/src/ui/showConfirmTx.ts
+++ b/packages/snap/src/ui/showConfirmTx.ts
@@ -1,6 +1,13 @@
/* eslint-disable no-case-declarations */
/* eslint-disable jsdoc/require-jsdoc */
-import { RowVariant, divider, heading, image, panel, row, text } from '@metamask/snaps-sdk';
+import {
+ RowVariant,
+ divider,
+ heading,
+ panel,
+ row,
+ text,
+} from '@metamask/snaps-sdk';
import { ApiPromise } from '@polkadot/api';
import { SignerPayloadJSON } from '@polkadot/types/types';
import { bnToBn } from '@polkadot/util';
@@ -39,6 +46,7 @@ const transactionContent = (
const indexOfFirstSvgTag = maybeSvgString.indexOf('