wowok 1.1.1 → 1.1.3

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/README.md CHANGED
@@ -4,7 +4,8 @@
4
4
  AI-oriented web3 collaboration protocol, driving innovaion and making it more likely to happen.
5
5
 
6
6
  Github: [https://github.com/wowok-ai/sdk](https://github.com/wowok-ai/sdk)
7
- Examples: [https://github.com/wowok-ai/sdk-examples](https://github.com/wowok-ai/sdk-examples)
7
+ Examples: [https://github.com/wowok-ai/sdk-examples](https://github.com/wowok-ai/sdk-examples)
8
+ Docs: [https://github.com/wowok-ai/sdk/wiki](https://github.com/wowok-ai/sdk/wiki)
8
9
 
9
10
  ### Installation
10
11
 
@@ -12,7 +13,7 @@ Examples: [https://github.com/wowok-ai/sdk-examples](https://github.com/wowok-ai
12
13
  $ npm i wowok
13
14
  ```
14
15
 
15
- ### Documentation
16
16
 
17
17
 
18
18
 
19
+
@@ -13,7 +13,9 @@ 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",
18
+ IsValidIndentifier = "indentifier invalid"
17
19
  }
18
20
  export declare const ERROR: (error: Errors, info?: any) => never;
19
21
  //# sourceMappingURL=exception.d.ts.map
@@ -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;CAC7B;AAED,eAAO,MAAM,KAAK,UAAU,MAAM,SAAQ,GAAG,UAG5C,CAAA"}
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;IACb,kBAAkB,wBAAwB;CAC7C;AAED,eAAO,MAAM,KAAK,UAAU,MAAM,SAAQ,GAAG,UAG5C,CAAA"}
package/dist/exception.js CHANGED
@@ -15,6 +15,8 @@ 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";
19
+ Errors["IsValidIndentifier"] = "indentifier invalid";
18
20
  })(Errors || (Errors = {}));
19
21
  export const ERROR = (error, info) => {
20
22
  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
@@ -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
- 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
- export type VariableType = Map<number, Guard_Vriable>;
12
- export type Guard_Vriable = {
13
- type: ContextType | OperatorType;
1
+ import { Protocol, GuardAddress, Data_Type, MODULES, ContextType, ValueType, OperatorType, VariableType } from './protocol';
2
+ export type GuardVariable = Map<number, Guard_Vriable>;
3
+ export interface Guard_Vriable {
4
+ type: VariableType;
14
5
  value?: Uint8Array;
15
6
  witness?: Uint8Array;
16
- };
17
- export type Guard_Creation = {
18
- description: string;
19
- variables?: VariableType;
20
- senses: Guard_Sense[];
21
- };
7
+ }
22
8
  export declare class Guard {
23
- static MAX_SENSE_COUNT: number;
24
- static IsValidGuardVirableType: (type: OperatorType | ContextType) => boolean;
25
- static IsValidIndentifier: (identifier: number) => boolean;
26
- static get_variable_value(variables: VariableType, identifier: number, type: OperatorType | ContextType): Uint8Array | boolean;
27
- static get_variable_witness(variables: VariableType, identifier: number, type: OperatorType | ContextType): Uint8Array | boolean;
28
- static add_future_variable(variables: VariableType, identifier: number, type: OperatorType | ContextType, witness: any, value?: any, bNeedSerialize?: boolean): boolean;
29
- static add_variable(variables: VariableType, identifier: number, type: OperatorType | ContextType, value: any, bNeedSerialize?: boolean): boolean;
30
- static launch(protocol: Protocol, creation: Guard_Creation): GuardAddress;
9
+ static MAX_INPUT_LENGTH: number;
10
+ static launch(protocol: Protocol, description: string, maker: GuardMaker): GuardAddress;
31
11
  static signer_guard(protocol: Protocol): GuardAddress;
32
12
  static everyone_guard(protocol: Protocol): GuardAddress;
33
13
  static QUERIES: any[];
34
14
  }
35
- export declare class SenseMaker {
15
+ export declare class GuardVariableHelper {
16
+ static IsValidIndentifier: (identifier: number) => boolean;
17
+ static get_variable_value(variables: GuardVariable, identifier: number, type: VariableType): Uint8Array | undefined;
18
+ static get_variable_witness(variables: GuardVariable, identifier: number): Uint8Array | undefined;
19
+ static add_future_variable(variables: GuardVariable, identifier: number, witness: any, value?: any, bNeedSerialize?: boolean): void;
20
+ static add_variable(variables: GuardVariable, identifier: number, type: ValueType, value: any, bNeedSerialize?: boolean): false | undefined;
21
+ }
22
+ export declare class GuardMaker {
36
23
  protected data: Uint8Array[];
37
24
  protected type_validator: Data_Type[];
25
+ protected variable: GuardVariable;
26
+ private static index;
27
+ private static get_index;
38
28
  constructor();
39
- add_param(type: ValueType | ContextType, param?: any, variable?: VariableType): boolean;
40
- static query_index(module: MODULES, query_name: string): number;
41
- add_future_query(identifier: number, module: MODULES, query_name: string, variable: VariableType): boolean;
42
- add_query(module: MODULES, query_name: string, object_address_from: string | number): boolean;
43
- add_logic(type: OperatorType): boolean;
44
- make(bNotAfterSense?: boolean, binder?: Guard_Sense_Binder): boolean | Guard_Sense;
29
+ add_variable(type: VariableType, value: any, bNeedSerialize?: boolean): number;
30
+ add_param(type: ValueType | ContextType, param?: any): GuardMaker;
31
+ add_query(module: MODULES, query_name: string, object_address_from: string | number, bWitness?: boolean): GuardMaker;
32
+ add_logic(type: OperatorType): GuardMaker;
33
+ build(bNot?: boolean): GuardMaker;
34
+ IsReady(): boolean;
35
+ combine(otherBuilt: GuardMaker, bAnd?: boolean, bCombinVariable?: boolean): GuardMaker;
36
+ get_variable(): GuardVariable;
37
+ get_input(): Uint8Array[];
38
+ static input_combine(input1: Uint8Array, input2: Uint8Array, bAnd?: boolean): Uint8Array;
39
+ static input_not(input: Uint8Array): Uint8Array;
45
40
  static match_u128(type: number): boolean;
46
41
  }
47
42
  //# sourceMappingURL=guard.d.ts.map
@@ -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,M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