@effectai/sdk
Version:
Effect Network Javscript/Typescript SDK (for [https://effect.network](https://effect.network))
33 lines (32 loc) • 1.13 kB
TypeScript
import { APIClient, FetchProvider, type FetchProviderOptions } from "@wharfkit/antelope";
import type { Session } from "@wharfkit/session";
import type { Network } from "./types/network";
import { type Cache } from "./cache";
import { type CacheManager } from "./cache";
import { EffectSession } from "./session";
export interface ClientOpts {
ipfsCacheDurationInMs?: number | null;
fetchProvider?: FetchProviderOptions;
cacheImplementation?: Cache;
}
export declare class Client {
readonly fetchProvider: FetchProvider;
readonly network: Network;
readonly options: ClientOpts;
readonly provider: APIClient;
cache: CacheManager;
private _session;
get session(): EffectSession | null;
constructor(network: Network, options: ClientOpts);
setSession: (session: Session | null) => Promise<EffectSession | null>;
}
export type CreateClientArgs = {
network?: Network;
session?: Session;
options?: ClientOpts;
} & ({
network: Network;
} | {
session: Session;
});
export declare const createClient: ({ network, session, options, }: CreateClientArgs) => Promise<Client>;