@dappykit/sdk
Version:
Web3 SDK for DApps
38 lines (37 loc) • 1.68 kB
TypeScript
import { IDecentralizedStorage, IDelegatedFsOptions, ILocalDataManager, ISigner } from './interfaces';
/**
* Delegated file system.
*/
export declare class DelegatedFs {
localDataManager: ILocalDataManager;
decentralizedStorage: IDecentralizedStorage;
authServiceAddress: string;
readonly KEY_RESULT_DATA = "result-data";
readonly KEY_USER_APP_DATA_ITEM = "user-app-data-item";
private options;
constructor(localDataManager: ILocalDataManager, decentralizedStorage: IDecentralizedStorage, authServiceAddress: string, options?: IDelegatedFsOptions);
/**
* Signs the data with the nonce and returns the signature.
* @param data Data
* @param nonce Nonce
* @param signer Signer
*/
static getDataSignature(data: string, nonce: number, signer: ISigner): Promise<string>;
/**
* Returns the text to sign for the delegated address.
* @param userAddress User address
* @param userDelegatedAddress User delegated address
* @param applicationAddress Application address
* @param errorText Error text
*/
static getDelegatedText(userAddress: string, userDelegatedAddress: string, applicationAddress: string, errorText?: string): string;
/**
* Creates a signature for the delegated address.
* @param userAddress User address
* @param userDelegatedAddress User delegated address
* @param applicationAddress Application address
* @param signer Signer
* @param errorText Error text
*/
static createDelegateSignature(userAddress: string, userDelegatedAddress: string, applicationAddress: string, signer: ISigner, errorText?: string): Promise<string>;
}