Metadata-Version: 2.4
Name: 0bit-0gate
Version: 0.1.0
Summary: Official Python SDK for the 0Gate ramp API. Stripe-style ergonomics — secret keys, sessions, signed webhooks.
Author: 0Bit / 0Bit
License: MIT
Project-URL: Homepage, https://0bit.io
Project-URL: Documentation, https://0bit.io/docs/0gate
Project-URL: Repository, https://github.com/0Bit-org/0bit_core
Keywords: 0gate,0bit,ramp,crypto,on-ramp,off-ramp
Classifier: Development Status :: 3 - Alpha
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
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Provides-Extra: django
Requires-Dist: django>=4.2; extra == "django"
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100; extra == "fastapi"
Requires-Dist: starlette>=0.27; extra == "fastapi"
Provides-Extra: flask
Requires-Dist: flask>=2.3; extra == "flask"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: responses>=0.24; extra == "dev"
Requires-Dist: mypy>=1.7; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Dynamic: license-file

# @0bit/0gate

Unified official SDK for the 0Gate ramp API — Node server, browser embed, React components, and Python.

## Install

| Surface | Command |
|---------|---------|
| **Node (server)** | `npm install @0bit/0gate` |
| **Browser (bundler)** | `npm install @0bit/0gate` → `import { GateRamp } from '@0bit/0gate/browser'` |
| **React** | `npm install @0bit/0gate` → `import { RampCheckout } from '@0bit/0gate/react'` |
| **Python** | `pip install 0bit-0gate` → `from zerobit.gate import GateClient` |

### Python framework extras

```bash
pip install "0bit-0gate[django]"
pip install "0bit-0gate[fastapi]"
pip install "0bit-0gate[flask]"
```

## Quick start — Node

```ts
import { GateClient } from '@0bit/0gate';

const client = new GateClient({ apiKey: process.env.GATE_KEY! });

const session = await client.sessions.create({
   amount: '100.00',
   currency: 'EUR',
   return_url: 'https://myapp.example/done',
});

console.log(session.client_secret);
```

## Quick start — Browser

```ts
import { GateRamp } from '@0bit/0gate/browser';

const ramp = new GateRamp({
   publishableKey: 'pk_test_...',
   clientSecret: session.client_secret,
});
await ramp.mount('#gate-container');
```

CDN (IIFE):

```html
<script src="https://cdn.jsdelivr.net/npm/@0bit/0gate/dist/browser/0gate.iife.js"></script>
<script>
  const ramp = new GateJS.GateRamp({ publishableKey: 'pk_test_...', clientSecret: 'gsec_...' });
  ramp.mount('#container');
</script>
```

## Quick start — React

```tsx
import { RampCheckout } from '@0bit/0gate/react';

<RampCheckout
   publishableKey={import.meta.env.VITE_GATE_KEY}
   clientSecret={session.client_secret}
   onSuccess={({ txId }) => router.push('/done')}
/>
```

## Quick start — Python

```python
from zerobit.gate import GateClient

client = GateClient(api_key="sk_test_...")
session = client.sessions.create({
    "amount": "100.00",
    "currency": "EUR",
    "return_url": "https://myapp.example/done",
})
print(session["client_secret"])
```

## SDK naming policy

| Surface | 0Gate | Future products |
|---------|-------|-----------------|
| npm | `@0bit/0gate` | `@0bit/0pools`, `@0bit/0base` |
| PyPI | `0bit-0gate` | `0bit-0pools`, `0bit-0base` |
| Python import | `zerobit.gate` | `zerobit.pools`, `zerobit.base` |

## Development

```bash
cd 0Bit_apps/0Gate/0Gate_Sdk
npm ci && npm run build && npm test
pip install -e ".[dev,django,fastapi,flask]"
pytest
```

## License

MIT. Part of the [0Bit / 0Gate](https://0bit.io) ramp platform.
