Skip to content

Commit

Permalink
chore: use typegen'd script
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 committed Nov 15, 2024
1 parent 7403f91 commit 64818af
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions apps/docs-snippets2/src/scripts/script-with-main-args.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
/* eslint-disable import/first */
/* eslint-disable import/order */
import { ScriptMainArgs } from '../typegend';

const bytecode = ScriptMainArgs.bytecode;
const abi = ScriptMainArgs.abi;

// #region full
import { bn, Provider, Wallet } from 'fuels';

import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../env';
import { bn, Provider, Script, Wallet } from 'fuels';
import { ScriptMainArgs } from '../typegend';

const provider = await Provider.create(LOCAL_NETWORK_URL);
const wallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);

const foo = 3;

const scriptInstance = new Script(bytecode, abi, wallet);
const scriptInstance = new ScriptMainArgs(wallet);

const { waitForResult } = await scriptInstance.functions.main(foo).call();

Expand Down

0 comments on commit 64818af

Please sign in to comment.