Skip to content

Commit 3f2d51d

Browse files
committed
update deploy script
1 parent d9198c8 commit 3f2d51d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

target_chains/ton/contracts/scripts/deployPyth.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
MAINNET_UPGRADE_VAAS,
1111
} from "../tests/utils/wormhole";
1212
import { BTC_PRICE_FEED_ID, ETH_PRICE_FEED_ID } from "../tests/utils/pyth";
13+
import { calculateUpdatePriceFeedsFee } from "@pythnetwork/pyth-ton-js";
1314

1415
export async function run(provider: NetworkProvider) {
1516
const SINGLE_UPDATE_FEE = 1;
@@ -113,12 +114,14 @@ export async function run(provider: NetworkProvider) {
113114

114115
// NOTE: As of 2024/10/14 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
115116
const updateFee = await main.getUpdateFee(updateData);
116-
console.log("Update fee:", updateFee);
117117

118-
await main.sendUpdatePriceFeeds(
118+
const totalFee =
119+
calculateUpdatePriceFeedsFee(BigInt(updateFee)) + BigInt(updateFee);
120+
121+
const result = await main.sendUpdatePriceFeeds(
119122
provider.sender(),
120123
updateData,
121-
toNano(updateFee)
124+
totalFee
122125
);
123126
console.log("Price feeds updated successfully.");
124127

0 commit comments

Comments
 (0)