Fix oracle swap example and add docs (#856)

This commit is contained in:
Jayant Krishnamurthy 2023-06-03 07:39:00 -07:00 committed by GitHub
parent 11cb14ca76
commit 925f606550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -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

View File

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