@obelyzk/sdk 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { W as WsConfig, a as WebSocketClient, b as WsEvent, P as PrivacyKeyPair, E as ECPoint, c as ElGamalCiphertext, A as AEHint, d as EncryptedBalance, S as SchnorrProof, T as TransferProof } from './tee-CiR0hpfm.js';
2
2
  export { cv as AccountHints, cz as AuditReport, ag as BatchClient, aS as BatchJobResponse, aV as BatchOperation, aU as BatchOperationType, bZ as BatchStatus, aT as BatchStatusResponse, aX as BatchVerifyRequest, aY as BatchVerifyResponse, B as BitSageClient, bH as BurnEvent, au as CAPABILITY_FLAGS, c6 as ChallengeParams, c7 as ChallengeStatus, cL as CheckpointStatus, C as ClientConfig, c4 as CompressedProof, c3 as CompressionStats, cK as ComputeCheckpoint, I as ContractClient, _ as ContractConfig, aa as ContractRegistry, bN as CreateProposalParams, co as DAILY_CAPS, D as DEFAULT_CONFIG, K as DEFAULT_CONTRACT_CONFIG, cP as DEFAULT_DISCOUNT_TIERS, cQ as DEFAULT_FEE_DISTRIBUTION, y as DEFAULT_HTTP_CONFIG, z as DEFAULT_WS_CONFIG, bs as DKGShare, ch as DailyStats, ae as DashboardClient, bP as DelegationInfo, cD as DiscountTiers, b7 as DisputeRecord, cR as DisputeStatus, bI as EcosystemEmissionStatus, c5 as EnclaveInfo, cT as ExecutionMetrics, ab as ExternalTokens, v as FaucetClaimResponse, F as FaucetStatus, cE as FeeDistribution, az as GOVERNANCE_CONFIG, cp as GPU_MULTIPLIERS, aW as GasEstimate, ax as GovernanceClient, bx as GovernanceClientConfig, bB as GovernanceProposal, bC as GovernanceRights, bD as GovernanceStats, by as GovernanceTransactionResult, ce as GpuAttestation, aI as GpuMetrics, aJ as GpuMetricsResponse, bY as GpuTeeProofParams, G as GpuTier, cq as HALVENING_SCHEDULE, aL as HistoryPeriod, b2 as HolderTier, H as HttpClient, U as HttpConfig, aO as JobAnalytics, J as JobId, cH as JobPaymentRecord, t as JobResult, i as JobStatus, s as JobStatusResponse, h as JobType, V as JobUpdateEvent, a3 as LOCAL_CONTRACTS, bg as LeaderboardEntry, bf as LeaderboardMetric, L as ListJobsParams, u as ListJobsResponse, a2 as MAINNET_CONTRACTS, a7 as MAINNET_TOKENS, ai as MAX_BATCH_SIZE, an as MIN_STAKE, bK as MilestoneStatus, ac as MiningClient, aF as MiningClientConfig, ck as MiningConfig, cm as MiningGpuTier, cj as MiningPoolStatus, bq as MixingOutput, bp as MixingTransaction, cy as MultiAssetBalance, bu as MultiAssetBalances, N as Network, o as NetworkStats, Y as NetworkStatsEvent, aR as NetworkWorkersResponse, cF as OTCConfig, a9 as PRAGMA_ORACLE, cC as PaymentQuote, cG as PaymentStats, cI as PaymentStatus, cB as PaymentToken, aj as PaymentsClient, aZ as PaymentsClientConfig, bM as PendingTransfer, be as PerformanceData, bE as PoolBalances, bk as PrivacyAsset, av as PrivacyClient, bi as PrivacyClientConfig, cM as PrivacyCreditDeposit, cN as PrivacyCreditUsage, bj as PrivacyTransactionResult, bl as PrivateAccount, bv as PrivateSwapParams, bm as PrivateTransferParams, bn as PrivateTransferWithAuditParams, cA as PrivateWorkerPayment, n as ProofDetails, b_ as ProofJobSpec, bX as ProofMetadata, c0 as ProofPriority, bU as ProofSource, c1 as ProofSubmission, b$ as ProofType, k as ProofVerificationStatus, Z as ProofVerifiedEvent, bz as ProposalStatus, bA as ProposalType, c2 as ProverMetrics, br as RagequitProof, bL as RateLimitInfo, aP as RecentJob, bh as RegisterWorkerParams, aM as RewardHistoryEntry, aN as RewardHistoryResponse, cl as RewardResult, aK as RewardsInfo, cw as RingMember, cx as RingSignature, a1 as SEPOLIA_CONTRACTS, a6 as SEPOLIA_TOKENS, ao as SLASH_PERCENTAGES, cn as STAKE_TIER_THRESHOLDS, cu as SameEncryption3Proof, e as SdkError, bG as SecurityBudget, b3 as SlashReason, b6 as SlashRecord, p as StakeInfo, cg as StakeTier, al as StakingClient, a_ as StakingClientConfig, b5 as StakingConfig, a$ as StakingTransactionResult, bw as StealthAddress, bo as SteganographicTransaction, aA as StwoClient, bR as StwoClientConfig, bV as StwoTeeType, bS as StwoTransactionResult, q as SubmitJobRequest, r as SubmitJobResponse, bW as TeeAttestation, cc as TeeChallengeParams, cd as TeeChallengeStatus, aD as TeeClient, c8 as TeeClientConfig, cb as TeeJobResult, cS as TeeQuote, ca as TeeResultParams, c9 as TeeTransactionResult, b0 as TeeType, bt as ThresholdDecryptionRequest, bJ as TokenFlowSummary, $ as TransactionReceipt, cO as TransactionResult, a0 as TxStatus, ap as UNSTAKE_LOCKUP_SECS, b9 as UnstakeRequest, aC as VERIFICATION_CONFIG, aG as ValidatorStatus, aH as ValidatorStatusResponse, cJ as VerificationSource, bT as VerificationStatus, bF as VestingStatus, bO as VoteDirection, bQ as VoterInfo, f as WalletConfig, l as WorkerCapabilities, bc as WorkerCapabilitiesExtended, g as WorkerId, m as WorkerInfo, ci as WorkerMiningStats, bd as WorkerProfile, b4 as WorkerStake, j as WorkerStatus, aQ as WorkerSummary, cf as WorkerTeeStatus, b1 as WorkerTier, b8 as WorkerTierBenefits, X as WorkerUpdateEvent, as as WorkersClient, ba as WorkersClientConfig, bb as WorkersTransactionResult, ah as createBatchClient, af as createDashboardClient, ay as createGovernanceClient, ad as createMiningClient, ak as createPaymentsClient, aw as createPrivacyClient, am as createStakingClient, aB as createStwoClient, aE as createTeeClient, at as createWorkersClient, O as fromFelt, a4 as getContractsForNetwork, cs as getDailyCapForTier, ct as getGpuMultiplier, x as getGpuTier, w as getMinStake, ar as getMinStakeForTier, cr as getStakeTierFromAmount, a8 as getTokensForNetwork, a5 as isContractConfigured, aq as isWorkerEligible, R as joinU256, Q as splitU256, M as toFelt } from './tee-CiR0hpfm.js';
