-
Notifications
You must be signed in to change notification settings - Fork 88
/
index.ts
59 lines (55 loc) · 2.32 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { ActorSubclass } from './actor';
export * from './actor';
export * from './agent';
export * from './auth';
export * from './certificate';
export * from './agent/http/transforms';
export * from './agent/http/types';
export * from './canisters/asset';
export * from './canisters/management';
export * from './fetch_candid';
export * from './request_id';
export * from './utils/bls';
export * from './utils/buffer';
export * as polling from './polling';
/**
* The CanisterStatus utility is used to request structured data directly from the IC public API. This data can be accessed using agent.readState, but CanisterStatus provides a helpful abstraction with some known paths.
*
* You can request a canisters Controllers, ModuleHash, Candid interface, Subnet, or Time, or provide a custom path {@link CanisterStatus.CustomPath} and pass arbitrary buffers for valid paths identified in https://smartcontracts.org/docs/current/references/ic-interface-spec/.
*
* The primary method for this namespace is {@link CanisterStatus.request}
*/
export * as CanisterStatus from './canisterStatus';
import { Agent, HttpAgent } from './agent';
import { IDL } from '@dfinity/candid';
export * as Cbor from './cbor';
export interface GlobalInternetComputer {
ic: {
agent: Agent;
HttpAgent: typeof HttpAgent;
IDL: typeof IDL;
/**
* Simple advertisement of features in whoever is managing this `globalThis.ic`.
* Use Case
* * Scripts that know they need an ic feature can detect using this and, if not present
* (e.g. old bootstrap version), they can dynamically include their own and continue
* operating (e.g. polyfill).
* This is useful when adding features to bootstrap. You can still deploy your canister to
* an ic with old bootstrap, then just dynamically reload your own new-version bootstrap if
* needed.
*/
features?: {
/** This is falsy if authn isn't supported at all */
authentication?: boolean;
};
/**
* The Actor for the canister being used for the frontend. Normally should correspond to the
* canister represented by the canister id in the URL.
*
* It does not have any functions configured.
*
* If a canister ID could not be found, no actor were created and this is undefined.
*/
canister: ActorSubclass | undefined;
};
}