Skip to content

Commit f95f1e5

Browse files
authored
feat: update ton addr (#497)
* update ton testnet addr * update addr * update ton * upd addr
1 parent 0273c28 commit f95f1e5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pages/price-feeds/contract-addresses/ton.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import CopyAddress from "../../../components/CopyAddress";
22

33
# Price Feed Contract Addresses on TON
44

5-
Pyth is currently deployed on TON Testnet.
5+
Pyth is currently deployed on TON Mainnet and TON Testnet.
66

77
| Network | Contract address |
88
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9-
| TON Testnet | <CopyAddress address={`EQDwGkJmcj7MMmWAHmhldnY-lAKI6hcTQ2tAEcapmwCnztQU`} url="https://testnet.tonscan.org/address/EQDwGkJmcj7MMmWAHmhldnY-lAKI6hcTQ2tAEcapmwCnztQU" /> |
9+
| TON Mainnet | <CopyAddress address={`EQBU6k8HH6yX4Jf3d18swWbnYr31D3PJI7PgjXT-flsKHqql`} url="https://tonscan.org/address/EQBU6k8HH6yX4Jf3d18swWbnYr31D3PJI7PgjXT-flsKHqql" /> |
10+
| TON Testnet | <CopyAddress address={`EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU`} url="https://testnet.tonscan.org/address/EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU" /> |

pages/price-feeds/use-real-time-data/ton.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { HermesClient } from "@pythnetwork/hermes-client";
3939
import {
4040
PythContract,
4141
PYTH_CONTRACT_ADDRESS_TESTNET,
42+
calculateUpdatePriceFeedsFee,
4243
} from "@pythnetwork/pyth-ton-js";
4344
const BTC_PRICE_FEED_ID =
4445
"0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43";
@@ -72,6 +73,8 @@ async function main() {
7273
// Get update fee
7374
const updateFee = await contract.getUpdateFee(updateData);
7475
console.log("Update fee:", updateFee);
76+
const totalFee =
77+
calculateUpdatePriceFeedsFee(BigInt(updateFee)) + BigInt(updateFee);
7578
// Update price feeds
7679
const mnemonic = "your mnemonic here";
7780
const key = await mnemonicToPrivateKey(mnemonic.split(" "));
@@ -83,7 +86,7 @@ async function main() {
8386
await contract.sendUpdatePriceFeeds(
8487
provider.sender(key.secretKey),
8588
updateData,
86-
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)
89+
totalFee
8790
);
8891
console.log("Price feeds updated successfully.");
8992
}

0 commit comments

Comments
 (0)