Start a contract agent with SDK 0.3.9
On this page
Download the guide and examples directly from this public Docs site. No GitHub
invitation, npm login, Ammora API account or signing key is required for the
installation and read-only steps below. Use Node 24.18.0 and public
@ammora-protocol/sdk@0.3.9 on GIWA Sepolia, chain 91342.
Approval and review boundaries
Use the common permission matrix before connecting a wallet. Supported/enabled paths and valid Config creation need no per-team Ammora approval; your wallet/holder consent, token policy and current contract roles still apply. New implementations, restricted policies, privileged rights changes and recovery have separate review gates. For an existing compatible external revenue source, follow self-service onboarding.
1. Download and verify the source project
curl -fL https://docs.ammora.org/examples/setup.mjs -o ammora-examples-setup.mjs
# Review the downloaded setup source before running it.
node ammora-examples-setup.mjs ./my-agent
cd my-agent
npm ci --ignore-scripts --no-audit --no-fund
npm run typecheck
The setup file downloads the public manifest, checks
every file's SHA-256 and refuses an existing directory. It never installs
dependencies or runs the examples automatically. PROVENANCE.json records the
exact examples revision. The SDK package is installed from npm; no local SDK
candidate or SDK publication is involved.
2. Run tools and bounded GIWA reads
npm run --silent agent:tools
node --import tsx onboarding/agent-readonly.mjs
The first command prints 12 tool definitions with JSON input schemas. The
second loads the real agent adapter, verifies GIWA/core identity and reads an
enabled Config #6. It prints SDK 0.3.9, chain 91342, the observed Config hash
and transactionsSubmitted: 0. It connects no signer, reads no environment key
and makes no approval, funding or transaction call. The optional argument is a
public address; the default is a demonstration address used only for reads.
Node's SQLite experimental warning can appear on stderr.
An RPC outage or disabled/mismatched Config is a real failed check: resolve it before planning. Success here proves installation and current read access; it does not grant an agent trading authority or repeat historical transactions.
3. Import the integration
Keep the downloaded relative paths intact and import from src/agent/index.ts:
import {
connectAgent, toolDefinitions, createLaunchpadConfig,
createToken, createTokenAndFirstBuy, createConfigAndFirstBuy,
buy, sell, finalFill, graduate, claimLaunchFees, claimLpFees,
executeReviewedStep, runLaunchpadWalkthrough,
} from './src/agent/index.js';
The connection, action functions and trusted host show where to connect your framework and wallet backend. Register the tool definitions and matching handlers with the model. The signer and owner-approval callback stay in trusted host code. These examples use Node filesystem/SQLite and belong in your agent backend, not in a browser bundle.
For a smaller project, run node scripts/package-agent.mjs ../my-agent-core
from the downloaded project, then install the exported project's pinned npm
dependencies. The exporter copies its local TypeScript dependency closure and
no environment, journal, credential or signer.
4. Choose your own Config, wallets and limits
Follow the full agent lifecycle guide in order.
Copy src/agent/policy.example.json to agent.policy.local.json, then replace
address placeholders, expiry, allowed Config ID/hash, payouts and spending limits.
The template cannot execute until you supply valid reviewed values.
Your actual Config owner chooses the Partner, LP and leftover recipients; the token's actual issuance caller becomes Creator. Fund executing wallets with gas ETH and separate WETH/input tokens. A reusable valid Config starts enabled without individual Ammora approval. The agent policy's word “approved” means your own wallet/application owner's consent, not an Ammora allowlist. See self-service and permission boundaries.
Use the connected host walkthrough to pass the confirmed Config ID, issued token/curve and migration NFT to each dependent action. Supply your own reviewed session policy, signer and owner approval callback. Each allowance and business transaction is approved separately. An INCOMPLETE result stops the sequence. Resume the same session, journal and request prefix after reconciling its original hash; never rerun under a new ID to resolve uncertainty. A temporary missing canonical block leaves the attempt pending rather than sending another transaction.
After each allowance/launch/trade, reconcile the original operation and receipt
before its dependent action. A terminal fill and migration are separate steps.
After Graduation use the actual canonical pool; never recreate it with
createProductionPool. Creator/Partner claim their own FeeVault entitlement;
LP owners or authorized fee delegates may claim fees to a reviewed payout.
Do not withdraw permanently locked LP principal as cleanup.
Read the qualification summary for prior actual GIWA payments, current-run versus reused evidence, and remaining limitations. Publishing this download does not change quote/callback policy, repository visibility, contract roles or the SDK package.