@apillon/sdk
Version:
▶◀ Apillon SDK for NodeJS ▶◀
81 lines • 2.89 kB
TypeScript
import { ApillonConfig, ApillonModel } from '../../lib/apillon';
import { ComputingContractData, ComputingContractStatus, ComputingContractType, IComputingTransaction, IEncryptData, ITransactionListFilters } from '../../types/computing';
import { IApillonList } from '../../types/apillon';
import { FileUploadResult } from '../../docs-index';
export declare class ComputingContract extends ApillonModel {
/**
* Name of the contract.
*/
name: string;
/**
* Contract description.
*/
description: string;
/**
* The bucket where files encrypted by this contract are stored
*/
bucketUuid: string;
/**
* The computing contract's type
*/
contractType: ComputingContractType;
/**
* The computing contract's status
*/
contractStatus: ComputingContractStatus;
/**
* The computing contract's on-chain address
*/
contractAddress: string;
/**
* The computing contract's on-chain deployer address
*/
deployerAddress: string;
/**
* The computing contract's deployment transaction hash
*/
transactionHash: string;
/**
* The computing contract's additional data
*/
data: ComputingContractData;
/**
* Apillon config used to initialize a storage module
* for saving encrypted files
*/
private config;
/**
* Constructor which should only be called via Computing class.
* @param uuid Unique identifier of the contract.
* @param data Data to populate computing contract with.
*/
constructor(uuid: string, data?: Partial<ComputingContract>, config?: ApillonConfig);
/**
* Gets list of transactions for this computing contract.
* @param {ITransactionListFilters} params Query filters.
* @returns {IComputingTransaction[]} List of transactions.
*/
listTransactions(params?: ITransactionListFilters): Promise<IApillonList<IComputingTransaction>>;
/**
* Transfers ownership of the computing contract.
* @param {string} accountAddress The address of the new owner.
* @returns Success status
*/
transferOwnership(accountAddress: string): Promise<boolean>;
/**
* - Calls the encrypt method on the computing contract
* - Uploads the encrypted file to the bucket
* - Assigns the encrypted file's CID to the NFT used for decryption authentication
* @param {IEncryptData} data The data to use for encryption.
* @returns The uploaded encrypted file metadata
*/
encryptFile(data: IEncryptData): Promise<FileUploadResult[]>;
/**
* Assigns a CID to an NFT on the contract.
* @param data The payload for assigning a CID to an NFT
* @returns Success status
*/
private assignCidToNft;
protected serializeFilter(key: string, value: any): any;
}
//# sourceMappingURL=computing-contract.d.ts.map