@taquito/tzip16 11.1.0 → 12.0.0-beta-RC.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.
Files changed (36) hide show
  1. package/README.md +31 -18
  2. package/dist/lib/composer.js +5 -4
  3. package/dist/lib/composer.js.map +1 -1
  4. package/dist/lib/handlers/http-handler.js +14 -43
  5. package/dist/lib/handlers/http-handler.js.map +1 -1
  6. package/dist/lib/handlers/ipfs-handler.js +14 -44
  7. package/dist/lib/handlers/ipfs-handler.js.map +1 -1
  8. package/dist/lib/handlers/tezos-storage-handler.js +31 -70
  9. package/dist/lib/handlers/tezos-storage-handler.js.map +1 -1
  10. package/dist/lib/metadata-provider.js +36 -71
  11. package/dist/lib/metadata-provider.js.map +1 -1
  12. package/dist/lib/tzip16-contract-abstraction.js +72 -155
  13. package/dist/lib/tzip16-contract-abstraction.js.map +1 -1
  14. package/dist/lib/tzip16-errors.js +44 -55
  15. package/dist/lib/tzip16-errors.js.map +1 -1
  16. package/dist/lib/tzip16-extension.js +9 -10
  17. package/dist/lib/tzip16-extension.js.map +1 -1
  18. package/dist/lib/tzip16-utils.js +1 -1
  19. package/dist/lib/tzip16-utils.js.map +1 -1
  20. package/dist/lib/version.js +2 -4
  21. package/dist/lib/version.js.map +1 -1
  22. package/dist/lib/viewKind/michelson-storage-view.js +98 -196
  23. package/dist/lib/viewKind/michelson-storage-view.js.map +1 -1
  24. package/dist/lib/viewKind/viewFactory.js +16 -19
  25. package/dist/lib/viewKind/viewFactory.js.map +1 -1
  26. package/dist/taquito-tzip16.es6.js +569 -0
  27. package/dist/taquito-tzip16.es6.js.map +1 -0
  28. package/dist/taquito-tzip16.umd.js +326 -522
  29. package/dist/taquito-tzip16.umd.js.map +1 -1
  30. package/dist/types/composer.d.ts +1 -1
  31. package/dist/types/tzip16-errors.d.ts +15 -22
  32. package/dist/types/viewKind/michelson-storage-view.d.ts +3 -1
  33. package/dist/types/viewKind/viewFactory.d.ts +2 -2
  34. package/package.json +27 -27
  35. package/dist/taquito-tzip16.es5.js +0 -761
  36. package/dist/taquito-tzip16.es5.js.map +0 -1
@@ -8,79 +8,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __values = (this && this.__values) || function(o) {
39
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
40
- if (m) return m.call(o);
41
- if (o && typeof o.length === "number") return {
42
- next: function () {
43
- if (o && i >= o.length) o = void 0;
44
- return { value: o && o[i++], done: !o };
45
- }
46
- };
47
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
48
- };
49
- var __read = (this && this.__read) || function (o, n) {
50
- var m = typeof Symbol === "function" && o[Symbol.iterator];
51
- if (!m) return o;
52
- var i = m.call(o), r, ar = [], e;
53
- try {
54
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
- }
56
- catch (error) { e = { error: error }; }
57
- finally {
58
- try {
59
- if (r && !r.done && (m = i["return"])) m.call(i);
60
- }
61
- finally { if (e) throw e.error; }
62
- }
63
- return ar;
64
- };
65
- var __spread = (this && this.__spread) || function () {
66
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
67
- return ar;
68
- };
69
11
  Object.defineProperty(exports, "__esModule", { value: true });
70
12
  exports.MichelsonStorageView = void 0;
