Skip to content

Commit 925f606

Browse files
authored
Fix oracle swap example and add docs (#856)
1 parent 11cb14c commit 925f606

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

target_chains/ethereum/examples/oracle_swap/README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,30 @@ forge inspect OracleSwap abi > ../app/src/abi/OracleSwapAbi.json
6565

6666
## Frontend Application
6767

68-
All of the commands in this section assume you are in the `app` directory.
69-
7068
By default, the frontend is configured to use the already deployed version of the oracle AMM
7169
at address [`0x15F9ccA28688F5E6Cbc8B00A8f33e8cE73eD7B02`](https://mumbai.polygonscan.com/address/0x15F9ccA28688F5E6Cbc8B00A8f33e8cE73eD7B02) on Polygon Mumbai.
7270
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).
7371

7472
### Build
7573

76-
`npm ci`
74+
From the root of the pyth-crosschain repository, run:
75+
76+
```
77+
npm ci
78+
npx lerna run build
79+
```
80+
81+
This command will install dependencies for all packages within the typescript monorepo, and also build some
82+
typescript SDKs that this example depends on.
7783

7884
### Run
7985

86+
After building, you can start the frontend by navigating to the `app/` directory and running:
87+
8088
`npm run start`
8189

90+
Then navigate your browser to `localhost:3000`.
91+
8292
### Other configurations:
8393

8494
optimism goerli addresses

target_chains/ethereum/examples/oracle_swap/app/src/OrderEntry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ async function sendSwapTx(
201201
);
202202

203203
const updateFee = await pythContract.methods
204-
.getUpdateFee(priceFeedUpdateData.length)
204+
.getUpdateFee(priceFeedUpdateData)
205205
.call();
206206

207207
const swapContract = new web3.eth.Contract(

0 commit comments

Comments
 (0)