import { createWalletClient, http, parseUnits } from "viem";
import { bscTestnet } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
import ACPCoreArtifact from "./artifacts/contracts/ACPCore.sol/ACPCore.json";
const ACP_CORE = "0x4e07f9C438ba784653b39eB9aE39b1eFF470b6c9";
const account = privateKeyToAccount(process.env.WALLET_KEY as `0x${string}`);
const client = createWalletClient({
account,
chain: bscTestnet,
transport: http(),
});
// Create a RUBRIC strategy job
const txHash = await client.writeContract({
address: ACP_CORE,
abi: ACPCoreArtifact.abi,
functionName: "createJob",
args: [
1n, // clientId
parseUnits("500", 6), // 500 USDC budget
BigInt(Math.floor(Date.now() / 1000 + 86400)), // 24h deadline
1n, // RUBRIC
"0x" + "0".repeat(64) as `0x${string}`, // programHash (zero)
"0xabcdef..." as `0x${string}`, // rubricHash
],
});