File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ import path from "path";
9
9
const parser = yargs ( hideBin ( process . argv ) )
10
10
. usage (
11
11
"Upgrades the Pyth contract on TON and creates a governance proposal for it.\n" +
12
- "Usage: $0 --network <mainnet|testnet> --contract-address <address> --ops-key-path <ops_key_path>"
12
+ "Usage: $0 --network <mainnet|testnet> --contract-address <address> --ops-key-path <ops_key_path>\n" +
13
+ "Required environment variables:\n" +
14
+ " - ENV_TON_MAINNET_API_KEY: API key for TON mainnet\n" +
15
+ " - ENV_TON_TESTNET_API_KEY: API key for TON testnet"
13
16
)
14
17
. options ( {
15
18
network : {
@@ -38,16 +41,11 @@ async function main() {
38
41
const chainId = isMainnet ? CHAINS . ton_mainnet : CHAINS . ton_testnet ;
39
42
const wormholeChainName = toChainName ( chainId ) ;
40
43
41
- // Get the TON chain instance with appropriate RPC URL based on network
42
- const chain = new TonChain (
43
- chainId . toString ( ) ,
44
- isMainnet ,
45
- wormholeChainName ,
46
- undefined ,
47
- isMainnet
48
- ? "https://toncenter.com/api/v2/jsonRPC"
49
- : "https://testnet.toncenter.com/api/v2/jsonRPC"
50
- ) ;
44
+ // Get the TON chain instance from DefaultStore based on network
45
+ const chain = DefaultStore . chains [ isMainnet ? "ton_mainnet" : "ton_testnet" ] ;
46
+ if ( ! chain || ! ( chain instanceof TonChain ) ) {
47
+ throw new Error ( `Chain configuration not found for TON ${ argv . network } ` ) ;
48
+ }
51
49
52
50
const vault =
53
51
DefaultStore . vaults [
You can’t perform that action at this time.
0 commit comments