Skip to main content

Widget Attributes

All HTML attributes accepted by the <argyros-swap> element.

Reference

AttributeTypeDefaultRequiredDescription
api-keystringyesYour Argyros API key. Used to authenticate SDK requests.
chain"solana" | "fogo""solana"noTarget chain. Determines which DEX markets are searched.
base-urlstring"https://api.argyros.xyz"noAPI base URL override. Use for self-hosted instances.
rpc-urlstring"https://mainnet.fogo.io/"noSolana JSON-RPC endpoint for balance queries. The widget calls getBalance and getTokenAccountsByOwner against this URL.
default-input-mintstringnoPre-selected input token mint address.
default-output-mintstringnoPre-selected output token mint address.
theme"dark" | "light""dark"noColor theme. See Theming for CSS variable overrides.

Dynamic Updates

All attributes are reactive. Changing them after mount updates the widget:
const widget = document.querySelector("argyros-swap");

// Switch to Fogo chain
widget.setAttribute("chain", "fogo");

// Point to a different API
widget.setAttribute("base-url", "http://localhost:8080");

// Change RPC endpoint
widget.setAttribute("rpc-url", "https://mainnet.fogo.io");

// Switch theme
widget.setAttribute("theme", "light");
When api-key, chain, or base-url change, the widget re-creates the internal SDK client. When rpc-url changes, subsequent balance queries use the new endpoint.

Examples

Minimal

<argyros-swap api-key="argy_your_api_key"></argyros-swap>

Pre-selected tokens (SOL to USDC)

<argyros-swap
  api-key="argy_your_api_key"
  default-input-mint="So11111111111111111111111111111111111111112"
  default-output-mint="uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG"
></argyros-swap>

Self-hosted with custom RPC

<argyros-swap
  api-key="any-value"
  base-url="http://localhost:8080"
  rpc-url="https://mainnet.fogo.io"
  chain="solana"
  theme="light"
></argyros-swap>

Fogo chain

<argyros-swap
  api-key="argy_your_api_key"
  chain="fogo"
></argyros-swap>