Skip to content

Commit

Permalink
fix: When using wallet, filter by substrate accounts only
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuripetusko committed Jan 3, 2024
1 parent c311431 commit 5f0f6b1
Show file tree
Hide file tree
Showing 8 changed files with 621 additions and 8,739 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"access": "public"
},
"dependencies": {
"@changesets/cli": "^2.25.0",
"@changesets/cli": "^2.26.1",
"prettier": "2.4.1",
"wsrun": "^5.2.1"
}
Expand Down
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@substra-hooks/core",
"version": "0.0.60",
"version": "0.0.61",
"main": "dist/cjs/src/index.js",
"module": "dist/esm/src/index.js",
"types": "dist/esm/src/index.d.ts",
Expand All @@ -27,11 +27,11 @@
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
"@babel/preset-env": "^7.13.9",
"@babel/preset-typescript": "^7.13.0",
"@polkadot/api": "^10.7.1",
"@polkadot/extension-dapp": "^0.46.3",
"@polkadot/keyring": "^12.2.1",
"@polkadot/util": "^12.2.1",
"@polkadot/util-crypto": "^12.2.1",
"@polkadot/api": "^10.11.2",
"@polkadot/extension-dapp": "^0.46.6",
"@polkadot/keyring": "^12.6.2",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@types/jest": "^29.5.1",
"@types/ramda": "^0.29.1",
"@typescript-eslint/eslint-plugin": "^5.59.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/hooks/use-polkadot-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const checkEnabled: (extensionName: string, systemProperties: ISystemProp
let accounts = null;

if (w3Enabled) {
accounts = await web3Accounts({ ss58Format: systemProperties.ss58Format });
accounts = await web3Accounts({ ss58Format: systemProperties.ss58Format, accountType: ['sr25519'] });
}
return { accounts, w3Enabled };
};
Expand Down
4 changes: 2 additions & 2 deletions packages/dotsama-wallet-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"dependencies": {
"@chakra-ui/react": "^2.6.1",
"@chakra-ui/system": "^2.5.7",
"@polkadot/react-identicon": "^2.9.12",
"@polkadot/react-identicon": "^3.6.4",
"@react-icons/all-files": "^4.1.0",
"@substra-hooks/core": "^0.0.60",
"@substra-hooks/core": "^0.0.61",
"fuse.js": "^6.6.2",
"react-copy-to-clipboard": "^5.1.0",
"zustand": "^4.1.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class BaseDotsamaWallet implements Omit<Wallet, 'extensionName' | 'getAcc
}

const unsubscribe = this._extension.accounts.subscribe((accounts: InjectedAccount[]) => {
const accountsWithWallet = accounts.map((account) => {
const accountsWithWallet = accounts.filter(a => a.type === 'sr25519').map((account) => {
return {
...account,
address: encodeAddress(account.address, ss58Format),
Expand Down
7,891 changes: 0 additions & 7,891 deletions packages/dotsama-wallet-react/yarn-error.log

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactNode } from 'react';
import { ApiProviderConfig, SubstraHooksProvider, ExtensionProvider } from '@substra-hooks/core';
import { ApiProviderConfig, SubstraHooksProvider } from '@substra-hooks/core';

interface ISubstraHooksProviderProps {
apiProviderConfig: ApiProviderConfig;
Expand Down
1,445 changes: 609 additions & 836 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 5f0f6b1

Please sign in to comment.