Skip to content

Commit ae3d9e8

Browse files
authored
Add files via upload
1 parent 0e93d39 commit ae3d9e8

20 files changed

Lines changed: 159 additions & 0 deletions

signia-sdk/python/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# Signia Python SDK
3+
4+
Python client and helpers for Signia.

signia-sdk/python/pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
[project]
3+
name = "signia"
4+
version = "0.1.0"
5+
dependencies = ["requests"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__all__ = ["api", "types", "utils"]

signia-sdk/python/signia/api.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
import requests
3+
4+
class SigniaClient:
5+
def __init__(self, base_url: str):
6+
self.base_url = base_url
7+
8+
def compile(self, payload: dict):
9+
r = requests.post(f"{self.base_url}/v1/compile", json=payload)
10+
r.raise_for_status()
11+
return r.json()
12+
13+
def verify(self, payload: dict):
14+
r = requests.post(f"{self.base_url}/v1/verify", json=payload)
15+
r.raise_for_status()
16+
return r.json()

signia-sdk/python/signia/types.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
from dataclasses import dataclass
3+
from typing import List
4+
5+
@dataclass
6+
class SchemaV1:
7+
kind: str
8+
nodes: list
9+
edges: list
10+
11+
@dataclass
12+
class ManifestV1:
13+
schema_hash: str
14+
artifacts: List[str]
15+
16+
@dataclass
17+
class ProofV1:
18+
root: str
19+
leaves: List[str]

signia-sdk/python/signia/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
import hashlib
3+
import json
4+
5+
def sha256_hex(data: bytes) -> str:
6+
return hashlib.sha256(data).hexdigest()
7+
8+
def canonical_json(obj) -> str:
9+
return json.dumps(obj, sort_keys=True, separators=(",", ":"))

signia-sdk/ts/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Signia TypeScript SDK
2+
3+
Official TypeScript SDK for interacting with Signia APIs, schemas, and Solana registry.

signia-sdk/ts/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@signia/sdk",
3+
"version": "0.1.0",
4+
"type": "module",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
7+
"scripts": {
8+
"build": "tsc",
9+
"test": "echo \"no tests\""
10+
},
11+
"dependencies": {
12+
"axios": "^1.6.0",
13+
"@solana/web3.js": "^1.95.4"
14+
}
15+
}

signia-sdk/ts/src/api/client.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
import axios from "axios";
3+
4+
export class SigniaClient {
5+
constructor(public baseUrl: string) {}
6+
7+
async compile(input: unknown) {
8+
const res = await axios.post(`${this.baseUrl}/v1/compile`, input);
9+
return res.data;
10+
}
11+
12+
async verify(payload: unknown) {
13+
const res = await axios.post(`${this.baseUrl}/v1/verify`, payload);
14+
return res.data;
15+
}
16+
}

signia-sdk/ts/src/api/endpoints.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
export const ENDPOINTS = {
3+
compile: "/v1/compile",
4+
verify: "/v1/verify",
5+
};

0 commit comments

Comments
 (0)