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
8 changes: 7 additions & 1 deletion contract_manager/store/contracts/TonPriceFeedContracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
]
8 changes: 7 additions & 1 deletion contract_manager/store/contracts/TonWormholeContracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
]
6 changes: 5 additions & 1 deletion target_chains/ton/sdk/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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.");

Expand Down
4 changes: 2 additions & 2 deletions target_chains/ton/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion target_chains/ton/sdk/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading