Ver Fonte

Fix oracle swap example and add docs (#856)

Jayant Krishnamurthy há 2 anos atrás
pai
commit
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
 
-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
 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).
 
 ### 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
 
+After building, you can start the frontend by navigating to the `app/` directory and running:
+
 `npm run start`
 
+Then navigate your browser to `localhost:3000`.
+
 ### Other configurations:
 
 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
-    .getUpdateFee(priceFeedUpdateData.length)
+    .getUpdateFee(priceFeedUpdateData)
     .call();
 
   const swapContract = new web3.eth.Contract(