Metadata-Version: 2.4
Name: anygas
Version: 1.0.0
Summary: Gasless cross-chain for AI agents — one signature moves value across 22 EVM chains + Stellar, no native gas
Project-URL: Homepage, https://anygas.xyz
Project-URL: Repository, https://github.com/ox31461/Gasless-Anygas-ROBYN-Relay
Project-URL: Documentation, https://anygas.xyz
Project-URL: Bug Tracker, https://github.com/ox31461/Gasless-Anygas-ROBYN-Relay/issues
Author: Any-Gas Systems
License: MIT
License-File: LICENSE
License-File: NOTICE
Keywords: ai-agents,anygas,cross-chain,defi,ethereum,gasless,permit2,stellar,web3
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: eth-account>=0.11
Requires-Dist: httpx>=0.24
Description-Content-Type: text/markdown

# anygas

**Gasless cross-chain for AI agents — one signature moves value across 22 EVM chains + Stellar, no native gas.**

An AI agent (or any automated system) holds a single verified asset (WETH / USDG / …)
and transacts by signing off-chain intents. Robyn's relayer fronts the gas on every
chain and is repaid from the asset. The signer needs **zero native balance** on any
chain — it only signs.

```bash
pip install anygas
```

## Quickstart

```python
from anygas import Robyn

ag = Robyn(signer="0x<private-key>")                                  # or an eth_account LocalAccount
ag.pay(token=USDG, to=merchant, amount=25_000000)                     # gasless transfer, one signature
ag.cross_chain(fromChain=8453, fromToken=USDC_BASE, amount=25_000000, # MOVE value across chains,
               toChain=42161, toToken=USDC_ARB)                       # gasless on BOTH sides
```

That's it. With no `svc` argument the client talks to the hosted gateway at
`https://api.anygas.xyz/svc` — **zero config**. Read-only methods (`info`, `mesh`,
`quote`, `route`, `route_status`) work with **no signer** at all.

`AnyGas` is a friendly alias for `Robyn`:

```python
from anygas import AnyGas
ag = AnyGas()                       # read-only, hosted gateway
print(ag.mesh())                    # the cross-chain route graph
```

## One-time Permit2 setup (for `cross_chain`)

`cross_chain` uses a Permit2 SignatureTransfer. Once per `(token, chain)` the agent
must approve Permit2 to spend the token:

```solidity
token.approve(client.permit2, MaxUint256)   // standard one-time Permit2 approval
```

After that, every cross-chain move is a single gasless signature — no native token ever.

## Methods

| Method | Kind | Endpoint | Notes |
| --- | --- | --- | --- |
| `info()` | read | `GET /api/gasless/info` | Router, chainId, gasless chain map (cached). |
| `chains()` | read | — | `info().gaslessChains`. |
| `mesh()` | read | `GET /api/route/chains` | Cross-chain route graph + relayer/spender (alias of `route_info`). |
| `route_info()` | read | `GET /api/route/chains` | Same as `mesh()`. |
| `quote(token, kind="pay")` | read | `POST /api/gasless/quote` | Fee quote; `kind` is `"pay"` or `"call"`. |
| `route(fromChain, fromToken, toChain, toToken, amount, toAddress=None, slippage=None)` | read | `POST /api/route/quote` | Quote the best cross-chain route. |
| `route_status(id)` / `status(id)` | read | `GET /api/route/status?id=` | Track an in-flight route to DONE. |
| `pay(token, to, amount, route="direct")` | exec | `POST /api/gasless/submit` (`pay`) | Gasless transfer; token must be a verified fee token. |
| `buy(token, amount, target, calldata, route="direct")` | exec | `POST /api/gasless/submit` (`call`) | Gasless purchase via an allowlisted venue. |
| `pay_any(token, to, amount, verifiedAsset, route="direct", chainId=None)` | exec | `POST /api/gasless/submit` (`payAny`) | Pay in ANY verified-swappable token; fee auto-converts. |
| `cross_chain(fromChain, fromToken, amount, toChain, toToken, toAddress=None)` | exec | `POST /api/route/execute` (`permit2`) | Move value across chains, one Permit2 signature. |
| `permit2` | prop | — | Canonical Permit2 address `0x0000…78BA3`. |

Method names are snake_case; **wire payload keys stay camelCase** exactly as the
reference JS SDK sends them (`fromChain`, `toToken`, `verifiedAsset`, …).

### Notes on the execution methods

- **`pay` / `buy` / `pay_any`** sign an EIP-712 intent **and** an EIP-2612 token
  permit. The permit requires reading the token's `name()` and `nonces(owner)` from
  chain — pass `rpc="https://…"` to the constructor so the client can do those
  read-only `eth_call`s (this mirrors the ethers provider in the JS SDK).
- **`cross_chain`** uses Permit2 and needs **no RPC** — just a signer and the hosted
  gateway.
- Execution methods raise `RobynError` if no signer was provided.

## Signing

- **Intents** (`Pay` / `Call` / `PayAny`) are EIP-712 typed data over the Robyn
  router domain (`RobynGaslessRouter` / `RobynAnyGasRouter`, version `1`).
- **Permit2** (`cross_chain`) signs `PermitTransferFrom(TokenPermissions permitted,
  address spender, uint256 nonce, uint256 deadline)` over the domain
  `{name:"Permit2", chainId, verifyingContract:0x000000000022D473030F116dDEE9F6B43aC78BA3}`
  (no `version` field), via `eth_account`.

## Integrate, don't replicate

The client in this package is **MIT** — vendor it, fork it, wrap it, ship it inside
your agent. The **Robyn relay, router, and on-chain contracts it talks to are
proprietary infrastructure**, operated by Any-Gas Systems. This SDK is a thin,
permissively-licensed door into that hosted service. Build **on** it — please don't
try to clone the relay behind it. See `NOTICE`.

## License

MIT © 2026 Any-Gas Systems. See `LICENSE`.
