Skip to content

Commit 4644c5c

Browse files
orunganiekanAniekancursoragentDokaIzk
authored
[1141] feat: soroban contract and sdk feature SC-36 (#1195)
Co-authored-by: Aniekan <victoranieknodung@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Edoka Isaac <105296855+DokaIzk@users.noreply.github.com>
1 parent 65b51b4 commit 4644c5c

7 files changed

Lines changed: 41 additions & 0 deletions

File tree

docs/features/SC-36.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Feature SC-36: Soroban Developer Telemetry & CLI Utilities
2+
3+
## Overview
4+
SC-36 provides structured event telemetry helpers and verification utilities for Soroban developer CLI tools.
5+
6+
## Usage
7+
```typescript
8+
import { verifySC36Payload } from "@soroscan/sdk";
9+
10+
const isValid = verifySC36Payload({ version: "1.0", data: {} });
11+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def verify_sc36_payload(payload):
2+
return isinstance(payload.get("version"), str) and len(payload.get("version", "")) > 0
3+
4+
def test_sc36_verifier():
5+
assert verify_sc36_payload({"version": "1.0", "data": {}}) is True
6+
assert verify_sc36_payload({"version": "", "data": {}}) is False
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export interface SC36Payload {
2+
version: string;
3+
data: unknown;
4+
}
5+
6+
export function verifySC36Payload(payload: SC36Payload): boolean {
7+
return typeof payload.version === "string" && payload.version.length > 0;
8+
}

sdk/typescript/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export type {
7070
SoroScanApiError,
7171
} from "./types.js";
7272

73+
export * from "./features/sc36";
7374
export * from "./features/sc31";
7475
export * from "./features/sc21";
7576
export * from "./features/sc20";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { verifySC36Payload } from "../src/features/sc36";
2+
3+
describe("SC-36 Payload Verifier", () => {
4+
it("should validate payloads correctly", () => {
5+
expect(verifySC36Payload({ version: "1.0", data: {} })).toBe(true);
6+
expect(verifySC36Payload({ version: "", data: {} })).toBe(false);
7+
});
8+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub mod sc_36;
12
pub mod sc_31;
23
pub mod sc_21;
34
pub mod sc_20;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//! Feature SC-36: Extended Telemetry & Verification
2+
use soroban_sdk::{Env, Symbol, Vec};
3+
4+
pub fn emit_sc36_telemetry_event(e: &Env, tag: Symbol, payload: Vec<Symbol>) {
5+
e.events().publish((Symbol::new(e, "SC36_TELEMETRY"), tag), payload);
6+
}

0 commit comments

Comments
 (0)