diff --git a/packages/get-starknet/package.json b/packages/get-starknet/package.json index 27abb9b0..c36f5b4e 100644 --- a/packages/get-starknet/package.json +++ b/packages/get-starknet/package.json @@ -53,6 +53,6 @@ "registry": "https://registry.npmjs.org/" }, "dependencies": { - "starknet": "^5.14.0" + "starknet": "6.11.0" } } diff --git a/packages/get-starknet/src/accounts.ts b/packages/get-starknet/src/accounts.ts index 96d52c47..f51558a5 100644 --- a/packages/get-starknet/src/accounts.ts +++ b/packages/get-starknet/src/accounts.ts @@ -36,10 +36,13 @@ export class MetaMaskAccount extends Account { async execute( calls: AllowArray, - abis?: Abi[] | undefined, + abisOrTransactionsDetail?: Abi[] | InvocationsDetails, transactionsDetail?: InvocationsDetails, ): Promise { - return this.#snap.execute(this.#address, calls, abis, transactionsDetail); + if (!transactionsDetail) { + return this.#snap.execute(this.#address, calls, undefined, abisOrTransactionsDetail as InvocationsDetails); + } + return this.#snap.execute(this.#address, calls, abisOrTransactionsDetail as Abi[], transactionsDetail); } async signMessage(typedData: TypedData): Promise { diff --git a/packages/get-starknet/src/wallet.ts b/packages/get-starknet/src/wallet.ts index 0a86214a..a24c81ca 100644 --- a/packages/get-starknet/src/wallet.ts +++ b/packages/get-starknet/src/wallet.ts @@ -117,9 +117,7 @@ export class MetaMaskSnapWallet implements IStarknetWindowObject { async #getRPCProvider(network: { chainId: string; nodeUrl: string }) { return new Provider({ - rpc: { - nodeUrl: network.nodeUrl, - }, + nodeUrl: network.nodeUrl, }); } diff --git a/packages/starknet-snap/package.json b/packages/starknet-snap/package.json index 096dd973..9dd71d74 100644 --- a/packages/starknet-snap/package.json +++ b/packages/starknet-snap/package.json @@ -43,7 +43,7 @@ "async-mutex": "^0.3.2", "ethereum-unit-converter": "^0.0.17", "ethers": "^5.5.1", - "starknet": "6.7.0", + "starknet": "6.11.0", "starknet_v4.22.0": "npm:starknet@4.22.0" }, "devDependencies": { diff --git a/packages/starknet-snap/snap.manifest.json b/packages/starknet-snap/snap.manifest.json index 89e1c0c6..8b5c0c28 100644 --- a/packages/starknet-snap/snap.manifest.json +++ b/packages/starknet-snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/ConsenSys/starknet-snap.git" }, "source": { - "shasum": "QTghmF19ZVAMHyKpyNlzjdwLvzrP6RHVWLfZzZHjynU=", + "shasum": "uG3NeaD7Ky06SZo9Hnx1KWn5EjavmUJC5VBSY/sqctM=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/starknet-snap/src/index.ts b/packages/starknet-snap/src/index.ts index 93edbcd4..dfaa4e4e 100644 --- a/packages/starknet-snap/src/index.ts +++ b/packages/starknet-snap/src/index.ts @@ -55,7 +55,6 @@ import { ETHER_MAINNET, ETHER_SEPOLIA_TESTNET, PRELOADED_TOKENS, - STARKNET_INTEGRATION_NETWORK, STARKNET_MAINNET_NETWORK, STARKNET_SEPOLIA_TESTNET_NETWORK, STARKNET_TESTNET_NETWORK, @@ -89,8 +88,6 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { logger.log(`${request.method}:\nrequestParams: ${toJson(requestParams)}`); try { - const isDev = Boolean(requestParams?.isDev); - if (request.method === 'ping') { logger.log('pong'); return 'pong'; @@ -120,16 +117,12 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => { } // pre-inserted the default networks and tokens await upsertNetwork(STARKNET_MAINNET_NETWORK, snap, saveMutex, state); - if (isDev) { - await upsertNetwork(STARKNET_INTEGRATION_NETWORK, snap, saveMutex, state); - } else { - await upsertNetwork( - STARKNET_SEPOLIA_TESTNET_NETWORK, - snap, - saveMutex, - state, - ); - } + await upsertNetwork( + STARKNET_SEPOLIA_TESTNET_NETWORK, + snap, + saveMutex, + state, + ); // remove the testnet network (migration) await removeNetwork(STARKNET_TESTNET_NETWORK, snap, saveMutex, state); diff --git a/packages/starknet-snap/src/types/snapApi.ts b/packages/starknet-snap/src/types/snapApi.ts index 532310e9..34b782e3 100644 --- a/packages/starknet-snap/src/types/snapApi.ts +++ b/packages/starknet-snap/src/types/snapApi.ts @@ -54,7 +54,6 @@ export type ApiRequestParams = export type BaseRequestParams = { chainId?: string; - isDev?: boolean; debugLevel?: string; }; diff --git a/packages/starknet-snap/src/utils/constants.ts b/packages/starknet-snap/src/utils/constants.ts index 00865193..4db722ce 100644 --- a/packages/starknet-snap/src/utils/constants.ts +++ b/packages/starknet-snap/src/utils/constants.ts @@ -71,15 +71,6 @@ export const STARKNET_SEPOLIA_TESTNET_NETWORK: Network = { accountClassHash: '', // from argent-x repo }; -export const STARKNET_INTEGRATION_NETWORK: Network = { - name: 'Goerli Integration', - chainId: constants.StarknetChainId.SN_GOERLI, - baseUrl: 'https://external.integration.starknet.io', - nodeUrl: '', - voyagerUrl: '', - accountClassHash: '', -}; - export const ETHER_MAINNET: Erc20Token = { address: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', name: 'Ether', @@ -182,7 +173,6 @@ export const PRELOADED_TOKENS = [ export const PRELOADED_NETWORKS = [ STARKNET_MAINNET_NETWORK, STARKNET_SEPOLIA_TESTNET_NETWORK, - STARKNET_INTEGRATION_NETWORK, ]; export const PROXY_CONTRACT_HASH = diff --git a/packages/starknet-snap/test/constants.test.ts b/packages/starknet-snap/test/constants.test.ts index 1114a173..a96d38b4 100644 --- a/packages/starknet-snap/test/constants.test.ts +++ b/packages/starknet-snap/test/constants.test.ts @@ -83,7 +83,7 @@ export const Cairo1Account1: AccContract = { '0x5bc00132b8f2fc0f673dc232594b26727e712b204a2716f9dc28a8c5f607b5e', publicKey: '0x019e59f349e1aa813ab4556c5836d0472e5e1ae82d1e5c3b3e8aabfeb290befd', - chainId: constants.StarknetChainId.SN_GOERLI, + chainId: constants.StarknetChainId.SN_SEPOLIA, }; export const token0: Erc20Token = { diff --git a/packages/wallet-ui/package.json b/packages/wallet-ui/package.json index 44ec1459..5837bb31 100644 --- a/packages/wallet-ui/package.json +++ b/packages/wallet-ui/package.json @@ -65,7 +65,7 @@ "react-redux": "^8.0.1", "redux-persist": "^6.0.0", "semver": "^7.5.2", - "starknet": "^4.22.0", + "starknet": "6.11.0", "styled-components": "^5.3.5", "toastr2": "^3.0.0-alpha.18", "web-vitals": "^2.1.4" diff --git a/packages/wallet-ui/src/components/ui/molecule/AmountInput/AmountInput.stories.tsx b/packages/wallet-ui/src/components/ui/molecule/AmountInput/AmountInput.stories.tsx index 5f04d774..8ae157ad 100644 --- a/packages/wallet-ui/src/components/ui/molecule/AmountInput/AmountInput.stories.tsx +++ b/packages/wallet-ui/src/components/ui/molecule/AmountInput/AmountInput.stories.tsx @@ -11,7 +11,7 @@ export default { const asset = { address: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', amount: BigNumber.from('1000000000000000000'), - chainId: constants.StarknetChainId.TESTNET, + chainId: constants.StarknetChainId.SN_SEPOLIA, decimals: 18, name: 'Ether', symbol: 'ETH', diff --git a/packages/wallet-ui/src/components/ui/molecule/AssetsList/AssetListItem/AssetListItem.stories.tsx b/packages/wallet-ui/src/components/ui/molecule/AssetsList/AssetListItem/AssetListItem.stories.tsx index d8364a52..273451e8 100644 --- a/packages/wallet-ui/src/components/ui/molecule/AssetsList/AssetListItem/AssetListItem.stories.tsx +++ b/packages/wallet-ui/src/components/ui/molecule/AssetsList/AssetListItem/AssetListItem.stories.tsx @@ -12,7 +12,7 @@ export default { const asset: Erc20TokenBalance = { address: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7', amount: BigNumber.from('1000000000000000000'), - chainId: constants.StarknetChainId.TESTNET, + chainId: constants.StarknetChainId.SN_SEPOLIA, decimals: 18, name: 'Ether', symbol: 'ETH', diff --git a/packages/wallet-ui/src/utils/constants.ts b/packages/wallet-ui/src/utils/constants.ts index 19b89eff..41343aca 100644 --- a/packages/wallet-ui/src/utils/constants.ts +++ b/packages/wallet-ui/src/utils/constants.ts @@ -4,7 +4,7 @@ import { constants } from 'starknet'; export const SEPOLIA_CHAINID = '0x534e5f5345504f4c4941'; export const TOKENS: any = { - [constants.StarknetChainId.MAINNET]: { + [constants.StarknetChainId.SN_MAIN]: { '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7': { coingeckoId: 'ethereum', }, diff --git a/packages/wallet-ui/src/utils/utils.ts b/packages/wallet-ui/src/utils/utils.ts index 116a23fb..eb431999 100644 --- a/packages/wallet-ui/src/utils/utils.ts +++ b/packages/wallet-ui/src/utils/utils.ts @@ -28,7 +28,7 @@ export const openExplorerTab = ( ) => { let explorerUrl = STARKNET_SEPOLIA_TESTNET_EXPLORER; switch (chainId) { - case constants.StarknetChainId.MAINNET: + case constants.StarknetChainId.SN_MAIN: explorerUrl = STARKNET_MAINNET_EXPLORER; break; case SEPOLIA_CHAINID: diff --git a/yarn.lock b/yarn.lock index fac3e595..d562515f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2205,7 +2205,7 @@ __metadata: prettier: ^2.7.1 rimraf: ^3.0.2 serve: 14.2.1 - starknet: ^5.14.0 + starknet: 6.11.0 ts-loader: ^9.5.1 typescript: ^4.6.3 webpack: ^5.91.0 @@ -2216,16 +2216,16 @@ __metadata: "@consensys/starknet-snap@file:../starknet-snap::locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui": version: 2.9.0 - resolution: "@consensys/starknet-snap@file:../starknet-snap#../starknet-snap::hash=76fd8f&locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui" + resolution: "@consensys/starknet-snap@file:../starknet-snap#../starknet-snap::hash=9f1103&locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui" dependencies: "@metamask/key-tree": 9.0.0 "@metamask/snaps-sdk": ^4.0.0 async-mutex: ^0.3.2 ethereum-unit-converter: ^0.0.17 ethers: ^5.5.1 - starknet: 6.7.0 + starknet: 6.11.0 starknet_v4.22.0: "npm:starknet@4.22.0" - checksum: df615cff6622e344c47f06f2cf8a2aade8277887aca0b84eb607a01be5f591049c9033bfed7a63f5905bdb54ab01758fb4f55c02e4efe5dee4d010889ebe6e1f + checksum: f517ec66c4ac9d0073711e4ca6a92bfd6cf2fc0ab288d2e438dd748ca0f1729292d205810f9d3677a67d9668de6e2cec4eb9c26193e8f01fdf085bc725674a39 languageName: node linkType: hard @@ -2271,7 +2271,7 @@ __metadata: rimraf: ^3.0.2 sinon: ^13.0.2 sinon-chai: ^3.7.0 - starknet: 6.7.0 + starknet: 6.11.0 starknet_v4.22.0: "npm:starknet@4.22.0" ts-jest: ^29.1.0 ts-node: ^10.9.2 @@ -5013,7 +5013,7 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.4.0, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.1.2, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.3.2, @noble/hashes@npm:~1.4.0": +"@noble/hashes@npm:1.4.0, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.1.2, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.3.2, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:~1.4.0": version: 1.4.0 resolution: "@noble/hashes@npm:1.4.0" checksum: 8ba816ae26c90764b8c42493eea383716396096c5f7ba6bea559993194f49d80a73c081f315f4c367e51bd2d5891700bcdfa816b421d24ab45b41cb03e4f3342 @@ -5354,48 +5354,6 @@ __metadata: languageName: node linkType: hard -"@rometools/cli-darwin-arm64@npm:12.1.3": - version: 12.1.3 - resolution: "@rometools/cli-darwin-arm64@npm:12.1.3" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@rometools/cli-darwin-x64@npm:12.1.3": - version: 12.1.3 - resolution: "@rometools/cli-darwin-x64@npm:12.1.3" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@rometools/cli-linux-arm64@npm:12.1.3": - version: 12.1.3 - resolution: "@rometools/cli-linux-arm64@npm:12.1.3" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - -"@rometools/cli-linux-x64@npm:12.1.3": - version: 12.1.3 - resolution: "@rometools/cli-linux-x64@npm:12.1.3" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - -"@rometools/cli-win32-arm64@npm:12.1.3": - version: 12.1.3 - resolution: "@rometools/cli-win32-arm64@npm:12.1.3" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@rometools/cli-win32-x64@npm:12.1.3": - version: 12.1.3 - resolution: "@rometools/cli-win32-x64@npm:12.1.3" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rushstack/eslint-patch@npm:^1.1.0": version: 1.10.3 resolution: "@rushstack/eslint-patch@npm:1.10.3" @@ -5560,6 +5518,13 @@ __metadata: languageName: node linkType: hard +"@starknet-io/types-js@npm:^0.7.7, starknet-types-07@npm:@starknet-io/types-js@^0.7.7": + version: 0.7.7 + resolution: "@starknet-io/types-js@npm:0.7.7" + checksum: e5355042b06f96a19ee02a07cc12e321a636d0c7eaa605f85363775b036303a82896e6bcb2b244f97b125c83ae691f0fc162a5167e9866152a3b2108a9e28402 + languageName: node + linkType: hard + "@storybook/addon-actions@npm:6.5.16, @storybook/addon-actions@npm:^6.5.3": version: 6.5.16 resolution: "@storybook/addon-actions@npm:6.5.16" @@ -8720,22 +8685,7 @@ __metadata: languageName: node linkType: hard -"abi-wan-kanabi-v1@npm:abi-wan-kanabi@^1.0.3, abi-wan-kanabi@npm:^1.0.1": - version: 1.0.3 - resolution: "abi-wan-kanabi@npm:1.0.3" - dependencies: - abi-wan-kanabi: ^1.0.1 - fs-extra: ^10.0.0 - rome: ^12.1.3 - typescript: ^4.9.5 - yargs: ^17.7.2 - bin: - generate: dist/generate.js - checksum: 03b03c507424f239a7832e310ffbb35568448f0eebbe19e8caf56b03962ad6c047db8c84c3e7487d1ff9c97b0b00733ac9579c3cc640179d2eeacc5558316237 - languageName: node - linkType: hard - -"abi-wan-kanabi-v2@npm:abi-wan-kanabi@^2.1.1, abi-wan-kanabi@npm:^2.2.2": +"abi-wan-kanabi@npm:^2.2.2": version: 2.2.2 resolution: "abi-wan-kanabi@npm:2.2.2" dependencies: @@ -15311,6 +15261,15 @@ __metadata: languageName: node linkType: hard +"get-starknet-core@npm:^4.0.0-next.3": + version: 4.0.0 + resolution: "get-starknet-core@npm:4.0.0" + dependencies: + "@starknet-io/types-js": ^0.7.7 + checksum: 06e4be1be945d8fb7ad3f0d77a5e92c2854ce43cae8091a9f9b5f3cc74d42cf7188de9e544d497f92c0cad316d6d0abc110520629987815be2aed26d0b9ab871 + languageName: node + linkType: hard + "get-stdin@npm:^4.0.1": version: 4.0.1 resolution: "get-stdin@npm:4.0.1" @@ -19211,13 +19170,6 @@ __metadata: languageName: node linkType: hard -"lossless-json@npm:^2.0.8": - version: 2.0.11 - resolution: "lossless-json@npm:2.0.11" - checksum: 0282cf40658c844c9c7983dad26b7134538ba30fd5a992c932790228e3c9131b48d2cc89d65b31ced247a4eeedf33676bf187849ba3635d659c7812f106b42a7 - languageName: node - linkType: hard - "lossless-json@npm:^4.0.1": version: 4.0.1 resolution: "lossless-json@npm:4.0.1" @@ -24017,35 +23969,6 @@ __metadata: languageName: node linkType: hard -"rome@npm:^12.1.3": - version: 12.1.3 - resolution: "rome@npm:12.1.3" - dependencies: - "@rometools/cli-darwin-arm64": 12.1.3 - "@rometools/cli-darwin-x64": 12.1.3 - "@rometools/cli-linux-arm64": 12.1.3 - "@rometools/cli-linux-x64": 12.1.3 - "@rometools/cli-win32-arm64": 12.1.3 - "@rometools/cli-win32-x64": 12.1.3 - dependenciesMeta: - "@rometools/cli-darwin-arm64": - optional: true - "@rometools/cli-darwin-x64": - optional: true - "@rometools/cli-linux-arm64": - optional: true - "@rometools/cli-linux-x64": - optional: true - "@rometools/cli-win32-arm64": - optional: true - "@rometools/cli-win32-x64": - optional: true - bin: - rome: bin/rome - checksum: 341e5520a23277bdc2571db279e72fe9427a95f4e3025cd215a989d381fe6690f6aa1c0fb9abbd318a8bfd85ff1cec2304e92b732329c8a46c69e259eeb080cc - languageName: node - linkType: hard - "rsvp@npm:^4.8.4": version: 4.8.5 resolution: "rsvp@npm:4.8.5" @@ -25096,33 +25019,28 @@ __metadata: languageName: unknown linkType: soft -"starknet-types@npm:^0.0.4": - version: 0.0.4 - resolution: "starknet-types@npm:0.0.4" - checksum: a83d306830696ea875b8b07541db47e515a4ddb7bfce0cf5555cce12c8ce0e697b984762720c7f27761dc4114b4e5d3f81006e82fc45e52b052afe8fc86240fa - languageName: node - linkType: hard - -"starknet@npm:6.7.0": - version: 6.7.0 - resolution: "starknet@npm:6.7.0" +"starknet@npm:6.11.0": + version: 6.11.0 + resolution: "starknet@npm:6.11.0" dependencies: "@noble/curves": ~1.4.0 + "@noble/hashes": ^1.4.0 "@scure/base": ~1.1.3 "@scure/starknet": ~1.0.0 abi-wan-kanabi: ^2.2.2 fetch-cookie: ^3.0.0 + get-starknet-core: ^4.0.0-next.3 isomorphic-fetch: ^3.0.0 lossless-json: ^4.0.1 pako: ^2.0.4 - starknet-types: ^0.0.4 + starknet-types-07: "npm:@starknet-io/types-js@^0.7.7" ts-mixer: ^6.0.3 url-join: ^4.0.1 - checksum: 3c4abda7bab3008c8f98728c4b23a47a2dc97b876c6a33a824da77907b63611fde2df22298aa4c512e3c81e3fe005dd7e288969f18b00299e6eae450a147769d + checksum: 997c4a9efad53b0c25d0402c2dcd4e334b83865389ea29791f72ac757e0d9a216cf4634c6fbd5d33154e26389d499d39d893cf52302ec6b4eb9d7f04c034b579 languageName: node linkType: hard -"starknet@npm:^4.22.0, starknet_v4.22.0@npm:starknet@4.22.0": +"starknet_v4.22.0@npm:starknet@4.22.0": version: 4.22.0 resolution: "starknet@npm:4.22.0" dependencies: @@ -25141,23 +25059,6 @@ __metadata: languageName: node linkType: hard -"starknet@npm:^5.14.0": - version: 5.29.0 - resolution: "starknet@npm:5.29.0" - dependencies: - "@noble/curves": ~1.3.0 - "@scure/base": ~1.1.3 - "@scure/starknet": ~1.0.0 - abi-wan-kanabi-v1: "npm:abi-wan-kanabi@^1.0.3" - abi-wan-kanabi-v2: "npm:abi-wan-kanabi@^2.1.1" - isomorphic-fetch: ^3.0.0 - lossless-json: ^2.0.8 - pako: ^2.0.4 - url-join: ^4.0.1 - checksum: ea44bcc7f7db76ef878a557658e289bd25383b6fbcc9d59153dcf1bd0e014f41484fa5faa95e09ce0bd3c5933833fc867fb5be325f5b55ae1531a2cd29915594 - languageName: node - linkType: hard - "state-toggle@npm:^1.0.0": version: 1.0.3 resolution: "state-toggle@npm:1.0.3" @@ -26733,7 +26634,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.6.3, typescript@npm:^4.7.4, typescript@npm:^4.9.5": +"typescript@npm:^4.6.3, typescript@npm:^4.7.4": version: 4.9.5 resolution: "typescript@npm:4.9.5" bin: @@ -26753,7 +26654,7 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^4.6.3#~builtin, typescript@patch:typescript@^4.7.4#~builtin, typescript@patch:typescript@^4.9.5#~builtin": +"typescript@patch:typescript@^4.6.3#~builtin, typescript@patch:typescript@^4.7.4#~builtin": version: 4.9.5 resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=7ad353" bin: @@ -27490,7 +27391,7 @@ __metadata: redux-persist: ^6.0.0 rimraf: ^3.0.2 semver: ^7.5.2 - starknet: ^4.22.0 + starknet: 6.11.0 styled-components: ^5.3.5 toastr2: ^3.0.0-alpha.18 typescript: ^4.7.4