Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pages/price-feeds/contract-addresses/ton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import CopyAddress from "../../../components/CopyAddress";

# Price Feed Contract Addresses on TON

Pyth is currently deployed on TON Testnet.
Pyth is currently deployed on TON Mainnet and TON Testnet.

| Network | Contract address |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TON Testnet | <CopyAddress address={`EQDwGkJmcj7MMmWAHmhldnY-lAKI6hcTQ2tAEcapmwCnztQU`} url="https://testnet.tonscan.org/address/EQDwGkJmcj7MMmWAHmhldnY-lAKI6hcTQ2tAEcapmwCnztQU" /> |
| TON Mainnet | <CopyAddress address={`EQBU6k8HH6yX4Jf3d18swWbnYr31D3PJI7PgjXT-flsKHqql`} url="https://tonscan.org/address/EQBU6k8HH6yX4Jf3d18swWbnYr31D3PJI7PgjXT-flsKHqql" /> |
| TON Testnet | <CopyAddress address={`EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU`} url="https://testnet.tonscan.org/address/EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU" /> |
5 changes: 4 additions & 1 deletion pages/price-feeds/use-real-time-data/ton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { HermesClient } from "@pythnetwork/hermes-client";
import {
PythContract,
PYTH_CONTRACT_ADDRESS_TESTNET,
calculateUpdatePriceFeedsFee,
} from "@pythnetwork/pyth-ton-js";
const BTC_PRICE_FEED_ID =
"0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43";
Expand Down Expand Up @@ -72,6 +73,8 @@ async function main() {
// Get update fee
const updateFee = await contract.getUpdateFee(updateData);
console.log("Update fee:", updateFee);
const totalFee =
calculateUpdatePriceFeedsFee(BigInt(updateFee)) + BigInt(updateFee);
// Update price feeds
const mnemonic = "your mnemonic here";
const key = await mnemonicToPrivateKey(mnemonic.split(" "));
Expand All @@ -83,7 +86,7 @@ async function main() {
await contract.sendUpdatePriceFeeds(
provider.sender(key.secretKey),
updateData,
156000000n + BigInt(updateFee) // 156000000 = 390000 (estimated gas used for the transaction, this is defined in (contracts/common/gas.fc)[https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ton/contracts/common/gas.fc] as UPDATE_PRICE_FEEDS_GAS) * 400 (current settings in basechain are as follows: 1 unit of gas costs 400 nanotons)
totalFee
);
console.log("Price feeds updated successfully.");
}
Expand Down
Loading