wowok 1.0.10 → 1.0.11
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/demand.d.ts +3 -2
- package/dist/demand.d.ts.map +1 -0
- package/dist/demand.js +55 -59
- package/dist/exception.d.ts +1 -0
- package/dist/exception.d.ts.map +1 -0
- package/dist/exception.js +3 -7
- package/dist/graphql.d.ts +1 -0
- package/dist/graphql.d.ts.map +1 -0
- package/dist/graphql.js +5 -8
- package/dist/guard.d.ts +2 -1
- package/dist/guard.d.ts.map +1 -0
- package/dist/guard.js +227 -254
- package/dist/index.d.ts +13 -14
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -56
- package/dist/machine.d.ts +3 -2
- package/dist/machine.d.ts.map +1 -0
- package/dist/machine.js +68 -72
- package/dist/passport.d.ts +3 -2
- package/dist/passport.d.ts.map +1 -0
- package/dist/passport.js +81 -86
- package/dist/permission.d.ts +2 -1
- package/dist/permission.d.ts.map +1 -0
- package/dist/permission.js +50 -54
- package/dist/progress.d.ts +2 -1
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +78 -82
- package/dist/protocol.d.ts +3 -2
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +27 -32
- package/dist/repository.d.ts +3 -2
- package/dist/repository.d.ts.map +1 -0
- package/dist/repository.js +78 -82
- package/dist/reward.d.ts +2 -1
- package/dist/reward.d.ts.map +1 -0
- package/dist/reward.js +62 -66
- package/dist/service.d.ts +2 -1
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +233 -237
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +37 -62
- package/dist/vote.d.ts +2 -1
- package/dist/vote.d.ts.map +1 -0
- package/dist/vote.js +101 -105
- package/package.json +8 -3
- package/src/demand.ts +4 -4
- package/src/guard.ts +4 -28
- package/src/index.ts +12 -34
- package/src/machine.ts +4 -4
- package/src/passport.ts +4 -4
- package/src/permission.ts +3 -3
- package/src/progress.ts +3 -3
- package/src/protocol.ts +3 -3
- package/src/repository.ts +4 -4
- package/src/reward.ts +3 -3
- package/src/service.ts +3 -3
- package/src/utils.ts +0 -2
- package/src/vote.ts +3 -3
- package/tsconfig.json +3 -3
package/dist/demand.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TransactionResult } from '@mysten/sui.js/transactions';
|
|
2
|
-
import { Protocol, PassportObject, PermissionObject, GuardObject, DemandAddress, TxbObject } from './protocol';
|
|
3
|
-
import { Service } from './service';
|
|
2
|
+
import { Protocol, PassportObject, PermissionObject, GuardObject, DemandAddress, TxbObject } from './protocol.js';
|
|
3
|
+
import { Service } from './service.js';
|
|
4
4
|
export declare class Demand {
|
|
5
5
|
protected earnest_type: string;
|
|
6
6
|
protected permission: PermissionObject;
|
|
@@ -24,3 +24,4 @@ export declare class Demand {
|
|
|
24
24
|
static MAX_EARNEST_COUNT: number;
|
|
25
25
|
static MAX_PRESENTERS_COUNT: number;
|
|
26
26
|
}
|
|
27
|
+
//# sourceMappingURL=demand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demand.d.ts","sourceRoot":"","sources":["../src/demand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAc,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAG7H,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,qBAAa,MAAM;IACf,SAAS,CAAC,YAAY,SAAC;IACvB,SAAS,CAAC,UAAU,mBAAE;IACtB,SAAS,CAAC,MAAM,EAAG,SAAS,CAAE;IAC9B,SAAS,CAAC,QAAQ,WAAC;IAEnB,gBAAgB;IAChB,UAAU;IAEV,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAC,QAAQ,EAAE,YAAY,EAAC,MAAM,EAAE,UAAU,EAAC,gBAAgB,EAAE,MAAM,EAAC,SAAS,GAAI,MAAM;IAM3G,OAAO;IAMP,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAC,QAAQ,EAAE,YAAY,EAAC,MAAM,EAAE,UAAU,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,EAC9F,OAAO,EAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAC,cAAc,GAAI,MAAM;IA8BjE,MAAM,IAAK,aAAa;IASxB,OAAO;IAQP,MAAM,CAAC,QAAQ,CAAC,EAAC,cAAc;IAiB/B,WAAW,CAAC,gBAAgB,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IAuB9D,SAAS,CAAC,KAAK,CAAC,EAAC,WAAW,EAAE,QAAQ,CAAC,EAAC,cAAc;IAuCrD,eAAe,CAAC,WAAW,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IAuB5D,GAAG,CAAC,UAAU,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IAuB/C,OAAO,CAAC,OAAO,EAAC,SAAS;IAazB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc,GAAI,OAAO;IAuB1E,iBAAiB,CAAC,cAAc,EAAC,gBAAgB;IAcjD,MAAM,CAAC,iBAAiB,SAAO;IAC/B,MAAM,CAAC,oBAAoB,SAAO;CACrC"}
|
package/dist/demand.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const utils_1 = require("./utils");
|
|
7
|
-
const exception_1 = require("./exception");
|
|
8
|
-
class Demand {
|
|
1
|
+
import { BCS } from '@mysten/bcs';
|
|
2
|
+
import { Protocol } from './protocol.js';
|
|
3
|
+
import { IsValidDesription, IsValidUint, IsValidAddress, IsValidArgType, } from './utils.js';
|
|
4
|
+
import { Errors, ERROR } from './exception.js';
|
|
5
|
+
export class Demand {
|
|
9
6
|
earnest_type;
|
|
10
7
|
permission;
|
|
11
8
|
object;
|
|
@@ -14,7 +11,7 @@ class Demand {
|
|
|
14
11
|
get_object() { return this.object; }
|
|
15
12
|
static From(protocol, earnest_type, permission, object) {
|
|
16
13
|
let d = new Demand(protocol, earnest_type, permission);
|
|
17
|
-
d.object =
|
|
14
|
+
d.object = Protocol.TXB_OBJECT(protocol.CurrentSession(), object);
|
|
18
15
|
return d;
|
|
19
16
|
}
|
|
20
17
|
constructor(protocol, earnest_type, permission) {
|
|
@@ -25,27 +22,27 @@ class Demand {
|
|
|
25
22
|
}
|
|
26
23
|
static New(protocol, earnest_type, permission, description, earnest, passport) {
|
|
27
24
|
let d = new Demand(protocol, earnest_type, permission);
|
|
28
|
-
if (!
|
|
29
|
-
|
|
25
|
+
if (!Protocol.IsValidObjects([permission, earnest])) {
|
|
26
|
+
ERROR(Errors.IsValidObjects, 'permission, earnest');
|
|
30
27
|
}
|
|
31
|
-
if (!
|
|
32
|
-
|
|
28
|
+
if (!IsValidDesription(description)) {
|
|
29
|
+
ERROR(Errors.IsValidDesription);
|
|
33
30
|
}
|
|
34
|
-
if (!
|
|
35
|
-
|
|
31
|
+
if (!IsValidArgType(earnest_type)) {
|
|
32
|
+
ERROR(Errors.IsValidArgType, earnest_type);
|
|
36
33
|
}
|
|
37
34
|
let txb = protocol.CurrentSession();
|
|
38
35
|
if (passport) {
|
|
39
36
|
d.object = txb.moveCall({
|
|
40
37
|
target: protocol.DemandFn('new_with_passport'),
|
|
41
|
-
arguments: [passport, txb.pure(description), earnest,
|
|
38
|
+
arguments: [passport, txb.pure(description), earnest, Protocol.TXB_OBJECT(txb, permission)],
|
|
42
39
|
typeArguments: [earnest_type],
|
|
43
40
|
});
|
|
44
41
|
}
|
|
45
42
|
else {
|
|
46
43
|
d.object = txb.moveCall({
|
|
47
44
|
target: protocol.DemandFn('new'),
|
|
48
|
-
arguments: [txb.pure(description), earnest,
|
|
45
|
+
arguments: [txb.pure(description), earnest, Protocol.TXB_OBJECT(txb, permission)],
|
|
49
46
|
typeArguments: [earnest_type],
|
|
50
47
|
});
|
|
51
48
|
}
|
|
@@ -55,7 +52,7 @@ class Demand {
|
|
|
55
52
|
let txb = this.protocol.CurrentSession();
|
|
56
53
|
return txb.moveCall({
|
|
57
54
|
target: this.protocol.DemandFn('create'),
|
|
58
|
-
arguments: [
|
|
55
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object)],
|
|
59
56
|
typeArguments: [this.earnest_type],
|
|
60
57
|
});
|
|
61
58
|
}
|
|
@@ -63,7 +60,7 @@ class Demand {
|
|
|
63
60
|
let txb = this.protocol.CurrentSession();
|
|
64
61
|
txb.moveCall({
|
|
65
62
|
target: this.protocol.DemandFn('destroy'),
|
|
66
|
-
arguments: [
|
|
63
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object)],
|
|
67
64
|
typeArguments: [this.earnest_type]
|
|
68
65
|
});
|
|
69
66
|
}
|
|
@@ -72,58 +69,58 @@ class Demand {
|
|
|
72
69
|
if (passport) {
|
|
73
70
|
txb.moveCall({
|
|
74
71
|
target: this.protocol.DemandFn('refund_with_passport'),
|
|
75
|
-
arguments: [passport,
|
|
72
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), txb.object(Protocol.CLOCK_OBJECT), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
76
73
|
typeArguments: [this.earnest_type],
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
76
|
else {
|
|
80
77
|
txb.moveCall({
|
|
81
78
|
target: this.protocol.DemandFn('refund'),
|
|
82
|
-
arguments: [
|
|
79
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.object(Protocol.CLOCK_OBJECT), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
83
80
|
typeArguments: [this.earnest_type],
|
|
84
81
|
});
|
|
85
82
|
}
|
|
86
83
|
}
|
|
87
84
|
expand_time(minutes_duration, passport) {
|
|
88
|
-
if (!
|
|
89
|
-
|
|
85
|
+
if (!IsValidUint(minutes_duration)) {
|
|
86
|
+
ERROR(Errors.IsValidUint, 'minutes_duration');
|
|
90
87
|
}
|
|
91
88
|
let txb = this.protocol.CurrentSession();
|
|
92
89
|
if (passport) {
|
|
93
90
|
txb.moveCall({
|
|
94
91
|
target: this.protocol.DemandFn('time_expand_with_passport'),
|
|
95
|
-
arguments: [passport,
|
|
96
|
-
txb.object(
|
|
92
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), txb.pure(minutes_duration, BCS.U64),
|
|
93
|
+
txb.object(Protocol.CLOCK_OBJECT), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
97
94
|
typeArguments: [this.earnest_type],
|
|
98
95
|
});
|
|
99
96
|
}
|
|
100
97
|
else {
|
|
101
98
|
txb.moveCall({
|
|
102
99
|
target: this.protocol.DemandFn('time_expand'),
|
|
103
|
-
arguments: [
|
|
104
|
-
txb.object(
|
|
100
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.pure(minutes_duration, BCS.U64),
|
|
101
|
+
txb.object(Protocol.CLOCK_OBJECT), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
105
102
|
typeArguments: [this.earnest_type],
|
|
106
103
|
});
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
106
|
set_guard(guard, passport) {
|
|
110
|
-
if (guard && !
|
|
111
|
-
|
|
107
|
+
if (guard && !Protocol.IsValidObjects([guard])) {
|
|
108
|
+
ERROR(Errors.IsValidObjects, 'guard');
|
|
112
109
|
}
|
|
113
110
|
let txb = this.protocol.CurrentSession();
|
|
114
111
|
if (passport) {
|
|
115
112
|
if (guard) {
|
|
116
113
|
txb.moveCall({
|
|
117
114
|
target: this.protocol.DemandFn('guard_set_with_passport'),
|
|
118
|
-
arguments: [passport,
|
|
119
|
-
|
|
115
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, guard),
|
|
116
|
+
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
120
117
|
typeArguments: [this.earnest_type],
|
|
121
118
|
});
|
|
122
119
|
}
|
|
123
120
|
else {
|
|
124
121
|
txb.moveCall({
|
|
125
122
|
target: this.protocol.DemandFn('guard_none_with_passport'),
|
|
126
|
-
arguments: [passport,
|
|
123
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
127
124
|
typeArguments: [this.earnest_type],
|
|
128
125
|
});
|
|
129
126
|
}
|
|
@@ -132,106 +129,106 @@ class Demand {
|
|
|
132
129
|
if (guard) {
|
|
133
130
|
txb.moveCall({
|
|
134
131
|
target: this.protocol.DemandFn('guard_set'),
|
|
135
|
-
arguments: [
|
|
136
|
-
|
|
132
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, guard),
|
|
133
|
+
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
137
134
|
typeArguments: [this.earnest_type],
|
|
138
135
|
});
|
|
139
136
|
}
|
|
140
137
|
else {
|
|
141
138
|
txb.moveCall({
|
|
142
139
|
target: this.protocol.DemandFn('guard_none'),
|
|
143
|
-
arguments: [
|
|
140
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
144
141
|
typeArguments: [this.earnest_type],
|
|
145
142
|
});
|
|
146
143
|
}
|
|
147
144
|
}
|
|
148
145
|
}
|
|
149
146
|
set_description(description, passport) {
|
|
150
|
-
if (!
|
|
151
|
-
|
|
147
|
+
if (!IsValidDesription(description)) {
|
|
148
|
+
ERROR(Errors.IsValidDesription);
|
|
152
149
|
}
|
|
153
150
|
let txb = this.protocol.CurrentSession();
|
|
154
151
|
if (passport) {
|
|
155
152
|
txb.moveCall({
|
|
156
153
|
target: this.protocol.DemandFn('description_set_with_passport'),
|
|
157
|
-
arguments: [passport,
|
|
158
|
-
|
|
154
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), txb.pure(description),
|
|
155
|
+
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
159
156
|
typeArguments: [this.earnest_type],
|
|
160
157
|
});
|
|
161
158
|
}
|
|
162
159
|
else {
|
|
163
160
|
txb.moveCall({
|
|
164
161
|
target: this.protocol.DemandFn('description_set'),
|
|
165
|
-
arguments: [
|
|
162
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.pure(description), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
166
163
|
typeArguments: [this.earnest_type],
|
|
167
164
|
});
|
|
168
165
|
}
|
|
169
166
|
return true;
|
|
170
167
|
}
|
|
171
168
|
yes(service_id, passport) {
|
|
172
|
-
if (!
|
|
173
|
-
|
|
169
|
+
if (!IsValidAddress(service_id)) {
|
|
170
|
+
ERROR(Errors.IsValidAddress);
|
|
174
171
|
}
|
|
175
172
|
let txb = this.protocol.CurrentSession();
|
|
176
173
|
if (passport) {
|
|
177
174
|
txb.moveCall({
|
|
178
175
|
target: this.protocol.DemandFn('yes_with_passport'),
|
|
179
|
-
arguments: [passport,
|
|
180
|
-
|
|
176
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), txb.pure(service_id, BCS.ADDRESS),
|
|
177
|
+
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
181
178
|
typeArguments: [this.earnest_type],
|
|
182
179
|
});
|
|
183
180
|
}
|
|
184
181
|
else {
|
|
185
182
|
txb.moveCall({
|
|
186
183
|
target: this.protocol.DemandFn('yes'),
|
|
187
|
-
arguments: [
|
|
188
|
-
|
|
184
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.pure(service_id, BCS.ADDRESS),
|
|
185
|
+
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
189
186
|
typeArguments: [this.earnest_type],
|
|
190
187
|
});
|
|
191
188
|
}
|
|
192
189
|
}
|
|
193
190
|
deposit(earnest) {
|
|
194
|
-
if (!
|
|
195
|
-
|
|
191
|
+
if (!Protocol.IsValidObjects([earnest])) {
|
|
192
|
+
ERROR(Errors.IsValidObjects);
|
|
196
193
|
}
|
|
197
194
|
let txb = this.protocol.CurrentSession();
|
|
198
195
|
txb.moveCall({
|
|
199
196
|
target: this.protocol.DemandFn('deposit'),
|
|
200
|
-
arguments: [
|
|
197
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, earnest)],
|
|
201
198
|
typeArguments: [this.earnest_type],
|
|
202
199
|
});
|
|
203
200
|
}
|
|
204
201
|
present(service, tips, passport) {
|
|
205
|
-
if (!
|
|
206
|
-
|
|
202
|
+
if (!IsValidDesription(tips)) {
|
|
203
|
+
ERROR(Errors.IsValidDesription, 'tips');
|
|
207
204
|
}
|
|
208
205
|
let txb = this.protocol.CurrentSession();
|
|
209
206
|
if (passport) {
|
|
210
207
|
txb.moveCall({
|
|
211
208
|
target: this.protocol.DemandFn('present_with_passport'),
|
|
212
|
-
arguments: [passport,
|
|
213
|
-
txb.pure(tips,
|
|
209
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, service.get_object()),
|
|
210
|
+
txb.pure(tips, BCS.STRING),],
|
|
214
211
|
typeArguments: [this.earnest_type, service.get_pay_type()],
|
|
215
212
|
});
|
|
216
213
|
}
|
|
217
214
|
else {
|
|
218
215
|
txb.moveCall({
|
|
219
216
|
target: this.protocol.DemandFn('present'),
|
|
220
|
-
arguments: [
|
|
221
|
-
txb.pure(tips,
|
|
217
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, service.get_object()),
|
|
218
|
+
txb.pure(tips, BCS.STRING),],
|
|
222
219
|
typeArguments: [this.earnest_type, service.get_pay_type()],
|
|
223
220
|
});
|
|
224
221
|
}
|
|
225
222
|
return true;
|
|
226
223
|
}
|
|
227
224
|
change_permission(new_permission) {
|
|
228
|
-
if (!
|
|
229
|
-
|
|
225
|
+
if (!Protocol.IsValidObjects([new_permission])) {
|
|
226
|
+
ERROR(Errors.IsValidObjects);
|
|
230
227
|
}
|
|
231
228
|
let txb = this.protocol.CurrentSession();
|
|
232
229
|
txb.moveCall({
|
|
233
230
|
target: this.protocol.DemandFn('permission_set'),
|
|
234
|
-
arguments: [
|
|
231
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, this.permission), Protocol.TXB_OBJECT(txb, new_permission)],
|
|
235
232
|
typeArguments: [this.earnest_type]
|
|
236
233
|
});
|
|
237
234
|
return true;
|
|
@@ -239,4 +236,3 @@ class Demand {
|
|
|
239
236
|
static MAX_EARNEST_COUNT = 200;
|
|
240
237
|
static MAX_PRESENTERS_COUNT = 200;
|
|
241
238
|
}
|
|
242
|
-
exports.Demand = Demand;
|
package/dist/exception.d.ts
CHANGED
|
@@ -0,0 +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"}
|
package/dist/exception.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERROR = exports.Errors = void 0;
|
|
4
|
-
var Errors;
|
|
1
|
+
export var Errors;
|
|
5
2
|
(function (Errors) {
|
|
6
3
|
Errors["IsValidDesription"] = "invalid description";
|
|
7
4
|
Errors["IsValidName"] = "invalid name";
|
|
@@ -18,9 +15,8 @@ var Errors;
|
|
|
18
15
|
Errors["InvalidParam"] = "invalid parameter";
|
|
19
16
|
Errors["IsValidPermissionIndex"] = "invalid permission index";
|
|
20
17
|
Errors["IsValidKey"] = "invalid key";
|
|
21
|
-
})(Errors || (
|
|
22
|
-
const ERROR = (error, info) => {
|
|
18
|
+
})(Errors || (Errors = {}));
|
|
19
|
+
export const ERROR = (error, info) => {
|
|
23
20
|
const e = error + info ? (': ' + info) : '';
|
|
24
21
|
throw e;
|
|
25
22
|
};
|
|
26
|
-
exports.ERROR = ERROR;
|
package/dist/graphql.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare const GRAPHQL_OBJECTS_TYPE: import("graphql/language/ast").Docume
|
|
|
2
2
|
export declare const GRAPHQL_OBJECT: import("graphql/language/ast").DocumentNode;
|
|
3
3
|
export declare const GRAPHQL_OWNER: import("graphql/language/ast").DocumentNode;
|
|
4
4
|
export declare const GRAPHQL_OBJECTS: import("graphql/language/ast").DocumentNode;
|
|
5
|
+
//# sourceMappingURL=graphql.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/graphql.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.GRAPHQL_OBJECTS = exports.GRAPHQL_OWNER = exports.GRAPHQL_OBJECT = exports.GRAPHQL_OBJECTS_TYPE = void 0;
|
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
-
exports.GRAPHQL_OBJECTS_TYPE = (0, graphql_tag_1.gql)(`
|
|
1
|
+
import { gql } from "graphql-tag";
|
|
2
|
+
export const GRAPHQL_OBJECTS_TYPE = gql(`
|
|
6
3
|
query objects_type_version($filter:ObjectFilter!) {
|
|
7
4
|
objects(filter:$filter) {
|
|
8
5
|
nodes {
|
|
@@ -19,7 +16,7 @@ exports.GRAPHQL_OBJECTS_TYPE = (0, graphql_tag_1.gql)(`
|
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
`);
|
|
22
|
-
|
|
19
|
+
export const GRAPHQL_OBJECT = gql(`
|
|
23
20
|
query object($ObjectID:SuiAddress!) {
|
|
24
21
|
object(address:$ObjectID) {
|
|
25
22
|
address
|
|
@@ -55,7 +52,7 @@ exports.GRAPHQL_OBJECT = (0, graphql_tag_1.gql)(`
|
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
54
|
`);
|
|
58
|
-
|
|
55
|
+
export const GRAPHQL_OWNER = gql(`
|
|
59
56
|
query owner($ObjectID:SuiAddress!) {
|
|
60
57
|
owner (address: $ObjectID) {
|
|
61
58
|
address
|
|
@@ -83,7 +80,7 @@ exports.GRAPHQL_OWNER = (0, graphql_tag_1.gql)(`
|
|
|
83
80
|
}
|
|
84
81
|
}
|
|
85
82
|
`);
|
|
86
|
-
|
|
83
|
+
export const GRAPHQL_OBJECTS = gql(`
|
|
87
84
|
query objects($filter:ObjectFilter!){
|
|
88
85
|
objects(filter:$filter) {
|
|
89
86
|
nodes {
|
package/dist/guard.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Protocol, GuardAddress, Data_Type, MODULES, ContextType, ValueType, OperatorType } from './protocol';
|
|
1
|
+
import { Protocol, GuardAddress, Data_Type, MODULES, ContextType, ValueType, OperatorType } from './protocol.js';
|
|
2
2
|
export declare enum Guard_Sense_Binder {
|
|
3
3
|
AND = 0,
|
|
4
4
|
OR = 1
|
|
@@ -44,3 +44,4 @@ export declare class SenseMaker {
|
|
|
44
44
|
make(bNotAfterSense?: boolean, binder?: Guard_Sense_Binder): boolean | Guard_Sense;
|
|
45
45
|
static match_u128(type: number): boolean;
|
|
46
46
|
}
|
|
47
|
+
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../src/guard.ts"],"names":[],"mappings":"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"}
|