wowok 1.0.10 → 1.1.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/demand.d.ts +4 -3
- package/dist/demand.d.ts.map +1 -0
- package/dist/demand.js +56 -62
- 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 +1 -0
- 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 +1 -0
- package/dist/machine.d.ts.map +1 -0
- package/dist/machine.js +69 -72
- package/dist/passport.d.ts +1 -0
- package/dist/passport.d.ts.map +1 -0
- package/dist/passport.js +81 -86
- package/dist/permission.d.ts +1 -0
- package/dist/permission.d.ts.map +1 -0
- package/dist/permission.js +50 -54
- package/dist/progress.d.ts +1 -0
- 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 +30 -35
- package/dist/repository.d.ts +1 -0
- package/dist/repository.d.ts.map +1 -0
- package/dist/repository.js +79 -82
- package/dist/reward.d.ts +1 -0
- package/dist/reward.d.ts.map +1 -0
- package/dist/reward.js +63 -66
- package/dist/service.d.ts +1 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +235 -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 +1 -0
- package/dist/vote.d.ts.map +1 -0
- package/dist/vote.js +102 -105
- package/package.json +4 -4
- package/src/demand.ts +20 -14
- package/src/guard.ts +0 -24
- package/src/index.ts +12 -34
- package/src/machine.ts +2 -1
- package/src/passport.ts +38 -23
- package/src/protocol.ts +18 -14
- package/src/repository.ts +2 -1
- package/src/reward.ts +1 -0
- package/src/service.ts +92 -90
- package/src/utils.ts +0 -2
- package/src/vote.ts +1 -0
- package/tsconfig.json +3 -3
package/dist/demand.d.ts
CHANGED
|
@@ -16,11 +16,12 @@ export declare class Demand {
|
|
|
16
16
|
refund(passport?: PassportObject): void;
|
|
17
17
|
expand_time(minutes_duration: number, passport?: PassportObject): void;
|
|
18
18
|
set_guard(guard?: GuardObject, passport?: PassportObject): void;
|
|
19
|
-
set_description(description: string, passport?: PassportObject):
|
|
19
|
+
set_description(description: string, passport?: PassportObject): void;
|
|
20
20
|
yes(service_id: string, passport?: PassportObject): void;
|
|
21
21
|
deposit(earnest: TxbObject): void;
|
|
22
|
-
present(service: Service, tips: string, passport?: PassportObject):
|
|
23
|
-
change_permission(new_permission: PermissionObject):
|
|
22
|
+
present(service: Service, tips: string, passport?: PassportObject): void;
|
|
23
|
+
change_permission(new_permission: PermissionObject): void;
|
|
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,YAAY,CAAC;AAG1H,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,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;IAsB5D,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;IAsB/D,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';
|
|
3
|
+
import { IsValidDesription, IsValidUint, IsValidAddress, IsValidArgType, } from './utils';
|
|
4
|
+
import { Errors, ERROR } from './exception';
|
|
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,111 +129,108 @@ 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
|
-
return true;
|
|
170
166
|
}
|
|
171
167
|
yes(service_id, passport) {
|
|
172
|
-
if (!
|
|
173
|
-
|
|
168
|
+
if (!IsValidAddress(service_id)) {
|
|
169
|
+
ERROR(Errors.IsValidAddress);
|
|
174
170
|
}
|
|
175
171
|
let txb = this.protocol.CurrentSession();
|
|
176
172
|
if (passport) {
|
|
177
173
|
txb.moveCall({
|
|
178
174
|
target: this.protocol.DemandFn('yes_with_passport'),
|
|
179
|
-
arguments: [passport,
|
|
180
|
-
|
|
175
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), txb.pure(service_id, BCS.ADDRESS),
|
|
176
|
+
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
181
177
|
typeArguments: [this.earnest_type],
|
|
182
178
|
});
|
|
183
179
|
}
|
|
184
180
|
else {
|
|
185
181
|
txb.moveCall({
|
|
186
182
|
target: this.protocol.DemandFn('yes'),
|
|
187
|
-
arguments: [
|
|
188
|
-
|
|
183
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.pure(service_id, BCS.ADDRESS),
|
|
184
|
+
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
189
185
|
typeArguments: [this.earnest_type],
|
|
190
186
|
});
|
|
191
187
|
}
|
|
192
188
|
}
|
|
193
189
|
deposit(earnest) {
|
|
194
|
-
if (!
|
|
195
|
-
|
|
190
|
+
if (!Protocol.IsValidObjects([earnest])) {
|
|
191
|
+
ERROR(Errors.IsValidObjects);
|
|
196
192
|
}
|
|
197
193
|
let txb = this.protocol.CurrentSession();
|
|
198
194
|
txb.moveCall({
|
|
199
195
|
target: this.protocol.DemandFn('deposit'),
|
|
200
|
-
arguments: [
|
|
196
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, earnest)],
|
|
201
197
|
typeArguments: [this.earnest_type],
|
|
202
198
|
});
|
|
203
199
|
}
|
|
204
200
|
present(service, tips, passport) {
|
|
205
|
-
if (!
|
|
206
|
-
|
|
201
|
+
if (!IsValidDesription(tips)) {
|
|
202
|
+
ERROR(Errors.IsValidDesription, 'tips');
|
|
207
203
|
}
|
|
208
204
|
let txb = this.protocol.CurrentSession();
|
|
209
205
|
if (passport) {
|
|
210
206
|
txb.moveCall({
|
|
211
207
|
target: this.protocol.DemandFn('present_with_passport'),
|
|
212
|
-
arguments: [passport,
|
|
213
|
-
txb.pure(tips,
|
|
208
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, service.get_object()),
|
|
209
|
+
txb.pure(tips, BCS.STRING),],
|
|
214
210
|
typeArguments: [this.earnest_type, service.get_pay_type()],
|
|
215
211
|
});
|
|
216
212
|
}
|
|
217
213
|
else {
|
|
218
214
|
txb.moveCall({
|
|
219
215
|
target: this.protocol.DemandFn('present'),
|
|
220
|
-
arguments: [
|
|
221
|
-
txb.pure(tips,
|
|
216
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, service.get_object()),
|
|
217
|
+
txb.pure(tips, BCS.STRING),],
|
|
222
218
|
typeArguments: [this.earnest_type, service.get_pay_type()],
|
|
223
219
|
});
|
|
224
220
|
}
|
|
225
|
-
return true;
|
|
226
221
|
}
|
|
227
222
|
change_permission(new_permission) {
|
|
228
|
-
if (!
|
|
229
|
-
|
|
223
|
+
if (!Protocol.IsValidObjects([new_permission])) {
|
|
224
|
+
ERROR(Errors.IsValidObjects);
|
|
230
225
|
}
|
|
231
226
|
let txb = this.protocol.CurrentSession();
|
|
232
227
|
txb.moveCall({
|
|
233
228
|
target: this.protocol.DemandFn('permission_set'),
|
|
234
|
-
arguments: [
|
|
229
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, this.permission), Protocol.TXB_OBJECT(txb, new_permission)],
|
|
235
230
|
typeArguments: [this.earnest_type]
|
|
236
231
|
});
|
|
237
|
-
|
|
232
|
+
this.permission = new_permission;
|
|
238
233
|
}
|
|
239
234
|
static MAX_EARNEST_COUNT = 200;
|
|
240
235
|
static MAX_PRESENTERS_COUNT = 200;
|
|
241
236
|
}
|
|
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
|
@@ -0,0 +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,oBAAY,kBAAkB;IAC1B,GAAG,IAA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