@xyo-network/xl1-protocol 1.5.18 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/provider/v1/XyoHost.d.ts +48 -9
- package/dist/types/provider/v1/XyoHost.d.ts.map +1 -1
- package/documents/proof-of-perfect/proof-of-perfect-draft.log +741 -0
- package/documents/xyol1-white-paper/white-paper-draft.log +547 -0
- package/package.json +15 -15
- package/src/provider/v1/XyoHost.ts +53 -19
|
@@ -1,25 +1,64 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Hex } from '@xylabs/hex';
|
|
2
|
+
import type { JsonValue } from '@xylabs/object';
|
|
2
3
|
import type { Promisable } from '@xylabs/promise';
|
|
3
4
|
export interface ChainConnection {
|
|
5
|
+
/** Chain Identifier - can be a hex (eth contract address) or a string */
|
|
4
6
|
chainId?: string | Hex;
|
|
7
|
+
/** Name of the chain */
|
|
5
8
|
name: string;
|
|
6
9
|
/** Url for accessing the network */
|
|
7
10
|
url: string;
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Modeled after EIP-2255
|
|
14
|
+
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
15
|
+
*/
|
|
16
|
+
export interface PermissionRequest {
|
|
17
|
+
[capability: string]: {
|
|
18
|
+
[caveatName: string]: JsonValue;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Modeled after EIP-2255
|
|
23
|
+
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
24
|
+
*/
|
|
25
|
+
export interface RequestedPermission {
|
|
26
|
+
/** Permission identifier (i.e. RPC method, action, etc.) */
|
|
27
|
+
capability: string;
|
|
28
|
+
/** Optional timestamp for when the permission was granted */
|
|
29
|
+
date?: number;
|
|
30
|
+
}
|
|
31
|
+
export type CaveatTypes = 'chain' | 'expiration' | 'filteredResponse' | 'rateLimit';
|
|
32
|
+
/**
|
|
33
|
+
* Modeled after EIP-2255
|
|
34
|
+
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
35
|
+
*/
|
|
36
|
+
export interface Caveats {
|
|
37
|
+
/** Type of caveat */
|
|
38
|
+
type: CaveatTypes;
|
|
39
|
+
/** Value for the caveat (i.e. chain id, subset of accounts, expiration, max request per minute, etc.) */
|
|
40
|
+
value: JsonValue;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Modeled after EIP-2255
|
|
44
|
+
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
45
|
+
*/
|
|
9
46
|
export interface Permission {
|
|
47
|
+
/** Permission identifier (i.e. RPC method, action, etc.) */
|
|
10
48
|
capability: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
49
|
+
/** Caveats for the permission, if applicable (i.e. allowed accounts, signing, etc.) */
|
|
50
|
+
caveats?: Caveats[];
|
|
51
|
+
/** Invoker for the given permission (URI, domain, webpage, address, etc.) */
|
|
52
|
+
invoker: string;
|
|
53
|
+
}
|
|
54
|
+
export interface InvokerPermission extends Permission {
|
|
55
|
+
/** Time at which the permission was granted */
|
|
56
|
+
date?: number;
|
|
18
57
|
}
|
|
19
58
|
export interface XyoHost {
|
|
20
59
|
addChain(chainConnectionInfo: ChainConnection): Promisable<boolean>;
|
|
21
60
|
chains(): Promisable<ChainConnection[]>;
|
|
22
|
-
getPermissions(): Promisable<
|
|
61
|
+
getPermissions(): Promisable<InvokerPermission[]>;
|
|
23
62
|
requestPermissions(permissions: Permission[]): Promisable<boolean>;
|
|
24
63
|
revokePermissions(permissions: Permission[]): Promisable<boolean>;
|
|
25
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoHost.d.ts","sourceRoot":"","sources":["../../../../src/provider/v1/XyoHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"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