npm package: @sonic-agent-kit/agent-evm-tools
Description: A production-grade library for agentic automation with persistent task storage, RabbitMQ queuing scheduling, and worker support.
Author: blok-hamster
Latest version: 1.0.4

```ts
import { ethers, Provider } from "ethers";
import { DexSwapContract } from "./src/DexSwapContract";
import { AssetTransferContract } from "./src/AssetTransferContract";
import { TokenFactoryContract } from "./src/TokenFactoryContract";

// Connect to your network (example with a JSON-RPC provider)
const provider = new ethers.JsonRpcProvider("http://127.0.0.1:8545/");


// Or if using a signer (for transactions):
// Create a signer from a private key
const privateKey1 = "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"; // Replace with your actual private key
const signer = new ethers.Wallet(privateKey1, provider);

// Instantiate your contracts with deployed addresses:
const assetTransferAddress = "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512";
const tokenFactoryAddress = "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0";

//const dexSwap = new DexSwapContract(dexSwapAddress, signer);
const assetTransfer = new AssetTransferContract(assetTransferAddress, signer);
const tokenFactory = new TokenFactoryContract(tokenFactoryAddress, signer);

// Now you can call methods like:
async function example() {
  // Create a new fungible token:
  const txCreate = await tokenFactory.createFungibleToken("NewToken", "NTK", ethers.parseEther("1000").toString());
  const receipt = await txCreate.wait();
  
  // Get the token creation event specifically
  const tokenCreatedFilter = tokenFactory.contract.filters.FungibleTokenCreated();
  const events = await tokenFactory.contract.queryFilter(
    tokenCreatedFilter, 
    receipt.blockNumber, 
    receipt.blockNumber
  );

  // Extract token address and creator from the event
  if ('args' in events[0]) {
    const tokenAddress = events[0].args[0];
    const creator = events[0].args[1];
    
    // Save the important event details
    const tokenCreationDetails = {
      tokenAddress,
      creator,
      transactionHash: events[0].transactionHash,
      blockNumber: events[0].blockNumber
    };
    
    console.log("Token Creation Details:", tokenCreationDetails);
  } else {
    // Handle case where event is a Log rather than EventLog
    const tokenCreationDetails = {
      transactionHash: events[0].transactionHash,
      blockNumber: events[0].blockNumber,
      topics: events[0].topics // Topics contain the indexed parameters
    };
    
    console.log("Token Creation Details:", tokenCreationDetails);
  }

  // Create a new non-fungible token:
  const txCreateNFT = await tokenFactory.createNonFungibleToken("NewNFT", "NFTK");
  const receiptNFT = await txCreateNFT.wait();
  console.log("NFT Creation Transaction:", receiptNFT);

  // Transfer ETH to a recipient:
  const txTransferETH = await assetTransfer.transferETH("0x70997970C51812dc3A010C7d01b50e0d17dc79C8", ethers.parseEther("1").toString());
  const receiptETH = await txTransferETH.wait();
  console.log("ETH Transfer Transaction:", receiptETH);

  // Transfer ERC20 tokens to a recipient:
//   const txTransferERC20 = await assetTransfer.transferERC20("0xTokenAddress", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", ethers.parseEther("100").toString());
//   console.log("ERC20 Transfer Transaction:", txTransferERC20.hash);

//   // Transfer NFT to a recipient:
//   const txTransferNFT = await assetTransfer.transferNFT("0xNFTAddress", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", 1);
//   console.log("NFT Transfer Transaction:", txTransferNFT.hash);
}

example().catch(console.error);
```