Skip to content

LeoYeAI/agent-master-skills / skills/aawp

AAWP (AI Agent Wallet Protocol) — the only crypto wallet protocol built exclusively for AI Agents on EVM-compatible blockchains. Not for humans. The signer is the AI Agent itself, cryptographically bound at wallet creation. Supports wallet lifecycle management, token transfers, DEX swaps, cross-chain bridging, arbitrary contract interactions, DCA automation, and price alerts.

FileKindSize
README.mdmarkdown10.9 KB
SKILL.mdskill md20.1 KB
WALLET_SETUP.mdmarkdown4.6 KB
_meta.jsonconfig436 B
bin/install.jsscript7.0 KB
config/chains.jsonconfig4.2 KB
core/index.d.tsscript2.8 KB
core/loader.jsscript1.0 KB
daemon/client.jsscript1.1 KB
daemon/daemon.jsscript606 B
lib/address-book.jsscript1.6 KB
lib/gas-estimator.jsscript1.7 KB
lib/multicall.jsscript2.6 KB
lib/nonce-manager.jsscript1.9 KB
lib/tx-history.jsscript1.3 KB
scripts/bootstrap.shscript1.7 KB
scripts/dca.jsscript9.4 KB
scripts/deploy-clanker.jsscript13.6 KB
scripts/doctor.shscript1.6 KB
scripts/ensure-daemon.shscript2.2 KB
scripts/limit-order.jsscript28.3 KB
scripts/nft.jsscript25.2 KB
scripts/portfolio.jsscript18.0 KB
scripts/price-alert.jsscript12.1 KB
scripts/provision.shscript9.4 KB
scripts/restart-daemon.shscript1.5 KB
scripts/restore-impl.jsscript3.9 KB
scripts/sign-worker.jsscript2.9 KB
scripts/start-daemon.jsscript3.9 KB
scripts/swap.jsscript31.8 KB
scripts/wallet-manager.jsscript70.6 KB
scripts/yield.jsscript34.1 KB

lib/gas-estimator.js

View on GitHub
'use strict';

const { ethers } = require('ethers');

// Legacy chains that don't support EIP-1559
const LEGACY_CHAINS = ['bsc'];

/**
 * Get dynamic gas price for a chain.
 * EIP-1559 chains: maxFeePerGas = baseFee * 1.5 + maxPriorityFeePerGas
 * Legacy chains (BSC): gasPrice * 1.1
 * @returns {{ maxFeePerGas, maxPriorityFeePerGas } | { gasPrice }}
 */
async function getGasPrice(provider, chainKey) {
  const feeData = await provider.getFeeData();

  if (LEGACY_CHAINS.includes(chainKey) || !feeData.maxFeePerGas) {
    // Legacy pricing
    const base = feeData.gasPrice || 3000000000n;
    const gasPrice = (base * 110n) / 100n; // +10%
    return { gasPrice };
  }

  // EIP-1559
  const baseFee = feeData.maxFeePerGas - (feeData.maxPriorityFeePerGas || 0n);
  const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas || ethers.parseUnits('1', 'gwei');
  const maxFeePerGas = (baseFee * 150n) / 100n + maxPriorityFeePerGas;

  return { maxFeePerGas, maxPriorityFeePerGas };
}

/**
 * Estimate gas cost in native currency (ETH/BNB/MATIC).
 * @param {object} provider
 * @param {object} txParams - { to, value, data }
 * @param {string} chainKey
 * @returns {{ gasLimit: bigint, gasCostWei: bigint, gasCostEth: string }}
 */
async function estimateGasCost(provider, txParams, chainKey) {
  const gasLimit = await provider.estimateGas(txParams).catch(() => 200000n);
  const prices = await getGasPrice(provider, chainKey);
  const effectivePrice = prices.gasPrice || prices.maxFeePerGas;
  const gasCostWei = BigInt(gasLimit) * effectivePrice;

  return {
    gasLimit,
    gasCostWei,
    gasCostEth: ethers.formatEther(gasCostWei),
  };
}

module.exports = { getGasPrice, estimateGasCost };
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexUnverifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall