Skip to content
Open
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
246 changes: 4 additions & 242 deletions etc/sdk.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,6 @@

```ts

// @public (undocumented)
export interface AgentConfig {
// (undocumented)
chain: Chain | Chain[];
// (undocumented)
message?: string;
// (undocumented)
name: string;
// (undocumented)
signature: string;
// (undocumented)
wallet: string;
}

// @public (undocumented)
export interface AgentInfo {
// (undocumented)
addresses: Record<Chain, string>;
// (undocumented)
chains: Chain[];
// (undocumented)
id: string;
// (undocumented)
metaAddresses: Record<Chain, string>;
// (undocumented)
name: string;
}

// @public (undocumented)
export interface Balance {
// (undocumented)
native: string;
// (undocumented)
tokens: Record<string, string>;
}

// @public
export interface BaseWalletAdapter<TChain extends WalletAdapterChain, TSignature> {
// (undocumented)
Expand All @@ -50,34 +14,6 @@ export interface BaseWalletAdapter<TChain extends WalletAdapterChain, TSignature
signMessage(message: Uint8Array): Promise<TSignature>;
}

// @public (undocumented)
export enum Chain {
// (undocumented)
All = "all",
// (undocumented)
Base = "base",
// (undocumented)
Ethereum = "ethereum",
// (undocumented)
Horizen = "horizen",
// (undocumented)
Polygon = "polygon",
// (undocumented)
Solana = "solana",
// (undocumented)
Stellar = "stellar"
}

// @public (undocumented)
export interface ChatResponse {
// (undocumented)
conversationId: string;
// (undocumented)
response: string;
// (undocumented)
toolCalls?: ToolCall[];
}

// @public (undocumented)
export interface CkbChainInput {
// Warning: (ae-forgotten-export) The symbol "StealthCell" needs to be exported by the entry point index.d.ts
Expand All @@ -103,18 +39,6 @@ export class ContractRevertError extends WraithContractError {
readonly reason: string;
}

// @public (undocumented)
export interface Conversation {
// (undocumented)
createdAt: string;
// (undocumented)
id: string;
// (undocumented)
title: string;
// (undocumented)
updatedAt: string;
}

// @public
export function createFreighterWalletAdapter(wallet: FreighterWalletApi): FreighterWalletAdapter;

Expand Down Expand Up @@ -242,28 +166,6 @@ export class InvalidSignatureError extends WraithInputError {
readonly code = "WRAITH/INPUT/INVALID_SIGNATURE";
}

// @public (undocumented)
export interface Invoice {
// (undocumented)
agentName: string;
// (undocumented)
amount: string;
// (undocumented)
asset: string;
// (undocumented)
createdAt: string;
// (undocumented)
id: string;
// (undocumented)
memo: string;
// (undocumented)
paymentLink: string;
// (undocumented)
status: 'pending' | 'paid';
// (undocumented)
txHash: string | null;
}

// @public (undocumented)
export class KeyDerivationFailedError extends WraithCryptoError {
constructor(reason: string);
Expand Down Expand Up @@ -308,47 +210,6 @@ export class NameNotFoundError extends WraithContractError {
readonly code = "WRAITH/CONTRACT/NAME_NOT_FOUND";
}

// @public (undocumented)
interface Notification_2 {
// (undocumented)
body: string;
// (undocumented)
createdAt: string;
// (undocumented)
id: number;
// (undocumented)
read: boolean;
// (undocumented)
title: string;
// (undocumented)
type: string;
}
export { Notification_2 as Notification }

// @public (undocumented)
export interface Payment {
// (undocumented)
balance: string;
// (undocumented)
ephemeralPubKey: string;
// (undocumented)
stealthAddress: string;
}

// @public (undocumented)
export interface PrivacyReport {
// (undocumented)
bestPractices: string[];
// (undocumented)
issues: Array<{
severity: 'info' | 'low' | 'medium' | 'high' | 'critical';
issue: string;
recommendation: string;
}>;
// (undocumented)
score: number;
}

// @public (undocumented)
export class RetentionExceededError extends WraithNetworkError {
constructor(limit: number, actual: number);
Expand Down Expand Up @@ -387,24 +248,6 @@ export interface ScanAllInput {
stellar?: StellarChainInput;
}

// @public (undocumented)
export interface Schedule {
// (undocumented)
amount: string;
// (undocumented)
asset: string;
// (undocumented)
id: string;
// (undocumented)
interval: 'daily' | 'weekly' | 'monthly';
// (undocumented)
nextRun: string;
// (undocumented)
recipient: string;
// (undocumented)
status: 'active' | 'paused' | 'cancelled';
}

// @public (undocumented)
export interface SolanaChainInput {
// Warning: (ae-forgotten-export) The symbol "Announcement_2" needs to be exported by the entry point index.d.ts
Expand Down Expand Up @@ -463,24 +306,6 @@ export type StellarWalletAdapter = BaseWalletAdapter<'stellar', Uint8Array>;
// @public (undocumented)
export type SupportedChain = 'evm' | 'stellar' | 'solana' | 'ckb';

// @public (undocumented)
export interface ToolCall {
// (undocumented)
detail?: string;
// (undocumented)
name: string;
// (undocumented)
status: string;
}

// @public (undocumented)
export interface TxResult {
// (undocumented)
txHash: string;
// (undocumented)
txLink: string;
}

// @public (undocumented)
export class UnsupportedAssetError extends WraithBuilderError {
constructor(asset: string, chain?: string);
Expand Down Expand Up @@ -531,73 +356,10 @@ export type WalletAdapter = StellarWalletAdapter | EvmWalletAdapter | SolanaChai
// @public
export type WalletAdapterChain = 'stellar' | 'evm' | 'solana';

// @public (undocumented)
export class Wraith {
constructor(config: WraithConfig);
// (undocumented)
agent(agentId: string): WraithAgent;
createAgent(config: AgentConfig): Promise<WraithAgent>;
getAgentByName(name: string): Promise<WraithAgent>;
getAgentByWallet(walletAddress: string): Promise<WraithAgent>;
listAgents(): Promise<AgentInfo[]>;
// @internal
_request<T>(method: string, path: string, body?: unknown): Promise<T>;
}

// @public (undocumented)
export class WraithAgent {
constructor(wraith: Wraith, info: AgentInfo);
// (undocumented)
chat(message: string, conversationId?: string): Promise<ChatResponse>;
// (undocumented)
clearNotifications(): Promise<void>;
// (undocumented)
deleteConversation(conversationId: string): Promise<void>;
// (undocumented)
exportKey(signature: string, message: string): Promise<{
secret: string;
}>;
// (undocumented)
getBalance(): Promise<Balance>;
// (undocumented)
getConversations(): Promise<Conversation[]>;
// (undocumented)
getMessages(conversationId: string): Promise<Array<{
role: string;
text: string;
}>>;
// (undocumented)
getNotifications(): Promise<{
notifications: Notification_2[];
unreadCount: number;
}>;
// (undocumented)
getStatus(): Promise<any>;
// (undocumented)
readonly info: AgentInfo;
// (undocumented)
markNotificationsRead(): Promise<void>;
// (undocumented)
scanPayments(): Promise<Payment[]>;
}

// @public (undocumented)
export abstract class WraithBuilderError extends WraithError {
}

// @public (undocumented)
export interface WraithConfig {
// (undocumented)
ai?: {
provider: 'gemini' | 'openai' | 'claude';
apiKey: string;
};
// (undocumented)
apiKey: string;
// (undocumented)
baseUrl?: string;
}

// @public (undocumented)
export abstract class WraithContractError extends WraithError {
}
Expand Down Expand Up @@ -635,10 +397,10 @@ export abstract class WraithNetworkError extends WraithError {

// Warnings were encountered during analysis:
//
// dist/index.d.ts:207:5 - (ae-forgotten-export) The symbol "MatchedAnnouncement_2" needs to be exported by the entry point index.d.ts
// dist/index.d.ts:212:5 - (ae-forgotten-export) The symbol "MatchedAnnouncement$1" needs to be exported by the entry point index.d.ts
// dist/index.d.ts:217:5 - (ae-forgotten-export) The symbol "MatchedAnnouncement_3" needs to be exported by the entry point index.d.ts
// dist/index.d.ts:222:5 - (ae-forgotten-export) The symbol "MatchedStealthCell" needs to be exported by the entry point index.d.ts
// dist/index.d.ts:42:5 - (ae-forgotten-export) The symbol "MatchedAnnouncement_2" needs to be exported by the entry point index.d.ts
// dist/index.d.ts:47:5 - (ae-forgotten-export) The symbol "MatchedAnnouncement$1" needs to be exported by the entry point index.d.ts
// dist/index.d.ts:52:5 - (ae-forgotten-export) The symbol "MatchedAnnouncement_3" needs to be exported by the entry point index.d.ts
// dist/index.d.ts:57:5 - (ae-forgotten-export) The symbol "MatchedStealthCell" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
2 changes: 1 addition & 1 deletion examples/agent/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* AI chat, and chain operations — via the hosted TEE infrastructure.
* No crypto libraries, no contracts, no RPC calls.
*/
import { Wraith, Chain } from '@wraith-protocol/sdk';
import { Wraith, Chain } from '@wraith-protocol/sdk-agent';

async function main() {
// 1. Initialize with your API key
Expand Down
17 changes: 17 additions & 0 deletions examples/agent/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@wraith-protocol/example-agent",
"private": true,
"type": "module",
"main": "client.ts",
"scripts": {
"start": "npx tsx client.ts"
},
"dependencies": {
"@wraith-protocol/sdk": "file:../..",
"@wraith-protocol/sdk-agent": "workspace:*"
},
"devDependencies": {
"tsx": "^4.0.0",
"typescript": "^5.7.0"
}
}
2 changes: 1 addition & 1 deletion examples/stellar-spectre-agent/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import { Wraith, Chain } from '@wraith-protocol/sdk';
import { Wraith, Chain } from '@wraith-protocol/sdk-agent';

function getEnv(name: string): string {
const value = process.env[name];
Expand Down
3 changes: 2 additions & 1 deletion examples/stellar-spectre-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start": "npx tsx index.ts"
},
"dependencies": {
"@wraith-protocol/sdk": "file:../.."
"@wraith-protocol/sdk": "file:../..",
"@wraith-protocol/sdk-agent": "file:../../packages/sdk-agent"
},
"devDependencies": {
"tsx": "^4.0.0",
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
"types": "./dist/chains/ckb/index.d.ts",
"import": "./dist/chains/ckb/index.js",
"require": "./dist/chains/ckb/index.cjs"
},
"./agent": {
"types": "./dist/agent/index.d.ts",
"import": "./dist/agent/index.js",
"require": "./dist/agent/index.cjs"
}
},
"files": [
Expand Down
Loading