wowok 1.6.72 → 1.6.73
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/arbitration.d.ts +1 -1
- package/dist/arbitration.d.ts.map +1 -1
- package/dist/demand.d.ts.map +1 -1
- package/dist/entity.d.ts +6 -9
- package/dist/entity.d.ts.map +1 -1
- package/dist/entity.js +9 -37
- package/dist/exception.d.ts +3 -1
- package/dist/exception.d.ts.map +1 -1
- package/dist/exception.js +3 -1
- package/dist/guard.d.ts +8 -5
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +271 -261
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/passport.d.ts +2 -2
- package/dist/passport.d.ts.map +1 -1
- package/dist/passport.js +0 -5
- package/dist/permission.d.ts +4 -4
- package/dist/permission.d.ts.map +1 -1
- package/dist/permission.js +10 -10
- package/dist/progress.d.ts.map +1 -1
- package/dist/protocol.d.ts +12 -12
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +11 -13
- package/dist/repository.d.ts +0 -1
- package/dist/repository.d.ts.map +1 -1
- package/dist/repository.js +1 -4
- package/dist/resource.d.ts +19 -20
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +89 -108
- package/dist/service.d.ts +1 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/treasury.d.ts +1 -1
- package/dist/treasury.d.ts.map +1 -1
- package/dist/utils.d.ts +7 -4
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +20 -1
- package/dist/wowok.js +2 -2
- package/package.json +1 -1
- package/src/demand.ts +1 -1
- package/src/entity.ts +2 -2
- package/src/guard.ts +1 -2
- package/src/index.ts +13 -4
- package/empty.ts +0 -0
package/dist/arbitration.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare class Arbitration {
|
|
|
37
37
|
get_object(): TxbObject;
|
|
38
38
|
private constructor();
|
|
39
39
|
static From(txb: TransactionBlock, token_type: string, permission: PermissionObject, object: TxbObject): Arbitration;
|
|
40
|
-
static New(txb: TransactionBlock, token_type: string, permission: PermissionObject, description: string, fee: bigint, withdrawTreasury: TreasuryObject, passport?: PassportObject): Arbitration;
|
|
40
|
+
static New(txb: TransactionBlock, token_type: string, permission: PermissionObject, description: string, fee: bigint | number | string, withdrawTreasury: TreasuryObject, passport?: PassportObject): Arbitration;
|
|
41
41
|
launch(): ArbitrationAddress;
|
|
42
42
|
set_description(description: string, passport?: PassportObject): void;
|
|
43
43
|
set_fee(fee: bigint, passport?: PassportObject): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbitration.d.ts","sourceRoot":"","sources":["../src/arbitration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arbitration.d.ts","sourceRoot":"","sources":["../src/arbitration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAC1E,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EACrF,UAAU,EAAC,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAI,MAAM,0BAA0B,CAAC;AAE7E,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,EAAC,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,IAAI;IACjB,GAAG,EAAE,SAAS,CAAC;IACf,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACrB,GAAG,EAAC,SAAS,CAAC;IACd,QAAQ,EAAC,MAAM,CAAC;IAChB,SAAS,CAAC,EAAC,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAA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,EAAC,OAAO,EAAE,QAAQ,CAAC,EAAC,cAAc;IAwCjF,SAAS,CAAC,WAAW,CAAC,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IAmCvD,KAAK,CAAC,KAAK,EAAC,OAAO,EAAE,QAAQ,CAAC,EAAC,cAAc;IAe7C,IAAI,CAAC,KAAK,EAAC,IAAI,EAAE,QAAQ,CAAC,EAAC,cAAc;IAuCzC,WAAW,CAAC,KAAK,EAAC,QAAQ,EAAE,QAAQ,CAAC,EAAC,cAAc;IA8BpD,YAAY,CAAC,GAAG,EAAC,SAAS,EAAE,KAAK,EAAC,WAAW,EAAG,QAAQ,CAAC,EAAC,cAAc,GAAI,cAAc;IAwD1F,oBAAoB,CAAC,QAAQ,EAAC,cAAc,EAAE,QAAQ,CAAC,EAAC,cAAc;IAqBtE,OAAO,CAAC,KAAK,EAAC,OAAO,EAAE,QAAQ,CAAC,EAAC,cAAc,GAAI,UAAU;IAiD7D,iBAAiB,CAAC,cAAc,EAAC,gBAAgB;IAajD,MAAM,CAAC,eAAe,GAAI,YAAW,MAAM,GAAG,SAAS,GAAG,IAAI,KAAI,MAAM,CAEvE;IAED,MAAM,CAAC,kBAAkB,GAAI,YAAW,MAAM,GAAG,SAAS,GAAG,IAAI,KAAI,MAAM,CAE1E;IAED,MAAM,CAAC,aAAa,aAEnB;IACD,MAAM,CAAC,qBAAqB,SAAM;IAClC,MAAM,CAAC,sBAAsB,SAAM;CACtC"}
|
package/dist/demand.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demand.d.ts","sourceRoot":"","sources":["../src/demand.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"demand.d.ts","sourceRoot":"","sources":["../src/demand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAwB,cAAc,EAAE,gBAAgB,EAAE,WA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AgB;IAYjD,MAAM,CAAC,eAAe,GAAI,aAAY,MAAM,GAAG,IAAI,KAAI,MAAM,CAE5D;IAED,MAAM,CAAC,gBAAgB,SAAO;IAC9B,MAAM,CAAC,oBAAoB,SAAO;CACrC"}
|
package/dist/entity.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { TxbObject, ResourceAddress, ResourceObject } from './protocol';
|
|
2
|
-
import {
|
|
3
|
-
import { Transaction as TransactionBlock } from '@mysten/sui/transactions';
|
|
4
|
-
export interface Safer {
|
|
5
|
-
name: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
2
|
+
import { TagName, Resource } from './resource';
|
|
3
|
+
import { Transaction as TransactionBlock, TransactionResult } from '@mysten/sui/transactions';
|
|
8
4
|
export interface Entity_Info {
|
|
9
5
|
name: string;
|
|
10
6
|
description?: string;
|
|
@@ -19,12 +15,13 @@ export declare class Entity {
|
|
|
19
15
|
get_object(): TxbObject;
|
|
20
16
|
private constructor();
|
|
21
17
|
static From(txb: TransactionBlock): Entity;
|
|
22
|
-
mark(resource: Resource, address: string, like:
|
|
18
|
+
mark(resource: Resource, address: string | TransactionResult, like: TagName.Like | TagName.Dislike): void;
|
|
23
19
|
update(info: Entity_Info): void;
|
|
24
20
|
create_resource(): ResourceAddress;
|
|
25
21
|
create_resource2(): ResourceObject;
|
|
26
|
-
destroy_resource(resource: Resource):
|
|
27
|
-
|
|
22
|
+
destroy_resource(resource: Resource): TransactionResult;
|
|
23
|
+
use_resource(resource: Resource): TransactionResult;
|
|
24
|
+
transfer_resource(resource: Resource, new_address: string): TransactionResult;
|
|
28
25
|
query_ent(address_queried: string): void;
|
|
29
26
|
}
|
|
30
27
|
//# sourceMappingURL=entity.d.ts.map
|
package/dist/entity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,SAAS,EA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
|
17
17
|
mark(resource, address, like) {
|
|
18
|
-
if (!IsValidAddress(address))
|
|
18
|
+
if (typeof (address) === 'string' && !IsValidAddress(address)) {
|
|
19
19
|
ERROR(Errors.IsValidAddress, like);
|
|
20
|
+
}
|
|
20
21
|
this.txb.moveCall({
|
|
21
22
|
target: Protocol.Instance().entityFn(like),
|
|
22
23
|
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, resource.get_object()),
|
|
23
|
-
this.txb.pure.address(address)]
|
|
24
|
+
typeof (address) === 'string' ? this.txb.pure.address(address) : address]
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
/*
|
|
27
|
-
add_safer(safer: Safer[], bExistModify:boolean=true) {
|
|
28
|
-
if (safer.length === 0) return ;
|
|
29
|
-
if (!IsValidArray(safer, (v:Safer) => {
|
|
30
|
-
if (!IsValidName(v.name) || !IsValidDesription(v.value)) {
|
|
31
|
-
return false
|
|
32
|
-
}
|
|
33
|
-
})) {
|
|
34
|
-
ERROR(Errors.InvalidParam, 'add_safer');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const name = safer.map((v)=>v.name);
|
|
38
|
-
const value = safer.map((v)=>v.value);
|
|
39
|
-
this.txb.moveCall({
|
|
40
|
-
target:Protocol.Instance().entityFn('safer_add') as FnCallType,
|
|
41
|
-
arguments:[Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.vector('string', name),
|
|
42
|
-
this.txb.pure.vector('string', value), this.txb.pure.bool(bExistModify)]
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
remove_safer(name:string[], removeall?:boolean) {
|
|
47
|
-
if (name.length === 0 && !removeall) return;
|
|
48
|
-
|
|
49
|
-
if (removeall) {
|
|
50
|
-
this.txb.moveCall({
|
|
51
|
-
target:Protocol.Instance().entityFn('safer_remove_all') as FnCallType,
|
|
52
|
-
arguments:[Protocol.TXB_OBJECT(this.txb, this.object)]
|
|
53
|
-
})
|
|
54
|
-
} else {
|
|
55
|
-
this.txb.moveCall({
|
|
56
|
-
target:Protocol.Instance().entityFn('safer_remove') as FnCallType,
|
|
57
|
-
arguments:[Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.vector('string', name)]
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
}*/
|
|
61
27
|
update(info) {
|
|
62
28
|
if (info?.name && !IsValidName(info.name))
|
|
63
29
|
ERROR(Errors.IsValidName, 'update');
|
|
@@ -102,6 +68,12 @@ export class Entity {
|
|
|
102
68
|
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, resource.get_object())]
|
|
103
69
|
});
|
|
104
70
|
}
|
|
71
|
+
use_resource(resource) {
|
|
72
|
+
return this.txb.moveCall({
|
|
73
|
+
target: Protocol.Instance().entityFn('resource_use'),
|
|
74
|
+
arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, resource.get_object())]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
105
77
|
transfer_resource(resource, new_address) {
|
|
106
78
|
if (!IsValidAddress(new_address))
|
|
107
79
|
ERROR(Errors.IsValidAddress, 'transfer_resource');
|
package/dist/exception.d.ts
CHANGED
|
@@ -20,9 +20,11 @@ export declare enum Errors {
|
|
|
20
20
|
Fail = "fail",
|
|
21
21
|
IsValidIndentifier = "indentifier invalid",
|
|
22
22
|
isValidHttpUrl = "invalid url",
|
|
23
|
-
|
|
23
|
+
IsValidBizPermissionIndex = "invalid biz-permission index",
|
|
24
24
|
bcsTypeInvalid = "invalid bcs type",
|
|
25
25
|
IsValidServiceItemName = "invalid service item name",
|
|
26
|
+
IsValidCoinType = "not the coin type",
|
|
27
|
+
IsValidGuardIdentifier = "guard identifier invalid",
|
|
26
28
|
noPermission = "no permission"
|
|
27
29
|
}
|
|
28
30
|
export declare const ERROR: (error: Errors, info?: any) => never;
|
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,0BAA0B;IACxC,gBAAgB,uBAAuB;IACvC,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,UAAU,gBAAgB;IAC1B,SAAS,eAAe;IACxB,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;IAC1C,cAAc,gBAAgB;IAC9B,
|
|
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,0BAA0B;IACxC,gBAAgB,uBAAuB;IACvC,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,UAAU,gBAAgB;IAC1B,SAAS,eAAe;IACxB,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;IAC1C,cAAc,gBAAgB;IAC9B,yBAAyB,iCAAiC;IAC1D,cAAc,qBAAqB;IACnC,sBAAsB,8BAA8B;IACpD,eAAe,sBAAsB;IACrC,sBAAsB,6BAA6B;IACnD,YAAY,kBAAkB;CACjC;AAED,eAAO,MAAM,KAAK,GAAI,OAAM,MAAM,EAAE,OAAM,GAAG,UAG5C,CAAA"}
|
package/dist/exception.js
CHANGED
|
@@ -21,9 +21,11 @@ export var Errors;
|
|
|
21
21
|
Errors["Fail"] = "fail";
|
|
22
22
|
Errors["IsValidIndentifier"] = "indentifier invalid";
|
|
23
23
|
Errors["isValidHttpUrl"] = "invalid url";
|
|
24
|
-
Errors["
|
|
24
|
+
Errors["IsValidBizPermissionIndex"] = "invalid biz-permission index";
|
|
25
25
|
Errors["bcsTypeInvalid"] = "invalid bcs type";
|
|
26
26
|
Errors["IsValidServiceItemName"] = "invalid service item name";
|
|
27
|
+
Errors["IsValidCoinType"] = "not the coin type";
|
|
28
|
+
Errors["IsValidGuardIdentifier"] = "guard identifier invalid";
|
|
27
29
|
Errors["noPermission"] = "no permission";
|
|
28
30
|
})(Errors || (Errors = {}));
|
|
29
31
|
export const ERROR = (error, info) => {
|
package/dist/guard.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface GuardAnswer {
|
|
|
18
18
|
identifiers: number[];
|
|
19
19
|
}
|
|
20
20
|
export type OnQueryAnswer = (answer: GuardAnswer) => void;
|
|
21
|
+
export declare const GUARD_QUERIES: any[];
|
|
21
22
|
export declare class Guard {
|
|
22
23
|
static MAX_INPUT_LENGTH: number;
|
|
23
24
|
protected txb: TransactionBlock;
|
|
@@ -29,7 +30,6 @@ export declare class Guard {
|
|
|
29
30
|
launch(): GuardAddress;
|
|
30
31
|
static everyone_guard(txb: TransactionBlock): GuardAddress;
|
|
31
32
|
static QueryAddressIdentifiers(guard: GuardObject, onQueryAnswer: OnQueryAnswer, sender: string): void;
|
|
32
|
-
static QUERIES: any[];
|
|
33
33
|
static BoolCmd: any[];
|
|
34
34
|
static IsBoolCmd: (cmd: number) => boolean;
|
|
35
35
|
static CmdFilter: (retType: ValueType) => any[];
|
|
@@ -48,14 +48,17 @@ export declare class Guard {
|
|
|
48
48
|
static StringOptions: () => Guard_Options[];
|
|
49
49
|
static BoolOptions: () => Guard_Options[];
|
|
50
50
|
static AddressOptions: () => Guard_Options[];
|
|
51
|
-
static Options: (ret_type: ValueType |
|
|
51
|
+
static Options: (ret_type: ValueType | "number" | "any") => Guard_Options[];
|
|
52
52
|
}
|
|
53
|
+
export declare const IsValidGuardIdentifier: (identifier: number | undefined) => boolean;
|
|
53
54
|
export declare class GuardMaker {
|
|
54
55
|
protected data: Uint8Array[];
|
|
55
56
|
protected type_validator: Data_Type[];
|
|
56
57
|
protected constant: GuardConstant;
|
|
57
|
-
private static
|
|
58
|
-
private static
|
|
58
|
+
private static _witness_index;
|
|
59
|
+
private static _const_index;
|
|
60
|
+
private static GetWitnessIndex;
|
|
61
|
+
private static getConstIndex;
|
|
59
62
|
static IsValidIndentifier: (identifier: number) => boolean;
|
|
60
63
|
constructor();
|
|
61
64
|
add_constant(type: ValueType, value?: any, identifier?: number, bNeedSerialize?: boolean): number;
|
|
@@ -67,7 +70,7 @@ export declare class GuardMaker {
|
|
|
67
70
|
IsReady(): boolean;
|
|
68
71
|
combine(otherBuilt: GuardMaker, bAnd?: boolean, bCombinConstant?: boolean): GuardMaker;
|
|
69
72
|
get_constant(): GuardConstant;
|
|
70
|
-
get_input(): Uint8Array[];
|
|
73
|
+
get_input(): Uint8Array<ArrayBufferLike>[];
|
|
71
74
|
static input_combine(input1: Uint8Array, input2: Uint8Array, bAnd?: boolean): Uint8Array;
|
|
72
75
|
static input_not(input: Uint8Array): Uint8Array;
|
|
73
76
|
static match_u256(type: number): boolean;
|
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,EAAwB,YAAY,EAAc,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAG,YAAY,EAAE,SAAS,EAAE,WAAW,EAAsB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources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