first commit

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kunkunxiaomaoandClaude committed 2026-11-16 20:45:22 +08:00
commit 9c5fef1a4d
412 files changed
+94582

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any
import aiohttp
class SignatureProvider(ABC):
@abstractmethod
async def sign(self, request_payload: dict[str, Any]) -> dict[str, Any]: ...
class NoopSignatureProvider(SignatureProvider):
async def sign(self, request_payload: dict[str, Any]) -> dict[str, Any]:
return {}
class RpcSignatureProvider(SignatureProvider):
def __init__(self, endpoint: str) -> None:
self.endpoint = endpoint
async def sign(self, request_payload: dict[str, Any]) -> dict[str, Any]:
if not self.endpoint:
return {}
async with aiohttp.ClientSession() as session:
async with session.post(self.endpoint, json=request_payload) as response:
response.raise_for_status()
data = await response.json()
return dict(data)