3
+ export { AgentFirewallSDK, AgentStatus, ClassifyResult, Decision, FirewallConfig, TransactionFeatures } from './firewall/index.js';
3
4
  export { AssetId, BalanceProof, CURVE_ORDER, ConfidentialOrder, ConfidentialSwapClient, ConfidentialSwapConfig, CreateOrderRequest, CreateOrderResponse, ElGamalKeyPair, FIELD_PRIME, GENERATOR_G, GENERATOR_H, ElGamalCiphertext as ObelyskCiphertext, EncryptionProof as ObelyskEncryptionProof, default as ObelyskPrivacy, RangeProof, RateProof, SwapHistoryEntry, SwapProofBundle, TakeOrderResponse, addMod, ecAdd, ecDouble, ecMul, invMod, isIdentity, mulMod, poseidonHash, powMod, randomScalar, subMod } from './privacy/index.js';
5
+ import 'starknet';
4
6
 
5
7
  /**
6
8
  * WebSocket Module
@@ -400,7 +402,7 @@ declare function verifyTransferProof(proof: TransferProof, senderPublicKey: ECPo
400
402
  *
401
403
  * @example
402
404
  * ```typescript
403
- * import { createStwoProverClient } from '@bitsage/sdk';
405
+ * import { createStwoProverClient } from '@obelyzk/sdk';
404
406
  *
405
407
  * const prover = createStwoProverClient({
406
408
  * baseUrl: 'https://prover.bitsage.network',
@@ -724,13 +726,17 @@ declare class StwoProverClient {
724
726
  declare function createStwoProverClient(config?: Partial<StwoProverConfig>): StwoProverClient;
725
727
  interface ZkmlLoadModelRequest {
726
728
  /** Path to ONNX model on the prover server filesystem */
