File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ import CopyAddress from "../../../components/CopyAddress";
2
2
3
3
# Price Feed Contract Addresses on TON
4
4
5
- Pyth is currently deployed on TON Testnet.
5
+ Pyth is currently deployed on TON Mainnet and TON Testnet.
6
6
7
7
| Network | Contract address |
8
8
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
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" /> |
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import { HermesClient } from "@pythnetwork/hermes-client";
39
39
import {
40
40
PythContract ,
41
41
PYTH_CONTRACT_ADDRESS_TESTNET ,
42
+ calculateUpdatePriceFeedsFee ,
42
43
} from " @pythnetwork/pyth-ton-js" ;
43
44
const BTC_PRICE_FEED_ID =
44
45
" 0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" ;
@@ -72,6 +73,8 @@ async function main() {
72
73
// Get update fee
73
74
const updateFee = await contract .getUpdateFee (updateData );
74
75
console .log (" Update fee:" , updateFee );
76
+ const totalFee =
77
+ calculateUpdatePriceFeedsFee (BigInt (updateFee )) + BigInt (updateFee );
75
78
// Update price feeds
76
79
const mnemonic = " your mnemonic here" ;
77
80
const key = await mnemonicToPrivateKey (mnemonic .split (" " ));
@@ -83,7 +86,7 @@ async function main() {
83
86
await contract .sendUpdatePriceFeeds (
84
87
provider .sender (key .secretKey ),
85
88
updateData ,
86
- 156000000 n + 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
87
90
);
88
91
console .log (" Price feeds updated successfully." );
89
92
}
You can’t perform that action at this time.
0 commit comments