đŸ”Ŧ
Chainex Whitepaper
  • 👋ChainEx Overview
  • Technological Foundations
    • 💡Account Abstraction: The New Horizon
    • ✨ERC-4337
    • 👩‍🏭User Operations
    • 💡Usecases
  • ChainEx Fundamentals
    • đŸ“ĒDApps Suite
    • đŸ› ī¸Roadmap
    • đŸĒ™Tokenomics
    • â„šī¸ChainEx Token Utility
    • ❓FAQs
  • Revenue
    • 💸Revenue Sharing
    • đŸ’ĩRevenue Generation Stratergy
    • 💲Paymaster Fees
  • SDK Integration Docs
    • 👨‍đŸ’ģGetting started
    • 🌟Initializing SDK
    • 💸Making transactions
    • đŸ•šī¸Demos
  • Community
    • 🌐Website
    • 📞Telegram
    • đŸĻTwitter
Powered by GitBook
On this page
  1. SDK Integration Docs

Making transactions

Example of a mint transaction using our SDK

  1. Initiating Smart Contract:

    const apiKey = process.env.API_KEY;
    const chainEx = new ChainEx(apiKey);
    const smartAccount = await chainEx.initialize(provider, configParams); 
    const contractAddress = "<contract_address>";
    const abi = ERC721_ABI;
    const erc721Contract = new ethers.Contract(contractAddress, abi);

    Identify the address and ABI of your ERC-721 contract for SDK-enabled interactions.

  2. Constructing a Transaction:

    const transaction = {
        target: contractAddress,
        data: erc721Contract.interface.encodeFunctionData("safeMint", [param1, param2]) `
    };

    Create a transaction blueprint for invoking the safeMint function on your ERC-721 contract via ChainEx.

  3. Transaction Execution:

    const operationHash = await chainEx.executeTransaction(transaction);
    console.log("Operation Hash:", operationHash);

    Execute the transaction with ChainEx and receive the operation hash.

Last updated 1 year ago

💸