727
- modelPath: string;
729
+ modelPath?: string;
730
+ /** Path to HuggingFace model directory on the prover */
731
+ model_dir?: string;
728
732
  /** Optional description for on-chain registration */
729
733
  description?: string;
730
734
  }
731
735
  interface ZkmlModelInfo {
732
736
  /** Model identifier (hex) */
733
737
  modelId: string;
738
+ /** Human-readable model name (e.g., "smollm2-135m") */
739
+ name: string;
734
740
  /** Poseidon hash of weight matrices (hex) */
735
741
  weightCommitment: string;
736
742
  /** Number of model layers */
@@ -739,7 +745,7 @@ interface ZkmlModelInfo {
739
745
  inputShape: [number, number];
740
746
  }
741
747
  interface ZkmlProveRequest {
742
- /** Model ID (must be loaded first) */
748
+ /** Model ID or name (e.g., "smollm2-135m" or "0x1cb4f9...") */
743
749
  modelId: string;
744
750
  /** Flat array of f32 input values (optional — random if omitted) */
745
751
  input?: number[];
@@ -781,7 +787,9 @@ interface ZkmlProveResult {
781
787
  }
782
788
  declare module './stwo-prover' {
783
789
  interface StwoProverClient {
784
- /** Load an ONNX model on the prover server */
790
+ /** List all loaded models on the prover */
791
+ listZkmlModels(): Promise<ZkmlModelInfo[]>;
792
+ /** Load a model on the prover server (ONNX or HuggingFace) */
785
793
  loadZkmlModel(req: ZkmlLoadModelRequest): Promise<ZkmlModelInfo>;
786
794
  /** Submit a ZKML proving job (returns immediately with job_id) */
787
795
  submitZkmlProve(req: ZkmlProveRequest): Promise<{
@@ -798,8 +806,46 @@ declare module './stwo-prover' {
798
806
  timeoutMs?: number;
799
807
  onProgress?: (status: ZkmlProveStatus) => void;
800
808
  }): Promise<ZkmlProveResult>;
809
+ /** Full attestation: prove + on-chain verification in one call */
810
+ attest(req: ZkmlAttestRequest): Promise<ZkmlAttestResult>;
801
811
  }
802
812
  }
813
+ interface ZkmlAttestRequest {
814
+ /** Model name or hex ID */
815
+ modelId: string;
816
+ /** Flat input array */
817
+ input: number[];
818
+ /** GPU acceleration (default: true) */
819
+ gpu?: boolean;
820
+ /** Submit on-chain (default: true) */
821
+ submitOnchain?: boolean;
822
+ }
823
+ interface ZkmlAttestResult {
824
+ /** Proof identifier */
825
+ proofId: string;
826
+ /** IO commitment (Poseidon hash of inputs + outputs) */
827
+ ioCommitment: string;
828
+ /** Weight commitment (Poseidon Merkle root of all weights) */
829
+ weightCommitment: string;
830
+ /** Number of computation nodes proven */
831
+ numProvenLayers: number;
832
+ /** Proof generation time in ms */
833
+ proveTimeMs: number;
834
+ /** Number of calldata felts */
835
+ calldataFelts: number;
836
+ /** Estimated gas for on-chain verification */
837
+ estimatedGas: number;
838
+ /** On-chain verification status */
839
+ onchain: {
840
+ submitted: boolean;
841
+ txHashes: string[];
842
+ network: string;
843
+ contract: string;
844
+ verified: boolean;
845
+ explorerUrl: string | null;
846
+ error: string | null;
847
+ };
848
+ }
803
849
  declare const PROOF_TYPES: {
804
850
  BATCH_PAYMENTS: ProofType;
805
851
  AI_INFERENCE: ProofType;
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ AgentFirewallSDK: () => AgentFirewallSDK,
23
24
  AssetId: () => AssetId,
24
25
  BITSAGE_BANNER: () => BITSAGE_BANNER,
25
26
  BITSAGE_LOGO: () => BITSAGE_LOGO,
@@ -6086,6 +6087,7 @@ var StwoProverClient = class {
6086
6087
  });
6087
6088
  return {
6088
6089
  modelId: response.model_id,
6090
+ name: response.name || response.model_id,
6089
6091
  weightCommitment: response.weight_commitment,
6090
6092
  numLayers: response.num_layers,
6091
6093
  inputShape: response.input_shape
@@ -6591,6 +6593,35 @@ StwoProverClient.prototype.proveZkml = async function(req, opts) {
6591
6593
  }
6592
6594
  throw new Error(`ZKML proving timed out after ${timeout}ms`);
6593
6595
  };
6596
+ StwoProverClient.prototype.attest = async function(req) {
6597
+ const response = await this.fetch("/api/v1/attest", {
6598
+ method: "POST",
6599
+ body: JSON.stringify({
6600
+ model_id: req.modelId,
6601
+ input: req.input,
6602
+ gpu: req.gpu ?? true,
6603
+ submit_onchain: req.submitOnchain ?? true
6604
+ })
6605
+ });
6606
+ return {
6607
+ proofId: response.proof_id,
6608
+ ioCommitment: response.io_commitment,
6609
+ weightCommitment: response.weight_commitment,
6610
+ numProvenLayers: response.num_proven_layers,
6611
+ proveTimeMs: response.prove_time_ms,
6612
+ calldataFelts: response.calldata_felts,
6613
+ estimatedGas: response.estimated_gas,
6614
+ onchain: {
6615
+ submitted: response.onchain?.submitted ?? false,
6616
+ txHashes: response.onchain?.tx_hashes ?? [],
6617
+ network: response.onchain?.network ?? "starknet-sepolia",
6618
+ contract: response.onchain?.contract ?? "",
6619
+ verified: response.onchain?.verified ?? false,
6620
+ explorerUrl: response.onchain?.explorer_url ?? null,
6621
+ error: response.onchain?.error ?? null
6622
+ }
6623
+ };
6624
+ };
6594
6625
  var PROOF_TYPES = {
6595
6626
  BATCH_PAYMENTS: "batch_payments",
6596
6627
  AI_INFERENCE: "ai_inference",
@@ -6612,6 +6643,209 @@ var GPU_TIERS = {
6612
6643
  AUTO: "auto"
6613
6644
  };
6614
6645
 
6646
+ // src/firewall/client.ts
6647
+ var import_starknet = require("starknet");
6648
+ var AgentFirewallSDK = class {
6649
+ config;
6650
+ provider;
6651
+ constructor(config) {
6652
+ this.config = config;
6653
+ this.provider = new import_starknet.RpcProvider({ nodeUrl: config.rpcUrl });
6654
+ }
6655
+ // ── Classification ─────────────────────────────────────────────────
6656
+ /**
6657
+ * Classify a transaction through the ZKML classifier.
6658
+ *
6659
+ * Sends the transaction features to the prove-server, which runs
6660
+ * the MLP classifier and generates a GKR+STARK proof. Returns the
6661
+ * proven threat score and decision.
6662
+ *
6663
+ * Does NOT submit anything on-chain — use `evaluateAction()` for
6664
+ * the full flow including on-chain submission.
6665
+ */
6666
+ async classify(tx) {
6667
+ const headers = {
6668
+ "Content-Type": "application/json"
6669
+ };
6670
+ if (this.config.apiKey) {
6671
+ headers["Authorization"] = `Bearer ${this.config.apiKey}`;
6672
+ }
6673
+ const body = {
6674
+ target: tx.target,
6675
+ value: tx.value || "0",
6676
+ selector: tx.selector || "0x0",
6677
+ calldata: tx.calldata || "0x",
6678
+ agent_trust_score: tx.agentTrustScore || 0,
6679
+ agent_strikes: tx.agentStrikes || 0,
6680
+ agent_age_blocks: tx.agentAgeBlocks || 0,
6681
+ target_verified: tx.targetVerified || false,
6682
+ target_is_proxy: tx.targetIsProxy || false,
6683
+ target_has_source: tx.targetHasSource || false,
6684
+ target_interaction_count: tx.targetInteractionCount || 0,
6685
+ tx_frequency: tx.txFrequency || 0,
6686
+ unique_targets_24h: tx.uniqueTargets24h || 0,
6687
+ avg_value_24h: tx.avgValue24h || 0,
6688
+ max_value_24h: tx.maxValue24h || 0
6689
+ };
6690
+ const response = await fetch(`${this.config.proverUrl}/api/v1/classify`, {
6691
+ method: "POST",
6692
+ headers,
6693
+ body: JSON.stringify(body)
6694
+ });
6695
+ if (!response.ok) {
6696
+ const error = await response.json().catch(() => ({ error: response.statusText }));
6697
+ throw new Error(`Classification failed (${response.status}): ${error.error || response.statusText}`);
6698
+ }
6699
+ const data = await response.json();
6700
+ return {
6701
+ requestId: data.request_id,
6702
+ decision: data.decision,
6703
+ threatScore: data.threat_score,
6704
+ scores: data.scores,
6705
+ ioCommitment: data.io_commitment,
6706
+ policyCommitment: data.policy_commitment,
6707
+ proveTimeMs: data.prove_time_ms
6708
+ };
6709
+ }
6710
+ // ── Agent Management ───────────────────────────────────────────────
6711
+ /**
6712
+ * Register a new agent on the firewall contract.
6713
+ * The calling account becomes the agent owner.
6714
+ */
6715
+ async registerAgent(agentId) {
6716
+ this.requireAccount();
6717
+ const tx = await this.config.account.execute({
6718
+ contractAddress: this.config.firewallContract,
6719
+ entrypoint: "register_agent",
6720
+ calldata: import_starknet.CallData.compile({ agent_id: agentId })
6721
+ });
6722
+ await this.provider.waitForTransaction(tx.transaction_hash);
6723
+ return tx.transaction_hash;
6724
+ }
6725
+ /** Deactivate an agent (owner or contract admin). */
6726
+ async deactivateAgent(agentId) {
6727
+ this.requireAccount();
6728
+ const tx = await this.config.account.execute({
6729
+ contractAddress: this.config.firewallContract,
6730
+ entrypoint: "deactivate_agent",
6731
+ calldata: import_starknet.CallData.compile({ agent_id: agentId })
6732
+ });
6733
+ await this.provider.waitForTransaction(tx.transaction_hash);
6734
+ return tx.transaction_hash;
6735
+ }
6736
+ /** Reactivate an agent and reset strikes (agent owner only). */
6737
+ async reactivateAgent(agentId) {
6738
+ this.requireAccount();
6739
+ const tx = await this.config.account.execute({
6740
+ contractAddress: this.config.firewallContract,
6741
+ entrypoint: "reactivate_agent",
6742
+ calldata: import_starknet.CallData.compile({ agent_id: agentId })
6743
+ });
6744
+ await this.provider.waitForTransaction(tx.transaction_hash);
6745
+ return tx.transaction_hash;
6746
+ }
6747
+ // ── Queries ────────────────────────────────────────────────────────
6748
+ /** Get the full status of an agent. */
6749
+ async getAgentStatus(agentId) {
6750
+ const contract = new import_starknet.Contract(
6751
+ FIREWALL_ABI,
6752
+ this.config.firewallContract,
6753
+ this.provider
6754
+ );
6755
+ const [registered, active, trustScore, strikes, trusted] = await Promise.all([
6756
+ contract.is_agent_registered(agentId),
6757
+ contract.is_agent_active(agentId),
6758
+ contract.get_trust_score(agentId),
6759
+ contract.get_strikes(agentId),
6760
+ contract.is_trusted(agentId)
6761
+ ]);
6762
+ return {
6763
+ registered,
6764
+ active,
6765
+ trustScore: Number(trustScore),
6766
+ strikes: Number(strikes),
6767
+ trusted
6768
+ };
6769
+ }
6770
+ /** Check if a specific action has been approved. */
6771
+ async isActionApproved(actionId) {
6772
+ const contract = new import_starknet.Contract(
6773
+ FIREWALL_ABI,
6774
+ this.config.firewallContract,
6775
+ this.provider
6776
+ );
6777
+ return contract.is_action_approved(actionId);
6778
+ }
6779
+ /** Check if an agent is trusted. */
6780
+ async isAgentTrusted(agentId) {
6781
+ const contract = new import_starknet.Contract(
6782
+ FIREWALL_ABI,
6783
+ this.config.firewallContract,
6784
+ this.provider
6785
+ );
6786
+ return contract.is_trusted(agentId);
6787
+ }
6788
+ // ── Helpers ────────────────────────────────────────────────────────
6789
+ requireAccount() {
6790
+ if (!this.config.account) {
6791
+ throw new Error(
6792
+ "Account required for write operations. Pass `account` in FirewallConfig."
6793
+ );
6794
+ }
6795
+ }
6796
+ };
6797
+ var FIREWALL_ABI = [
6798
+ {
6799
+ name: "is_agent_registered",
6800
+ type: "function",
6801
+ inputs: [{ name: "agent_id", type: "felt" }],
6802
+ outputs: [{ type: "felt" }],
6803
+ state_mutability: "view"
6804
+ },
6805
+ {
6806
+ name: "is_agent_active",
6807
+ type: "function",
6808
+ inputs: [{ name: "agent_id", type: "felt" }],
6809
+ outputs: [{ type: "felt" }],
6810
+ state_mutability: "view"
6811
+ },
6812
+ {
6813
+ name: "get_trust_score",
6814
+ type: "function",
6815
+ inputs: [{ name: "agent_id", type: "felt" }],
6816
+ outputs: [{ type: "felt" }],
6817
+ state_mutability: "view"
6818
+ },
6819
+ {
6820
+ name: "get_strikes",
6821
+ type: "function",
6822
+ inputs: [{ name: "agent_id", type: "felt" }],
6823
+ outputs: [{ type: "felt" }],
6824
+ state_mutability: "view"
6825
+ },
6826
+ {
6827
+ name: "is_trusted",
6828
+ type: "function",
6829
+ inputs: [{ name: "agent_id", type: "felt" }],
6830
+ outputs: [{ type: "felt" }],
6831
+ state_mutability: "view"
6832
+ },
6833
+ {
6834
+ name: "is_action_approved",
6835
+ type: "function",
6836
+ inputs: [{ name: "action_id", type: "felt" }],
6837
+ outputs: [{ type: "felt" }],
6838
+ state_mutability: "view"
6839
+ },
6840
+ {
6841
+ name: "get_action_decision",
6842
+ type: "function",
6843
+ inputs: [{ name: "action_id", type: "felt" }],
6844
+ outputs: [{ type: "felt" }],
6845
+ state_mutability: "view"
6846
+ }
6847
+ ];
6848
+
6615
6849
  // src/branding.ts
6616
6850
  var BITSAGE_LOGO = `
6617
6851
  \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
@@ -7351,6 +7585,7 @@ var ConfidentialSwapClient = class {
7351
7585
  };
7352
7586
  // Annotate the CommonJS export names for ESM import in node:
7353
7587
  0 && (module.exports = {
7588
+ AgentFirewallSDK,
7354
7589
  AssetId,
7355
7590
  BITSAGE_BANNER,
7356
7591
  BITSAGE_LOGO,
package/dist/index.mjs CHANGED
@@ -1,3 +1,6 @@
1
+ import {
2
+ AgentFirewallSDK
3
+ } from "./chunk-BHUXKNDT.mjs";
1
4
  import {
2
5
  BatchClient,
3
6
  BitSageClient,
@@ -84,7 +87,8 @@ import {
84
87
  powMod,
85
88
  randomScalar,
86
89
  subMod
87
- } from "./chunk-CGPFHXUF.mjs";
90
+ } from "./chunk-MDF4P52S.mjs";
91
+ import "./chunk-Y6FXYEAI.mjs";
88
92
 
89
93
  // src/types.ts
90
94
  function getMinStake(tier) {
@@ -165,6 +169,7 @@ var StwoProverClient = class {
165
169
  });
166
170
  return {
167
171
  modelId: response.model_id,
172
+ name: response.name || response.model_id,
168
173
  weightCommitment: response.weight_commitment,
169
174
  numLayers: response.num_layers,
170
175
  inputShape: response.input_shape
@@ -670,6 +675,35 @@ StwoProverClient.prototype.proveZkml = async function(req, opts) {
670
675
  }
671
676
  throw new Error(`ZKML proving timed out after ${timeout}ms`);
672
677
  };
678
+ StwoProverClient.prototype.attest = async function(req) {
679
+ const response = await this.fetch("/api/v1/attest", {
680
+ method: "POST",
681
+ body: JSON.stringify({
682
+ model_id: req.modelId,
683
+ input: req.input,
684
+ gpu: req.gpu ?? true,
685
+ submit_onchain: req.submitOnchain ?? true
686
+ })
687
+ });
688
+ return {
689
+ proofId: response.proof_id,
690
+ ioCommitment: response.io_commitment,
691
+ weightCommitment: response.weight_commitment,
692
+ numProvenLayers: response.num_proven_layers,
693
+ proveTimeMs: response.prove_time_ms,
694
+ calldataFelts: response.calldata_felts,
695
+ estimatedGas: response.estimated_gas,
696
+ onchain: {
697
+ submitted: response.onchain?.submitted ?? false,
698
+ txHashes: response.onchain?.tx_hashes ?? [],
699
+ network: response.onchain?.network ?? "starknet-sepolia",
700
+ contract: response.onchain?.contract ?? "",
701
+ verified: response.onchain?.verified ?? false,
702
+ explorerUrl: response.onchain?.explorer_url ?? null,
703
+ error: response.onchain?.error ?? null
704
+ }
705
+ };
706
+ };
673
707
  var PROOF_TYPES = {
674
708
  BATCH_PAYMENTS: "batch_payments",
675
709
  AI_INFERENCE: "ai_inference",
@@ -759,6 +793,7 @@ function getVersionBanner(version) {
759
793
  `;
760
794
  }
761
795
  export {
796
+ AgentFirewallSDK,
762
797
  AssetId,
763
798
  BITSAGE_BANNER,
764
799
  BITSAGE_LOGO,
@@ -4,12 +4,14 @@ import {
4
4
  GENERATOR_G,
5
5
  GENERATOR_H,
6
6
  ObelyskPrivacy,
7
- __require,
8
7
  ecAdd,
9
8
  ecMul,
10
9
  invMod,
11
10
  randomScalar
12
- } from "../chunk-CGPFHXUF.mjs";
11
+ } from "../chunk-MDF4P52S.mjs";
12
+ import {
13
+ __require
14
+ } from "../chunk-Y6FXYEAI.mjs";
13
15
 
14
16
  // src/obelysk/client.ts
15
17
  import { RpcProvider } from "starknet";
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @example
11
11
  * ```typescript
12
- * import { ObelyskPrivacy, ConfidentialSwapClient } from '@bitsage/sdk/privacy';
12
+ * import { ObelyskPrivacy, ConfidentialSwapClient } from '@obelyzk/sdk/privacy';
13
13
  *
14
14
  * // Initialize privacy client
15
15
  * const privacy = new ObelyskPrivacy();
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @example
11
11
  * ```typescript
12
- * import { ObelyskPrivacy, ConfidentialSwapClient } from '@bitsage/sdk/privacy';
12
+ * import { ObelyskPrivacy, ConfidentialSwapClient } from '@obelyzk/sdk/privacy';
13
13
  *
14
14
  * // Initialize privacy client
15
15
  * const privacy = new ObelyskPrivacy();
@@ -19,7 +19,8 @@ import {
19
19
  randomBytes,
20
20
  randomScalar,
21
21
  subMod
22
- } from "../chunk-CGPFHXUF.mjs";
22
+ } from "../chunk-MDF4P52S.mjs";
23
+ import "../chunk-Y6FXYEAI.mjs";
23
24
  export {
24
25
  AssetId,
25
26
  CURVE_ORDER,
@@ -78,7 +78,7 @@ declare const BitSageContext: React.Context<BitSageContextValue | undefined>;
78
78
  *
79
79
  * @example
80
80
  * ```tsx
81
- * import { BitSageProvider } from '@bitsage/sdk/react';
81
+ * import { BitSageProvider } from '@obelyzk/sdk/react';
82
82
  *
83
83
  * function App() {
84
84
  * return (
@@ -189,7 +189,7 @@ declare const PrivacyContext: React.Context<PrivacyContextValue | undefined>;
189
189
  *
190
190
  * @example
191
191
  * ```tsx
192
- * import { BitSageProvider, PrivacyProvider } from '@bitsage/sdk/react';
192
+ * import { BitSageProvider, PrivacyProvider } from '@obelyzk/sdk/react';
193
193
  *
194
194
  * function App() {
195
195
  * return (
@@ -289,7 +289,7 @@ declare const WebSocketContext: React.Context<WebSocketContextValue | undefined>
289
289
  *
290
290
  * @example
291
291
  * ```tsx
292
- * import { BitSageProvider, WebSocketProvider } from '@bitsage/sdk/react';
292
+ * import { BitSageProvider, WebSocketProvider } from '@obelyzk/sdk/react';
293
293
  *
294
294
  * function App() {
295
295
  * return (
@@ -78,7 +78,7 @@ declare const BitSageContext: React.Context<BitSageContextValue | undefined>;
78
78
  *
79
79
  * @example
80
80
  * ```tsx
81
- * import { BitSageProvider } from '@bitsage/sdk/react';
81
+ * import { BitSageProvider } from '@obelyzk/sdk/react';
82
82
  *
83
83
  * function App() {
84
84
  * return (
@@ -189,7 +189,7 @@ declare const PrivacyContext: React.Context<PrivacyContextValue | undefined>;
189
189
  *
190
190
  * @example
191
191
  * ```tsx
192
- * import { BitSageProvider, PrivacyProvider } from '@bitsage/sdk/react';
192
+ * import { BitSageProvider, PrivacyProvider } from '@obelyzk/sdk/react';
193
193
  *
194
194
  * function App() {
195
195
  * return (
@@ -289,7 +289,7 @@ declare const WebSocketContext: React.Context<WebSocketContextValue | undefined>
289
289
  *
290
290
  * @example
291
291
  * ```tsx
292
- * import { BitSageProvider, WebSocketProvider } from '@bitsage/sdk/react';
292
+ * import { BitSageProvider, WebSocketProvider } from '@obelyzk/sdk/react';
293
293
  *
294
294
  * function App() {
295
295
  * return (
@@ -16,7 +16,8 @@ import {
16
16
  WorkersClient,
17
17
  getContractsForNetwork
18
18
  } from "../chunk-LXJT3QK6.mjs";
19
- import "../chunk-CGPFHXUF.mjs";
19
+ import "../chunk-MDF4P52S.mjs";
20
+ import "../chunk-Y6FXYEAI.mjs";
20
21
 
21
22
  // src/react/providers/BitSageProvider.tsx
22
23
  import {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@obelyzk/sdk",
3
- "version": "1.1.0",
4
- "description": "BitSage Network SDK - Client library for distributed compute, privacy swaps, and Obelysk encryption",
3
+ "version": "1.3.0",
4
+ "description": "ObelyZK SDK verifiable ML inference on Starknet with recursive STARK proofs",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -21,6 +21,11 @@
21
21
  "import": "./dist/react/index.mjs",
22
22
  "require": "./dist/react/index.js"
23
23
  },
24
+ "./firewall": {
25
+ "types": "./dist/firewall/index.d.ts",
26
+ "import": "./dist/firewall/index.mjs",
27
+ "require": "./dist/firewall/index.js"
28
+ },
24
29
  "./obelysk": {
25
30
  "types": "./dist/obelysk/index.d.ts",
26
31
  "import": "./dist/obelysk/index.mjs",
@@ -54,7 +59,7 @@
54
59
  "zk-proofs"
55
60
  ],
56
61
  "scripts": {
57
- "build": "tsup src/index.ts src/privacy/index.ts src/react/index.ts src/obelysk/index.ts --format cjs,esm --dts",
62
+ "build": "tsup src/index.ts src/privacy/index.ts src/react/index.ts src/obelysk/index.ts src/firewall/index.ts --format cjs,esm --dts",
58
63
  "dev": "tsup src/index.ts src/privacy/index.ts src/react/index.ts src/obelysk/index.ts --format cjs,esm --dts --watch",
59
64
  "lint": "eslint src/",
60
65
  "test": "vitest",
@@ -94,7 +99,7 @@
94
99
  "access": "public",
95
100
  "registry": "https://registry.npmjs.org/"
96
101
  },
97
- "homepage": "https://bitsage.network",
102
+ "homepage": "https://obelysk.com",
98
103
  "bugs": {
99
104
  "url": "https://github.com/Bitsage-Network/bitsage-network/issues"
100
105
  },