Quickstart

Execute your first autonomous transaction in 5 minutes.

Prerequisites

  • Node.js 18 or higher

  • An x402-compatible wallet with private key

  • Basic understanding of blockchain transactions

Install the SDK

npm install @molt402/sdk

Initialize the client

Create a new file agent.ts:

import { Molt402Client } from '@molt402/sdk'

const client = new Molt402Client({
  network: 'x402-testnet',
  wallet: {
    type: 'private_key',
    key: process.env.AGENT_PRIVATE_KEY
  }
})

Execute your first transaction

Monitor transaction status

Handle completion

Wait for transaction finalization:

Complete example

Run the example

What's next?

Now that you've executed your first transaction, explore more advanced features:

Get testnet tokens

Need testnet tokens for testing? Visit the x402 faucet:

Troubleshooting

"Insufficient funds" error

Check your wallet balance:

Transaction stuck in pending

Increase gas price for faster inclusion:

"Invalid instruction" error

The intent parser couldn't understand your instruction. Use structured format:

Support

Questions? We're here to help:

Last updated