@@ -256,15 +256,12 @@ const anchor = require('@coral-xyz/anchor');
256256const userScript = require("{script_path}");
257257
258258async function main() {{
259- const url = "{cluster_url}";
260- const preflightCommitment = 'recent';
261- const connection = new anchor.web3.Connection(url, preflightCommitment);
259+ const connection = new anchor.web3.Connection(
260+ "{cluster_url}",
261+ anchor.AnchorProvider.defaultOptions().commitment
262+ );
262263 const wallet = anchor.Wallet.local();
263-
264- const provider = new anchor.AnchorProvider(connection, wallet, {{
265- preflightCommitment,
266- commitment: 'recent',
267- }});
264+ const provider = new anchor.AnchorProvider(connection, wallet);
268265
269266 // Run the user's deploy script.
270267 userScript(provider);
@@ -282,15 +279,12 @@ pub fn deploy_ts_script_host(cluster_url: &str, script_path: &str) -> String {
282279const userScript = require("{script_path}");
283280
284281async function main() {{
285- const url = "{cluster_url}";
286- const preflightCommitment = 'recent';
287- const connection = new anchor.web3.Connection(url, preflightCommitment);
282+ const connection = new anchor.web3.Connection(
283+ "{cluster_url}",
284+ anchor.AnchorProvider.defaultOptions().commitment
285+ );
288286 const wallet = anchor.Wallet.local();
289-
290- const provider = new anchor.AnchorProvider(connection, wallet, {{
291- preflightCommitment,
292- commitment: 'recent',
293- }});
287+ const provider = new anchor.AnchorProvider(connection, wallet);
294288
295289 // Run the user's deploy script.
296290 userScript(provider);
0 commit comments