Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,17 @@ Domain’e özel imza/finality doğrulamaları üst katmanda ayrıca zorunlu tut


Audit evidence template: `docs/AUDIT_EVIDENCE_BUNDLE.md`.

---

# AOXCON ↔ AOXCHAIN Uyum Katmanı

Bu depoya, AOXCON ve AOXCHAIN entegrasyonu için çoklu klasör yapısı eklendi:

- `cli/` → Etkileşimli terminal menüsü (`python3 cli/aoxchain_cli.py`)
- `frontend/` → Hızlı başlangıç frontpage (`frontend/index.html`)
- `examples/contracts/` → Çoklu Move sözleşme örnekleri
- `scripts/bootstrap.sh` → Build + test otomasyon akışı
- `sdk/ts/` → TypeScript istemci SDK başlangıç alanı

Bu yapı, Move tabanlı geliştirme akışını daha modüler ve genişletilebilir hale getirmek için hazırlanmıştır.
16 changes: 16 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AOXChain CLI

Bu klasördeki `aoxchain_cli.py`, AOXCON Move deposu için etkileşimli bir komut satırı arayüzü sağlar.

## Kullanım

```bash
python3 cli/aoxchain_cli.py
```

## Özellikler

- `sui move test` ve `sui move build` komutlarını menüden çalıştırma
- AOXCON ↔ AOXCHAIN uyumluluk klasörlerini JSON olarak görüntüleme
- Örnek Move sözleşmelerini listeleme
- Frontend giriş sayfası yolunu gösterme
83 changes: 83 additions & 0 deletions cli/aoxchain_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env python3
"""AOXChain uyumlu etkileşimli yerel CLI yardımcı aracı."""

from __future__ import annotations

import json
import shlex
import subprocess
from dataclasses import dataclass
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]


@dataclass
class MenuAction:
key: str
label: str
command: list[str] | None = None


def run_command(command: list[str]) -> None:
print(f"\n$ {' '.join(shlex.quote(part) for part in command)}")
completed = subprocess.run(command, cwd=ROOT, check=False, text=True, capture_output=True)
if completed.stdout:
print(completed.stdout.strip())
if completed.stderr:
print(completed.stderr.strip())
if completed.returncode != 0:
print(f"\nKomut başarısız oldu (kod={completed.returncode}).")


def show_repo_layout() -> None:
manifest = {
"move_package": str(ROOT / "Move.toml"),
"contracts": str(ROOT / "sources"),
"contract_examples": str(ROOT / "examples" / "contracts"),
"frontend": str(ROOT / "frontend"),
"scripts": str(ROOT / "scripts"),
"typescript_sdk": str(ROOT / "sdk" / "ts"),
}
print(json.dumps(manifest, indent=2, ensure_ascii=False))


def interactive_menu() -> None:
actions = [
MenuAction("1", "Move testlerini çalıştır", ["sui", "move", "test"]),
MenuAction("2", "Move paketini derle", ["sui", "move", "build"]),
MenuAction("3", "Repo uyumluluk klasörlerini göster"),
MenuAction("4", "Örnek sözleşme listesini göster", ["bash", "-lc", "find examples/contracts -maxdepth 1 -name '*.move' | sort"]),
MenuAction("5", "Frontend index yolunu göster"),
MenuAction("q", "Çıkış"),
]

while True:
print("\n=== AOXCON ↔ AOXCHAIN Move Toolkit CLI ===")
for action in actions:
print(f"[{action.key}] {action.label}")

choice = input("Seçiminiz: ").strip().lower()
if choice == "q":
print("Çıkılıyor.")
return

selected = next((action for action in actions if action.key == choice), None)
if selected is None:
print("Geçersiz seçim, tekrar deneyin.")
continue

if choice == "3":
show_repo_layout()
continue

if choice == "5":
print(ROOT / "frontend" / "index.html")
continue

if selected.command is not None:
run_command(selected.command)


