@dwn-protocol/id-sdk
Version:
SDK for accessing the features and capabilities
81 lines • 2.63 kB
TypeScript
import type { AppDataStore, IDAgent } from './agent/index.js';
import { DwnApi } from './dwn-api.js';
import { DidApi } from './did-api.js';
import { DidKeyMethod, DidDhtMethod, DidIonMethod } from './dids/index.js';
import { Metadata } from './interfaces/metadata.js';
import { Queue } from './interfaces/queue.js';
import { Services } from './interfaces/services.js';
import { Transactions } from './interfaces/transactions.js';
import { Jose } from './crypto/index.js';
import { VcApi } from './vc-api.js';
import { Jws } from '@dwn-protocol/id';
/**
* Override defaults.
*/
export type ServiceOptions = {
dwnEndpoints?: string[];
};
/**
* Optional overrides that can be provided when calling {@link IDDwn.connect}.
*/
export type IDConnectOptions = {
/** Provide a {@link IDAgent} implementation. Defaults to creating a local
* {@link IDUserAgent} if one isn't provided */
agent?: IDAgent;
/** Provide an instance of a {@link AppDataStore} implementation. Defaults to
* a LevelDB-backed store with an insecure, static unlock passphrase if one
* isn't provided. To allow the app user to enter a secure passphrase of
* their choosing, provide an initialized {@link AppDataStore} instance. */
appData?: AppDataStore;
connectedDid?: string;
/** Enable synchronization of DWN records between local and remote DWNs.
* Sync defaults to running every 30 seconds and can be set to any value accepted by `ms()`.
* To disable sync set to 'off'. */
sync?: string;
/** Override defaults service options.
* See {@link ServiceOptions} for available options. */
serviceOptions?: ServiceOptions;
passphrase?: string;
};
/**
* @see {@link IDConnectOptions}
*/
type IDOptions = {
agent: IDAgent;
connectedDid: string;
};
type UtilsOptions = {
DidKeyMethod: DidKeyMethod;
DidDhtMethod: DidDhtMethod;
DidIonMethod: DidIonMethod;
Jose: Jose;
Jws: Jws;
};
export declare class IDDwn {
agent: IDAgent;
private connectedDid;
did: DidApi;
dwn: DwnApi;
metadata: Metadata;
jose: Jose;
protocol: any;
queue: Queue;
services: Services;
transactions: Transactions;
utils: UtilsOptions;
vc: VcApi;
constructor(options: IDOptions);
/**
* Connects to a {@link IDAgent}. Defaults to creating a local {@link IDUserAgent}
* if one isn't provided.
*
* @param options - optional overrides
* @returns
*/
static connect(options?: IDConnectOptions): Promise<{
iddwn: IDDwn;
did: string;
}>;
}
export {};
//# sourceMappingURL=iddwn.d.ts.map