avalanche
v0.3.0Scaffold a dapp, deploy contracts and send contract calls (for example mint) on the Fuji testnet.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_templates List templates
List the Avalanche dapp templates available to scaffold_app.
scaffold_app Scaffold an Avalanche dapp
Create a new Avalanche dapp from a template (minimal, nft-mint, token-gated-app, erc20-token, icm-messenger, eerc-token, l1-launch, token-bridge). Wraps create-avalanche-app. Returns the created files, next steps, and `artifacts`: the paths of the project's compiled contracts, which deploy_contract and write_contract take as artifactPath — nothing has to be read or copied to deploy and call them. Each template supports only the chains list_templates shows for it — most are Fuji-only — and any other chain is refused. The project is created inside the server's working directory (or AVAKIT_…
| Parameter | Type | Description |
|---|---|---|
name * | string | Project directory name, e.g. my-avax-app |
chain | string | Must be one of the template's chains (see list_templates). c-chain is mainnet. |
directory | string | Parent directory for the project. Must be inside the server's working directory, which is also the default. |
local | boolean | Only for developing AvaKit itself: links @avakit/* with workspace:*, so the app installs only inside the AvaKit monorepo. Leave unset. |
template | string |
read_chain Read Avalanche chain data
Read a native AVAX balance, a transaction receipt, or a contract view/pure function over RPC. No key needed. For contractRead pass the contract's ABI the same way write_contract takes it: as artifactPath (one of the `artifacts` scaffold_app returned) or as abi (the JSON ABI, or just the function's signature). To change state (for example to mint) use write_contract.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
abi | array | For contractRead, instead of artifactPath: the JSON ABI, or signatures such as ["function ownerOf(uint256 tokenId) view returns (address)"]. |
address | string | Address for balance / contractRead |
args | array | The function's arguments, in order. Pass large integers as decimal strings. |
artifactPath | string | Path to the contract's artifact file, relative to the server's working directory: one of the `artifacts` scaffold_app returned (e.g. my-app/lib/nft-artifact.ts), or a Foundry/Hardhat JSON artifact wit… |
chain | string | |
functionName | string | For contractRead: the view or pure function to read, e.g. "ownerOf". To pick between overloads, the full signature, e.g. "balanceOf(address,uint256)". |
hash | string | Tx hash for txReceipt |
estimate_gas Estimate gas
Estimate the gas a transaction (to / data / value) would use and report the current gas price and rough AVAX cost, over RPC. No key needed.
| Parameter | Type | Description |
|---|---|---|
to * | string | Recipient / contract address (0x…) |
chain | string | |
data | string | Calldata (0x…) |
from | string | Sender address (0x…) |
value | string | Native value in wei (decimal string) |
deploy_contract Deploy a contract
Deploy a compiled contract to Avalanche and return its address, once the transaction has succeeded and there is code at that address. Pass the contract either as artifactPath (a file: one of the `artifacts` scaffold_app returned, or a Foundry/Hardhat JSON artifact) or as abi + bytecode — exactly one of the two; artifactPath means no bytecode has to be copied into the call. On the Fuji testnet (the default) no key is needed: when AVAKIT_DEPLOYER_KEY is not set, the server signs with a temporary session test wallet that exists only in its memory, works on Fuji only, and is funded from the AvaK…
| Parameter | Type | Description |
|---|---|---|
abi | array | With bytecode, instead of artifactPath: the JSON ABI, or signatures such as ["constructor(address owner)"]. |
args | array | Constructor arguments, in order. Pass large integers as decimal strings. |
artifactPath | string | Path to the contract's artifact file, relative to the server's working directory: one of the `artifacts` scaffold_app returned (e.g. my-app/lib/nft-artifact.ts), or a Foundry/Hardhat JSON artifact wit… |
bytecode | string | With abi, instead of artifactPath: the creation bytecode (0x-prefixed). |
chain | string | |
confirm | boolean | Required on mainnet (c-chain), together with AVAKIT_ALLOW_MAINNET=1 in the server environment. Not needed on Fuji. |
write_contract Call a contract (state-changing)
Send a state-changing contract call — for example mint — and return once it has succeeded on chain. The call is simulated first: if it would revert, the revert reason is returned and nothing is sent. Give the ABI as artifactPath (the file deploy_contract took) or as abi, which can be just the function's signature, e.g. ["function mint() returns (uint256)"] — exactly one of the two. It calls only a contract this server deployed in this session (with deploy_contract, on the same chain) or one whose address AVAKIT_WRITE_ALLOWLIST lists in the server's environment (AVAKIT_WRITE_ALLOWLIST=* a…
| Parameter | Type | Description |
|---|---|---|
address * | string | The contract's address, e.g. the one deploy_contract returned: a contract this server deployed in this session, or one AVAKIT_WRITE_ALLOWLIST lists. |
functionName * | string | The function to call, e.g. "mint". To pick between overloads, the full signature, e.g. "safeTransferFrom(address,address,uint256)". |
abi | array | Instead of artifactPath: the JSON ABI, or signatures such as ["function mint() returns (uint256)"]. |
args | array | The function's arguments, in order. Pass large integers as decimal strings. |
artifactPath | string | Path to the contract's artifact file, relative to the server's working directory: one of the `artifacts` scaffold_app returned (e.g. my-app/lib/nft-artifact.ts), or a Foundry/Hardhat JSON artifact wit… |
chain | string | |
confirm | boolean | Required on mainnet (c-chain), together with AVAKIT_ALLOW_MAINNET=1 in the server environment. Not needed on Fuji. |
value | string | Wei to send with a payable call (decimal string). Only with your own key (AVAKIT_DEPLOYER_KEY) on Fuji, and at most AVAKIT_MAX_VALUE AVAX (0.1 unless the server sets it): the session test wallet never… |
wallet_status Wallet status
Show the wallet deploy_contract and write_contract would sign with on a chain, where it comes from ("session": the temporary Fuji test wallet; "env": your key in AVAKIT_DEPLOYER_KEY; "none": nothing to sign with), and its balance. Read-only: it sends nothing and never asks the faucet for funds. A session wallet with a zero balance is normal before its first transaction — the signing tools fund it when it cannot pay. On mainnet (c-chain) there is a wallet only when AVAKIT_DEPLOYER_KEY is set.
| Parameter | Type | Description |
|---|---|---|
chain | string |
get_context Get AvaKit context
Return AvaKit + Avalanche context for coding: the API surface, conventions, doc links, and how deploying and minting work from this server (no key needed on Fuji; what mainnet needs).
| Parameter | Type | Description |
|---|---|---|
topic | string | Optional focus topic |