From 7dd36ec643df0321169d051fa70bfa5192126a1a Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Sun, 19 Oct 2025 19:05:22 +0200 Subject: [PATCH] chore(target_chains/ton): update contract address --- .../store/contracts/TonPriceFeedContracts.json | 8 +++++++- .../store/contracts/TonWormholeContracts.json | 8 +++++++- target_chains/ton/sdk/js/README.md | 6 +++++- target_chains/ton/sdk/js/package.json | 4 ++-- target_chains/ton/sdk/js/src/index.ts | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/contract_manager/store/contracts/TonPriceFeedContracts.json b/contract_manager/store/contracts/TonPriceFeedContracts.json index 00078df867..f6645af70b 100644 --- a/contract_manager/store/contracts/TonPriceFeedContracts.json +++ b/contract_manager/store/contracts/TonPriceFeedContracts.json @@ -6,7 +6,13 @@ }, { "chain": "ton_mainnet", + "comment": "This is deprecated, use the new contract address", "address": "EQBU6k8HH6yX4Jf3d18swWbnYr31D3PJI7PgjXT-flsKHqql", "type": "TonPriceFeedContract" + }, + { + "chain": "ton_mainnet", + "address": "EQBgtfuGIzWLiOzpZO48_psYvco4xRtkAbdbmTwy0_o95LtZ", + "type": "TonPriceFeedContract" } -] \ No newline at end of file +] diff --git a/contract_manager/store/contracts/TonWormholeContracts.json b/contract_manager/store/contracts/TonWormholeContracts.json index a99bec5116..9c6f58ef8f 100644 --- a/contract_manager/store/contracts/TonWormholeContracts.json +++ b/contract_manager/store/contracts/TonWormholeContracts.json @@ -6,7 +6,13 @@ }, { "chain": "ton_mainnet", + "comment": "This is deprecated, use the new contract address", "address": "EQBU6k8HH6yX4Jf3d18swWbnYr31D3PJI7PgjXT-flsKHqql", "type": "TonWormholeContract" + }, + { + "chain": "ton_mainnet", + "address": "EQBgtfuGIzWLiOzpZO48_psYvco4xRtkAbdbmTwy0_o95LtZ", + "type": "TonWormholeContract" } -] \ No newline at end of file +] diff --git a/target_chains/ton/sdk/js/README.md b/target_chains/ton/sdk/js/README.md index 3fa4c45d96..4d186b2f78 100644 --- a/target_chains/ton/sdk/js/README.md +++ b/target_chains/ton/sdk/js/README.md @@ -57,9 +57,13 @@ async function main() { ); console.log("Hermes BTC price:", latestPriceUpdates.parsed?.[0].price); + const numUpdates = 1; // Only BTC price const updateData = Buffer.from(latestPriceUpdates.binary.data[0], "hex"); console.log("Update data:", updateData); + // NOTE: As of 2025/10/19 There's a bug with TON Access (https://ton.access.orbs.network) RPC service where if you provide an + // update data buffer with length of more than ~320 then the rpc returns error 404 and the function fails. In this case you can use the + // contract.getSingleUpdateFee() method to get the single update fee and multiply it by the number of updates you want to perform. const updateFee = await contract.getUpdateFee(updateData); console.log("Update fee:", updateFee); @@ -74,7 +78,7 @@ async function main() { await contract.sendUpdatePriceFeeds( provider.sender(key.secretKey), updateData, - calculateUpdatePriceFeedsFee(1n) + BigInt(updateFee) + calculateUpdatePriceFeedsFee(numUpdates) + BigInt(updateFee) ); console.log("Price feeds updated successfully."); diff --git a/target_chains/ton/sdk/js/package.json b/target_chains/ton/sdk/js/package.json index c0927f5583..e7c6946398 100644 --- a/target_chains/ton/sdk/js/package.json +++ b/target_chains/ton/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-ton-js", - "version": "0.1.2", + "version": "0.2.0", "description": "Pyth Network TON Utilities", "homepage": "https://pyth.network", "author": { @@ -27,7 +27,7 @@ "fix:format": "prettier --write \"src/**/*.ts\"", "prepublishOnly": "pnpm run build && pnpm run test:lint", "preversion": "pnpm run test:lint", - "version": "pnpm run format && git add -A src" + "version": "pnpm run test:format && git add -A src" }, "keywords": [ "pyth", diff --git a/target_chains/ton/sdk/js/src/index.ts b/target_chains/ton/sdk/js/src/index.ts index dfe56a63da..ad82854490 100644 --- a/target_chains/ton/sdk/js/src/index.ts +++ b/target_chains/ton/sdk/js/src/index.ts @@ -11,7 +11,7 @@ import { import { ContractProvider } from "@ton/ton"; export const PYTH_CONTRACT_ADDRESS_MAINNET = - "EQBU6k8HH6yX4Jf3d18swWbnYr31D3PJI7PgjXT-flsKHqql"; + "EQBgtfuGIzWLiOzpZO48_psYvco4xRtkAbdbmTwy0_o95LtZ"; export const PYTH_CONTRACT_ADDRESS_TESTNET = "EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU"; // This is defined in target_chains/ton/contracts/common/gas.fc