Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit b301f7c

Browse files
Added price feed docs for Unity (#505)
* Added price feed docs for Unity * Remove GetCollectiblePrices method as it isn't working
1 parent e91c991 commit b301f7c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/pages/sdk/unity/read-from-blockchain.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,14 @@ GetTransactionHistoryReturn history = await chainIndexer.GetTransactionHistory(
125125
```
126126

127127
The `TransactionHistoryFilter` object allows you to specify how you want to filter your transaction history query, e.g. by account address(es), contract address(es), etc. More info [here](/api/indexer/examples/transaction-history).
128+
129+
## Get Token Prices
130+
131+
To fetch the price of a given token, you'll want to use the `PriceFeed`:
132+
133+
```
134+
PriceFeed priceFeed = new PriceFeed();
135+
TokenPrice[] prices = await priceFeed.GetCoinPrices(
136+
new PriceFeed.Token(Chain.Polygon, polygonUSDCContractAddress),
137+
new PriceFeed.Token(Chain.ArbitrumNova, arbitrumNovaUSDCContractAddress));
138+
```

0 commit comments

Comments
 (0)