diff --git a/packages/examples/create-react-app/package.json b/packages/examples/create-react-app/package.json index 6792757e9..bb34630d2 100644 --- a/packages/examples/create-react-app/package.json +++ b/packages/examples/create-react-app/package.json @@ -4,7 +4,7 @@ "private": true, "homepage": "./", "dependencies": { - "@metamask/sdk-react": "^0.16.0", + "@metamask/sdk-react": "^0.17.1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", diff --git a/packages/examples/create-react-app/src/App.tsx b/packages/examples/create-react-app/src/App.tsx index 529a94d30..d4416ce62 100644 --- a/packages/examples/create-react-app/src/App.tsx +++ b/packages/examples/create-react-app/src/App.tsx @@ -92,7 +92,7 @@ export const App = () => { const to = '0x0000000000000000000000000000000000000000'; const transactionParameters = { to, // Required except during contract publications. - from: provider?.selectedAddress, // must match user's active address. + from: provider?.getSelectedAddress(), // must match user's active address. value: '0x5AF3107A4000', // Only required to send ether to the recipient from the initiating external account. }; @@ -115,7 +115,7 @@ export const App = () => { setResponse(`invalid ethereum provider`); return; } - const result = await send_eth_signTypedData_v4(provider, provider.chainId); + const result = await send_eth_signTypedData_v4(provider, provider.getChainId()); setResponse(result); }; @@ -206,7 +206,7 @@ export const App = () => { Send transaction - { provider?.chainId === '0x1' ? ( + { provider?.getChainId() === '0x1' ? ( - { activeProvider?.chainId === '0x1' ? ( + { activeProvider?.getChainId() === '0x1' ? ( - { provider?.chainId === '0x1' ? ( + { provider?.getChainId() === '0x1' ? (