71
- var michelson_encoder_1 = require("@taquito/michelson-encoder");
72
- var tzip16_errors_1 = require("../tzip16-errors");
73
- var MichelsonStorageView = /** @class */ (function () {
74
- function MichelsonStorageView(viewName, contract, rpc, returnType, code, viewParameterType) {
13
+ const michelson_encoder_1 = require("@taquito/michelson-encoder");
14
+ const taquito_1 = require("@taquito/taquito");
15
+ const tzip16_errors_1 = require("../tzip16-errors");
16
+ const taquito_2 = require("@taquito/taquito");
17
+ class MichelsonStorageView {
18
+ constructor(viewName, contract, rpc, readProvider, returnType, code, viewParameterType) {
75
19
  this.viewName = viewName;
76
20
  this.contract = contract;
77
21
  this.rpc = rpc;
22
+ this.readProvider = readProvider;
78
23
  this.returnType = returnType;
79
24
  this.code = code;
80
25
  this.viewParameterType = viewParameterType;
81
- this.validateArgs = function (args, schema, viewName) {
82
- var sigs = schema.ExtractSignatures();
83
- if (!sigs.find(function (x) { return x.length === args.length; })) {
26
+ this.validateArgs = (args, schema, viewName) => {
27
+ const sigs = schema.ExtractSignatures();
28
+ if (!sigs.find((x) => x.length === args.length)) {
84
29
  throw new tzip16_errors_1.InvalidViewParameterError(viewName, sigs, args);
85
30
  }
86
31
  };
@@ -90,106 +35,73 @@ var MichelsonStorageView = /** @class */ (function () {
90
35
  * 'AMOUNT', 'CREATE_CONTRACT', 'SENDER', 'SET_DELEGATE', 'SOURCE', and 'TRANSFER_TOKENS'
91
36
  * The method throw an error if an illegal instruction is found
92
37
  */
93
- MichelsonStorageView.prototype.findForbiddenInstructionInViewCode = function (code) {
94
- var e_1, _a, e_2, _b;
95
- var illegalInstructions = [
38
+ findForbiddenInstructionInViewCode(code) {
39
+ const illegalInstructions = [
96
40
  'AMOUNT',
97
41
  'CREATE_CONTRACT',
98
42
  'SENDER',
99
43
  'SET_DELEGATE',
100
44
  'SOURCE',
101
- 'TRANSFER_TOKENS'
45
+ 'TRANSFER_TOKENS',
102
46
  ];
103
- try {
104
- for (var illegalInstructions_1 = __values(illegalInstructions), illegalInstructions_1_1 = illegalInstructions_1.next(); !illegalInstructions_1_1.done; illegalInstructions_1_1 = illegalInstructions_1.next()) {
105
- var forbiddenInstruction = illegalInstructions_1_1.value;
106
- try {
107
- for (var code_1 = (e_2 = void 0, __values(code)), code_1_1 = code_1.next(); !code_1_1.done; code_1_1 = code_1.next()) {
108
- var instruction = code_1_1.value;
109
- if (instruction.prim === forbiddenInstruction) {
110
- throw new tzip16_errors_1.ForbiddenInstructionInViewCode(forbiddenInstruction);
111
- }
112
- if (instruction.args && instruction.args.length !== 0) {
113
- this.findForbiddenInstructionInViewCode(instruction.args);
114
- }
115
- }
47
+ for (const forbiddenInstruction of illegalInstructions) {
48
+ for (const instruction of code) {
49
+ if (instruction.prim === forbiddenInstruction) {
50
+ throw new tzip16_errors_1.ForbiddenInstructionInViewCode(forbiddenInstruction);
116
51
  }
117
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
118
- finally {
119
- try {
120
- if (code_1_1 && !code_1_1.done && (_b = code_1.return)) _b.call(code_1);
121
- }
122
- finally { if (e_2) throw e_2.error; }
52
+ if (instruction.args && instruction.args.length !== 0) {
53
+ this.findForbiddenInstructionInViewCode(instruction.args);
123
54
  }
124
55
  }
125
56
  }
126
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
127
- finally {
128
- try {
129
- if (illegalInstructions_1_1 && !illegalInstructions_1_1.done && (_a = illegalInstructions_1.return)) _a.call(illegalInstructions_1);
130
- }
131
- finally { if (e_1) throw e_1.error; }
132
- }
133
- };
57
+ }
134
58
  /**
135
59
  * @description According to the tzip-16 standard, in the first version of the specification, the instruction SELF should only be used before ADDRESS
136
60
  * The method throws an error is the instruction SELF is present, but not followed by ADDRESS
137
61
  */
138
- MichelsonStorageView.prototype.illegalUseOfSelfInstruction = function (code) {
139
- var e_3, _a;
140
- try {
141
- for (var code_2 = __values(code), code_2_1 = code_2.next(); !code_2_1.done; code_2_1 = code_2.next()) {
142
- var instruction = code_2_1.value;
143
- if (instruction.prim === 'SELF') {
144
- var index = code.indexOf(instruction);
145
- var nextInstruction = code[index + 1] ? code[index + 1].prim : undefined;
146
- if (nextInstruction !== 'ADDRESS') {
147
- throw new tzip16_errors_1.ForbiddenInstructionInViewCode('the instruction SELF should only be used before ADDRESS');
148
- }
149
- }
150
- if (instruction.args && instruction.args.length !== 0) {
151
- this.illegalUseOfSelfInstruction(instruction.args);
62
+ illegalUseOfSelfInstruction(code) {
63
+ for (const instruction of code) {
64
+ if (instruction.prim === 'SELF') {
65
+ const index = code.indexOf(instruction);
66
+ const nextInstruction = code[index + 1] ? code[index + 1].prim : undefined;
67
+ if (nextInstruction !== 'ADDRESS') {
68
+ throw new tzip16_errors_1.ForbiddenInstructionInViewCode('the instruction SELF should only be used before ADDRESS');
152
69
  }
153
70
  }
154
- }
155
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
156
- finally {
157
- try {
158
- if (code_2_1 && !code_2_1.done && (_a = code_2.return)) _a.call(code_2);
71
+ if (instruction.args && instruction.args.length !== 0) {
72
+ this.illegalUseOfSelfInstruction(instruction.args);
159
73
  }
160
- finally { if (e_3) throw e_3.error; }
161
74
  }
162
- };
75
+ }
163
76
  /**
164
77
  * @description Loops through the view's code and replace SELF, BALANCE, NOW, and CHAIN_ID with Michelson expressions that match the current context, if applicable.
165
78
  */
166
- MichelsonStorageView.prototype.adaptViewCodeToContext = function (code, contractBalance, blockTimeStamp, chainId) {
167
- var _this = this;
168
- var instructionsToReplace = {
79
+ adaptViewCodeToContext(code, contractBalance, blockTimeStamp, chainId) {
80
+ const instructionsToReplace = {
169
81
  SELF: [
170
82
  { prim: 'PUSH', args: [{ prim: 'address' }, { string: this.contract.address }] },
171
83
  { prim: 'CONTRACT', args: [{ prim: 'unit' }] },
172
- { prim: 'IF_NONE', args: [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }], []] }
84
+ { prim: 'IF_NONE', args: [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }], []] },
173
85
  ],
174
86
  BALANCE: [{ prim: 'PUSH', args: [{ prim: 'mutez' }, { int: contractBalance }] }],
175
87
  NOW: [{ prim: 'PUSH', args: [{ prim: 'timestamp' }, { string: blockTimeStamp }] }],
176
- CHAIN_ID: [{ prim: 'PUSH', args: [{ prim: 'string' }, { string: chainId }] }]
88
+ CHAIN_ID: [{ prim: 'PUSH', args: [{ prim: 'string' }, { string: chainId }] }],
177
89
  };
178
- code.forEach(function (x, i) {
179
- for (var instruction in instructionsToReplace) {
90
+ code.forEach((x, i) => {
91
+ for (const instruction in instructionsToReplace) {
180
92
  if (x.prim === instruction) {
181
93
  code[i] = Object(instructionsToReplace)[instruction];
182
94
  }
183
95
  if (x.args && x.args.length !== 0) {
184
- _this.adaptViewCodeToContext(x.args, contractBalance, blockTimeStamp, chainId);
96
+ this.adaptViewCodeToContext(x.args, contractBalance, blockTimeStamp, chainId);
185
97
  }
186
98
  }
187
99
  });
188
100
  return code;
189
- };
190
- MichelsonStorageView.prototype.formatArgsAndParameter = function (argView) {
191
- var args = argView;
192
- var viewParameterType = this.viewParameterType;
101
+ }
102
+ formatArgsAndParameter(argView) {
103
+ let args = argView;
104
+ let viewParameterType = this.viewParameterType;
193
105
  if (!viewParameterType) {
194
106
  viewParameterType = { args: [], prim: 'unit', annots: [] };
195
107
  }
@@ -201,75 +113,65 @@ var MichelsonStorageView = /** @class */ (function () {
201
113
  throw new tzip16_errors_1.NoParameterExpectedError(this.viewName, argView);
202
114
  }
203
115
  }
204
- var parameterViewSchema = new michelson_encoder_1.ParameterSchema(viewParameterType);
116
+ const parameterViewSchema = new michelson_encoder_1.ParameterSchema(viewParameterType);
205
117
  this.validateArgs(args, parameterViewSchema, this.viewName);
206
- var arg = parameterViewSchema.Encode.apply(parameterViewSchema, __spread(args));
207
- return { arg: arg, viewParameterType: viewParameterType };
208
- };
209
- MichelsonStorageView.prototype.executeView = function () {
210
- var args = [];
211
- for (var _i = 0; _i < arguments.length; _i++) {
212
- args[_i] = arguments[_i];
213
- }
214
- return __awaiter(this, void 0, void 0, function () {
215
- var _a, arg, viewParameterType, storageType, storageArgs, storageValue, chainId, contractBalance, block, blockTimestamp, code, viewScript, result, viewResultSchema;
216
- return __generator(this, function (_b) {
217
- switch (_b.label) {
218
- case 0:
219
- // validate view code against tzip-16 specifications
220
- this.findForbiddenInstructionInViewCode(this.code);
221
- this.illegalUseOfSelfInstruction(this.code);
222
- _a = this.formatArgsAndParameter(args), arg = _a.arg, viewParameterType = _a.viewParameterType;
223
- storageType = this.contract.script.code.find(function (x) { return x.prim === 'storage'; });
224
- storageArgs = storageType.args[0];
225
- storageValue = this.contract.script.storage;
226
- return [4 /*yield*/, this.rpc.getChainId()];
227
- case 1:
228
- chainId = _b.sent();
229
- return [4 /*yield*/, this.rpc.getBalance(this.contract.address)];
230
- case 2:
231
- contractBalance = (_b.sent()).toString();
232
- return [4 /*yield*/, this.rpc.getBlock()];
233
- case 3:
234
- block = _b.sent();
235
- blockTimestamp = block.header.timestamp.toString();
236
- code = this.adaptViewCodeToContext(this.code, contractBalance, blockTimestamp, chainId);
237
- if (!this.viewParameterType) {
238
- code.unshift({ prim: 'CDR' });
239
- }
240
- viewScript = {
241
- script: [
242
- { prim: 'parameter', args: [{ prim: 'pair', args: [viewParameterType, storageArgs] }] },
243
- { prim: 'storage', args: [{ prim: 'option', args: [this.returnType] }] },
244
- {
245
- prim: 'code',
246
- args: [
247
- [
248
- { prim: 'CAR' },
249
- code,
250
- { prim: 'SOME' },
251
- { prim: 'NIL', args: [{ prim: 'operation' }] },
252
- { prim: 'PAIR' }
253
- ]
254
- ]
255
- }
118
+ const arg = parameterViewSchema.Encode(...args);
119
+ return { arg, viewParameterType };
120
+ }
121
+ executeView(...args) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ // validate view code against tzip-16 specifications
124
+ this.findForbiddenInstructionInViewCode(this.code);
125
+ this.illegalUseOfSelfInstruction(this.code);
126
+ const { arg, viewParameterType } = this.formatArgsAndParameter(args);
127
+ const storageType = this.contract.script.code.find((x) => x.prim === 'storage');
128
+ const storageArgs = storageType.args[0];
129
+ // currentContext
130
+ const storageValue = yield this.readProvider.getStorage(this.contract.address, 'head');
131
+ const chainId = yield this.readProvider.getChainId();
132
+ const contractBalance = (yield this.readProvider.getBalance(this.contract.address, 'head')).toString();
133
+ const blockTimestamp = yield this.readProvider.getBlockTimestamp('head');
134
+ const code = this.adaptViewCodeToContext(this.code, contractBalance, blockTimestamp, chainId);
135
+ if (!this.viewParameterType) {
136
+ code.unshift({ prim: 'CDR' });
137
+ }
138
+ const viewScript = {
139
+ script: [
140
+ { prim: 'parameter', args: [{ prim: 'pair', args: [viewParameterType, storageArgs] }] },
141
+ { prim: 'storage', args: [{ prim: 'option', args: [this.returnType] }] },
142
+ {
143
+ prim: 'code',
144
+ args: [
145
+ [
146
+ { prim: 'CAR' },
147
+ code,
148
+ { prim: 'SOME' },
149
+ { prim: 'NIL', args: [{ prim: 'operation' }] },
150
+ { prim: 'PAIR' },
256
151
  ],
257
- storage: { prim: 'None' },
258
- input: { prim: 'Pair', args: [arg, storageValue] },
259
- amount: '0',
260
- chain_id: chainId,
261
- balance: '0'
262
- };
263
- return [4 /*yield*/, this.rpc.runCode(viewScript)];
264
- case 4:
265
- result = _b.sent();
266
- viewResultSchema = new michelson_encoder_1.ParameterSchema(this.returnType);
267
- return [2 /*return*/, viewResultSchema.Execute(result.storage.args[0])];
268
- }
269
- });
152
+ ],
153
+ },
154
+ ],
155
+ storage: { prim: 'None' },
156
+ input: { prim: 'Pair', args: [arg, storageValue] },
157
+ amount: '0',
158
+ chain_id: chainId,
159
+ balance: '0',
160
+ };
161
+ let result;
162
+ try {
163
+ result = yield this.rpc.runCode(viewScript);
164
+ }
165
+ catch (error) {
166
+ const failWith = taquito_2.validateAndExtractFailwith(error);
167
+ throw failWith
168
+ ? new taquito_1.ViewSimulationError(`The simulation of the Michelson view failed with: ${JSON.stringify(failWith)}`, this.viewName, failWith, error)
169
+ : error;
170
+ }
171
+ const viewResultSchema = new michelson_encoder_1.ParameterSchema(this.returnType);
172
+ return viewResultSchema.Execute(result.storage.args[0]);
270
173
  });
271
- };
272
- return MichelsonStorageView;
273
- }());
174
+ }
175
+ }
274
176
  exports.MichelsonStorageView = MichelsonStorageView;
275
177
  //# sourceMappingURL=michelson-storage-view.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"michelson-storage-view.js","sourceRoot":"","sources":["../../../src/viewKind/michelson-storage-view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAA6D;AAG7D,kDAAuH;AAGvH;IACI,8BACY,QAAgB,EAChB,QAAwD,EACxD,GAAuB,EACvB,UAAiC,EACjC,IAAqC,EACrC,iBAAiD;QALjD,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAgD;QACxD,QAAG,GAAH,GAAG,CAAoB;QACvB,eA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,CAAC,CAAC,IAAI,6BAAmB,CACrB,qDAAqD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAC/E,IAAI,CAAC,QAAQ,EACb,QAAQ,EACR,KAAK,CACN;oBACH,CAAC,CAAC,KAAK,CAAC;aACX;YAED,MAAM,gBAAgB,GAAG,IAAI,mCAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC9D,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC;KAAA;CACF;AA3LD,oDA2LC"}
@@ -1,31 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ViewFactory = void 0;
4
- var metadata_interface_1 = require("../metadata-interface");
5
- var michelson_storage_view_1 = require("./michelson-storage-view");
6
- var ViewFactory = /** @class */ (function () {
7
- function ViewFactory() {
8
- }
9
- ViewFactory.prototype.getView = function (viewName, rpc, contract, viewImplementation) {
4
+ const metadata_interface_1 = require("../metadata-interface");
5
+ const michelson_storage_view_1 = require("./michelson-storage-view");
6
+ class ViewFactory {
7
+ getView(viewName, rpc, readProvider, contract, viewImplementation) {
10
8
  if (this.isMichelsonStorageView(viewImplementation)) {
11
- var viewValues_1 = viewImplementation[metadata_interface_1.ViewImplementationType.MICHELSON_STORAGE];
12
- if (!viewValues_1.returnType || !viewValues_1.code) {
13
- console.warn(viewName + " is missing mandatory code or returnType property therefore it will be skipped.");
9
+ const viewValues = viewImplementation[metadata_interface_1.ViewImplementationType.MICHELSON_STORAGE];
10
+ if (!viewValues.returnType || !viewValues.code) {
11
+ console.warn(`${viewName} is missing mandatory code or returnType property therefore it will be skipped.`);
14
12
  return;
15
13
  }
16
- return function () {
17
- var view = new michelson_storage_view_1.MichelsonStorageView(viewName, contract, rpc, viewValues_1.returnType, viewValues_1.code, viewValues_1.parameter);
14
+ return () => {
15
+ const view = new michelson_storage_view_1.MichelsonStorageView(viewName, contract, rpc, readProvider, viewValues.returnType, viewValues.code, viewValues.parameter);
18
16
  return view;
19
17
  };
20
18
  }
21
- };
22
- ViewFactory.prototype.getImplementationType = function (viewImplementation) {
19
+ }
20
+ getImplementationType(viewImplementation) {
23
21
  return Object.keys(viewImplementation)[0];
24
- };
25
- ViewFactory.prototype.isMichelsonStorageView = function (viewImplementation) {
26
- return this.getImplementationType(viewImplementation) === metadata_interface_1.ViewImplementationType.MICHELSON_STORAGE;
27
- };
28
- return ViewFactory;
29
- }());
22
+ }
23
+ isMichelsonStorageView(viewImplementation) {
24
+ return (this.getImplementationType(viewImplementation) === metadata_interface_1.ViewImplementationType.MICHELSON_STORAGE);
25
+ }
26
+ }
30
27
  exports.ViewFactory = ViewFactory;
31
28
  //# sourceMappingURL=viewFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"viewFactory.js","sourceRoot":"","sources":["../../../src/viewKind/viewFactory.ts"],"names":[],"mappings":";;;AAEA,4DAAmF;AACnF,mEAAgE;AAEhE;IAAA;IAsCA,CAAC;IArCG,6BAAO,GAAP,UACI,QAAgB,EAChB,GAAuB,EACvB,QAAwD,EACxD,kBAAsC;QAEtC,IAAI,IAAI,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,EAAE;YACjD,IAAM,YAAU,GAAG,kBAAkB,CAAC,2CAAsB,CAAC,iBAAiB,CAAC,CAAC;YAChF,IAAI,CAAC,YAAU,CAAC,UAAU,IAAI,CAAC,YAAU,CAAC,IAAI,EAAE;gBAC5C,OAAO,CAAC,IAAI,CACL,QAAQ,oFAAiF,CAC/F,CAAC;gBACF,OAAO;aACV;YACD,OAAO;gBACH,IAAM,IAAI,GAAG,IAAI,6CAAoB,CACjC,QAAQ,EACR,QAAQ,EACR,GAAG,EACH,YAAU,CAAC,UAAiB,EAC5B,YAAU,CAAC,IAAW,EACtB,YAAU,CAAC,SAAgB,CAC9B,CAAC;gBACF,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC;SACL;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