@keypo/synapse-storage-sdk
Version:
TypeScript SDK for encrypted file storage on Filecoin via Synapse
48 lines • 1.94 kB
TypeScript
/**
* Smart contract management for Synapse Storage SDK
*/
import { ethers } from 'ethers';
import type { ExtendedMetadata } from '../../types/index.js';
import { type PermissionParameters } from './deployPermissionedData.js';
export type { PermissionParameters };
export interface ContractConfig {
registryAddress: string;
validationAddress: string;
bundlerRpcUrl: string;
}
export declare class ContractManager {
private config;
constructor(config: ContractConfig);
/**
* Deploy permissioned data contract and optionally mint NFT
*/
deployPermissionsAndMintNFT(dataIdentifier: string, metadata: ExtendedMetadata, kernelClient: any, userAddress: string, isPublic?: boolean, debug?: boolean): Promise<string>;
/**
* Mint NFT for file owner
*/
mintOwnerNFT(dataIdentifier: string, kernelClient: any): Promise<void>;
/**
* Share file with another user
*/
shareFile(dataIdentifier: string, recipientAddress: string, _quantity: number | undefined, // Keep for backward compatibility but not used
kernelClient: any, // ZeroDev kernel client for account abstraction
debug?: boolean): Promise<void>;
/**
* Revoke file access for a user
*/
revokeAccess(dataIdentifier: string, userAddress: string, kernelClient: any): Promise<void>;
/**
* Check if a user has permission to access a file
*/
checkPermission(dataIdentifier: string, userAddress: string, provider: ethers.Provider): Promise<boolean>;
/**
* Get file contract address from data identifier
*/
getFileContractAddress(dataIdentifier: string, provider: ethers.Provider): Promise<string | null>;
/**
* Delete a file from the permissions registry
*/
deleteFile(dataIdentifier: string, kernelClient: any, // ZeroDev kernel client for account abstraction
debug?: boolean): Promise<string>;
}
//# sourceMappingURL=ContractManager.d.ts.map