From 8f521dc08a2292b8616e1e9a0d694de4a57d062f Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Tue, 12 Nov 2024 10:46:28 +0900 Subject: [PATCH 1/4] update ton testnet addr --- pages/price-feeds/contract-addresses/ton.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/price-feeds/contract-addresses/ton.mdx b/pages/price-feeds/contract-addresses/ton.mdx index 4c2917e6..e87b0b9c 100644 --- a/pages/price-feeds/contract-addresses/ton.mdx +++ b/pages/price-feeds/contract-addresses/ton.mdx @@ -6,4 +6,4 @@ Pyth is currently deployed on TON Testnet. | Network | Contract address | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| TON Testnet | | +| TON Testnet | | From 16a59b748287fb7265c9b10e8a4a2f0d3f5ce1b1 Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Tue, 12 Nov 2024 12:51:48 +0900 Subject: [PATCH 2/4] update addr --- pages/price-feeds/contract-addresses/ton.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/price-feeds/contract-addresses/ton.mdx b/pages/price-feeds/contract-addresses/ton.mdx index e87b0b9c..2976b503 100644 --- a/pages/price-feeds/contract-addresses/ton.mdx +++ b/pages/price-feeds/contract-addresses/ton.mdx @@ -6,4 +6,4 @@ Pyth is currently deployed on TON Testnet. | Network | Contract address | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| TON Testnet | | +| TON Testnet | | From e44d8ab32653bd5bf25ebd133e0860e4ceaaf54c Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Tue, 12 Nov 2024 15:19:31 +0900 Subject: [PATCH 3/4] update ton --- pages/price-feeds/contract-addresses/ton.mdx | 3 ++- pages/price-feeds/use-real-time-data/ton.mdx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/price-feeds/contract-addresses/ton.mdx b/pages/price-feeds/contract-addresses/ton.mdx index 2976b503..bc756867 100644 --- a/pages/price-feeds/contract-addresses/ton.mdx +++ b/pages/price-feeds/contract-addresses/ton.mdx @@ -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 Mainnet | | | TON Testnet | | diff --git a/pages/price-feeds/use-real-time-data/ton.mdx b/pages/price-feeds/use-real-time-data/ton.mdx index 442f855b..2253ccbd 100644 --- a/pages/price-feeds/use-real-time-data/ton.mdx +++ b/pages/price-feeds/use-real-time-data/ton.mdx @@ -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"; @@ -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(" ")); @@ -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."); } From 808faa0a4ca1b47524534bcc47a1ca22f8f892f4 Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Tue, 12 Nov 2024 22:41:25 +0900 Subject: [PATCH 4/4] upd addr --- pages/price-feeds/contract-addresses/ton.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/price-feeds/contract-addresses/ton.mdx b/pages/price-feeds/contract-addresses/ton.mdx index bc756867..755d1ed9 100644 --- a/pages/price-feeds/contract-addresses/ton.mdx +++ b/pages/price-feeds/contract-addresses/ton.mdx @@ -6,5 +6,5 @@ Pyth is currently deployed on TON Mainnet and TON Testnet. | Network | Contract address | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| TON Mainnet | | -| TON Testnet | | +| TON Mainnet | | +| TON Testnet | |