| name | morph-altfee |
| version | 1.0.0 |
| description | Alt-fee gas payment on Morph L2 — pay gas with alternative ERC20 tokens via tx type 0x7f |
Morph Alt-Fee — AI Agent Skill
Pay gas with alternative tokens (tx type 0x7f) on Morph Mainnet (Chain ID: 2818).
All commands output JSON. Morph-exclusive feature not available on other L2s.
Activation Triggers
Use this skill when the user wants to: list fee tokens, check fee token info, estimate gas cost in an alternative token, or send a transaction paying gas with a non-ETH token on Morph.
Quick Start
pip install requests eth_account
python3 scripts/morph_api.py <command> [options]
No API keys required. Queries the on-chain TokenRegistry at 0x5300000000000000000000000000000000000021.
BGW Routing Note
Decide the mode once via the root SKILL.md and docs/social-wallet-integration.md.
- Altfee is a Morph transaction mechanism, not a Social Login Wallet product feature.
altfee-send requires --private-key (local signing only).
- Social Login Wallet users cannot use altfee through this skill. BGW's swap flow has its own gas handling (including gasless
no_gas mode).
Commands
altfee-tokens
List all supported fee tokens from the on-chain TokenRegistry.
python3 scripts/morph_api.py altfee-tokens
altfee-token-info
Get details for a specific fee token: contract address, scale, feeRate, decimals, active status.
python3 scripts/morph_api.py altfee-token-info --id 5
altfee-estimate
Estimate the minimum feeLimit needed to pay gas with a fee token. Includes a 10% safety margin.
python3 scripts/morph_api.py altfee-estimate --id 5
python3 scripts/morph_api.py altfee-estimate --id 5 --gas-limit 200000
altfee-send
Sign and broadcast a transaction paying gas with an alternative fee token (tx type 0x7f). --fee-limit defaults to 0 (no limit — uses available balance, unused portion is refunded).
python3 scripts/morph_api.py altfee-send --to 0xRecipient --value 0.01 --fee-token-id 5 --private-key 0xKey
python3 scripts/morph_api.py altfee-send --to 0xContract --data 0xCalldata... --fee-token-id 5 --fee-limit 500000 --gas-limit 200000 --private-key 0xKey
Safety Rules
- Always confirm with the user before executing
altfee-send — show the recipient, amount, fee token, and fee limit before signing.
- Private keys are used locally for signing only — never sent to any API.
- Default
feeLimit=0 means no limit — unused portion is refunded, but confirm this with the user.
Domain Knowledge
- Morph supports paying gas with alternative tokens via custom transaction type
0x7f
- Fee tokens are managed by the on-chain TokenRegistry (IDs 1-6)
- Current fee tokens:
1=USDT.e, 2=USDC.e, 3=BGB (old), 4=BGB, 5=USDT, 6=USDC
- Formula:
feeLimit >= (gasFeeCap × gasLimit + L1DataFee) × tokenScale / feeRate
feeLimit = 0 means "no limit" — uses entire balance, unused portion is refunded
- Fee token 5 = USDT (
0xe7cd86e13AC4309349F30B3435a9d337750fC82D)
- Alt-fee and EIP-7702 are mutually exclusive — cannot use both in one transaction
- L1 Data Fee depends on calldata size and L1 gas price; not estimable upfront
Common Workflows
Pay gas with alternative token:
altfee-tokens (list available) → altfee-estimate (calculate cost) → altfee-send (sign & broadcast)
DEX swap with alt-fee gas payment:
dex-quote --recipient 0xAddr (morph-dex skill) → altfee-send --data 0xCalldata... --fee-token-id 5
Which Commands Support Altfee
| Command | --fee-token-id support |
|---|
altfee-send | Yes (required) — standalone altfee transaction |
agent-register | Yes (optional) — inline altfee gas payment |
agent-feedback | Yes (optional) — inline altfee gas payment |
transfer | No — use altfee-send --to ... --value ... instead |
transfer-token | No — use altfee-send --to ... --data ... instead |
dex-send | No — use altfee-send --to ... --data ... instead |
Cross-Skill Integration
- Use
dex-quote (morph-dex) to get swap calldata, then pass to altfee-send for gas payment with alt tokens.
- Use
token-balance (morph-wallet) to check fee token balance before sending.
- Use
balance (morph-wallet) to check if user has ETH — if not, suggest alt-fee.
- If the user is actually asking for a Social Login Wallet or TEE signing flow, route to BGW skills instead — BGW's swap flow has its own gas handling (including gasless
no_gas mode).