@pod-protocol/cli
Version:
Official CLI for the PoD Protocol
93 lines • 2.51 kB
TypeScript
/**
* Digital Asset Standard (DAS) API Integration
* Provides interface for querying compressed NFTs and Merkle trees
*/
export interface DASAsset {
id: string;
content: {
metadata: {
name: string;
symbol: string;
description?: string;
};
files?: Array<{
uri: string;
mime: string;
}>;
json_uri?: string;
};
compression?: {
compressed: boolean;
tree: string;
leaf_id: number;
data_hash: string;
creator_hash: string;
asset_hash: string;
seq: number;
};
ownership: {
owner: string;
ownership_model: string;
};
royalty?: {
royalty_model: string;
percent: number;
basis_points: number;
};
}
export interface DASResponse<T> {
items: T[];
total: number;
limit: number;
page: number;
}
export interface AssetProof {
root: string;
proof: string[];
node_index: number;
leaf: string;
tree_id: string;
}
export interface SearchOptions {
compressed?: boolean;
limit?: number;
page?: number;
sortBy?: string;
sortDirection?: 'asc' | 'desc';
}
export declare class DASAPI {
private connection;
private endpoint;
private developmentMode;
constructor(endpoint: string, developmentMode?: boolean);
testConnection(): Promise<{
healthy: boolean;
version: string;
latency: number;
}>;
getAsset(assetId: string): Promise<DASAsset>;
getAssetsByOwner(owner: string, options?: {
limit?: number;
page?: number;
}): Promise<DASResponse<DASAsset>>;
getAssetProof(assetId: string): Promise<AssetProof>;
searchAssets(options?: SearchOptions): Promise<DASResponse<DASAsset>>;
getAssetBatch(assetIds: string[]): Promise<DASAsset[]>;
private createMockAsset;
}
export declare class DASUtils {
static filterCompressedAssets(assets: DASAsset[]): DASAsset[];
static groupAssetsByTree(assets: DASAsset[]): Record<string, DASAsset[]>;
static calculateStorageSavings(nftCount: number): {
regular_cost: string;
compressed_cost: string;
savings: string;
multiplier: string;
};
static extractCollections(assets: DASAsset[]): Array<{
key: string;
count: number;
}>;
}
export declare function createDASAPI(endpoint: string, developmentMode?: boolean): DASAPI;
//# sourceMappingURL=das-api.d.ts.map