UNPKG

2.17 kBTypeScriptView Raw
1import { ClientConfig } from './types/config';
2import { IpfsService } from './services/ipfs';
3import { TasksService } from './services/tasks';
4import { VAccountService } from './services/vaccount';
5import { TokenService } from './services/token';
6import { APIClient, FetchProvider, FetchProviderOptions } from '@wharfkit/antelope';
7import { Name, Session } from "@wharfkit/session";
8import { ActionService } from './services/actions';
9import { AtomicAssetsService } from './services/atomic';
10import { DaoService } from './services/dao';
11export declare class Client {
12 static __classname: string;
13 readonly config: ClientConfig;
14 readonly fetchProvider: FetchProvider;
15 readonly eos: APIClient;
16 session: Session;
17 /**
18 * Create a new Effect Network Client instance
19 * @param {string} environment Which network you would like to connect to, defaults to 'jungle4'
20 */
21 constructor(environment?: string, fetchProviderOptions?: FetchProviderOptions);
22 tasks: TasksService;
23 ipfs: IpfsService;
24 vaccount: VAccountService;
25 efx: TokenService;
26 action: ActionService;
27 atomic: AtomicAssetsService;
28 dao: DaoService;
29 /**
30 * Login to the Effect Network with a session
31 * @param session Session object
32 */
33 loginWithSession(session: Session): void;
34 /**
35 * Login to the Effect Network with a private key
36 * @param actor EOS account name of the user
37 * @param permission EOS permission of the user
38 * @param privateKey EOS private key of the user
39 */
40 login(actor: string, permission: string, privateKey: string): void;
41 /**
42 * Logout from the Effect Network
43 */
44 logout(): void;
45 /**
46 * Check if the user is logged in
47 * @returns {boolean} Whether or not the user is logged in
48 */
49 isLoggedIn(): boolean;
50 /**
51 * Require a session to be set (make sure user is logged in), otherwise throw an error.
52 */
53 requireSession(): void;
54 /**
55 * Retrieve the actor and permission from the session
56 * @returns [{ actor: Name; permission: Name }]
57 */
58 sessionAuth: () => {
59 actor: Name;
60 permission: Name;
61 }[];
62}