if __name__ == "__main__":
interactive_menu()
19 changes: 19 additions & 0 deletions examples/contracts/governance_example.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module examples::governance_example {
struct Proposal has copy, drop {
id: u64,
yes: u64,
no: u64,
}

public fun create(id: u64): Proposal {
Proposal { id, yes: 0, no: 0 }
}

public fun vote_yes(p: &mut Proposal) {
p.yes = p.yes + 1;
}

public fun vote_no(p: &mut Proposal) {
p.no = p.no + 1;
}
}
11 changes: 11 additions & 0 deletions examples/contracts/nft_rental_example.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module examples::nft_rental_example {
struct RentalAgreement has copy, drop {
renter: address,
lessor: address,
expires_at_ms: u64,
}

public fun new(renter: address, lessor: address, expires_at_ms: u64): RentalAgreement {
RentalAgreement { renter, lessor, expires_at_ms }
}
}
15 changes: 15 additions & 0 deletions examples/contracts/oracle_guard_example.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module examples::oracle_guard_example {
const MAX_DEVIATION_BPS: u64 = 300;

public fun within_bounds(reference_price: u64, observed_price: u64): bool {
if (reference_price == 0) {
return false
};
let diff = if (observed_price > reference_price) {
observed_price - reference_price
} else {
reference_price - observed_price
};
(diff * 10_000) / reference_price <= MAX_DEVIATION_BPS
}
}
23 changes: 23 additions & 0 deletions examples/contracts/payment_channel_example.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module examples::payment_channel_example {
use sui::object::{Self, UID};
use sui::tx_context::{Self, TxContext};

public struct Channel has key, store {
id: UID,
payer: address,
payee: address,
amount: u64,
open: bool,
}

public entry fun open_channel(payee: address, amount: u64, ctx: &mut TxContext) {
let channel = Channel {
id: object::new(ctx),
payer: tx_context::sender(ctx),
payee,
amount,
open: true,
};
sui::transfer::transfer(channel, tx_context::sender(ctx));
}
}
47 changes: 47 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!doctype html>
<html lang="tr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AOXC Move Frontpage</title>
<style>
body { font-family: Inter, system-ui, sans-serif; margin: 0; background: #06091a; color: #eaf0ff; }
header { padding: 32px; border-bottom: 1px solid #243053; }
main { max-width: 900px; margin: 0 auto; padding: 32px; }
.card { background: #111937; border: 1px solid #2c3866; border-radius: 14px; padding: 16px; margin-bottom: 16px; }
code { color: #9ed0ff; }
button { background: #2d6bff; color: white; border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; }
pre { background: #0c1330; padding: 14px; border-radius: 10px; overflow: auto; }
</style>
</head>
<body>
<header>
<h1>AOXCON Move Library Frontpage</h1>
<p>AOXCON ve AOXCHAIN ile uyumlu Move ekosistemi başlangıç ekranı.</p>
</header>
<main>
<section class="card">
<h2>Hızlı Başlat</h2>
<p>CLI menüsünü açmak için:</p>
<pre><code>python3 cli/aoxchain_cli.py</code></pre>
</section>
<section class="card">
<h2>Sözleşme Örnekleri</h2>
<p>`examples/contracts` içinde çoklu örnek paketler bulunur.</p>
<button id="loadExamples">Örnekleri Yükle</button>
<pre id="output">Henüz yüklenmedi.</pre>
</section>
</main>
<script>
const examples = [
"payment_channel_example.move",
"governance_example.move",
"nft_rental_example.move",
"oracle_guard_example.move"
];
document.getElementById("loadExamples").addEventListener("click", () => {
document.getElementById("output").textContent = examples.map((e, i) => `${i + 1}. ${e}`).join("\n");
});
</script>
</body>
</html>
13 changes: 13 additions & 0 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

echo "[AOXC] Move bağımlılıkları doğrulanıyor..."
sui --version

echo "[AOXC] Paket derlemesi başlatılıyor..."
sui move build

echo "[AOXC] Testler başlatılıyor..."
sui move test

echo "[AOXC] Tamamlandı."
9 changes: 9 additions & 0 deletions sdk/ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# AOXC TypeScript SDK Placeholder

Bu dizin AOXCHAIN istemcileriyle uyumlu olacak TypeScript yardımcı fonksiyonları için ayrılmıştır.

Planlanan modüller:

- `client.ts`: RPC bağlantı katmanı
- `contracts.ts`: Move fonksiyon çağrı yardımcıları
- `wallet.ts`: imzalama/transaction hazırlama yardımcıları
Loading