@opcat-labs/scrypt-ts-transpiler-opcat 1.0.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/compile/compilerWrapper.d.ts +203 -0
- package/dist/compile/compilerWrapper.d.ts.map +1 -0
- package/dist/compile/compilerWrapper.js +1019 -0
- package/dist/compile/compilerWrapper.js.map +1 -0
- package/dist/compile/findCompiler.d.ts +3 -0
- package/dist/compile/findCompiler.d.ts.map +1 -0
- package/dist/compile/findCompiler.js +102 -0
- package/dist/compile/findCompiler.js.map +1 -0
- package/dist/compile/getBinary.d.ts +3 -0
- package/dist/compile/getBinary.d.ts.map +1 -0
- package/dist/compile/getBinary.js +94 -0
- package/dist/compile/getBinary.js.map +1 -0
- package/dist/debug.d.ts +25 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +110 -0
- package/dist/debug.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +110 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer.d.ts +52 -0
- package/dist/indexer.d.ts.map +1 -0
- package/dist/indexer.js +189 -0
- package/dist/indexer.js.map +1 -0
- package/dist/relinker.d.ts +44 -0
- package/dist/relinker.d.ts.map +1 -0
- package/dist/relinker.js +321 -0
- package/dist/relinker.js.map +1 -0
- package/dist/resolver.d.ts +3 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +280 -0
- package/dist/resolver.js.map +1 -0
- package/dist/scryptParser.d.ts +31 -0
- package/dist/scryptParser.d.ts.map +1 -0
- package/dist/scryptParser.js +372 -0
- package/dist/scryptParser.js.map +1 -0
- package/dist/snippets.d.ts +39 -0
- package/dist/snippets.d.ts.map +1 -0
- package/dist/snippets.js +54 -0
- package/dist/snippets.js.map +1 -0
- package/dist/transpiler.d.ts +314 -0
- package/dist/transpiler.d.ts.map +1 -0
- package/dist/transpiler.js +4239 -0
- package/dist/transpiler.js.map +1 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +31 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +23 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +352 -0
- package/dist/utils.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ScryptFileParser = exports.buildinSymbols = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
exports.buildinSymbols = [
|
|
10
|
+
// basic types
|
|
11
|
+
'bytes',
|
|
12
|
+
'int',
|
|
13
|
+
'bool',
|
|
14
|
+
// struct
|
|
15
|
+
'struct',
|
|
16
|
+
'Tx',
|
|
17
|
+
'SigHash',
|
|
18
|
+
// type infer
|
|
19
|
+
'auto',
|
|
20
|
+
// domain subtypes
|
|
21
|
+
'PubKey',
|
|
22
|
+
'Sig',
|
|
23
|
+
'Ripemd160',
|
|
24
|
+
'Sha1',
|
|
25
|
+
'Sha256',
|
|
26
|
+
'SigHashType',
|
|
27
|
+
'SigHashPreimage',
|
|
28
|
+
'OpCodeType',
|
|
29
|
+
'OpCode',
|
|
30
|
+
// subtype of int
|
|
31
|
+
'PrivKey',
|
|
32
|
+
'const',
|
|
33
|
+
'if',
|
|
34
|
+
'else',
|
|
35
|
+
'loop',
|
|
36
|
+
'exit',
|
|
37
|
+
'require',
|
|
38
|
+
'return',
|
|
39
|
+
// Code Separator
|
|
40
|
+
// keyword
|
|
41
|
+
'static',
|
|
42
|
+
'public',
|
|
43
|
+
'private',
|
|
44
|
+
'library',
|
|
45
|
+
'contract',
|
|
46
|
+
'function',
|
|
47
|
+
'constructor',
|
|
48
|
+
// decorator
|
|
49
|
+
'prop',
|
|
50
|
+
'method',
|
|
51
|
+
// inline assembly
|
|
52
|
+
'asm',
|
|
53
|
+
// Library Functions
|
|
54
|
+
'abs',
|
|
55
|
+
'min',
|
|
56
|
+
'max',
|
|
57
|
+
'within',
|
|
58
|
+
'ripemd160',
|
|
59
|
+
'sha1',
|
|
60
|
+
'sha256',
|
|
61
|
+
'hash160',
|
|
62
|
+
'hash256',
|
|
63
|
+
'flattenSha256',
|
|
64
|
+
'checkSig',
|
|
65
|
+
'checkMultiSig',
|
|
66
|
+
'pack',
|
|
67
|
+
'unpack',
|
|
68
|
+
'reverseBytes',
|
|
69
|
+
];
|
|
70
|
+
class ScryptFileParser {
|
|
71
|
+
static parseScryptFile(fileContent) {
|
|
72
|
+
// for .scrypt file reference, check the link https://scryptdoc.readthedocs.io/en/latest/
|
|
73
|
+
// we parse each line of the .scrypt file;
|
|
74
|
+
// and get the import expressions, export symbols, symbols that not defined in the current .scrypt file;
|
|
75
|
+
// note: because the template is generated by the transpiler, so here we suppose the template do not have any comment expressions;
|
|
76
|
+
const importExpressions = this.parseImportExpression(fileContent);
|
|
77
|
+
const exportSymbols = this.parseExportSymbols(fileContent);
|
|
78
|
+
const usedSymbols = this.parseUsedSymbols(fileContent, exportSymbols);
|
|
79
|
+
return {
|
|
80
|
+
importExpressions,
|
|
81
|
+
exportSymbols,
|
|
82
|
+
usedSymbols,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static parseUsedSymbols(fileContent, exportSymbols) {
|
|
86
|
+
// suppose the symbols are not wrapped by asm {}
|
|
87
|
+
// suppose the symbols are not wrapped by ""
|
|
88
|
+
// match function functionName(ArgTyep1 arg1, ArgType2 arg2): ReturnType {
|
|
89
|
+
const functionRegex = /\bfunction\s*.+\{/g;
|
|
90
|
+
const constructorRegex = /\bconstructor\s*.+\{/g;
|
|
91
|
+
// match propType propVariable;
|
|
92
|
+
// also match return variable;
|
|
93
|
+
// eslint-disable-next-line no-useless-escape
|
|
94
|
+
const propsRegex = /\s+([\w\[\]]+)\s(\w+);/g;
|
|
95
|
+
// match type variable =
|
|
96
|
+
// also match static const type variable
|
|
97
|
+
// eslint-disable-next-line no-useless-escape
|
|
98
|
+
const localVariableRegex = /\s+([\w\[\]]+)\s(\w+)\s=/g;
|
|
99
|
+
// match xxx.yyy, xxx.yyy()
|
|
100
|
+
// also match this.xxx, should be excluded
|
|
101
|
+
// do not match xxx.yyy.zzz
|
|
102
|
+
const accessVariableRegex = /(\w+)\.\w+(?:\(\))?/g;
|
|
103
|
+
// match new xxx
|
|
104
|
+
const newRegex = /\bnew\s+(\w+)\s*\(/g;
|
|
105
|
+
const localVariables = [];
|
|
106
|
+
const propVariables = [];
|
|
107
|
+
const argumentVariables = [];
|
|
108
|
+
const types = [];
|
|
109
|
+
const accessVariables = [];
|
|
110
|
+
const stripArray = (type) => {
|
|
111
|
+
const idx = type.indexOf('[');
|
|
112
|
+
if (idx === -1) {
|
|
113
|
+
return type;
|
|
114
|
+
}
|
|
115
|
+
return type.slice(0, idx);
|
|
116
|
+
};
|
|
117
|
+
// parse function declaration
|
|
118
|
+
{
|
|
119
|
+
let match;
|
|
120
|
+
while ((match = functionRegex.exec(fileContent) || constructorRegex.exec(fileContent))) {
|
|
121
|
+
const lParenthesisIndex = match[0].indexOf('(');
|
|
122
|
+
const rParenthesisIndex = match[0].indexOf(')');
|
|
123
|
+
const argumentsString = match[0].slice(lParenthesisIndex + 1, rParenthesisIndex);
|
|
124
|
+
if (argumentsString.trim() !== '') {
|
|
125
|
+
const argsIndex = match.index + match[0].indexOf(argumentsString);
|
|
126
|
+
let argIndex = argsIndex;
|
|
127
|
+
const argumentList = argumentsString.split(',');
|
|
128
|
+
for (const arg of argumentList) {
|
|
129
|
+
const index = argIndex;
|
|
130
|
+
const parts = arg.trim().split(' ');
|
|
131
|
+
const type = stripArray(parts[0].trim());
|
|
132
|
+
const value = parts[1].trim();
|
|
133
|
+
types.push({
|
|
134
|
+
value: type,
|
|
135
|
+
index: index + arg.indexOf(type),
|
|
136
|
+
});
|
|
137
|
+
argumentVariables.push({
|
|
138
|
+
value,
|
|
139
|
+
index: index + arg.indexOf(value),
|
|
140
|
+
});
|
|
141
|
+
argIndex += arg.length + ','.length;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const returnTypeString = match[0].slice(rParenthesisIndex + 1);
|
|
145
|
+
const returnType = returnTypeString.match(/\w+/)?.[0]?.trim() || '';
|
|
146
|
+
if (returnType) {
|
|
147
|
+
const index = match.index + rParenthesisIndex + 1 + returnTypeString.indexOf(returnType);
|
|
148
|
+
types.push({
|
|
149
|
+
value: returnType,
|
|
150
|
+
index,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// parse contract property, struct property
|
|
156
|
+
{
|
|
157
|
+
let match;
|
|
158
|
+
while ((match = propsRegex.exec(fileContent))) {
|
|
159
|
+
if (match[0].trim().startsWith('return '))
|
|
160
|
+
continue;
|
|
161
|
+
const propType = stripArray(match[1]);
|
|
162
|
+
const propVariable = match[2];
|
|
163
|
+
propVariables.push({
|
|
164
|
+
value: propVariable,
|
|
165
|
+
index: match.index + match[0].indexOf(propVariable),
|
|
166
|
+
});
|
|
167
|
+
types.push({
|
|
168
|
+
value: propType,
|
|
169
|
+
index: match.index + match[0].indexOf(propType),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// parse local variable declaration
|
|
174
|
+
{
|
|
175
|
+
let match;
|
|
176
|
+
while ((match = localVariableRegex.exec(fileContent))) {
|
|
177
|
+
const type = stripArray(match[1]);
|
|
178
|
+
localVariables.push({
|
|
179
|
+
value: match[2],
|
|
180
|
+
index: match.index + match[0].indexOf(match[2]),
|
|
181
|
+
});
|
|
182
|
+
types.push({
|
|
183
|
+
value: type,
|
|
184
|
+
index: match.index + match[0].indexOf(type),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// parse variable access
|
|
189
|
+
{
|
|
190
|
+
let match;
|
|
191
|
+
while ((match = accessVariableRegex.exec(fileContent))) {
|
|
192
|
+
// exclude this.xxx
|
|
193
|
+
if (match[0].trim().startsWith('this.'))
|
|
194
|
+
continue;
|
|
195
|
+
// exclude xxx.scrypt
|
|
196
|
+
if (match[0].trim().endsWith('.scrypt'))
|
|
197
|
+
continue;
|
|
198
|
+
// exclude yyy.zzz in xxx.yyy.zzz
|
|
199
|
+
if (fileContent[match.index - 1] === '.')
|
|
200
|
+
continue;
|
|
201
|
+
accessVariables.push({
|
|
202
|
+
value: match[1],
|
|
203
|
+
index: match.index + match[0].indexOf(match[1]),
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// parse new xxx
|
|
208
|
+
{
|
|
209
|
+
let match;
|
|
210
|
+
while ((match = newRegex.exec(fileContent))) {
|
|
211
|
+
types.push({
|
|
212
|
+
value: match[1],
|
|
213
|
+
index: match.index + match[0].indexOf(match[1]),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const usedImportedSymbols = [];
|
|
218
|
+
const usedExportedSymbols = [];
|
|
219
|
+
// for access variables, we need to check if the access variable is defined in the current .scrypt file
|
|
220
|
+
for (const accessVariable of accessVariables) {
|
|
221
|
+
// is accessing a local variable
|
|
222
|
+
if ((0, utils_1.arrayIncludes)(localVariables, accessVariable, (a, b) => a.value === b.value)) {
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
// is accessing a argument variable
|
|
226
|
+
if ((0, utils_1.arrayIncludes)(argumentVariables, accessVariable, (a, b) => a.value === b.value)) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
// is accessing a built-in type
|
|
230
|
+
if ((0, utils_1.arrayIncludes)(exports.buildinSymbols, accessVariable, (a, b) => a === b.value)) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
// is accessing a exportSymbols
|
|
234
|
+
if ((0, utils_1.arrayIncludes)(exportSymbols, accessVariable, (a, b) => a.value === b.value)) {
|
|
235
|
+
usedExportedSymbols.push(accessVariable);
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
// not found in the current .scrypt file, so it is an outer symbol
|
|
239
|
+
usedImportedSymbols.push(accessVariable);
|
|
240
|
+
}
|
|
241
|
+
// for types, we need to check if the type is defined in the current .scrypt file, or is a built-in type
|
|
242
|
+
for (const type of types) {
|
|
243
|
+
// is accessing a built-in type
|
|
244
|
+
if (exports.buildinSymbols.includes(type.value)) {
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
// is accessing a export symbol
|
|
248
|
+
if ((0, utils_1.arrayIncludes)(exportSymbols, type, (a, b) => a.value === b.value)) {
|
|
249
|
+
usedExportedSymbols.push(type);
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
// not found in the current .scrypt file, so it is an outer symbol
|
|
253
|
+
usedImportedSymbols.push(type);
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
exportedSymbols: usedExportedSymbols,
|
|
257
|
+
importedSymbols: usedImportedSymbols,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
static parseImportExpression(fileContent) {
|
|
261
|
+
// we parse the import expression from the line;
|
|
262
|
+
// and get the import path;
|
|
263
|
+
/*
|
|
264
|
+
import "../types.scrypt";
|
|
265
|
+
import "./cat721State.scrypt";
|
|
266
|
+
import "./cat721GuardState.scrypt";
|
|
267
|
+
import "../utils/ownerUtils.scrypt";
|
|
268
|
+
import "@scrypt-inc/scrypt-ts-transpiler-btc/assets/smart-contract/types/structs.scrypt";
|
|
269
|
+
import "@scrypt-inc/scrypt-ts-transpiler-btc/assets/smart-contract/builtin-libs/txUtils.scrypt";
|
|
270
|
+
*/
|
|
271
|
+
const regex = /\bimport\s+['"]([^'"]+)['"];/g;
|
|
272
|
+
let match;
|
|
273
|
+
const importExpressions = [];
|
|
274
|
+
while ((match = regex.exec(fileContent))) {
|
|
275
|
+
importExpressions.push({
|
|
276
|
+
expression: match[0],
|
|
277
|
+
importPath: match[1],
|
|
278
|
+
index: match.index,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
return importExpressions;
|
|
282
|
+
}
|
|
283
|
+
static parseExportSymbols(fileContent) {
|
|
284
|
+
// we parse the export symbols from the line;
|
|
285
|
+
// for getting the export symbols, we need to parse the line that starts with contract, struct, library;
|
|
286
|
+
/*
|
|
287
|
+
contract symbol:
|
|
288
|
+
contract CAT721 {
|
|
289
|
+
...
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
struct symbol:
|
|
293
|
+
struct Cat721State {
|
|
294
|
+
...
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
library symbol:
|
|
298
|
+
library Cat721Guard {
|
|
299
|
+
...
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
*/
|
|
304
|
+
const contractRegex = /\bcontract\s+([\w]+)\s+{/g;
|
|
305
|
+
const structRegex = /\bstruct\s+([\w]+)\s+{/g;
|
|
306
|
+
const libraryRegex = /\blibrary\s+([\w]+)\s+{/g;
|
|
307
|
+
let match;
|
|
308
|
+
const exportSymbols = [];
|
|
309
|
+
while ((match = contractRegex.exec(fileContent))) {
|
|
310
|
+
exportSymbols.push({
|
|
311
|
+
type: 'contract',
|
|
312
|
+
value: match[1],
|
|
313
|
+
index: match.index + match[0].indexOf(match[1]),
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
while ((match = structRegex.exec(fileContent))) {
|
|
317
|
+
exportSymbols.push({
|
|
318
|
+
type: 'struct',
|
|
319
|
+
value: match[1],
|
|
320
|
+
index: match.index + match[0].indexOf(match[1]),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
while ((match = libraryRegex.exec(fileContent))) {
|
|
324
|
+
exportSymbols.push({
|
|
325
|
+
type: 'library',
|
|
326
|
+
value: match[1],
|
|
327
|
+
index: match.index + match[0].indexOf(match[1]),
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
return exportSymbols;
|
|
331
|
+
}
|
|
332
|
+
static verifyParseResult(filePath) {
|
|
333
|
+
console.log(`verifyParse ${filePath}`);
|
|
334
|
+
const fileContent = fs_1.default.readFileSync(filePath, 'utf-8');
|
|
335
|
+
const parsedResult = ScryptFileParser.parseScryptFile(fileContent);
|
|
336
|
+
const { importExpressions, exportSymbols, usedSymbols } = parsedResult;
|
|
337
|
+
// check importExpressions
|
|
338
|
+
for (const importExpression of importExpressions) {
|
|
339
|
+
const expression = importExpression.expression;
|
|
340
|
+
const actualExpression = fileContent.slice(importExpression.index, importExpression.index + expression.length);
|
|
341
|
+
if (actualExpression !== expression) {
|
|
342
|
+
throw new Error(`Import expression ${expression} is not equal to ${actualExpression}`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
// check exportSymbols
|
|
346
|
+
for (const exportSymbol of exportSymbols) {
|
|
347
|
+
const value = exportSymbol.value;
|
|
348
|
+
const actualValue = fileContent.slice(exportSymbol.index, exportSymbol.index + value.length);
|
|
349
|
+
if (actualValue !== value) {
|
|
350
|
+
throw new Error(`Export symbol ${value} is not equal to ${actualValue}`);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
// check importedSymbols
|
|
354
|
+
for (const importedSymbol of usedSymbols.importedSymbols) {
|
|
355
|
+
const value = importedSymbol.value;
|
|
356
|
+
const actualValue = fileContent.slice(importedSymbol.index, importedSymbol.index + value.length);
|
|
357
|
+
if (actualValue !== value) {
|
|
358
|
+
throw new Error(`used Imported symbol ${value} is not equal to ${actualValue}`);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
// check exportedSymbols
|
|
362
|
+
for (const exportedSymbol of usedSymbols.exportedSymbols) {
|
|
363
|
+
const value = exportedSymbol.value;
|
|
364
|
+
const actualValue = fileContent.slice(exportedSymbol.index, exportedSymbol.index + value.length);
|
|
365
|
+
if (actualValue !== value) {
|
|
366
|
+
throw new Error(`used Exported symbol ${value} is not equal to ${actualValue}`);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
exports.ScryptFileParser = ScryptFileParser;
|
|
372
|
+
//# sourceMappingURL=scryptParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scryptParser.js","sourceRoot":"","sources":["../src/scryptParser.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,mCAAwC;AAiB3B,QAAA,cAAc,GAAG;IAC5B,cAAc;IACd,OAAO;IACP,KAAK;IACL,MAAM;IAEN,SAAS;IACT,QAAQ;IAER,IAAI;IACJ,SAAS;IAET,aAAa;IACb,MAAM;IAEN,kBAAkB;IAClB,QAAQ;IACR,KAAK;IACL,WAAW;IACX,MAAM;IACN,QAAQ;IACR,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,QAAQ;IAER,iBAAiB;IACjB,SAAS;IAET,OAAO;IAEP,IAAI;IACJ,MAAM;IACN,MAAM;IAEN,MAAM;IACN,SAAS;IACT,QAAQ;IAER,iBAAiB;IAEjB,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,SAAS;IAET,SAAS;IACT,UAAU;IAEV,UAAU;IACV,aAAa;IAEb,YAAY;IACZ,MAAM;IACN,QAAQ;IAER,kBAAkB;IAClB,KAAK;IAEL,oBAAoB;IACpB,KAAK;IACL,KAAK;IACL,KAAK;IACL,QAAQ;IAER,WAAW;IACX,MAAM;IACN,QAAQ;IACR,SAAS;IACT,SAAS;IACT,eAAe;IAEf,UAAU;IACV,eAAe;IAEf,MAAM;IACN,QAAQ;IAER,cAAc;CACf,CAAC;AAEF,MAAa,gBAAgB;IAC3B,MAAM,CAAC,eAAe,CAAC,WAAmB;QACxC,yFAAyF;QAEzF,0CAA0C;QAC1C,wGAAwG;QACxG,kIAAkI;QAElI,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAClE,MAAM,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AAK,EAAE,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;YAC7F,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAK,oBAAoB,WAAW,EAAE,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;QAED,wBAAwB;QACxB,KAAK,MAAM,cAAc,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC;YACzD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;YACnC,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CACnC,cAAc,CAAC,KAAK,EACpB,cAAc,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CACpC,CAAC;YACF,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,oBAAoB,WAAW,EAAE,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;QAED,wBAAwB;QACxB,KAAK,MAAM,cAAc,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC;YACzD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;YACnC,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CACnC,cAAc,CAAC,KAAK,EACpB,cAAc,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CACpC,CAAC;YACF,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,oBAAoB,WAAW,EAAE,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAvVD,4CAuVC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const InjectedParam_SHPreimage = "__scrypt_ts_shPreimage";
|
|
2
|
+
export declare const InjectedParam_InputIndexVal = "__scrypt_ts_inputIndexVal";
|
|
3
|
+
export declare const InjectedParam_Prevouts = "__scrypt_ts_prevouts";
|
|
4
|
+
export declare const InjectedParam_Prevout = "__scrypt_ts_prevout";
|
|
5
|
+
export declare const InjectedParam_SpentScriptHashes = "__scrypt_ts_spentScriptHashes";
|
|
6
|
+
export declare const InjectedParam_SpentAmounts = "__scrypt_ts_spentAmounts";
|
|
7
|
+
export declare const InjectedParam_SpentDataHashes = "__scrypt_ts_spentDataHashes";
|
|
8
|
+
export declare const InjectedParam_ChangeInfo = "__scrypt_ts_changeInfo";
|
|
9
|
+
export declare const InjectedParam_NextStateHashes = "__scrypt_ts_nextStateHashes";
|
|
10
|
+
export declare const InjectedParam_CurState = "__scrypt_ts_curState";
|
|
11
|
+
export declare const InjectedParam_PrevTxHashPreimage = "__scrypt_ts_prevTxHashPreimage";
|
|
12
|
+
export declare const InjectedProp_SHPreimage = "__scrypt_ts_shPreimage";
|
|
13
|
+
export declare const InjectedProp_ChangeInfo = "__scrypt_ts_changeInfo";
|
|
14
|
+
export declare const InjectedProp_PrevoutsCtx = "__scrypt_ts_prevouts";
|
|
15
|
+
export declare const InjectedProp_Prevout = "__scrypt_ts_prevout";
|
|
16
|
+
export declare const InjectedProp_CurState = "__scrypt_ts_curState";
|
|
17
|
+
export declare const InjectedProp_NextState = "__scrypt_ts_nextState";
|
|
18
|
+
export declare const InjectedProp_SpentScriptHashes = "__scrypt_ts_spentScriptHashes";
|
|
19
|
+
export declare const InjectedProp_SpentAmounts = "__scrypt_ts_spentAmounts";
|
|
20
|
+
export declare const InjectedProp_SpentDataHashes = "__scrypt_ts_spentDataHashes";
|
|
21
|
+
export declare const InjectedProp_PrevTxHashPreimage = "__scrypt_ts_prevTxHashPreimage";
|
|
22
|
+
export declare const InjectedVar_InputCount = "__scrypt_ts_inputCount";
|
|
23
|
+
export declare const InjectedVar_StateCount = "__scrypt_ts_stateCount";
|
|
24
|
+
export declare const InjectedVar_StateOutputs = "__scrypt_ts_stateOutputs";
|
|
25
|
+
export declare const InjectedVar_StateRoots = "__scrypt_ts_stateRoots";
|
|
26
|
+
export declare const InjectedVar_InputStateHashes = "__scrypt_ts_inputStateHashes";
|
|
27
|
+
export declare const InjectedVar_NextState = "__scrypt_ts_nextState";
|
|
28
|
+
export declare function thisAssignment(intjectedProp: string): string;
|
|
29
|
+
export declare const EMPTY_CONSTRUCTOR = "\nconstructor(){\n}\n";
|
|
30
|
+
export declare const CALL_CHECK_SHPREIMAGE = "require(Tx.checkPreimageSigHashType(ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage), SigHash.ALL))";
|
|
31
|
+
export declare const CALL_BUILD_CHANGE_OUTPUT: {
|
|
32
|
+
accessArgument: string;
|
|
33
|
+
accessThis: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const ACCESS_INPUT_COUNT: {
|
|
36
|
+
accessArgument: string;
|
|
37
|
+
accessThis: string;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=snippets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../src/snippets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AACjE,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AACvE,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAC7D,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAC3D,eAAO,MAAM,+BAA+B,kCAAkC,CAAC;AAC/E,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AACrE,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAC3E,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AACjE,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAC3E,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAC7D,eAAO,MAAM,gCAAgC,mCAAmC,CAAC;AAEjF,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAC1D,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAC5D,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAC9D,eAAO,MAAM,8BAA8B,kCAAkC,CAAC;AAC9E,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AACpE,eAAO,MAAM,4BAA4B,gCAAgC,CAAC;AAC1E,eAAO,MAAM,+BAA+B,mCAAmC,CAAC;AAGhF,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AACnE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAU7D,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,UAEnD;AAED,eAAO,MAAM,iBAAiB,0BAG7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,gHAAqH,CAAC;AAExJ,eAAO,MAAM,wBAAwB;;;CAGpC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;CAG9B,CAAA"}
|
package/dist/snippets.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACCESS_INPUT_COUNT = exports.CALL_BUILD_CHANGE_OUTPUT = exports.CALL_CHECK_SHPREIMAGE = exports.EMPTY_CONSTRUCTOR = exports.thisAssignment = exports.InjectedVar_NextState = exports.InjectedVar_InputStateHashes = exports.InjectedVar_StateRoots = exports.InjectedVar_StateOutputs = exports.InjectedVar_StateCount = exports.InjectedVar_InputCount = exports.InjectedProp_PrevTxHashPreimage = exports.InjectedProp_SpentDataHashes = exports.InjectedProp_SpentAmounts = exports.InjectedProp_SpentScriptHashes = exports.InjectedProp_NextState = exports.InjectedProp_CurState = exports.InjectedProp_Prevout = exports.InjectedProp_PrevoutsCtx = exports.InjectedProp_ChangeInfo = exports.InjectedProp_SHPreimage = exports.InjectedParam_PrevTxHashPreimage = exports.InjectedParam_CurState = exports.InjectedParam_NextStateHashes = exports.InjectedParam_ChangeInfo = exports.InjectedParam_SpentDataHashes = exports.InjectedParam_SpentAmounts = exports.InjectedParam_SpentScriptHashes = exports.InjectedParam_Prevout = exports.InjectedParam_Prevouts = exports.InjectedParam_InputIndexVal = exports.InjectedParam_SHPreimage = void 0;
|
|
4
|
+
exports.InjectedParam_SHPreimage = '__scrypt_ts_shPreimage';
|
|
5
|
+
exports.InjectedParam_InputIndexVal = '__scrypt_ts_inputIndexVal';
|
|
6
|
+
exports.InjectedParam_Prevouts = '__scrypt_ts_prevouts';
|
|
7
|
+
exports.InjectedParam_Prevout = '__scrypt_ts_prevout';
|
|
8
|
+
exports.InjectedParam_SpentScriptHashes = '__scrypt_ts_spentScriptHashes';
|
|
9
|
+
exports.InjectedParam_SpentAmounts = '__scrypt_ts_spentAmounts';
|
|
10
|
+
exports.InjectedParam_SpentDataHashes = '__scrypt_ts_spentDataHashes';
|
|
11
|
+
exports.InjectedParam_ChangeInfo = '__scrypt_ts_changeInfo';
|
|
12
|
+
exports.InjectedParam_NextStateHashes = '__scrypt_ts_nextStateHashes';
|
|
13
|
+
exports.InjectedParam_CurState = '__scrypt_ts_curState';
|
|
14
|
+
exports.InjectedParam_PrevTxHashPreimage = '__scrypt_ts_prevTxHashPreimage';
|
|
15
|
+
exports.InjectedProp_SHPreimage = '__scrypt_ts_shPreimage';
|
|
16
|
+
exports.InjectedProp_ChangeInfo = '__scrypt_ts_changeInfo';
|
|
17
|
+
exports.InjectedProp_PrevoutsCtx = '__scrypt_ts_prevouts';
|
|
18
|
+
exports.InjectedProp_Prevout = '__scrypt_ts_prevout';
|
|
19
|
+
exports.InjectedProp_CurState = '__scrypt_ts_curState';
|
|
20
|
+
exports.InjectedProp_NextState = '__scrypt_ts_nextState';
|
|
21
|
+
exports.InjectedProp_SpentScriptHashes = '__scrypt_ts_spentScriptHashes';
|
|
22
|
+
exports.InjectedProp_SpentAmounts = '__scrypt_ts_spentAmounts';
|
|
23
|
+
exports.InjectedProp_SpentDataHashes = '__scrypt_ts_spentDataHashes';
|
|
24
|
+
exports.InjectedProp_PrevTxHashPreimage = '__scrypt_ts_prevTxHashPreimage';
|
|
25
|
+
exports.InjectedVar_InputCount = '__scrypt_ts_inputCount';
|
|
26
|
+
exports.InjectedVar_StateCount = '__scrypt_ts_stateCount';
|
|
27
|
+
exports.InjectedVar_StateOutputs = '__scrypt_ts_stateOutputs';
|
|
28
|
+
exports.InjectedVar_StateRoots = '__scrypt_ts_stateRoots';
|
|
29
|
+
exports.InjectedVar_InputStateHashes = '__scrypt_ts_inputStateHashes';
|
|
30
|
+
exports.InjectedVar_NextState = '__scrypt_ts_nextState';
|
|
31
|
+
// export const BUILD_CHANGE_OUTPUT_FUNCTION = `
|
|
32
|
+
// function buildChangeOutput() : bytes {
|
|
33
|
+
// return len(this.${InjectedProp_ChangeInfo}.satoshis) > 0 ? TxUtils.buildOutput(this.${InjectedProp_ChangeInfo}.script, this.${InjectedProp_ChangeInfo}.satoshis) : b'';
|
|
34
|
+
// }
|
|
35
|
+
// `;
|
|
36
|
+
// export const INIT_CHANGE = `this.${InjectedProp_ChangeInfo} = ${InjectedParam_ChangeInfo};`;
|
|
37
|
+
function thisAssignment(intjectedProp) {
|
|
38
|
+
return `this.${intjectedProp} = ${intjectedProp};`;
|
|
39
|
+
}
|
|
40
|
+
exports.thisAssignment = thisAssignment;
|
|
41
|
+
exports.EMPTY_CONSTRUCTOR = `
|
|
42
|
+
constructor(){
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
exports.CALL_CHECK_SHPREIMAGE = `require(Tx.checkPreimageSigHashType(ContextUtils.serializeSHPreimage(${exports.InjectedParam_SHPreimage}), SigHash.ALL))`;
|
|
46
|
+
exports.CALL_BUILD_CHANGE_OUTPUT = {
|
|
47
|
+
accessArgument: `(${exports.InjectedParam_ChangeInfo}.satoshis > 0 ? TxUtils.buildOutput(${exports.InjectedParam_ChangeInfo}.scriptHash, ${exports.InjectedParam_ChangeInfo}.satoshis) : b'')`,
|
|
48
|
+
accessThis: `(this.${exports.InjectedProp_ChangeInfo}.satoshis > 0 ? TxUtils.buildOutput(this.${exports.InjectedProp_ChangeInfo}.scriptHash, this.${exports.InjectedProp_ChangeInfo}.satoshis) : b'')`,
|
|
49
|
+
};
|
|
50
|
+
exports.ACCESS_INPUT_COUNT = {
|
|
51
|
+
accessArgument: exports.InjectedVar_InputCount,
|
|
52
|
+
accessThis: `ContextUtils.checkSpentAmounts(this.${exports.InjectedProp_SpentAmounts}, this.${exports.InjectedProp_SHPreimage}.hashSpentAmounts)`,
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=snippets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets.js","sourceRoot":"","sources":["../src/snippets.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAAG,wBAAwB,CAAC;AACpD,QAAA,2BAA2B,GAAG,2BAA2B,CAAC;AAC1D,QAAA,sBAAsB,GAAG,sBAAsB,CAAC;AAChD,QAAA,qBAAqB,GAAG,qBAAqB,CAAC;AAC9C,QAAA,+BAA+B,GAAG,+BAA+B,CAAC;AAClE,QAAA,0BAA0B,GAAG,0BAA0B,CAAC;AACxD,QAAA,6BAA6B,GAAG,6BAA6B,CAAC;AAC9D,QAAA,wBAAwB,GAAG,wBAAwB,CAAC;AACpD,QAAA,6BAA6B,GAAG,6BAA6B,CAAC;AAC9D,QAAA,sBAAsB,GAAG,sBAAsB,CAAC;AAChD,QAAA,gCAAgC,GAAG,gCAAgC,CAAC;AAEpE,QAAA,uBAAuB,GAAG,wBAAwB,CAAC;AACnD,QAAA,uBAAuB,GAAG,wBAAwB,CAAC;AACnD,QAAA,wBAAwB,GAAG,sBAAsB,CAAC;AAClD,QAAA,oBAAoB,GAAG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