From af204fc2f3e5365c6780ef37cd58f3350d62bd1a Mon Sep 17 00:00:00 2001 From: Martin Domajnko <35891136+martines3000@users.noreply.github.com> Date: Fri, 26 Jan 2024 21:43:45 +0100 Subject: [PATCH] feat: remove goerli (#554) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Urban Vidovič Co-authored-by: Urban Vidovič --- .changeset/five-planets-wave.md | 5 + .changeset/light-candles-accept.md | 5 + .changeset/sixty-ties-relate.md | 5 + packages/dapp/.env.example | 1 - packages/dapp/package.json | 3 +- .../components/AppNavbar/NavConnection.tsx | 6 +- .../src/components/MascaProvider/index.tsx | 33 +- packages/dapp/src/config/wagmiConfig.ts | 5 +- packages/dapp/src/messages/en.json | 5 + packages/dapp/src/utils/networks.ts | 5 +- .../docs/integrate-masca/masca-connector.md | 2 +- .../docs/docs/integrate-masca/rpc-methods.md | 2 +- packages/snap/index.html | 620 ------------------ packages/snap/package.json | 1 - packages/snap/snap.manifest.json | 2 +- .../snap/src/polygon-id/Polygon.service.ts | 25 +- packages/snap/src/polygon-id/constants.ts | 15 +- .../src/polygon-id/storage/SnapDataSource.ts | 5 +- .../storage/SnapMerkleTreeStorage.ts | 5 +- .../src/polygon-id/storage/SnapTreeStorage.ts | 5 +- packages/snap/src/utils/config.ts | 4 - packages/snap/src/veramo/Veramo.service.ts | 4 - packages/snap/tests/data/constants.ts | 2 +- .../verifiable-credentials/exampleJSONLD.json | 2 +- packages/snap/tests/helpers/snapMock.ts | 10 +- .../snap/tests/unit/Veramo.service.spec.ts | 2 +- packages/types/src/state.ts | 5 +- pnpm-lock.yaml | 92 +-- 28 files changed, 89 insertions(+), 787 deletions(-) create mode 100644 .changeset/five-planets-wave.md create mode 100644 .changeset/light-candles-accept.md create mode 100644 .changeset/sixty-ties-relate.md diff --git a/.changeset/five-planets-wave.md b/.changeset/five-planets-wave.md new file mode 100644 index 000000000..fdc800fa2 --- /dev/null +++ b/.changeset/five-planets-wave.md @@ -0,0 +1,5 @@ +--- +'@blockchain-lab-um/masca-types': patch +--- + +Remove support for Goerli. diff --git a/.changeset/light-candles-accept.md b/.changeset/light-candles-accept.md new file mode 100644 index 000000000..49c242148 --- /dev/null +++ b/.changeset/light-candles-accept.md @@ -0,0 +1,5 @@ +--- +'@blockchain-lab-um/dapp': patch +--- + +Remove support for Goerli. diff --git a/.changeset/sixty-ties-relate.md b/.changeset/sixty-ties-relate.md new file mode 100644 index 000000000..2668fc898 --- /dev/null +++ b/.changeset/sixty-ties-relate.md @@ -0,0 +1,5 @@ +--- +'@blockchain-lab-um/masca': patch +--- + +Remove support for Goerli. diff --git a/packages/dapp/.env.example b/packages/dapp/.env.example index 760ebba6a..3ec79d0fc 100644 --- a/packages/dapp/.env.example +++ b/packages/dapp/.env.example @@ -8,7 +8,6 @@ GOOGLE_DRIVE_FILE_NAME=masca-backup- MAINNET_RPC_URL= SEPOLIA_RPC_URL= IPFS_GATEWAY= -GOERLI_RPC_URL= POLYGON_RPC_URL= POLYGON_MUMBAI_RPC_URL= diff --git a/packages/dapp/package.json b/packages/dapp/package.json index 2d47fd4b7..80853a5e6 100644 --- a/packages/dapp/package.json +++ b/packages/dapp/package.json @@ -21,10 +21,9 @@ "start": "next start" }, "dependencies": { - "@blockchain-lab-um/did-provider-key": "1.0.7", + "@blockchain-lab-um/did-provider-key": "1.0.8-beta.0", "@blockchain-lab-um/masca-connector": "1.2.2-beta.0", "@blockchain-lab-um/oidc-types": "0.0.8", - "@ethersproject/providers": "^5.7.2", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@nextui-org/react": "^2.2.9", diff --git a/packages/dapp/src/components/AppNavbar/NavConnection.tsx b/packages/dapp/src/components/AppNavbar/NavConnection.tsx index 19e82fbf0..28861e8f1 100644 --- a/packages/dapp/src/components/AppNavbar/NavConnection.tsx +++ b/packages/dapp/src/components/AppNavbar/NavConnection.tsx @@ -89,7 +89,11 @@ export const NavConnection = () => { shadow="none" variant="method" items={getAvailableNetworksList(currMethod)} - selected={selectedNetwork} + selected={ + selectedNetwork === 'Goerli' + ? t('unsupported-method') + : selectedNetwork + } setSelected={setNetwork} /> diff --git a/packages/dapp/src/components/MascaProvider/index.tsx b/packages/dapp/src/components/MascaProvider/index.tsx index a8a9d7395..4883d712e 100644 --- a/packages/dapp/src/components/MascaProvider/index.tsx +++ b/packages/dapp/src/components/MascaProvider/index.tsx @@ -2,9 +2,10 @@ import { useEffect } from 'react'; import { enableMasca, isError } from '@blockchain-lab-um/masca-connector'; -import { useAccount, useChainId } from 'wagmi'; +import { useTranslations } from 'next-intl'; +import { useAccount, useChainId, useSwitchChain } from 'wagmi'; -import { useMascaStore } from '@/stores'; +import { useMascaStore, useToastStore } from '@/stores'; import { useAuthStore } from '@/stores/authStore'; const snapId = @@ -15,6 +16,8 @@ const snapId = const MascaProvider = () => { const { address, isConnected } = useAccount(); const chainId = useChainId(); + const { switchChainAsync } = useSwitchChain(); + const t = useTranslations('MascaProvider'); const { api, @@ -103,7 +106,31 @@ const MascaProvider = () => { useEffect(() => { if (!address) return; - enableMascaHandler().catch((err) => { + enableMascaHandler().catch(async (err) => { + // FIXME: this is only a temporary solution + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + if (err.message.toLowerCase().includes('unsupported network')) { + useToastStore.setState({ + open: true, + title: t('unsupported-network'), + text: t('unsupported-network-description'), + type: 'error', + loading: false, + link: null, + }); + await switchChainAsync({ chainId: 1 }); + await enableMascaHandler(); + return; + } + setTimeout(() => { + useToastStore.setState({ + open: true, + title: t('connection-failed'), + type: 'error', + loading: false, + link: null, + }); + }, 200); console.error(err); }); }, [isConnected, address]); diff --git a/packages/dapp/src/config/wagmiConfig.ts b/packages/dapp/src/config/wagmiConfig.ts index 94e0f90e1..aca829046 100644 --- a/packages/dapp/src/config/wagmiConfig.ts +++ b/packages/dapp/src/config/wagmiConfig.ts @@ -1,15 +1,14 @@ import { createConfig, http } from 'wagmi'; -import { goerli, mainnet, polygon, polygonMumbai, sepolia } from 'wagmi/chains'; +import { mainnet, polygon, polygonMumbai, sepolia } from 'wagmi/chains'; import { injected } from 'wagmi/connectors'; export const config = createConfig({ - chains: [mainnet, sepolia, goerli, polygon, polygonMumbai], + chains: [mainnet, sepolia, polygon, polygonMumbai], connectors: [injected({ target: 'metaMask' })], ssr: true, transports: { [mainnet.id]: http(), [sepolia.id]: http(), - [goerli.id]: http(), [polygon.id]: http(), [polygonMumbai.id]: http(), }, diff --git a/packages/dapp/src/messages/en.json b/packages/dapp/src/messages/en.json index d0a90e468..874a8d335 100644 --- a/packages/dapp/src/messages/en.json +++ b/packages/dapp/src/messages/en.json @@ -54,6 +54,11 @@ "select-method": "Select a method", "unsupported-network": "Unsupported network" }, + "MascaProvider": { + "connection-failed": "Failed to connect to Masca", + "unsupported-network": "Unsupported network", + "unsupported-network-description": "Please approve the network switch." + }, "ChooseDeviceView": { "connect": "Connect Wallet to see more options...", "primary-has-camera": "This Device can scan/upload QR codes", diff --git a/packages/dapp/src/utils/networks.ts b/packages/dapp/src/utils/networks.ts index 005917dc4..55c99c2e9 100644 --- a/packages/dapp/src/utils/networks.ts +++ b/packages/dapp/src/utils/networks.ts @@ -1,7 +1,6 @@ export const NETWORKS: Record = { '0x1': 'Ethereum', '0xaa36a7': 'Sepolia', - '0x5': 'Goerli Testnet', '0x89': 'Polygon', '0x13881': 'Polygon Mumbai', }; @@ -10,8 +9,8 @@ export const NETWORKS_BY_DID: Record = { 'did:ethr': ['*'], 'did:pkh': ['0x1', '0x89'], 'did:ens': ['0x1'], - 'did:polygonid': ['0x1', '0x5', '0x89', '0x13881'], - 'did:iden3': ['0x1', '0x5', '0x89', '0x13881'], + 'did:polygonid': ['0x1', '0x89', '0x13881'], + 'did:iden3': ['0x1', '0x89', '0x13881'], }; export function getAvailableNetworksList(method: string): string[] { diff --git a/packages/docs/docs/integrate-masca/masca-connector.md b/packages/docs/docs/integrate-masca/masca-connector.md index a2fc790ad..068587650 100644 --- a/packages/docs/docs/integrate-masca/masca-connector.md +++ b/packages/docs/docs/integrate-masca/masca-connector.md @@ -136,7 +136,7 @@ const payload: MinimalUnsignedCredential = { type: ['VerifiableCredential', 'Test Certificate'], credentialSubject: { accomplishmentType: 'Test Certificate', - id: 'did:ethr:goerli:0x123...321', + id: 'did:ethr:sepolia:0x123...321', }, credentialSchema: { id: 'https://beta.api.schemas.serto.id/v1/public/program-completion-certificate/1.0/json-schema.json', diff --git a/packages/docs/docs/integrate-masca/rpc-methods.md b/packages/docs/docs/integrate-masca/rpc-methods.md index 30d1ef5b7..48ff3ece6 100644 --- a/packages/docs/docs/integrate-masca/rpc-methods.md +++ b/packages/docs/docs/integrate-masca/rpc-methods.md @@ -155,7 +155,7 @@ const payload: MinimalUnsignedCredential = { type: ['VerifiableCredential', 'TestCertificate'], credentialSubject: { accomplishmentType: 'Test Certificate', - id: 'did:ethr:goerli:0x123...321', + id: 'did:ethr:sepolia:0x123...321', }, credentialSchema: { id: 'https://beta.api.schemas.serto.id/v1/public/program-completion-certificate/1.0/json-schema.json', diff --git a/packages/snap/index.html b/packages/snap/index.html index 906f4a3b7..6f3b2d5c6 100644 --- a/packages/snap/index.html +++ b/packages/snap/index.html @@ -7,625 +7,5 @@

Hello, Masca!

-
- Instructions -
    -
  • First, click "Connect". Then, try out the other buttons!
  • -
  • Please note that:
  • -
      -
    • - If you want to generate a VP you need a VC ID. To get it, you need a - VC saved in MetaMask state (use Save VC). Then you need to retrieve - id of VC by using Get VCS button and searching for "key" property in - the console. -
    • -
    -
-
-
- - - -
-
- -
-
- -
- - - -
-
- -
- -
-
- - With challenge - - - - -
-
- - -
-
- - - -
-
- -
-
- - -
-
- - - -
-
- - -
- - - diff --git a/packages/snap/package.json b/packages/snap/package.json index 73a0c9839..19bc48094 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -64,7 +64,6 @@ "@blockchain-lab-um/utils": "1.3.7", "@blockchain-lab-um/veramo-datamanager": "1.0.1-beta.0", "@ceramicnetwork/http-client": "2.27.0", - "@ethersproject/providers": "^5.7.2", "@glazed/did-datastore": "0.3.2", "@iden3/js-iden3-core": "1.0.1", "@iden3/js-jwz": "1.0.1", diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 6e75a922e..9ad3f29f1 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -26,7 +26,7 @@ "./files/circuits/credentialAtomicQuerySigV2/circuit_final.zkey", "./files/circuits/credentialAtomicQuerySigV2/verification_key.json" ], - "shasum": "1rYyqwvViVUs+jqS94nxtW9HebI92Udp8veNtLP5L+8=" + "shasum": "WcGYh+wxUGmNhtRywe2CtCMeSCk2kSi4GMm+tLoE4No=" }, "initialPermissions": { "endowment:ethereum-provider": {}, diff --git a/packages/snap/src/polygon-id/Polygon.service.ts b/packages/snap/src/polygon-id/Polygon.service.ts index 750fa3b09..7484d1088 100644 --- a/packages/snap/src/polygon-id/Polygon.service.ts +++ b/packages/snap/src/polygon-id/Polygon.service.ts @@ -79,33 +79,26 @@ class PolygonService { DidMethod.Iden3 | DidMethod.PolygonId, Record< Blockchain.Ethereum | Blockchain.Polygon, - Record< - NetworkId.Main | NetworkId.Goerli | NetworkId.Mumbai, - PolygonServicBaseInstance - > + Record > > = { polygonid: { eth: { main: {} as PolygonServicBaseInstance, - goerli: {} as PolygonServicBaseInstance, mumbai: {} as PolygonServicBaseInstance, }, polygon: { main: {} as PolygonServicBaseInstance, - goerli: {} as PolygonServicBaseInstance, mumbai: {} as PolygonServicBaseInstance, }, }, iden3: { eth: { main: {} as PolygonServicBaseInstance, - goerli: {} as PolygonServicBaseInstance, mumbai: {} as PolygonServicBaseInstance, }, polygon: { main: {} as PolygonServicBaseInstance, - goerli: {} as PolygonServicBaseInstance, mumbai: {} as PolygonServicBaseInstance, }, }, @@ -132,10 +125,6 @@ class PolygonService { !( blockchain === Blockchain.Ethereum && networkId === NetworkId.Mumbai - ) && - !( - blockchain === Blockchain.Polygon && - networkId === NetworkId.Goerli ) ) { this.instance[method][blockchain][networkId] = @@ -211,7 +200,7 @@ class PolygonService { static async createBaseInstance(params: { method: DidMethod.Iden3 | DidMethod.PolygonId; blockchain: Blockchain.Ethereum | Blockchain.Polygon; - networkId: NetworkId.Main | NetworkId.Goerli | NetworkId.Mumbai; + networkId: NetworkId.Main | NetworkId.Mumbai; circuitData: CircuitData; }) { const { method, blockchain, networkId, circuitData } = params; @@ -281,10 +270,6 @@ class PolygonService { !( blockchain === Blockchain.Ethereum && networkId === NetworkId.Mumbai - ) && - !( - blockchain === Blockchain.Polygon && - networkId === NetworkId.Goerli ) ) { const { credWallet } = this.instance[method][blockchain][networkId]; @@ -315,10 +300,6 @@ class PolygonService { !( blockchain === Blockchain.Ethereum && networkId === NetworkId.Mumbai - ) && - !( - blockchain === Blockchain.Polygon && - networkId === NetworkId.Goerli ) ) { const { credWallet } = this.instance[method][blockchain][networkId]; @@ -406,7 +387,7 @@ class PolygonService { static async createWallet(params: { method: DidMethod.Iden3 | DidMethod.PolygonId; blockchain: Blockchain.Ethereum | Blockchain.Polygon; - networkId: NetworkId.Main | NetworkId.Goerli | NetworkId.Mumbai; + networkId: NetworkId.Main | NetworkId.Mumbai; }) { const { method, blockchain, networkId } = params; const state = StorageService.get(); diff --git a/packages/snap/src/polygon-id/constants.ts b/packages/snap/src/polygon-id/constants.ts index 9d0ff845b..b8ef3a680 100644 --- a/packages/snap/src/polygon-id/constants.ts +++ b/packages/snap/src/polygon-id/constants.ts @@ -6,8 +6,7 @@ export const RHS_URL = 'https://rhs-staging.polygonid.me'; export const POLYGON_MAINNET_RPC_URL = 'https://polygon.llamarpc.com'; export const POLYGON_MUMBAI_RPC_URL = 'https://polygon-mumbai.blockpi.network/v1/rpc/public'; -export const ETH_GOERLI_RPC_URL = - 'https://goerli.blockpi.network/v1/rpc/public '; + export const ETH_MAINNET_RPC_URL = 'https://eth.llamarpc.com'; export const CONTRACT_POLYGON_MAINNET = @@ -34,8 +33,6 @@ export const getDefaultEthConnectionConfig = ( } else if (blockchain === Blockchain.Ethereum) { if (networkId === NetworkId.Main) { url = ETH_MAINNET_RPC_URL; - } else if (networkId === NetworkId.Goerli) { - url = ETH_GOERLI_RPC_URL; } } @@ -61,21 +58,13 @@ export const getDefaultEthConnectionConfig = ( export const METHODS = [DidMethod.PolygonId, DidMethod.Iden3] as const; export const BLOCKCHAINS = [Blockchain.Polygon, Blockchain.Ethereum] as const; -export const NETWORKS = [ - NetworkId.Mumbai, - NetworkId.Main, - NetworkId.Goerli, -] as const; +export const NETWORKS = [NetworkId.Mumbai, NetworkId.Main] as const; export const CHAIN_ID_TO_BLOCKCHAIN_AND_NETWORK_ID = { '0x1': { blockchain: Blockchain.Ethereum, networkId: NetworkId.Main, }, - '0x5': { - blockchain: Blockchain.Ethereum, - networkId: NetworkId.Goerli, - }, '0x89': { blockchain: Blockchain.Polygon, networkId: NetworkId.Main, diff --git a/packages/snap/src/polygon-id/storage/SnapDataSource.ts b/packages/snap/src/polygon-id/storage/SnapDataSource.ts index 062bb0dc9..82b495961 100644 --- a/packages/snap/src/polygon-id/storage/SnapDataSource.ts +++ b/packages/snap/src/polygon-id/storage/SnapDataSource.ts @@ -11,10 +11,7 @@ export class SnapDataSource implements IDataSource { private readonly account: string, private readonly method: DidMethod.Iden3 | DidMethod.PolygonId, private readonly blockchain: Blockchain.Ethereum | Blockchain.Polygon, - private readonly networkId: - | NetworkId.Main - | NetworkId.Goerli - | NetworkId.Mumbai, + private readonly networkId: NetworkId.Main | NetworkId.Mumbai, private readonly STORAGE_KEY: StorageKey ) {} diff --git a/packages/snap/src/polygon-id/storage/SnapMerkleTreeStorage.ts b/packages/snap/src/polygon-id/storage/SnapMerkleTreeStorage.ts index 1ca9542af..9cf67ed2f 100644 --- a/packages/snap/src/polygon-id/storage/SnapMerkleTreeStorage.ts +++ b/packages/snap/src/polygon-id/storage/SnapMerkleTreeStorage.ts @@ -23,10 +23,7 @@ export class SnapMerkleTreeStorage implements IMerkleTreeStorage { private readonly account: string, private readonly method: DidMethod.Iden3 | DidMethod.PolygonId, private readonly blockchain: Blockchain.Ethereum | Blockchain.Polygon, - private readonly networkId: - | NetworkId.Main - | NetworkId.Goerli - | NetworkId.Mumbai, + private readonly networkId: NetworkId.Main | NetworkId.Mumbai, private readonly depth: number ) {} diff --git a/packages/snap/src/polygon-id/storage/SnapTreeStorage.ts b/packages/snap/src/polygon-id/storage/SnapTreeStorage.ts index 8afa93a91..8b4356e3e 100644 --- a/packages/snap/src/polygon-id/storage/SnapTreeStorage.ts +++ b/packages/snap/src/polygon-id/storage/SnapTreeStorage.ts @@ -28,10 +28,7 @@ export class SnapTreeStorage implements ITreeStorage { private readonly account: string, private readonly method: DidMethod.Iden3 | DidMethod.PolygonId, private readonly blockchain: Blockchain.Ethereum | Blockchain.Polygon, - private readonly networkId: - | NetworkId.Main - | NetworkId.Goerli - | NetworkId.Mumbai, + private readonly networkId: NetworkId.Main | NetworkId.Mumbai, private readonly prefix: Bytes ) { this.currentRoot = ZERO_HASH; diff --git a/packages/snap/src/utils/config.ts b/packages/snap/src/utils/config.ts index d40592470..15eb6f0cc 100644 --- a/packages/snap/src/utils/config.ts +++ b/packages/snap/src/utils/config.ts @@ -21,25 +21,21 @@ const emptyPolygonState: PolygonState = { polygonid: { eth: { main: cloneDeep(emptyPolygonBaseState), - goerli: cloneDeep(emptyPolygonBaseState), mumbai: cloneDeep(emptyPolygonBaseState), // To satisfy the type checker }, polygon: { main: cloneDeep(emptyPolygonBaseState), mumbai: cloneDeep(emptyPolygonBaseState), - goerli: cloneDeep(emptyPolygonBaseState), // To satisfy the type checker }, }, iden3: { eth: { main: cloneDeep(emptyPolygonBaseState), - goerli: cloneDeep(emptyPolygonBaseState), mumbai: cloneDeep(emptyPolygonBaseState), // To satisfy the type checker }, polygon: { main: cloneDeep(emptyPolygonBaseState), mumbai: cloneDeep(emptyPolygonBaseState), - goerli: cloneDeep(emptyPolygonBaseState), // To satisfy the type checker }, }, }; diff --git a/packages/snap/src/veramo/Veramo.service.ts b/packages/snap/src/veramo/Veramo.service.ts index 189468311..a81936881 100644 --- a/packages/snap/src/veramo/Veramo.service.ts +++ b/packages/snap/src/veramo/Veramo.service.ts @@ -967,10 +967,6 @@ class VeramoService { name: 'mainnet', provider: new BrowserProvider(ethereum as any), }, - { - name: 'goerli', - provider: new BrowserProvider(ethereum as any), - }, { name: 'sepolia', provider: new BrowserProvider(ethereum as any), diff --git a/packages/snap/tests/data/constants.ts b/packages/snap/tests/data/constants.ts index bdbfda36c..3da0e3498 100644 --- a/packages/snap/tests/data/constants.ts +++ b/packages/snap/tests/data/constants.ts @@ -82,7 +82,7 @@ export const resolutionInvalidDID = { didDocument: null, didResolutionMetadata: { error: 'invalidDid', - message: 'Not a valid did:ethr: 0x5:0x123', + message: 'Not a valid did:ethr: 0x1:0x123', }, didDocumentMetadata: {}, }; diff --git a/packages/snap/tests/data/verifiable-credentials/exampleJSONLD.json b/packages/snap/tests/data/verifiable-credentials/exampleJSONLD.json index 02219b8a5..78a9d26b1 100644 --- a/packages/snap/tests/data/verifiable-credentials/exampleJSONLD.json +++ b/packages/snap/tests/data/verifiable-credentials/exampleJSONLD.json @@ -14,7 +14,7 @@ "learnerName": "Bob", "achievement": "Certified Solidity Developer 2", "courseProvider": "https://blockchain-lab.um.si/", - "id": "did:ethr:goerli:0xb6665128ee91d84590f70c3268765384a9cafbcd" + "id": "did:ethr:sepolia:0xb6665128ee91d84590f70c3268765384a9cafbcd" }, "proof": { "type": "Ed25519Signature2018", diff --git a/packages/snap/tests/helpers/snapMock.ts b/packages/snap/tests/helpers/snapMock.ts index c07e1fd85..174b3806b 100644 --- a/packages/snap/tests/helpers/snapMock.ts +++ b/packages/snap/tests/helpers/snapMock.ts @@ -51,8 +51,8 @@ export class SnapMock implements ISnapMock { } private async snapEthCall(data: any[]): Promise { - const apiKey = 'NRFBwig_CLVL0WnQLY3dUo8YkPmW-7iN'; - const provider = new AlchemyProvider('goerli', apiKey); + const apiKey = 'onEdpQuHfIjaPMc0c5G0Nf8V_ajHh0We'; + const provider = new AlchemyProvider('mainnet', apiKey); return provider.call({ ...data[0], blockTag: data[1], @@ -60,8 +60,8 @@ export class SnapMock implements ISnapMock { } private async snapEthLogs(data: any[]): Promise { - const apiKey = 'NRFBwig_CLVL0WnQLY3dUo8YkPmW-7iN'; - const provider = new AlchemyProvider('goerli', apiKey); + const apiKey = 'onEdpQuHfIjaPMc0c5G0Nf8V_ajHh0We'; + const provider = new AlchemyProvider('mainnet', apiKey); return provider.getLogs(data[0] as Filter); } @@ -69,7 +69,7 @@ export class SnapMock implements ISnapMock { snap_dialog: vi.fn().mockReturnValue(true), eth_requestAccounts: vi.fn().mockResolvedValue([account]), eth_chainId: vi.fn().mockResolvedValue('0x1'), - net_version: vi.fn().mockResolvedValue('5'), + net_version: vi.fn().mockResolvedValue('1'), snap_getBip44Entropy: vi .fn() .mockImplementation(async (params: { coinType: number }) => { diff --git a/packages/snap/tests/unit/Veramo.service.spec.ts b/packages/snap/tests/unit/Veramo.service.spec.ts index 462db7837..75e033f4d 100644 --- a/packages/snap/tests/unit/Veramo.service.spec.ts +++ b/packages/snap/tests/unit/Veramo.service.spec.ts @@ -760,7 +760,7 @@ describe('Veramo Service', () => { }); it('should resolve invalid did', async () => { - const didDoc = await VeramoService.resolveDID('did:ethr:0x5:0x123'); + const didDoc = await VeramoService.resolveDID('did:ethr:0x1:0x123'); expect(didDoc).toEqual(resolutionInvalidDID); expect.assertions(1); }); diff --git a/packages/types/src/state.ts b/packages/types/src/state.ts index 72b1c4db0..deabb5d02 100644 --- a/packages/types/src/state.ts +++ b/packages/types/src/state.ts @@ -72,9 +72,6 @@ export type PolygonState = Record< DidMethod.Iden3 | DidMethod.PolygonId, Record< Blockchain.Ethereum | Blockchain.Polygon, - Record< - NetworkId.Main | NetworkId.Goerli | NetworkId.Mumbai, - PolygonBaseState - > + Record > >; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89a89dd62..cd40e8052 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -390,17 +390,14 @@ importers: packages/dapp: dependencies: '@blockchain-lab-um/did-provider-key': - specifier: 1.0.7 - version: 1.0.7(encoding@0.1.13) + specifier: 1.0.8-beta.0 + version: link:../../libs/did-provider-key '@blockchain-lab-um/masca-connector': specifier: 1.2.2-beta.0 version: link:../connector '@blockchain-lab-um/oidc-types': specifier: 0.0.8 version: link:../../libs/oidc/types - '@ethersproject/providers': - specifier: ^5.7.2 - version: 5.7.2 '@headlessui/react': specifier: ^1.7.17 version: 1.7.17(react-dom@18.2.0)(react@18.2.0) @@ -737,9 +734,6 @@ importers: '@ceramicnetwork/http-client': specifier: 2.27.0 version: 2.27.0 - '@ethersproject/providers': - specifier: ^5.7.2 - version: 5.7.2 '@glazed/did-datastore': specifier: 0.3.2 version: 0.3.2 @@ -3013,33 +3007,6 @@ packages: resolution: {integrity: sha512-R524tD5VwOt3QRHr7N518nqTVR/HKgfWL4LypekcGuNQN8R4PWScvuRcRzrY39A28kLztMv+TJdiKuMNbkU1ug==} engines: {node: '>=8.9'} - /@blockchain-lab-um/did-provider-key@1.0.7(encoding@0.1.13): - resolution: {integrity: sha512-pkWO0llegx4mPzeiEG6ZJZekuJ/+mriGQ1MNK6Pgc4mnzxuvCBjyG+8eZpcpR98gInENfSz4bDb0lqHQ93xkHQ==} - dependencies: - '@blockchain-lab-um/utils': 1.3.6(encoding@0.1.13) - '@cef-ebsi/key-did-resolver': 1.1.0 - '@stablelib/ed25519': 1.0.3 - '@veramo/core': 5.4.1 - '@veramo/did-manager': 5.4.1 - did-resolver: 4.1.0 - transitivePeerDependencies: - - encoding - - supports-color - dev: false - - /@blockchain-lab-um/utils@1.3.6(encoding@0.1.13): - resolution: {integrity: sha512-pQLflCwhzuV8tYtJW2DNdx0WqjrsKiH6QUGdWMTRPBIIxDKqOvHNLfxw29SG2FXX2JcfrTqNG80aX+qCdAdlfg==} - dependencies: - '@veramo/utils': 5.4.1(encoding@0.1.13) - did-resolver: 4.1.0 - elliptic: 6.5.4 - multiformats: 11.0.2 - secp256k1: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - dev: false - /@cef-ebsi/ebsi-did-resolver@3.2.0: resolution: {integrity: sha512-4wM5TK5l6xRBSkOCEZRP64Xqsd0BqmvjfSpREn8fXbrpMZqOafku77YQSMzqFmOIQ62HSEi5Vf4CSzDHAmalig==} engines: {node: '>=16.10.0'} @@ -10066,7 +10033,6 @@ packages: - encoding - supports-color - utf-8-validate - optional: true /@react-native-community/cli-plugin-metro@11.3.7(@babel/core@7.23.2)(encoding@0.1.13): resolution: {integrity: sha512-0WhgoBVGF1f9jXcuagQmtxpwpfP+2LbLZH4qMyo6OtYLWLG13n2uRep+8tdGzfNzl1bIuUTeE9yZSAdnf9LfYQ==} @@ -10088,6 +10054,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /@react-native-community/cli-server-api@11.3.7(encoding@0.1.13): resolution: {integrity: sha512-yoFyGdvR3HxCnU6i9vFqKmmSqFzCbnFSnJ29a+5dppgPRetN+d//O8ard/YHqHzToFnXutAFf2neONn23qcJAg==} @@ -10155,7 +10122,6 @@ packages: - encoding - supports-color - utf-8-validate - optional: true /@react-native-community/cli@11.3.7(@babel/core@7.23.2)(encoding@0.1.13): resolution: {integrity: sha512-Ou8eDlF+yh2rzXeCTpMPYJ2fuqsusNOhmpYPYNQJQ2h6PvaF30kPomflgRILems+EBBuggRtcT+I+1YH4o/q6w==} @@ -10185,6 +10151,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /@react-native/assets-registry@0.72.0: resolution: {integrity: sha512-Im93xRJuHHxb1wniGhBMsxLwcfzdYreSZVQGDoMJgkd6+Iky61LInGEHnQCTN0fKNYF1Dvcofb4uMmE1RQHXHQ==} @@ -10222,7 +10189,7 @@ packages: dependencies: invariant: 2.2.4 nullthrows: 1.1.1 - react-native: 0.72.6(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(encoding@0.1.13)(react@18.2.0) + react-native: 0.72.6(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(react@18.2.0) /@react-oauth/google@0.11.1(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-tywZisXbsdaRBVbEu0VX6dRbOSL2I6DgY97woq5NMOOOz+xtDsm418vqq+Vx10KMtra3kdHMRMf0hXLWrk2RMg==} @@ -12525,17 +12492,6 @@ packages: transitivePeerDependencies: - supports-color - /@veramo/core@5.4.1: - resolution: {integrity: sha512-qmd/0lYKuxZyT3N85VrRe6XwJDRqs+NRHFbWnO9T+/G2LGu1P/VBKeHNdPaLHTK4jTyfkyXTwHc2513T1Tvfjg==} - dependencies: - '@veramo/core-types': 5.5.3 - debug: 4.3.4 - events: 3.3.0 - z-schema: 6.0.1 - transitivePeerDependencies: - - supports-color - dev: false - /@veramo/core@5.5.3: resolution: {integrity: sha512-Z74AaGJB6syijEr+GgdlIf+4pXB46BDHKWEnL3ca1HOLmfCiZgpO94dl27+x+tMWBKQAGs0fEJj2yQQengre1g==} dependencies: @@ -12716,15 +12672,6 @@ packages: - supports-color dev: false - /@veramo/did-manager@5.4.1: - resolution: {integrity: sha512-6Tz5elqYt/k7POT7rB6qZ/wsf6/uu5P1bRHk55eti+5u67PQF8/4/EqoLf4vxXCNk8fC+vttASpGQrCj74cnog==} - dependencies: - '@veramo/core-types': 5.5.3 - '@veramo/did-discovery': 5.5.3 - transitivePeerDependencies: - - supports-color - dev: false - /@veramo/did-manager@5.5.3: resolution: {integrity: sha512-nDmoZV0MV5fyjn0ApSh0wgTb9cSuVIRa4lUbkOG1P/7TkQMunPsQk3gw95tflEU5B/m7CClCUiKwk8qh8Mf8kw==} dependencies: @@ -12911,27 +12858,6 @@ packages: - supports-color dev: false - /@veramo/utils@5.4.1(encoding@0.1.13): - resolution: {integrity: sha512-9TcONSD1PKxrlU3frE/Vp33wTauTsoTSLK0ubWEkzxeH9XYVgXhhe4jRBVfYS2aRz4nCNYesfWNgiX2QYSV+IQ==} - dependencies: - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@veramo/core-types': 5.5.3 - credential-status: 2.0.6 - cross-fetch: 3.1.8(patch_hash=o7exbxzvysudd5km3yp6v3mgsi)(encoding@0.1.13) - debug: 4.3.4 - did-jwt: 7.4.4 - did-jwt-vc: 3.2.13 - did-resolver: 4.1.0 - multiformats: 12.1.3 - uint8arrays: 4.0.6 - transitivePeerDependencies: - - encoding - - supports-color - dev: false - /@veramo/utils@5.5.3: resolution: {integrity: sha512-ZvlMiO2KB7qScfy68+ubjY/9z42u4aK8Yd0bn498cUD2emCLg94gnpi9bw0ntLR4fIarSfwT9dt5kepjGZ/nPw==} dependencies: @@ -22694,7 +22620,6 @@ packages: - encoding - supports-color - utf-8-validate - optional: true /metro-config@0.76.8(encoding@0.1.13): resolution: {integrity: sha512-SL1lfKB0qGHALcAk2zBqVgQZpazDYvYFGwCK1ikz0S6Y/CM2i2/HwuZN31kpX6z3mqjv/6KvlzaKoTb1otuSAA==} @@ -22712,6 +22637,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /metro-core@0.76.8: resolution: {integrity: sha512-sl2QLFI3d1b1XUUGxwzw/KbaXXU/bvFYrSKz6Sg19AdYGWFyzsgZ1VISRIDf+HWm4R/TJXluhWMEkEtZuqi3qA==} @@ -22904,7 +22830,6 @@ packages: - encoding - supports-color - utf-8-validate - optional: true /metro-transform-worker@0.76.8(encoding@0.1.13): resolution: {integrity: sha512-mE1fxVAnJKmwwJyDtThildxxos9+DGs9+vTrx2ktSFMEVTtXS/bIv2W6hux1pqivqAfyJpTeACXHk5u2DgGvIQ==} @@ -22927,6 +22852,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /metro@0.76.8: resolution: {integrity: sha512-oQA3gLzrrYv3qKtuWArMgHPbHu8odZOD9AoavrqSFllkPgOtmkBvNNDLCELqv5SjBfqjISNffypg+5UGG3y0pg==} @@ -22986,7 +22912,6 @@ packages: - encoding - supports-color - utf-8-validate - optional: true /metro@0.76.8(encoding@0.1.13): resolution: {integrity: sha512-oQA3gLzrrYv3qKtuWArMgHPbHu8odZOD9AoavrqSFllkPgOtmkBvNNDLCELqv5SjBfqjISNffypg+5UGG3y0pg==} @@ -23046,6 +22971,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /micro-ftch@0.3.1: resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} @@ -25765,6 +25691,7 @@ packages: - encoding - supports-color - utf-8-validate + dev: false /react-native@0.72.6(@babel/core@7.23.2)(@babel/preset-env@7.23.2)(react@18.2.0): resolution: {integrity: sha512-RafPY2gM7mcrFySS8TL8x+TIO3q7oAlHpzEmC7Im6pmXni6n1AuufGaVh0Narbr1daxstw7yW7T9BKW5dpVc2A==} @@ -25817,7 +25744,6 @@ packages: - encoding - supports-color - utf-8-validate - optional: true /react-refresh@0.4.3: resolution: {integrity: sha512-Hwln1VNuGl/6bVwnd0Xdn1e84gT/8T9aYNL+HAKDArLCS7LWjwr7StE30IEYbIkx0Vi3vs+coQxe+SQDbGbbpA==}