Преглед изворни кода

Fix oracle swap example and add docs (#856)

Jayant Krishnamurthy пре 2 година
родитељ
комит
925f606550

+ 13 - 3
target_chains/ethereum/examples/oracle_swap/README.md

@@ -65,20 +65,30 @@ forge inspect OracleSwap abi > ../app/src/abi/OracleSwapAbi.json
 
 
 ## Frontend Application
 ## Frontend Application
 
 
-All of the commands in this section assume you are in the `app` directory.
-
 By default, the frontend is configured to use the already deployed version of the oracle AMM
 By default, the frontend is configured to use the already deployed version of the oracle AMM
 at address [`0x15F9ccA28688F5E6Cbc8B00A8f33e8cE73eD7B02`](https://mumbai.polygonscan.com/address/0x15F9ccA28688F5E6Cbc8B00A8f33e8cE73eD7B02) on Polygon Mumbai.
 at address [`0x15F9ccA28688F5E6Cbc8B00A8f33e8cE73eD7B02`](https://mumbai.polygonscan.com/address/0x15F9ccA28688F5E6Cbc8B00A8f33e8cE73eD7B02) on Polygon Mumbai.
 This means you can start playing with the application without going through the steps above (Remember to switch your wallet to Mumbai and to claim funds from a faucet to pay for the gas).
 This means you can start playing with the application without going through the steps above (Remember to switch your wallet to Mumbai and to claim funds from a faucet to pay for the gas).
 
 
 ### Build
 ### Build
 
 
-`npm ci`
+From the root of the pyth-crosschain repository, run:
+
+```
+npm ci
+npx lerna run build
+```
+
+This command will install dependencies for all packages within the typescript monorepo, and also build some
+typescript SDKs that this example depends on.
 
 
 ### Run
 ### Run
 
 
+After building, you can start the frontend by navigating to the `app/` directory and running:
+
 `npm run start`
 `npm run start`
 
 
+Then navigate your browser to `localhost:3000`.
+
 ### Other configurations:
 ### Other configurations:
 
 
 optimism goerli addresses
 optimism goerli addresses

+ 1 - 1
target_chains/ethereum/examples/oracle_swap/app/src/OrderEntry.tsx

@@ -201,7 +201,7 @@ async function sendSwapTx(
   );
   );
 
 
   const updateFee = await pythContract.methods
   const updateFee = await pythContract.methods
-    .getUpdateFee(priceFeedUpdateData.length)
+    .getUpdateFee(priceFeedUpdateData)
     .call();
     .call();
 
 
   const swapContract = new web3.eth.Contract(
   const swapContract = new web3.eth.Contract(