@oracle-agent/oracle 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +525 -13
- package/SECURITY.md +114 -0
- package/SETUP.md +319 -0
- package/artifacts/inscription/oracle-was-here-preview.png +0 -0
- package/artifacts/inscription/oracle-was-here.svg +1 -0
- package/artifacts/specialist-packs/oracle-full-crypto.json +298 -0
- package/dist/action-receipts.mjs +1 -0
- package/dist/action-semantics.mjs +1 -0
- package/dist/address-book.mjs +2 -0
- package/dist/assets/profiles/_template/SOUL.md +54 -0
- package/dist/assets/profiles/_template/profile.json +22 -0
- package/dist/assets/profiles/bitcoin-agent/SOUL.md +31 -0
- package/dist/assets/profiles/bitcoin-agent/profile.json +32 -0
- package/dist/assets/profiles/hyperliquid-agent/SOUL.md +34 -0
- package/dist/assets/profiles/hyperliquid-agent/profile.json +38 -0
- package/dist/assets/profiles/oracle/SOUL.md +134 -0
- package/dist/assets/profiles/oracle/profile.json +40 -0
- package/dist/assets/profiles/polymarket-agent/SOUL.md +35 -0
- package/dist/assets/profiles/polymarket-agent/profile.json +34 -0
- package/dist/assets/profiles/profile.schema.json +90 -0
- package/dist/assets/profiles/protocol-builder/SOUL.md +57 -0
- package/dist/assets/profiles/protocol-builder/profile.json +39 -0
- package/dist/assets/profiles/robinhood-agent/SOUL.md +53 -0
- package/dist/assets/profiles/robinhood-agent/profile.json +41 -0
- package/dist/assets/profiles/solana-agent/SOUL.md +37 -0
- package/dist/assets/profiles/solana-agent/profile.json +38 -0
- package/dist/assets/profiles/stable-agent/SOUL.md +43 -0
- package/dist/assets/profiles/stable-agent/profile.json +38 -0
- package/dist/assets/skills/balance/SKILL.md +176 -0
- package/dist/assets/skills/bitcoin-l1.md +33 -0
- package/dist/assets/skills/chain-defi-ecosystem-profiling.md +27 -0
- package/dist/assets/skills/evm-contract-research.md +27 -0
- package/dist/assets/skills/hyperliquid.md +26 -0
- package/dist/assets/skills/multichain-exec-desk.md +33 -0
- package/dist/assets/skills/oracle-action-semantics/SKILL.md +40 -0
- package/dist/assets/skills/oracle-best-execution/SKILL.md +127 -0
- package/dist/assets/skills/oracle-best-execution.md +27 -0
- package/dist/assets/skills/oracle-bitcoin/SKILL.md +53 -0
- package/dist/assets/skills/oracle-chain-graphs-telegram-cards/SKILL.md +59 -0
- package/dist/assets/skills/oracle-chat/SKILL.md +61 -0
- package/dist/assets/skills/oracle-chat/chain.SKILL.md +31 -0
- package/dist/assets/skills/oracle-chat/setup.SKILL.md +37 -0
- package/dist/assets/skills/oracle-circuit-breaker/SKILL.md +51 -0
- package/dist/assets/skills/oracle-contract-research/SKILL.md +55 -0
- package/dist/assets/skills/oracle-desk/SKILL.md +58 -0
- package/dist/assets/skills/oracle-desk.md +27 -0
- package/dist/assets/skills/oracle-dex-launch/SKILL.md +38 -0
- package/dist/assets/skills/oracle-equities/SKILL.md +62 -0
- package/dist/assets/skills/oracle-grants/SKILL.md +69 -0
- package/dist/assets/skills/oracle-hypercore-staking/SKILL.md +57 -0
- package/dist/assets/skills/oracle-hyperliquid/SKILL.md +56 -0
- package/dist/assets/skills/oracle-meme-token-sniper/SKILL.md +73 -0
- package/dist/assets/skills/oracle-multichain-nft-launch/SKILL.md +338 -0
- package/dist/assets/skills/oracle-multichain-token-launch/SKILL.md +300 -0
- package/dist/assets/skills/oracle-nft-gacha-launch/SKILL.md +48 -0
- package/dist/assets/skills/oracle-nft-mint-gas-war/SKILL.md +63 -0
- package/dist/assets/skills/oracle-polymarket/SKILL.md +60 -0
- package/dist/assets/skills/oracle-protocol-builder/SKILL.md +59 -0
- package/dist/assets/skills/oracle-protocol-security/SKILL.md +60 -0
- package/dist/assets/skills/oracle-public-product/SKILL.md +44 -0
- package/dist/assets/skills/oracle-receipts/SKILL.md +52 -0
- package/dist/assets/skills/oracle-receipts.md +29 -0
- package/dist/assets/skills/oracle-rfq-tokenized-assets/SKILL.md +69 -0
- package/dist/assets/skills/oracle-smart-wallet-scanner/SKILL.md +49 -0
- package/dist/assets/skills/oracle-solana/SKILL.md +65 -0
- package/dist/assets/skills/oracle-solana-nft/SKILL.md +54 -0
- package/dist/assets/skills/oracle-token-research/SKILL.md +67 -0
- package/dist/assets/skills/solana.md +22 -0
- package/dist/bin/desk-server.mjs +59 -0
- package/dist/bin/oracle-data-mcp.mjs +8 -0
- package/dist/bin/oracle-equities.mjs +20 -0
- package/dist/bin/oracle-init.mjs +24 -0
- package/dist/bin/oracle-public-server.mjs +5 -0
- package/dist/bin/oracle-route.mjs +22 -0
- package/dist/bin/oracle-scan.mjs +18 -0
- package/dist/bin/oracle-upgrade.mjs +21 -0
- package/dist/bin/oracle.mjs +76 -0
- package/dist/chains.mjs +1 -0
- package/dist/cli/commands/auth.mjs +16 -0
- package/dist/cli/commands/bootstrap.mjs +18 -0
- package/dist/cli/commands/chain.mjs +21 -0
- package/dist/cli/commands/chat.mjs +45 -0
- package/dist/cli/commands/credential.mjs +1 -0
- package/dist/cli/commands/data-mcp.mjs +2 -0
- package/dist/cli/commands/data.mjs +12 -0
- package/dist/cli/commands/doctor.mjs +5 -0
- package/dist/cli/commands/equities.mjs +15 -0
- package/dist/cli/commands/farm.mjs +59 -0
- package/dist/cli/commands/follow.mjs +28 -0
- package/dist/cli/commands/gate.mjs +13 -0
- package/dist/cli/commands/harness.mjs +15 -0
- package/dist/cli/commands/help.mjs +1 -0
- package/dist/cli/commands/init.mjs +3 -0
- package/dist/cli/commands/mcp.mjs +60 -0
- package/dist/cli/commands/model.mjs +54 -0
- package/dist/cli/commands/plugins.mjs +38 -0
- package/dist/cli/commands/prepare.mjs +2 -0
- package/dist/cli/commands/public.mjs +3 -0
- package/dist/cli/commands/resolve.mjs +23 -0
- package/dist/cli/commands/route.mjs +2 -0
- package/dist/cli/commands/runner.mjs +1 -0
- package/dist/cli/commands/scan.mjs +2 -0
- package/dist/cli/commands/setup.mjs +34 -0
- package/dist/cli/commands/sign.mjs +21 -0
- package/dist/cli/commands/signer.mjs +1 -0
- package/dist/cli/commands/swap.mjs +36 -0
- package/dist/cli/commands/upgrade.mjs +2 -0
- package/dist/cli/commands/vault.mjs +1 -0
- package/dist/cli/commands/version.mjs +2 -0
- package/dist/data/desk-data.mjs +55 -0
- package/dist/data/names.mjs +2 -0
- package/dist/data/providers/farming.mjs +2 -0
- package/dist/equities/index.mjs +1 -0
- package/dist/index.mjs +60 -0
- package/dist/nft-gas-war-guard.mjs +1 -0
- package/dist/onboarding/harness-configs.mjs +4 -0
- package/dist/portfolio-risk.mjs +1 -0
- package/dist/prepare-envelope.mjs +1 -0
- package/dist/public-api/agent-grants.mjs +3 -0
- package/dist/public-control/policy-schema.mjs +1 -0
- package/dist/router/index.mjs +2 -0
- package/dist/scanner/index.mjs +4 -0
- package/dist/signals/index.mjs +1 -0
- package/dist/watch-preferences.mjs +1 -0
- package/package.json +66 -16
- package/public/agent-connect/app.js +84 -0
- package/public/agent-connect/index.html +83 -0
- package/public/agent-connect/styles.css +70 -0
- package/public/index.html +12 -0
- package/public/oracle-console/app.js +272 -0
- package/public/oracle-console/bitcoin-wallets.js +206 -0
- package/public/oracle-console/index.html +91 -0
- package/public/oracle-console/styles.css +239 -0
- package/public/oracle-splash/_variants/ice.html +2073 -0
- package/public/oracle-splash/_variants/ivory.html +2075 -0
- package/public/oracle-splash/assets/agents/claude.png +0 -0
- package/public/oracle-splash/assets/agents/codex.png +0 -0
- package/public/oracle-splash/assets/cli-chain-hyperliquid.jpg +0 -0
- package/public/oracle-splash/assets/desktop-app.jpg +0 -0
- package/public/oracle-splash/assets/hero/cli-session-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/cli-session.mp4 +0 -0
- package/public/oracle-splash/assets/hero/cli-session.webm +0 -0
- package/public/oracle-splash/assets/hero/orb-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/orb.avif +0 -0
- package/public/oracle-splash/assets/hero/orb.webm +0 -0
- package/public/oracle-splash/assets/hero/risk-session-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/risk-session.mp4 +0 -0
- package/public/oracle-splash/assets/hero/risk-session.webm +0 -0
- package/public/oracle-splash/assets/hero/route-session-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/route-session.mp4 +0 -0
- package/public/oracle-splash/assets/hero/route-session.webm +0 -0
- package/public/oracle-splash/assets/llms/claude.svg +1 -0
- package/public/oracle-splash/assets/llms/codex-icon.svg +1 -0
- package/public/oracle-splash/assets/llms/codex.svg +1 -0
- package/public/oracle-splash/assets/llms/cursor-icon.svg +12 -0
- package/public/oracle-splash/assets/llms/cursor.svg +17 -0
- package/public/oracle-splash/assets/llms/deepseek.svg +1 -0
- package/public/oracle-splash/assets/llms/gemini-icon.svg +1 -0
- package/public/oracle-splash/assets/llms/gemini.svg +1 -0
- package/public/oracle-splash/assets/llms/grok.svg +8 -0
- package/public/oracle-splash/assets/llms/hermes.png +0 -0
- package/public/oracle-splash/assets/llms/kimi-icon.svg +1 -0
- package/public/oracle-splash/assets/llms/kimi.svg +1 -0
- package/public/oracle-splash/assets/llms/manus.svg +18 -0
- package/public/oracle-splash/assets/llms/openclaw.svg +22 -0
- package/public/oracle-splash/assets/llms/perplexity.svg +1 -0
- package/public/oracle-splash/assets/llms/qwen.svg +1 -0
- package/public/oracle-splash/assets/llms/windsurf.svg +1 -0
- package/public/oracle-splash/assets/protocols/abcdex.png +0 -0
- package/public/oracle-splash/assets/protocols/across.png +0 -0
- package/public/oracle-splash/assets/protocols/aerodrome.png +0 -0
- package/public/oracle-splash/assets/protocols/balancer.png +0 -0
- package/public/oracle-splash/assets/protocols/cowswap.png +0 -0
- package/public/oracle-splash/assets/protocols/curve.png +0 -0
- package/public/oracle-splash/assets/protocols/dreamcash.png +0 -0
- package/public/oracle-splash/assets/protocols/felix.png +0 -0
- package/public/oracle-splash/assets/protocols/gmx.png +0 -0
- package/public/oracle-splash/assets/protocols/hyena.png +0 -0
- package/public/oracle-splash/assets/protocols/hyperbeat.png +0 -0
- package/public/oracle-splash/assets/protocols/hyperliquid.png +0 -0
- package/public/oracle-splash/assets/protocols/hyperswap.png +0 -0
- package/public/oracle-splash/assets/protocols/jupiter.png +0 -0
- package/public/oracle-splash/assets/protocols/kinetiq.png +0 -0
- package/public/oracle-splash/assets/protocols/lfj.png +0 -0
- package/public/oracle-splash/assets/protocols/lifi.png +0 -0
- package/public/oracle-splash/assets/protocols/magic-eden.png +0 -0
- package/public/oracle-splash/assets/protocols/morpho.png +0 -0
- package/public/oracle-splash/assets/protocols/odos.png +0 -0
- package/public/oracle-splash/assets/protocols/oneinch.png +0 -0
- package/public/oracle-splash/assets/protocols/opensea.png +0 -0
- package/public/oracle-splash/assets/protocols/pancakeswap.png +0 -0
- package/public/oracle-splash/assets/protocols/paragon.png +0 -0
- package/public/oracle-splash/assets/protocols/paraswap.png +0 -0
- package/public/oracle-splash/assets/protocols/pendle.png +0 -0
- package/public/oracle-splash/assets/protocols/polymarket.png +0 -0
- package/public/oracle-splash/assets/protocols/quickswap.png +0 -0
- package/public/oracle-splash/assets/protocols/relay.png +0 -0
- package/public/oracle-splash/assets/protocols/stargate.png +0 -0
- package/public/oracle-splash/assets/protocols/tradexyz.png +0 -0
- package/public/oracle-splash/assets/protocols/uniswap.png +0 -0
- package/public/oracle-splash/assets/protocols/velodrome.png +0 -0
- package/public/oracle-splash/assets/protocols/ventuals.png +0 -0
- package/public/oracle-splash/assets/wordmarks/across-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/across.svg +4 -0
- package/public/oracle-splash/assets/wordmarks/aerodrome.svg +23 -0
- package/public/oracle-splash/assets/wordmarks/balancer.svg +3 -0
- package/public/oracle-splash/assets/wordmarks/cowswap.svg +1 -0
- package/public/oracle-splash/assets/wordmarks/curve.png +0 -0
- package/public/oracle-splash/assets/wordmarks/gmx.svg +13 -0
- package/public/oracle-splash/assets/wordmarks/hop-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/hyena.svg +7 -0
- package/public/oracle-splash/assets/wordmarks/hyperliquid.svg +21 -0
- package/public/oracle-splash/assets/wordmarks/hyperswap.svg +13 -0
- package/public/oracle-splash/assets/wordmarks/jupiter.svg +35 -0
- package/public/oracle-splash/assets/wordmarks/kinetiq.svg +1 -0
- package/public/oracle-splash/assets/wordmarks/lfj.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/lifi.png +0 -0
- package/public/oracle-splash/assets/wordmarks/magic-eden.svg +1 -0
- package/public/oracle-splash/assets/wordmarks/markets.svg +1 -0
- package/public/oracle-splash/assets/wordmarks/morpho.svg +1 -0
- package/public/oracle-splash/assets/wordmarks/odos.svg +3 -0
- package/public/oracle-splash/assets/wordmarks/oneinch-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/oneinch.svg +6 -0
- package/public/oracle-splash/assets/wordmarks/opensea-icon.svg +17 -0
- package/public/oracle-splash/assets/wordmarks/opensea.svg +1 -0
- package/public/oracle-splash/assets/wordmarks/outcome.svg +16 -0
- package/public/oracle-splash/assets/wordmarks/pancakeswap.svg +18 -0
- package/public/oracle-splash/assets/wordmarks/paragon.svg +9 -0
- package/public/oracle-splash/assets/wordmarks/paraswap.svg +16 -0
- package/public/oracle-splash/assets/wordmarks/pendle.png +0 -0
- package/public/oracle-splash/assets/wordmarks/polymarket.png +0 -0
- package/public/oracle-splash/assets/wordmarks/quickswap.png +0 -0
- package/public/oracle-splash/assets/wordmarks/relay.svg +8 -0
- package/public/oracle-splash/assets/wordmarks/satflow-icon.png +0 -0
- package/public/oracle-splash/assets/wordmarks/stargate-icon.webp +0 -0
- package/public/oracle-splash/assets/wordmarks/stargate.svg +15 -0
- package/public/oracle-splash/assets/wordmarks/uniswap.svg +18 -0
- package/public/oracle-splash/assets/wordmarks/velodrome.svg +84 -0
- package/public/oracle-splash/assets/wordmarks/xyz.svg +12 -0
- package/public/oracle-splash/assets/wordmarks/zerox-icon.webp +0 -0
- package/public/oracle-splash/brand/aave.webp +0 -0
- package/public/oracle-splash/brand/aavev2.webp +0 -0
- package/public/oracle-splash/brand/aborean.webp +0 -0
- package/public/oracle-splash/brand/across.webp +0 -0
- package/public/oracle-splash/brand/aerodrome.webp +0 -0
- package/public/oracle-splash/brand/afi.webp +0 -0
- package/public/oracle-splash/brand/arcus.webp +0 -0
- package/public/oracle-splash/brand/aster.webp +0 -0
- package/public/oracle-splash/brand/avant.webp +0 -0
- package/public/oracle-splash/brand/balancer.webp +0 -0
- package/public/oracle-splash/brand/beefy.webp +0 -0
- package/public/oracle-splash/brand/benqi.webp +0 -0
- package/public/oracle-splash/brand/bestinslot.ico +0 -0
- package/public/oracle-splash/brand/bitfi.webp +0 -0
- package/public/oracle-splash/brand/bonkswap.webp +0 -0
- package/public/oracle-splash/brand/bouncebit.webp +0 -0
- package/public/oracle-splash/brand/camelot.webp +0 -0
- package/public/oracle-splash/brand/compound.webp +0 -0
- package/public/oracle-splash/brand/concrete.webp +0 -0
- package/public/oracle-splash/brand/cow.webp +0 -0
- package/public/oracle-splash/brand/curve.webp +0 -0
- package/public/oracle-splash/brand/derive.webp +0 -0
- package/public/oracle-splash/brand/dolomite.webp +0 -0
- package/public/oracle-splash/brand/eigenlayer.webp +0 -0
- package/public/oracle-splash/brand/ekubo.webp +0 -0
- package/public/oracle-splash/brand/ethena.webp +0 -0
- package/public/oracle-splash/brand/etherfi.webp +0 -0
- package/public/oracle-splash/brand/etherfiborrow.webp +0 -0
- package/public/oracle-splash/brand/felix.webp +0 -0
- package/public/oracle-splash/brand/fluid.webp +0 -0
- package/public/oracle-splash/brand/fluxbeam.webp +0 -0
- package/public/oracle-splash/brand/folks.webp +0 -0
- package/public/oracle-splash/brand/fortyacres.webp +0 -0
- package/public/oracle-splash/brand/gainsnetwork.webp +0 -0
- package/public/oracle-splash/brand/gassss.webp +0 -0
- package/public/oracle-splash/brand/gmx.webp +0 -0
- package/public/oracle-splash/brand/harmonix.webp +0 -0
- package/public/oracle-splash/brand/hlorderbook.webp +0 -0
- package/public/oracle-splash/brand/hlp.webp +0 -0
- package/public/oracle-splash/brand/hop.webp +0 -0
- package/public/oracle-splash/brand/hyperbeat.webp +0 -0
- package/public/oracle-splash/brand/hyperlend.webp +0 -0
- package/public/oracle-splash/brand/hyperliquid.webp +0 -0
- package/public/oracle-splash/brand/hyperliquidhpl.webp +0 -0
- package/public/oracle-splash/brand/hyperliquidspot.webp +0 -0
- package/public/oracle-splash/brand/hyperswap.webp +0 -0
- package/public/oracle-splash/brand/hypha.webp +0 -0
- package/public/oracle-splash/brand/joedex.webp +0 -0
- package/public/oracle-splash/brand/jupiter.webp +0 -0
- package/public/oracle-splash/brand/kelp.webp +0 -0
- package/public/oracle-splash/brand/kinetiq.webp +0 -0
- package/public/oracle-splash/brand/kmhype.webp +0 -0
- package/public/oracle-splash/brand/kona.webp +0 -0
- package/public/oracle-splash/brand/konalend.webp +0 -0
- package/public/oracle-splash/brand/lfj.webp +0 -0
- package/public/oracle-splash/brand/lido.webp +0 -0
- package/public/oracle-splash/brand/lifi.webp +0 -0
- package/public/oracle-splash/brand/lighter.webp +0 -0
- package/public/oracle-splash/brand/lista.webp +0 -0
- package/public/oracle-splash/brand/loopedhype.webp +0 -0
- package/public/oracle-splash/brand/lorenzo.webp +0 -0
- package/public/oracle-splash/brand/magic-eden.webp +0 -0
- package/public/oracle-splash/brand/magiceden.webp +0 -0
- package/public/oracle-splash/brand/mempool.png +0 -0
- package/public/oracle-splash/brand/meteora.webp +0 -0
- package/public/oracle-splash/brand/morpho.webp +0 -0
- package/public/oracle-splash/brand/myriad.webp +0 -0
- package/public/oracle-splash/brand/noxa.webp +0 -0
- package/public/oracle-splash/brand/odos.webp +0 -0
- package/public/oracle-splash/brand/oneinch.webp +0 -0
- package/public/oracle-splash/brand/openbook.webp +0 -0
- package/public/oracle-splash/brand/opensea.webp +0 -0
- package/public/oracle-splash/brand/orca.webp +0 -0
- package/public/oracle-splash/brand/ordinals.png +0 -0
- package/public/oracle-splash/brand/ostium.webp +0 -0
- package/public/oracle-splash/brand/pancakeswap.webp +0 -0
- package/public/oracle-splash/brand/pendle.webp +0 -0
- package/public/oracle-splash/brand/perena.webp +0 -0
- package/public/oracle-splash/brand/pharaoh.webp +0 -0
- package/public/oracle-splash/brand/phoenix.webp +0 -0
- package/public/oracle-splash/brand/polymarket.webp +0 -0
- package/public/oracle-splash/brand/polynomial.webp +0 -0
- package/public/oracle-splash/brand/projectx.webp +0 -0
- package/public/oracle-splash/brand/pumpfun.webp +0 -0
- package/public/oracle-splash/brand/quickswap.webp +0 -0
- package/public/oracle-splash/brand/rain.webp +0 -0
- package/public/oracle-splash/brand/raydium.webp +0 -0
- package/public/oracle-splash/brand/relay.webp +0 -0
- package/public/oracle-splash/brand/rocketpool.webp +0 -0
- package/public/oracle-splash/brand/saber.webp +0 -0
- package/public/oracle-splash/brand/sakuraswap.webp +0 -0
- package/public/oracle-splash/brand/sanctum.webp +0 -0
- package/public/oracle-splash/brand/satflow.png +0 -0
- package/public/oracle-splash/brand/sierra.webp +0 -0
- package/public/oracle-splash/brand/sky.webp +0 -0
- package/public/oracle-splash/brand/solv.webp +0 -0
- package/public/oracle-splash/brand/spark.webp +0 -0
- package/public/oracle-splash/brand/sparksavings.webp +0 -0
- package/public/oracle-splash/brand/sphere.webp +0 -0
- package/public/oracle-splash/brand/ssv.webp +0 -0
- package/public/oracle-splash/brand/stabble.webp +0 -0
- package/public/oracle-splash/brand/stableswap.webp +0 -0
- package/public/oracle-splash/brand/stakewise.webp +0 -0
- package/public/oracle-splash/brand/stargate.webp +0 -0
- package/public/oracle-splash/brand/sthype.webp +0 -0
- package/public/oracle-splash/brand/sushiswap.webp +0 -0
- package/public/oracle-splash/brand/unisat.png +0 -0
- package/public/oracle-splash/brand/uniswap.webp +0 -0
- package/public/oracle-splash/brand/uniswapv2.webp +0 -0
- package/public/oracle-splash/brand/uniswapv4.webp +0 -0
- package/public/oracle-splash/brand/unit.webp +0 -0
- package/public/oracle-splash/brand/velodrome.webp +0 -0
- package/public/oracle-splash/brand/velora.webp +0 -0
- package/public/oracle-splash/brand/venus.webp +0 -0
- package/public/oracle-splash/brand/wbeth.webp +0 -0
- package/public/oracle-splash/brand/xsy.webp +0 -0
- package/public/oracle-splash/brand/yieldyak.webp +0 -0
- package/public/oracle-splash/brand/zerobase.webp +0 -0
- package/public/oracle-splash/brand/zerox.webp +0 -0
- package/public/oracle-splash/downloads/index.html +241 -0
- package/public/oracle-splash/favicon.ico +0 -0
- package/public/oracle-splash/favicon.svg +6 -0
- package/public/oracle-splash/index.html +2537 -0
- package/public/oracle-splash/mesh-graph.png +0 -0
- package/public/oracle-splash/mesh-graph.svg +216 -0
- package/bin/oracle.mjs +0 -25
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="description" content="Connect your agent harness to Oracle read tools without giving up custody." />
|
|
7
|
+
<title>Oracle Agent Connect</title>
|
|
8
|
+
<link rel="stylesheet" href="styles.css" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<main class="shell">
|
|
12
|
+
<header class="hero">
|
|
13
|
+
<a class="wordmark" href="/">ORACLE</a>
|
|
14
|
+
<p class="eyebrow">AGENT CONNECT</p>
|
|
15
|
+
<h1>Give your agent market context.<br /><span>Keep custody local.</span></h1>
|
|
16
|
+
<p class="lede">Connect a read-only Oracle API to your preferred harness. The model proposes actions; you review and authorize them through your local operator.</p>
|
|
17
|
+
</header>
|
|
18
|
+
|
|
19
|
+
<section class="card setup" aria-labelledby="connection-title">
|
|
20
|
+
<div class="section-heading">
|
|
21
|
+
<span class="step">01</span>
|
|
22
|
+
<div>
|
|
23
|
+
<h2 id="connection-title">Your connection</h2>
|
|
24
|
+
<p>These values stay in this browser and are only used to build the config below.</p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="fields">
|
|
28
|
+
<label>Agent API URL
|
|
29
|
+
<input id="api-url" type="url" value="https://api.oracle-agent.dev" spellcheck="false" autocomplete="url" />
|
|
30
|
+
</label>
|
|
31
|
+
<label>Read API key
|
|
32
|
+
<input id="api-key" type="password" placeholder="Your read-only API key" spellcheck="false" autocomplete="off" />
|
|
33
|
+
<span class="hint">Use only a user-owned, read-only API credential.</span>
|
|
34
|
+
</label>
|
|
35
|
+
<label>Public wallet address <span class="optional">optional</span>
|
|
36
|
+
<input id="wallet-address" type="text" placeholder="0x... or a public Solana address" spellcheck="false" autocomplete="off" />
|
|
37
|
+
<span class="hint">Used to personalize portfolio reads. No wallet connection or signature.</span>
|
|
38
|
+
</label>
|
|
39
|
+
</div>
|
|
40
|
+
</section>
|
|
41
|
+
|
|
42
|
+
<section class="card config" aria-labelledby="config-title">
|
|
43
|
+
<div class="section-heading">
|
|
44
|
+
<span class="step">02</span>
|
|
45
|
+
<div>
|
|
46
|
+
<h2 id="config-title">Choose your harness</h2>
|
|
47
|
+
<p>Copy a ready-to-paste cloud/read MCP configuration.</p>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="tabs" role="tablist" aria-label="Agent harness">
|
|
51
|
+
<button role="tab" aria-selected="true" data-harness="hermes">Hermes</button>
|
|
52
|
+
<button role="tab" aria-selected="false" data-harness="claude">Claude Code</button>
|
|
53
|
+
<button role="tab" aria-selected="false" data-harness="codex">Codex</button>
|
|
54
|
+
<button role="tab" aria-selected="false" data-harness="cursor">Cursor</button>
|
|
55
|
+
<button role="tab" aria-selected="false" data-harness="mcp">Generic MCP</button>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="code-wrap">
|
|
58
|
+
<div class="code-bar">
|
|
59
|
+
<span id="config-label">Hermes config</span>
|
|
60
|
+
<button id="copy-button" class="copy" type="button">Copy config</button>
|
|
61
|
+
</div>
|
|
62
|
+
<pre><code id="config-output"></code></pre>
|
|
63
|
+
</div>
|
|
64
|
+
<p id="copy-status" class="status" aria-live="polite"></p>
|
|
65
|
+
</section>
|
|
66
|
+
|
|
67
|
+
<section class="operator" aria-labelledby="operator-title">
|
|
68
|
+
<div class="operator-mark" aria-hidden="true">LOCAL</div>
|
|
69
|
+
<div>
|
|
70
|
+
<p class="eyebrow">SEPARATE EXECUTION LANE</p>
|
|
71
|
+
<h2 id="operator-title">Install the local operator to execute</h2>
|
|
72
|
+
<p>The cloud/read MCP can research, quote, simulate, and prepare. Execution belongs in a separate local process under your policy and approval controls.</p>
|
|
73
|
+
<div class="command"><code>npx @oracle-agent/oracle init</code><button id="copy-install" type="button">Copy</button></div>
|
|
74
|
+
</div>
|
|
75
|
+
</section>
|
|
76
|
+
|
|
77
|
+
<footer>
|
|
78
|
+
<p><strong>Custody stays local.</strong> The model proposes; the owner authorizes. This page never connects a wallet, requests a signature, or sends the values you enter.</p>
|
|
79
|
+
</footer>
|
|
80
|
+
</main>
|
|
81
|
+
<script src="app.js"></script>
|
|
82
|
+
</body>
|
|
83
|
+
</html>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: dark;
|
|
3
|
+
--ink: #07110f;
|
|
4
|
+
--panel: #0d1a17;
|
|
5
|
+
--panel-high: #12231f;
|
|
6
|
+
--line: #26443d;
|
|
7
|
+
--mint: #55e6c1;
|
|
8
|
+
--paper: #edf8f4;
|
|
9
|
+
--muted: #9bb8b0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
* { box-sizing: border-box; }
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
margin: 0;
|
|
16
|
+
background:
|
|
17
|
+
radial-gradient(circle at 85% 8%, rgba(85, 230, 193, 0.12), transparent 25rem),
|
|
18
|
+
linear-gradient(rgba(85, 230, 193, 0.025) 1px, transparent 1px),
|
|
19
|
+
linear-gradient(90deg, rgba(85, 230, 193, 0.025) 1px, transparent 1px),
|
|
20
|
+
var(--ink);
|
|
21
|
+
background-size: auto, 48px 48px, 48px 48px, auto;
|
|
22
|
+
color: var(--paper);
|
|
23
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
24
|
+
min-height: 100vh;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
button, input { font: inherit; }
|
|
28
|
+
.shell { width: min(980px, calc(100% - 32px)); margin: auto; padding: 56px 0 32px; }
|
|
29
|
+
.hero { max-width: 780px; margin-bottom: 42px; }
|
|
30
|
+
.wordmark { color: var(--paper); text-decoration: none; font-size: 14px; font-weight: 800; letter-spacing: .28em; }
|
|
31
|
+
.eyebrow { margin: 36px 0 10px; color: var(--mint); font: 700 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; }
|
|
32
|
+
h1 { margin: 0; font-size: clamp(40px, 7vw, 76px); line-height: .98; letter-spacing: -.055em; }
|
|
33
|
+
h1 span { color: var(--mint); }
|
|
34
|
+
.lede { max-width: 660px; margin: 24px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
|
|
35
|
+
.card { background: rgba(13, 26, 23, .92); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 4vw, 38px); margin-top: 18px; box-shadow: 0 22px 70px rgba(0, 0, 0, .22); }
|
|
36
|
+
.section-heading { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 28px; }
|
|
37
|
+
.step { display: grid; place-items: center; min-width: 42px; height: 42px; border: 1px solid var(--mint); border-radius: 50%; color: var(--mint); font: 700 12px ui-monospace, monospace; }
|
|
38
|
+
h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
|
|
39
|
+
.section-heading p, .operator p { color: var(--muted); margin: 6px 0 0; line-height: 1.55; }
|
|
40
|
+
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
|
|
41
|
+
label { display: flex; flex-direction: column; gap: 9px; color: var(--paper); font-size: 13px; font-weight: 700; }
|
|
42
|
+
label:first-child { grid-column: 1 / -1; }
|
|
43
|
+
.optional { color: var(--muted); font-weight: 400; }
|
|
44
|
+
input { width: 100%; color: var(--paper); background: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 13px 14px; outline: none; }
|
|
45
|
+
input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(85, 230, 193, .1); }
|
|
46
|
+
.hint { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
|
|
47
|
+
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
|
|
48
|
+
.tabs button { flex: 0 0 auto; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; cursor: pointer; }
|
|
49
|
+
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--mint); border-color: var(--mint); font-weight: 700; }
|
|
50
|
+
.code-wrap { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--ink); }
|
|
51
|
+
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
|
|
52
|
+
.copy, .command button { color: var(--mint); background: transparent; border: 0; cursor: pointer; font-weight: 700; }
|
|
53
|
+
pre { min-height: 270px; margin: 0; padding: 20px; overflow: auto; color: #c8f7e9; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
54
|
+
.status { min-height: 20px; margin: 10px 0 0; color: var(--mint); font-size: 12px; }
|
|
55
|
+
.operator { display: grid; grid-template-columns: 120px 1fr; gap: 30px; margin: 54px 0; padding: 0 20px; align-items: center; }
|
|
56
|
+
.operator .eyebrow { margin: 0 0 8px; }
|
|
57
|
+
.operator-mark { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--mint); border-radius: 50%; color: var(--mint); font: 700 12px ui-monospace, monospace; letter-spacing: .15em; box-shadow: inset 0 0 30px rgba(85, 230, 193, .09); }
|
|
58
|
+
.command { display: flex; justify-content: space-between; max-width: 520px; margin-top: 18px; padding: 13px 16px; background: var(--panel-high); border: 1px solid var(--line); border-radius: 9px; }
|
|
59
|
+
.command code { overflow: auto; }
|
|
60
|
+
footer { border-top: 1px solid var(--line); padding: 25px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
|
|
61
|
+
footer strong { color: var(--paper); }
|
|
62
|
+
|
|
63
|
+
@media (max-width: 640px) {
|
|
64
|
+
.shell { padding-top: 30px; }
|
|
65
|
+
.fields { grid-template-columns: 1fr; }
|
|
66
|
+
label:first-child { grid-column: auto; }
|
|
67
|
+
.operator { grid-template-columns: 1fr; padding: 0; }
|
|
68
|
+
.operator-mark { width: 88px; }
|
|
69
|
+
pre { min-height: 320px; }
|
|
70
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8"/>
|
|
5
|
+
<meta http-equiv="refresh" content="0; url=./oracle-splash/"/>
|
|
6
|
+
<link rel="canonical" href="./oracle-splash/"/>
|
|
7
|
+
<title>Oracle</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<p><a href="./oracle-splash/">Oracle splash</a></p>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// Oracle Console. Public frontend, Slice I.
|
|
2
|
+
//
|
|
3
|
+
// Single action UI: connect a wallet, then preview a proposed permission set.
|
|
4
|
+
// This file never installs a grant or session key and never claims on-chain
|
|
5
|
+
// enforcement. It never stores, logs, or transmits a private key, session
|
|
6
|
+
// secret, bearer token, or signer URL.
|
|
7
|
+
//
|
|
8
|
+
// Talks to two BFF routes only:
|
|
9
|
+
// POST /public/connect/assemble -> assembleUnsignedGrant(body)
|
|
10
|
+
// POST /public/grants/active -> listActiveGrants(body.store, body.opts)
|
|
11
|
+
|
|
12
|
+
(function () {
|
|
13
|
+
"use strict";
|
|
14
|
+
|
|
15
|
+
const CONNECT_ASSEMBLE_URL = "/public/connect/assemble";
|
|
16
|
+
const GRANTS_ACTIVE_URL = "/public/grants/active";
|
|
17
|
+
|
|
18
|
+
// Demo policy for the connected agent. Read only scopes, bounded caps,
|
|
19
|
+
// one hour expiry. Nothing here is authorization.
|
|
20
|
+
const DEMO_AGENT_ADDRESS = "0x1111111111111111111111111111111111111111";
|
|
21
|
+
const DEMO_CHAIN_ID = 8453;
|
|
22
|
+
const DEMO_ACTIONS = ["read:balance", "read:positions"];
|
|
23
|
+
const DEMO_TARGETS = [];
|
|
24
|
+
const DEMO_MAX_VALUE_WEI = "0";
|
|
25
|
+
const DEMO_MAX_GAS_WEI = "0";
|
|
26
|
+
const DEMO_MAX_SLIPPAGE_BPS = 0;
|
|
27
|
+
const DEMO_TTL_SECONDS = 3600;
|
|
28
|
+
|
|
29
|
+
const connectBtn = document.getElementById("connect-btn");
|
|
30
|
+
const walletState = document.getElementById("wallet-state");
|
|
31
|
+
const revokeBtn = document.getElementById("revoke-btn");
|
|
32
|
+
const permissionPanel = document.getElementById("permission-panel");
|
|
33
|
+
const panelStatus = document.getElementById("panel-status");
|
|
34
|
+
|
|
35
|
+
const stepConnect = document.getElementById("step-connect");
|
|
36
|
+
const stepBound = document.getElementById("step-bound");
|
|
37
|
+
const stepEnforced = document.getElementById("step-enforced");
|
|
38
|
+
|
|
39
|
+
const permChain = document.getElementById("perm-chain");
|
|
40
|
+
const permActions = document.getElementById("perm-actions");
|
|
41
|
+
const permTargets = document.getElementById("perm-targets");
|
|
42
|
+
const permMaxValue = document.getElementById("perm-max-value");
|
|
43
|
+
const permExpiry = document.getElementById("perm-expiry");
|
|
44
|
+
|
|
45
|
+
// In-memory session state only. Never persisted, never logged.
|
|
46
|
+
let session = {
|
|
47
|
+
accountAddress: null,
|
|
48
|
+
grant: null,
|
|
49
|
+
grantId: null,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
function setStep(stepEl, state) {
|
|
53
|
+
stepEl.setAttribute("data-state", state);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function resetSteps() {
|
|
57
|
+
setStep(stepConnect, "pending");
|
|
58
|
+
setStep(stepBound, "pending");
|
|
59
|
+
setStep(stepEnforced, "pending");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function hasInjectedWallet() {
|
|
63
|
+
return typeof window !== "undefined" && typeof window.ethereum !== "undefined";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function postJson(url, body) {
|
|
67
|
+
const res = await fetch(url, {
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers: { "content-type": "application/json" },
|
|
70
|
+
body: JSON.stringify(body),
|
|
71
|
+
});
|
|
72
|
+
const data = await res.json().catch(() => null);
|
|
73
|
+
if (!res.ok) {
|
|
74
|
+
const message = (data && data.error) || `request to ${url} failed with status ${res.status}`;
|
|
75
|
+
throw new Error(message);
|
|
76
|
+
}
|
|
77
|
+
return data;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function nowUnixSeconds() {
|
|
81
|
+
return Math.floor(Date.now() / 1000);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function formatExpiry(unixSeconds) {
|
|
85
|
+
return new Date(unixSeconds * 1000).toISOString();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function renderPermissionPanel(grant) {
|
|
89
|
+
permChain.textContent = String(grant.chainId);
|
|
90
|
+
permActions.textContent = grant.actions.join(", ");
|
|
91
|
+
permTargets.textContent = grant.targets.length ? grant.targets.join(", ") : "none, read and simulate only";
|
|
92
|
+
permMaxValue.textContent = `${grant.maxValueWei} wei`;
|
|
93
|
+
permExpiry.textContent = formatExpiry(grant.expiresAt);
|
|
94
|
+
permissionPanel.hidden = false;
|
|
95
|
+
revokeBtn.disabled = false;
|
|
96
|
+
panelStatus.textContent = "";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function requestAccount() {
|
|
100
|
+
const accounts = await window.ethereum.request({ method: "eth_requestAccounts" });
|
|
101
|
+
if (!accounts || !accounts[0]) {
|
|
102
|
+
throw new Error("no account returned by wallet");
|
|
103
|
+
}
|
|
104
|
+
return accounts[0];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async function connectFlow() {
|
|
108
|
+
if (!hasInjectedWallet()) {
|
|
109
|
+
walletState.textContent = "Connect a wallet to continue.";
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
connectBtn.disabled = true;
|
|
114
|
+
resetSteps();
|
|
115
|
+
permissionPanel.hidden = true;
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
walletState.textContent = "Requesting account.";
|
|
119
|
+
const accountAddress = await requestAccount();
|
|
120
|
+
session.accountAddress = accountAddress;
|
|
121
|
+
setStep(stepConnect, "done");
|
|
122
|
+
walletState.textContent = `Connected as ${accountAddress}.`;
|
|
123
|
+
|
|
124
|
+
setStep(stepBound, "active");
|
|
125
|
+
const assembled = await postJson(CONNECT_ASSEMBLE_URL, {
|
|
126
|
+
chainId: DEMO_CHAIN_ID,
|
|
127
|
+
agentAddress: DEMO_AGENT_ADDRESS,
|
|
128
|
+
accountAddress: accountAddress,
|
|
129
|
+
actions: DEMO_ACTIONS,
|
|
130
|
+
targets: DEMO_TARGETS,
|
|
131
|
+
maxValueWei: DEMO_MAX_VALUE_WEI,
|
|
132
|
+
maxGasWei: DEMO_MAX_GAS_WEI,
|
|
133
|
+
maxSlippageBps: DEMO_MAX_SLIPPAGE_BPS,
|
|
134
|
+
ttlSeconds: DEMO_TTL_SECONDS,
|
|
135
|
+
nonce: `console.${nowUnixSeconds()}`,
|
|
136
|
+
revocationKey: `revoke.console.${nowUnixSeconds()}`,
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const grant = assembled.payload.grant;
|
|
140
|
+
const grantId = assembled.payload.grantId;
|
|
141
|
+
session.grant = grant;
|
|
142
|
+
session.grantId = grantId;
|
|
143
|
+
setStep(stepBound, "done");
|
|
144
|
+
walletState.textContent = "Permission set reviewed. Building local preview.";
|
|
145
|
+
|
|
146
|
+
setStep(stepEnforced, "active");
|
|
147
|
+
await refreshActiveGrants();
|
|
148
|
+
setStep(stepEnforced, "done");
|
|
149
|
+
walletState.textContent = "Permission preview ready. No session was installed.";
|
|
150
|
+
} catch (err) {
|
|
151
|
+
walletState.textContent = `Connect failed: ${err.message}`;
|
|
152
|
+
} finally {
|
|
153
|
+
connectBtn.disabled = false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async function refreshActiveGrants() {
|
|
158
|
+
if (!session.grant || !session.accountAddress) return;
|
|
159
|
+
|
|
160
|
+
const store = [
|
|
161
|
+
{
|
|
162
|
+
grant: session.grant,
|
|
163
|
+
revoked: false,
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
|
|
167
|
+
const result = await postJson(GRANTS_ACTIVE_URL, {
|
|
168
|
+
store: store,
|
|
169
|
+
opts: {
|
|
170
|
+
now: nowUnixSeconds(),
|
|
171
|
+
accountAddress: session.accountAddress,
|
|
172
|
+
agentAddress: DEMO_AGENT_ADDRESS,
|
|
173
|
+
chainId: DEMO_CHAIN_ID,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
const active = Array.isArray(result) ? result : result.active || [];
|
|
178
|
+
const match = active.find((entry) => entry.id === session.grantId);
|
|
179
|
+
|
|
180
|
+
if (match) {
|
|
181
|
+
renderPermissionPanel(match.grant);
|
|
182
|
+
} else {
|
|
183
|
+
permissionPanel.hidden = false;
|
|
184
|
+
revokeBtn.disabled = true;
|
|
185
|
+
panelStatus.textContent = "This permission preview is no longer active.";
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function clearPreviewFlow() {
|
|
190
|
+
if (!session.grant) return;
|
|
191
|
+
revokeBtn.disabled = true;
|
|
192
|
+
session.grant = null;
|
|
193
|
+
session.grantId = null;
|
|
194
|
+
permissionPanel.hidden = true;
|
|
195
|
+
resetSteps();
|
|
196
|
+
setStep(stepConnect, "done");
|
|
197
|
+
walletState.textContent = "Permission preview cleared. No on-chain revocation was required.";
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
connectBtn.addEventListener("click", () => {
|
|
201
|
+
connectFlow();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
revokeBtn.addEventListener("click", () => {
|
|
205
|
+
clearPreviewFlow();
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// ── Bitcoin multi-wallet lane (actual BTC L1) ───────────────────────────
|
|
209
|
+
const btcConnectBtn = document.getElementById("btc-connect-btn");
|
|
210
|
+
const btcWalletState = document.getElementById("btc-wallet-state");
|
|
211
|
+
const btcPanel = document.getElementById("btc-panel");
|
|
212
|
+
const btcWalletLabel = document.getElementById("btc-wallet-label");
|
|
213
|
+
const btcAddressEl = document.getElementById("btc-address");
|
|
214
|
+
const btcDetectedEl = document.getElementById("btc-detected");
|
|
215
|
+
const btcPanelStatus = document.getElementById("btc-panel-status");
|
|
216
|
+
|
|
217
|
+
let btcSession = null;
|
|
218
|
+
|
|
219
|
+
function refreshBtcDetected() {
|
|
220
|
+
const api = window.OracleBitcoinWallets;
|
|
221
|
+
if (!api) {
|
|
222
|
+
if (btcDetectedEl) btcDetectedEl.textContent = "wallet adapter missing";
|
|
223
|
+
return [];
|
|
224
|
+
}
|
|
225
|
+
const detected = api.listDetected();
|
|
226
|
+
if (btcDetectedEl) {
|
|
227
|
+
btcDetectedEl.textContent = detected.length
|
|
228
|
+
? detected.map((d) => d.label).join(", ")
|
|
229
|
+
: "none - install Xverse / UniSat / Leather / OKX / Phantom / Magic Eden";
|
|
230
|
+
}
|
|
231
|
+
return detected;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async function btcConnectFlow() {
|
|
235
|
+
const api = window.OracleBitcoinWallets;
|
|
236
|
+
if (!api) {
|
|
237
|
+
btcWalletState.textContent = "Bitcoin wallet adapter failed to load.";
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
btcConnectBtn.disabled = true;
|
|
241
|
+
btcWalletState.textContent = "Requesting Bitcoin wallet.";
|
|
242
|
+
try {
|
|
243
|
+
btcSession = await api.connect();
|
|
244
|
+
btcWalletState.textContent = `BTC connected: ${btcSession.walletLabel}`;
|
|
245
|
+
btcWalletLabel.textContent = btcSession.walletLabel;
|
|
246
|
+
btcAddressEl.textContent = btcSession.address;
|
|
247
|
+
btcPanel.hidden = false;
|
|
248
|
+
btcPanelStatus.textContent =
|
|
249
|
+
"Connected. Signing stays in your wallet (signPsbt). Oracle only reads + broadcasts user-signed hex.";
|
|
250
|
+
refreshBtcDetected();
|
|
251
|
+
} catch (err) {
|
|
252
|
+
btcWalletState.textContent = `BTC connect failed: ${err.message}`;
|
|
253
|
+
btcPanelStatus.textContent = err.message;
|
|
254
|
+
} finally {
|
|
255
|
+
btcConnectBtn.disabled = false;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (btcConnectBtn) {
|
|
260
|
+
btcConnectBtn.addEventListener("click", () => {
|
|
261
|
+
btcConnectFlow();
|
|
262
|
+
});
|
|
263
|
+
refreshBtcDetected();
|
|
264
|
+
if (!refreshBtcDetected().length) {
|
|
265
|
+
btcWalletState.textContent = "No Bitcoin wallet detected yet.";
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (!hasInjectedWallet()) {
|
|
270
|
+
walletState.textContent = "Connect an EVM wallet to continue.";
|
|
271
|
+
}
|
|
272
|
+
})();
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// Multi-wallet Bitcoin connector for Oracle Console.
|
|
2
|
+
// Injected providers only - no npm wallet SDK required in the static console.
|
|
3
|
+
// Supported: Xverse, UniSat, Leather, OKX, Phantom, Magic Eden, generic.
|
|
4
|
+
// Signing: PSBT stays in the wallet. Oracle never sees private keys.
|
|
5
|
+
|
|
6
|
+
(function (root) {
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
const WALLETS = [
|
|
10
|
+
{
|
|
11
|
+
id: "unisat",
|
|
12
|
+
label: "UniSat",
|
|
13
|
+
detect: () => window.unisat,
|
|
14
|
+
async connect(provider) {
|
|
15
|
+
const accounts = await provider.requestAccounts();
|
|
16
|
+
const address = accounts && accounts[0];
|
|
17
|
+
if (!address) throw new Error("UniSat returned no address");
|
|
18
|
+
const network = (await provider.getNetwork?.()) || "livenet";
|
|
19
|
+
return { address, network, provider };
|
|
20
|
+
},
|
|
21
|
+
async signPsbt(provider, psbtHex, options = {}) {
|
|
22
|
+
return provider.signPsbt(psbtHex, options);
|
|
23
|
+
},
|
|
24
|
+
async pushPsbt(provider, psbtHex) {
|
|
25
|
+
if (typeof provider.pushPsbt === "function") return provider.pushPsbt(psbtHex);
|
|
26
|
+
throw new Error("UniSat pushPsbt unavailable - use Oracle broadcast with raw hex");
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "okx",
|
|
31
|
+
label: "OKX",
|
|
32
|
+
detect: () => window.okxwallet && window.okxwallet.bitcoin,
|
|
33
|
+
async connect(provider) {
|
|
34
|
+
const result = await provider.connect();
|
|
35
|
+
const address = result?.address || result?.addresses?.[0] || (Array.isArray(result) && result[0]);
|
|
36
|
+
if (!address) throw new Error("OKX returned no address");
|
|
37
|
+
return { address, network: result?.network || "livenet", provider };
|
|
38
|
+
},
|
|
39
|
+
async signPsbt(provider, psbtHex, options = {}) {
|
|
40
|
+
return provider.signPsbt(psbtHex, options);
|
|
41
|
+
},
|
|
42
|
+
async pushPsbt(provider, psbtHex) {
|
|
43
|
+
if (typeof provider.pushPsbt === "function") return provider.pushPsbt(psbtHex);
|
|
44
|
+
throw new Error("OKX pushPsbt unavailable - use Oracle broadcast with raw hex");
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "xverse",
|
|
49
|
+
label: "Xverse",
|
|
50
|
+
detect: () =>
|
|
51
|
+
window.XverseProviders?.BitcoinProvider ||
|
|
52
|
+
window.BitcoinProvider ||
|
|
53
|
+
(window.xverse && window.xverse.bitcoin),
|
|
54
|
+
async connect(provider) {
|
|
55
|
+
// Sats Connect request shape when provider.request exists
|
|
56
|
+
if (typeof provider.request === "function") {
|
|
57
|
+
const res = await provider.request("getAccounts", {
|
|
58
|
+
purposes: ["payment", "ordinals"],
|
|
59
|
+
message: "Connect to Oracle",
|
|
60
|
+
});
|
|
61
|
+
const arr = res?.result || res;
|
|
62
|
+
const payment = Array.isArray(arr) ? arr.find((a) => a.purpose === "payment") || arr[0] : null;
|
|
63
|
+
const address = payment?.address || payment;
|
|
64
|
+
if (!address) throw new Error("Xverse returned no address");
|
|
65
|
+
return { address, network: payment?.network || "Mainnet", provider };
|
|
66
|
+
}
|
|
67
|
+
if (typeof provider.connect === "function") {
|
|
68
|
+
const res = await provider.connect("Oracle");
|
|
69
|
+
const address = res?.addresses?.payment?.address || res?.paymentAddress || res?.address;
|
|
70
|
+
if (!address) throw new Error("Xverse returned no address");
|
|
71
|
+
return { address, network: res?.network || "Mainnet", provider };
|
|
72
|
+
}
|
|
73
|
+
throw new Error("Xverse provider has no connect/request method");
|
|
74
|
+
},
|
|
75
|
+
async signPsbt(provider, psbtBase64, options = {}) {
|
|
76
|
+
if (typeof provider.request === "function") {
|
|
77
|
+
const res = await provider.request("signPsbt", {
|
|
78
|
+
psbt: psbtBase64,
|
|
79
|
+
allowedSignHash: options.allowedSignHash,
|
|
80
|
+
signInputs: options.signInputs,
|
|
81
|
+
broadcast: false,
|
|
82
|
+
});
|
|
83
|
+
return res?.result?.psbt || res?.psbt || res;
|
|
84
|
+
}
|
|
85
|
+
if (typeof provider.signPsbt === "function") {
|
|
86
|
+
return provider.signPsbt(psbtBase64, options);
|
|
87
|
+
}
|
|
88
|
+
throw new Error("Xverse signPsbt unavailable");
|
|
89
|
+
},
|
|
90
|
+
async pushPsbt() {
|
|
91
|
+
throw new Error("Xverse: finalize in wallet or broadcast raw hex via Oracle");
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "leather",
|
|
96
|
+
label: "Leather",
|
|
97
|
+
detect: () => window.LeatherProvider || window.HiroWalletProvider || window.btc,
|
|
98
|
+
async connect(provider) {
|
|
99
|
+
if (typeof provider.request === "function") {
|
|
100
|
+
const res = await provider.request("getAddresses");
|
|
101
|
+
const addrs = res?.result?.addresses || res?.addresses || [];
|
|
102
|
+
const payment = addrs.find((a) => a.type === "p2wpkh" || a.symbol === "BTC") || addrs[0];
|
|
103
|
+
const address = payment?.address;
|
|
104
|
+
if (!address) throw new Error("Leather returned no address");
|
|
105
|
+
return { address, network: payment?.network || "mainnet", provider };
|
|
106
|
+
}
|
|
107
|
+
throw new Error("Leather provider has no request method");
|
|
108
|
+
},
|
|
109
|
+
async signPsbt(provider, psbtBase64, options = {}) {
|
|
110
|
+
const res = await provider.request("signPsbt", {
|
|
111
|
+
hex: options.hex || undefined,
|
|
112
|
+
base64: psbtBase64,
|
|
113
|
+
broadcast: false,
|
|
114
|
+
...options,
|
|
115
|
+
});
|
|
116
|
+
return res?.result?.hex || res?.result?.base64 || res?.hex || res;
|
|
117
|
+
},
|
|
118
|
+
async pushPsbt() {
|
|
119
|
+
throw new Error("Leather: broadcast raw hex via Oracle");
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: "phantom",
|
|
124
|
+
label: "Phantom",
|
|
125
|
+
detect: () => window.phantom && window.phantom.bitcoin,
|
|
126
|
+
async connect(provider) {
|
|
127
|
+
const res = await provider.requestAccounts();
|
|
128
|
+
const address = res?.[0]?.address || res?.[0];
|
|
129
|
+
if (!address) throw new Error("Phantom returned no BTC address");
|
|
130
|
+
return { address, network: "mainnet", provider };
|
|
131
|
+
},
|
|
132
|
+
async signPsbt(provider, psbtHex, options = {}) {
|
|
133
|
+
const res = await provider.signPSBT(Buffer.from(psbtHex, "hex"), options);
|
|
134
|
+
return res;
|
|
135
|
+
},
|
|
136
|
+
async pushPsbt() {
|
|
137
|
+
throw new Error("Phantom: broadcast raw hex via Oracle");
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "magic-eden",
|
|
142
|
+
label: "Magic Eden",
|
|
143
|
+
detect: () => window.magicEden && window.magicEden.bitcoin,
|
|
144
|
+
async connect(provider) {
|
|
145
|
+
const res = await provider.connect();
|
|
146
|
+
const address = res?.address || res?.ordinals?.address || res?.payment?.address;
|
|
147
|
+
if (!address) throw new Error("Magic Eden returned no address");
|
|
148
|
+
return { address, network: "mainnet", provider };
|
|
149
|
+
},
|
|
150
|
+
async signPsbt(provider, psbt, options = {}) {
|
|
151
|
+
return provider.signPsbt(psbt, options);
|
|
152
|
+
},
|
|
153
|
+
async pushPsbt() {
|
|
154
|
+
throw new Error("Magic Eden: broadcast raw hex via Oracle");
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
function listDetected() {
|
|
160
|
+
return WALLETS.filter((w) => {
|
|
161
|
+
try {
|
|
162
|
+
return !!w.detect();
|
|
163
|
+
} catch {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}).map((w) => ({ id: w.id, label: w.label }));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async function connect(preferredId) {
|
|
170
|
+
const detected = WALLETS.filter((w) => {
|
|
171
|
+
try {
|
|
172
|
+
return !!w.detect();
|
|
173
|
+
} catch {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
if (!detected.length) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
"No Bitcoin wallet detected. Install Xverse, UniSat, Leather, OKX, Phantom, or Magic Eden."
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
const wallet = (preferredId && detected.find((w) => w.id === preferredId)) || detected[0];
|
|
183
|
+
const provider = wallet.detect();
|
|
184
|
+
const session = await wallet.connect(provider);
|
|
185
|
+
return {
|
|
186
|
+
walletId: wallet.id,
|
|
187
|
+
walletLabel: wallet.label,
|
|
188
|
+
address: session.address,
|
|
189
|
+
network: session.network,
|
|
190
|
+
provider: session.provider,
|
|
191
|
+
wallet,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
async function signPsbt(session, psbt, options = {}) {
|
|
196
|
+
if (!session?.wallet || !session?.provider) throw new Error("Bitcoin wallet not connected");
|
|
197
|
+
return session.wallet.signPsbt(session.provider, psbt, options);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
root.OracleBitcoinWallets = {
|
|
201
|
+
listDetected,
|
|
202
|
+
connect,
|
|
203
|
+
signPsbt,
|
|
204
|
+
supported: WALLETS.map((w) => ({ id: w.id, label: w.label })),
|
|
205
|
+
};
|
|
206
|
+
})(typeof window !== "undefined" ? window : globalThis);
|