wowok 1.1.1 → 1.1.2
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/exception.d.ts +2 -1
- package/dist/exception.d.ts.map +1 -1
- package/dist/exception.js +1 -0
- package/dist/graphql.d.ts +2 -0
- package/dist/graphql.d.ts.map +1 -1
- package/dist/graphql.js +19 -0
- package/dist/guard.d.ts +18 -23
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +196 -175
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/machine.d.ts +6 -6
- package/dist/machine.d.ts.map +1 -1
- package/dist/passport.d.ts +34 -22
- package/dist/passport.d.ts.map +1 -1
- package/dist/passport.js +120 -220
- package/dist/permission.d.ts +3 -0
- package/dist/permission.d.ts.map +1 -1
- package/dist/permission.js +3 -0
- package/dist/protocol.d.ts +6 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -4
- package/dist/repository.d.ts +2 -0
- package/dist/repository.d.ts.map +1 -1
- package/dist/repository.js +68 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +31 -0
- package/package.json +1 -1
- package/src/exception.ts +1 -0
- package/src/graphql.ts +20 -0
- package/src/guard.ts +184 -168
- package/src/index.ts +1 -0
- package/src/machine.ts +3 -3
- package/src/passport.ts +139 -251
- package/src/permission.ts +3 -0
- package/src/protocol.ts +17 -6
- package/src/repository.ts +68 -0
- package/src/utils.ts +36 -0
- package/tsconfig.json +3 -2
package/dist/exception.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export declare enum Errors {
|
|
|
13
13
|
AllInvalid = "one valid at least",
|
|
14
14
|
InvalidParam = "invalid parameter",
|
|
15
15
|
IsValidPermissionIndex = "invalid permission index",
|
|
16
|
-
IsValidKey = "invalid key"
|
|
16
|
+
IsValidKey = "invalid key",
|
|
17
|
+
Fail = "fail"
|
|
17
18
|
}
|
|
18
19
|
export declare const ERROR: (error: Errors, info?: any) => never;
|
|
19
20
|
//# sourceMappingURL=exception.d.ts.map
|
package/dist/exception.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.d.ts","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":"AACA,oBAAY,MAAM;IACd,iBAAiB,wBAAwB;IACzC,WAAW,iBAAiB;IAC5B,sBAAsB,iBAAiB;IACvC,eAAe,qBAAqB;IACpC,cAAc,oBAAoB;IAClC,cAAc,yBAAyB;IACvC,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;IAC9B,cAAc,oBAAoB;IAClC,UAAU,uBAAuB;IACjC,YAAY,sBAAuB;IACnC,sBAAsB,6BAA6B;IACnD,UAAU,gBAAgB;
|
|
1
|
+
{"version":3,"file":"exception.d.ts","sourceRoot":"","sources":["../src/exception.ts"],"names":[],"mappings":"AACA,oBAAY,MAAM;IACd,iBAAiB,wBAAwB;IACzC,WAAW,iBAAiB;IAC5B,sBAAsB,iBAAiB;IACvC,eAAe,qBAAqB;IACpC,cAAc,oBAAoB;IAClC,cAAc,yBAAyB;IACvC,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;IAC9B,cAAc,oBAAoB;IAClC,UAAU,uBAAuB;IACjC,YAAY,sBAAuB;IACnC,sBAAsB,6BAA6B;IACnD,UAAU,gBAAgB;IAC1B,IAAI,SAAS;CAChB;AAED,eAAO,MAAM,KAAK,UAAU,MAAM,SAAQ,GAAG,UAG5C,CAAA"}
|
package/dist/exception.js
CHANGED
|
@@ -15,6 +15,7 @@ export var Errors;
|
|
|
15
15
|
Errors["InvalidParam"] = "invalid parameter";
|
|
16
16
|
Errors["IsValidPermissionIndex"] = "invalid permission index";
|
|
17
17
|
Errors["IsValidKey"] = "invalid key";
|
|
18
|
+
Errors["Fail"] = "fail";
|
|
18
19
|
})(Errors || (Errors = {}));
|
|
19
20
|
export const ERROR = (error, info) => {
|
|
20
21
|
const e = error + info ? (': ' + info) : '';
|
package/dist/graphql.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const GRAPHQL_OBJECTS_TYPE: import("graphql/language/ast").DocumentNode;
|
|
2
|
+
export declare const GRAPHQL_CHILD_OBJECT: import("graphql/language/ast").DocumentNode;
|
|
2
3
|
export declare const GRAPHQL_OBJECT: import("graphql/language/ast").DocumentNode;
|
|
3
4
|
export declare const GRAPHQL_OWNER: import("graphql/language/ast").DocumentNode;
|
|
4
5
|
export declare const GRAPHQL_OBJECTS: import("graphql/language/ast").DocumentNode;
|
|
6
|
+
export declare const GRAPHQL_DECIMALS: import("graphql/language/ast").DocumentNode;
|
|
5
7
|
//# sourceMappingURL=graphql.d.ts.map
|
package/dist/graphql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,6CAgB/B,CAAC;AAEH,eAAO,MAAM,cAAc,6CAmCzB,CAAC;AAEH,eAAO,MAAM,aAAa,6CA2BxB,CAAC;AAEH,eAAO,MAAM,eAAe,6CAgB1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,6CAgB/B,CAAC;AACH,eAAO,MAAM,oBAAoB,6CAW/B,CAAC;AAEH,eAAO,MAAM,cAAc,6CAmCzB,CAAC;AAEH,eAAO,MAAM,aAAa,6CA2BxB,CAAC;AAEH,eAAO,MAAM,eAAe,6CAgB1B,CAAC;AAEH,eAAO,MAAM,gBAAgB,6CAM3B,CAAC"}
|
package/dist/graphql.js
CHANGED
|
@@ -16,6 +16,18 @@ export const GRAPHQL_OBJECTS_TYPE = gql(`
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
`);
|
|
19
|
+
export const GRAPHQL_CHILD_OBJECT = gql(`
|
|
20
|
+
query object($ObjectID:SuiAddress!) {
|
|
21
|
+
object(address:$ObjectID) {
|
|
22
|
+
address
|
|
23
|
+
asMoveObject {
|
|
24
|
+
contents {
|
|
25
|
+
json
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`);
|
|
19
31
|
export const GRAPHQL_OBJECT = gql(`
|
|
20
32
|
query object($ObjectID:SuiAddress!) {
|
|
21
33
|
object(address:$ObjectID) {
|
|
@@ -97,3 +109,10 @@ export const GRAPHQL_OBJECTS = gql(`
|
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
`);
|
|
112
|
+
export const GRAPHQL_DECIMALS = gql(`
|
|
113
|
+
query getTotalSupply($coinType: String!) {
|
|
114
|
+
coinMetadata(coinType: $coinType) {
|
|
115
|
+
decimals
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`);
|
package/dist/guard.d.ts
CHANGED
|
@@ -1,47 +1,42 @@
|
|
|
1
1
|
import { Protocol, GuardAddress, Data_Type, MODULES, ContextType, ValueType, OperatorType } from './protocol';
|
|
2
|
-
export declare enum Guard_Sense_Binder {
|
|
3
|
-
AND = 0,
|
|
4
|
-
OR = 1
|
|
5
|
-
}
|
|
6
|
-
export type Guard_Sense = {
|
|
7
|
-
input: Uint8Array;
|
|
8
|
-
notAfterSense: boolean;
|
|
9
|
-
binder: Guard_Sense_Binder;
|
|
10
|
-
};
|
|
11
2
|
export type VariableType = Map<number, Guard_Vriable>;
|
|
12
|
-
export
|
|
3
|
+
export interface Guard_Vriable {
|
|
13
4
|
type: ContextType | OperatorType;
|
|
14
5
|
value?: Uint8Array;
|
|
15
6
|
witness?: Uint8Array;
|
|
16
|
-
}
|
|
7
|
+
}
|
|
17
8
|
export type Guard_Creation = {
|
|
18
9
|
description: string;
|
|
19
10
|
variables?: VariableType;
|
|
20
|
-
|
|
11
|
+
input: Uint8Array;
|
|
21
12
|
};
|
|
22
13
|
export declare class Guard {
|
|
23
|
-
static
|
|
14
|
+
static MAX_INPUT_LENGTH: number;
|
|
15
|
+
static launch(protocol: Protocol, creation: Guard_Creation): GuardAddress;
|
|
16
|
+
static signer_guard(protocol: Protocol): GuardAddress;
|
|
17
|
+
static everyone_guard(protocol: Protocol): GuardAddress;
|
|
18
|
+
static QUERIES: any[];
|
|
19
|
+
}
|
|
20
|
+
export declare class GuardVariableMaker {
|
|
24
21
|
static IsValidGuardVirableType: (type: OperatorType | ContextType) => boolean;
|
|
25
22
|
static IsValidIndentifier: (identifier: number) => boolean;
|
|
26
23
|
static get_variable_value(variables: VariableType, identifier: number, type: OperatorType | ContextType): Uint8Array | boolean;
|
|
27
24
|
static get_variable_witness(variables: VariableType, identifier: number, type: OperatorType | ContextType): Uint8Array | boolean;
|
|
28
25
|
static add_future_variable(variables: VariableType, identifier: number, type: OperatorType | ContextType, witness: any, value?: any, bNeedSerialize?: boolean): boolean;
|
|
29
26
|
static add_variable(variables: VariableType, identifier: number, type: OperatorType | ContextType, value: any, bNeedSerialize?: boolean): boolean;
|
|
30
|
-
static launch(protocol: Protocol, creation: Guard_Creation): GuardAddress;
|
|
31
|
-
static signer_guard(protocol: Protocol): GuardAddress;
|
|
32
|
-
static everyone_guard(protocol: Protocol): GuardAddress;
|
|
33
|
-
static QUERIES: any[];
|
|
34
27
|
}
|
|
35
|
-
export declare class
|
|
28
|
+
export declare class GuardInputMaker {
|
|
36
29
|
protected data: Uint8Array[];
|
|
37
30
|
protected type_validator: Data_Type[];
|
|
38
31
|
constructor();
|
|
39
|
-
add_param(type: ValueType | ContextType, param?: any, variable?: VariableType):
|
|
32
|
+
add_param(type: ValueType | ContextType, param?: any, variable?: VariableType): void;
|
|
40
33
|
static query_index(module: MODULES, query_name: string): number;
|
|
41
|
-
add_future_query(identifier: number, module: MODULES, query_name: string, variable: VariableType):
|
|
42
|
-
add_query(module: MODULES, query_name: string, object_address_from: string | number):
|
|
43
|
-
add_logic(type: OperatorType):
|
|
44
|
-
make(
|
|
34
|
+
add_future_query(identifier: number, module: MODULES, query_name: string, variable: VariableType): void;
|
|
35
|
+
add_query(module: MODULES, query_name: string, object_address_from: string | number): void;
|
|
36
|
+
add_logic(type: OperatorType): void;
|
|
37
|
+
make(bNot?: boolean): Uint8Array;
|
|
38
|
+
static combine(input1: Uint8Array, input2: Uint8Array, bAnd?: boolean): Uint8Array;
|
|
39
|
+
static not(input: Uint8Array): Uint8Array;
|
|
45
40
|
static match_u128(type: number): boolean;
|
|
46
41
|
}
|
|
47
42
|
//# sourceMappingURL=guard.d.ts.map
|
package/dist/guard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../src/guard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAc,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAG,YAAY,EAAC,MAAM,YAAY,CAAC;AAK1H,
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../src/guard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAc,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAG,YAAY,EAAC,MAAM,YAAY,CAAC;AAK1H,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,WAAW,GAAG,YAAY,CAAC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,KAAK,EAAE,UA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