@airgap/mina 0.13.45-beta.3 → 0.13.45-beta.5
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/package.json +5 -5
- package/v1/block-explorer/MinaExplorerBlockExplorer.js +61 -12
- package/v1/block-explorer/MinaExplorerBlockExplorer.js.map +1 -1
- package/v1/index.js +2 -2
- package/v1/index.js.map +1 -1
- package/v1/indexer/MinaExplorerIndexer.js +107 -64
- package/v1/indexer/MinaExplorerIndexer.js.map +1 -1
- package/v1/module/MinaModule.js +96 -38
- package/v1/module/MinaModule.js.map +1 -1
- package/v1/module.js +3 -2
- package/v1/module.js.map +1 -1
- package/v1/node/GraphQLNode.js +107 -70
- package/v1/node/GraphQLNode.js.map +1 -1
- package/v1/protocol/MinaProtocol.js +317 -179
- package/v1/protocol/MinaProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +20 -8
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +148 -69
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +65 -16
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/serializer/v3/validators/validators.js +81 -36
- package/v1/serializer/v3/validators/validators.js.map +1 -1
- package/v1/types/crypto.d.ts +1 -1
- package/v1/types/protocol.d.ts +2 -2
- package/v1/types/transaction.d.ts +1 -1
- package/v1/utils/key.d.ts +1 -0
- package/v1/utils/key.js +14 -23
- package/v1/utils/key.js.map +1 -1
- package/v1/utils/math.js +11 -7
- package/v1/utils/math.js.map +1 -1
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.minaUnsignedTransactionToRequest =
|
|
4
|
-
|
|
5
|
-
exports.minaTransactionSignRequestToUnsigned = minaTransactionSignRequestToUnsigned;
|
|
6
|
-
exports.minaTransactionSignResponseToSigned = minaTransactionSignResponseToSigned;
|
|
7
|
-
const module_kit_1 = require("@airgap/module-kit");
|
|
14
|
+
exports.minaTransactionSignResponseToSigned = exports.minaTransactionSignRequestToUnsigned = exports.minaSignedTransactionToResponse = exports.minaUnsignedTransactionToRequest = void 0;
|
|
15
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
8
16
|
function minaUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
9
|
-
|
|
17
|
+
var _ = unsigned.type, rest = __rest(unsigned, ["type"]);
|
|
10
18
|
return {
|
|
11
19
|
transaction: rest,
|
|
12
|
-
publicKey,
|
|
20
|
+
publicKey: publicKey,
|
|
13
21
|
callbackURL: callbackUrl
|
|
14
22
|
};
|
|
15
23
|
}
|
|
24
|
+
exports.minaUnsignedTransactionToRequest = minaUnsignedTransactionToRequest;
|
|
16
25
|
function minaSignedTransactionToResponse(signed, accountIdentifier) {
|
|
17
|
-
return { transaction: JSON.stringify(signed), accountIdentifier };
|
|
26
|
+
return { transaction: JSON.stringify(signed), accountIdentifier: accountIdentifier };
|
|
18
27
|
}
|
|
28
|
+
exports.minaSignedTransactionToResponse = minaSignedTransactionToResponse;
|
|
19
29
|
function minaTransactionSignRequestToUnsigned(request) {
|
|
20
30
|
return (0, module_kit_1.newUnsignedTransaction)(request.transaction);
|
|
21
31
|
}
|
|
32
|
+
exports.minaTransactionSignRequestToUnsigned = minaTransactionSignRequestToUnsigned;
|
|
22
33
|
function minaTransactionSignResponseToSigned(response) {
|
|
23
34
|
return (0, module_kit_1.newSignedTransaction)(JSON.parse(response.transaction));
|
|
24
35
|
}
|
|
36
|
+
exports.minaTransactionSignResponseToSigned = minaTransactionSignResponseToSigned;
|
|
25
37
|
//# sourceMappingURL=transaction-converter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iDAAiF;AAMjF,SAAgB,gCAAgC,CAC9C,QAAiC,EACjC,SAAiB,EACjB,WAAoB;IAEZ,IAAM,CAAC,GAAc,QAAQ,KAAtB,EAAK,IAAI,UAAK,QAAQ,EAA/B,QAAoB,CAAF,CAAa;IAErC,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,SAAS,WAAA;QACT,WAAW,EAAE,WAAW;KACzB,CAAA;AACH,CAAC;AAZD,4EAYC;AAED,SAAgB,+BAA+B,CAAC,MAA6B,EAAE,iBAAyB;IACtG,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,iBAAiB,mBAAA,EAAE,CAAA;AACnE,CAAC;AAFD,0EAEC;AAED,SAAgB,oCAAoC,CAAC,OAAmC;IACtF,OAAO,IAAA,mCAAsB,EAA0B,OAAO,CAAC,WAAW,CAAC,CAAA;AAC7E,CAAC;AAFD,oFAEC;AAED,SAAgB,mCAAmC,CAAC,QAAqC;IACvF,OAAO,IAAA,iCAAoB,EAAwB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAA;AACtF,CAAC;AAFD,kFAEC"}
|
|
@@ -1,17 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.MinaV3SerializerCompanion = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
40
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
41
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
42
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
43
|
+
var serializer_1 = require("@airgap/serializer");
|
|
44
|
+
var transaction_converter_1 = require("./schemas/converter/transaction-converter");
|
|
45
|
+
var transaction_validator_1 = require("./validators/transaction-validator");
|
|
46
|
+
var validators_1 = require("./validators/validators");
|
|
47
|
+
var minaTransactionSignRequest = require('./schemas/generated/transaction-sign-request-mina.json');
|
|
48
|
+
var minaTransactionSignResponse = require('./schemas/generated/transaction-sign-response-mina.json');
|
|
49
|
+
var MinaV3SerializerCompanion = /** @class */ (function () {
|
|
50
|
+
function MinaV3SerializerCompanion() {
|
|
15
51
|
this.schemas = [
|
|
16
52
|
{
|
|
17
53
|
type: serializer_1.IACMessageType.TransactionSignRequest,
|
|
@@ -25,70 +61,113 @@ class MinaV3SerializerCompanion {
|
|
|
25
61
|
}
|
|
26
62
|
];
|
|
27
63
|
this.minaTransactionValidator = new transaction_validator_1.MinaTransactionValidator();
|
|
28
|
-
Object.keys(validators_1.minaValidators).forEach((key)
|
|
64
|
+
Object.keys(validators_1.minaValidators).forEach(function (key) {
|
|
29
65
|
validate_1.validators[key] = validators_1.minaValidators[key];
|
|
30
66
|
});
|
|
31
67
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
async fromTransactionSignRequest(identifier, transactionSignRequest) {
|
|
41
|
-
switch (identifier) {
|
|
42
|
-
case coinlib_core_1.MainProtocolSymbols.MINA:
|
|
43
|
-
return (0, transaction_converter_1.minaTransactionSignRequestToUnsigned)(transactionSignRequest);
|
|
44
|
-
default:
|
|
45
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.MINA, `Protocol ${identifier} not supported`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
async validateTransactionSignRequest(identifier, transactionSignRequest) {
|
|
49
|
-
switch (identifier) {
|
|
50
|
-
case coinlib_core_1.MainProtocolSymbols.MINA:
|
|
51
|
-
try {
|
|
52
|
-
await this.minaTransactionValidator.validateUnsignedTransaction(transactionSignRequest);
|
|
53
|
-
return true;
|
|
68
|
+
MinaV3SerializerCompanion.prototype.toTransactionSignRequest = function (identifier, unsignedTransaction, publicKey, callbackUrl) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
switch (identifier) {
|
|
72
|
+
case coinlib_core_1.MainProtocolSymbols.MINA:
|
|
73
|
+
return [2 /*return*/, (0, transaction_converter_1.minaUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl)];
|
|
74
|
+
default:
|
|
75
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.MINA, "Protocol ".concat(identifier, " not supported"));
|
|
54
76
|
}
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
return [2 /*return*/];
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
MinaV3SerializerCompanion.prototype.fromTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
return __generator(this, function (_a) {
|
|
84
|
+
switch (identifier) {
|
|
85
|
+
case coinlib_core_1.MainProtocolSymbols.MINA:
|
|
86
|
+
return [2 /*return*/, (0, transaction_converter_1.minaTransactionSignRequestToUnsigned)(transactionSignRequest)];
|
|
87
|
+
default:
|
|
88
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.MINA, "Protocol ".concat(identifier, " not supported"));
|
|
57
89
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return true;
|
|
90
|
+
return [2 /*return*/];
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
MinaV3SerializerCompanion.prototype.validateTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
+
var _a, _b;
|
|
97
|
+
return __generator(this, function (_c) {
|
|
98
|
+
switch (_c.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
_a = identifier;
|
|
101
|
+
switch (_a) {
|
|
102
|
+
case coinlib_core_1.MainProtocolSymbols.MINA: return [3 /*break*/, 1];
|
|
103
|
+
}
|
|
104
|
+
return [3 /*break*/, 4];
|
|
105
|
+
case 1:
|
|
106
|
+
_c.trys.push([1, 3, , 4]);
|
|
107
|
+
return [4 /*yield*/, this.minaTransactionValidator.validateUnsignedTransaction(transactionSignRequest)];
|
|
108
|
+
case 2:
|
|
109
|
+
_c.sent();
|
|
110
|
+
return [2 /*return*/, true];
|
|
111
|
+
case 3:
|
|
112
|
+
_b = _c.sent();
|
|
113
|
+
return [2 /*return*/, false];
|
|
114
|
+
case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.MINA, "Protocol ".concat(identifier, " not supported"));
|
|
84
115
|
}
|
|
85
|
-
|
|
86
|
-
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
MinaV3SerializerCompanion.prototype.toTransactionSignResponse = function (identifier, signedTransaction, accountIdentifier) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
switch (identifier) {
|
|
123
|
+
case coinlib_core_1.MainProtocolSymbols.MINA:
|
|
124
|
+
return [2 /*return*/, (0, transaction_converter_1.minaSignedTransactionToResponse)(signedTransaction, accountIdentifier)];
|
|
125
|
+
default:
|
|
126
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.MINA, "Protocol ".concat(identifier, " not supported"));
|
|
87
127
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
MinaV3SerializerCompanion.prototype.fromTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (identifier) {
|
|
136
|
+
case coinlib_core_1.MainProtocolSymbols.MINA:
|
|
137
|
+
return [2 /*return*/, (0, transaction_converter_1.minaTransactionSignResponseToSigned)(transactionSignResponse)];
|
|
138
|
+
default:
|
|
139
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.MINA, "Protocol ".concat(identifier, " not supported"));
|
|
140
|
+
}
|
|
141
|
+
return [2 /*return*/];
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
MinaV3SerializerCompanion.prototype.validateTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
147
|
+
var _a, _b;
|
|
148
|
+
return __generator(this, function (_c) {
|
|
149
|
+
switch (_c.label) {
|
|
150
|
+
case 0:
|
|
151
|
+
_a = identifier;
|
|
152
|
+
switch (_a) {
|
|
153
|
+
case coinlib_core_1.MainProtocolSymbols.MINA: return [3 /*break*/, 1];
|
|
154
|
+
}
|
|
155
|
+
return [3 /*break*/, 4];
|
|
156
|
+
case 1:
|
|
157
|
+
_c.trys.push([1, 3, , 4]);
|
|
158
|
+
return [4 /*yield*/, this.minaTransactionValidator.validateSignedTransaction(transactionSignResponse)];
|
|
159
|
+
case 2:
|
|
160
|
+
_c.sent();
|
|
161
|
+
return [2 /*return*/, true];
|
|
162
|
+
case 3:
|
|
163
|
+
_b = _c.sent();
|
|
164
|
+
return [2 /*return*/, false];
|
|
165
|
+
case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.MINA, "Protocol ".concat(identifier, " not supported"));
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
return MinaV3SerializerCompanion;
|
|
171
|
+
}());
|
|
93
172
|
exports.MinaV3SerializerCompanion = MinaV3SerializerCompanion;
|
|
94
173
|
//# sourceMappingURL=serializer-companion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer-companion.js","sourceRoot":"","sources":["../../../../src/v1/serializer/v3/serializer-companion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"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AAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;iBAClF;;;;KACF;IAEY,mEAA+B,GAA5C,UAA6C,UAAkB,EAAE,uBAAgD;;;;;;wBACvG,KAAA,UAAU,CAAA;;iCACX,kCAAmB,CAAC,IAAI,CAAC,CAAzB,wBAAwB;;;;;wBAEzB,qBAAM,IAAI,CAAC,wBAAwB,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,EAAA;;wBAAtF,SAAsF,CAAA;wBAEtF,sBAAO,IAAI,EAAA;;;wBAEX,sBAAO,KAAK,EAAA;4BAGd,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,IAAI,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;;;;KAEpF;IACH,gCAAC;AAAD,CAAC,AAtGD,IAsGC;AAtGY,8DAAyB"}
|
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.MinaTransactionValidator = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
40
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
41
|
+
var serializer_1 = require("@airgap/serializer");
|
|
42
|
+
var unsignedTransactionConstraints = {
|
|
7
43
|
networkType: {
|
|
8
44
|
presence: { allowEmpty: false },
|
|
9
45
|
type: 'String',
|
|
@@ -14,7 +50,7 @@ const unsignedTransactionConstraints = {
|
|
|
14
50
|
isValidMinaPayment: true
|
|
15
51
|
}
|
|
16
52
|
};
|
|
17
|
-
|
|
53
|
+
var signedTransactionConstraints = {
|
|
18
54
|
data: {
|
|
19
55
|
presence: { allowEmpty: false },
|
|
20
56
|
isValidMinaPayment: true
|
|
@@ -24,18 +60,31 @@ const signedTransactionConstraints = {
|
|
|
24
60
|
isValidMinaSignature: true
|
|
25
61
|
}
|
|
26
62
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const transaction = request.transaction;
|
|
32
|
-
(0, serializer_1.validateSyncScheme)({});
|
|
33
|
-
return (0, validate_1.async)(transaction, unsignedTransactionConstraints).then(success, error);
|
|
34
|
-
}
|
|
35
|
-
async validateSignedTransaction(response) {
|
|
36
|
-
const transaction = JSON.parse(response.transaction);
|
|
37
|
-
return (0, validate_1.async)(transaction, signedTransactionConstraints).then(success, error);
|
|
63
|
+
var success = function () { return undefined; };
|
|
64
|
+
var error = function (errors) { return errors; };
|
|
65
|
+
var MinaTransactionValidator = /** @class */ (function () {
|
|
66
|
+
function MinaTransactionValidator() {
|
|
38
67
|
}
|
|
39
|
-
|
|
68
|
+
MinaTransactionValidator.prototype.validateUnsignedTransaction = function (request) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
+
var transaction;
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
transaction = request.transaction;
|
|
73
|
+
(0, serializer_1.validateSyncScheme)({});
|
|
74
|
+
return [2 /*return*/, (0, validate_1.async)(transaction, unsignedTransactionConstraints).then(success, error)];
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
MinaTransactionValidator.prototype.validateSignedTransaction = function (response) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
+
var transaction;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
transaction = JSON.parse(response.transaction);
|
|
83
|
+
return [2 /*return*/, (0, validate_1.async)(transaction, signedTransactionConstraints).then(success, error)];
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
return MinaTransactionValidator;
|
|
88
|
+
}());
|
|
40
89
|
exports.MinaTransactionValidator = MinaTransactionValidator;
|
|
41
90
|
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAAyF;AACzF,iDAA6E;AAK7E,IAAM,8BAA8B,GAAG;IACrC,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,sBAAsB,EAAE,IAAI;KAC7B;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,kBAAkB,EAAE,IAAI;KACzB;CACF,CAAA;AACD,IAAM,4BAA4B,GAAG;IACnC,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,kBAAkB,EAAE,IAAI;KACzB;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,oBAAoB,EAAE,IAAI;KAC3B;CACF,CAAA;AAED,IAAM,OAAO,GAAG,cAAM,OAAA,SAAS,EAAT,CAAS,CAAA;AAC/B,IAAM,KAAK,GAAG,UAAC,MAAM,IAAK,OAAA,MAAM,EAAN,CAAM,CAAA;AAEhC;IAAA;IAYA,CAAC;IAXc,8DAA2B,GAAxC,UAAyC,OAAmC;;;;gBACpE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;gBACvC,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAA;gBAEtB,sBAAO,IAAA,gBAAK,EAAC,WAAW,EAAE,8BAA8B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAAA;;;KAC/E;IAEY,4DAAyB,GAAtC,UAAuC,QAAqC;;;;gBACpE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;gBACpD,sBAAO,IAAA,gBAAK,EAAC,WAAW,EAAE,4BAA4B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAAA;;;KAC7E;IACH,+BAAC;AAAD,CAAC,AAZD,IAYC;AAZY,4DAAwB"}
|
|
@@ -1,45 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.minaValidators = void 0;
|
|
4
|
-
|
|
40
|
+
var MinaProtocol_1 = require("../../../protocol/MinaProtocol");
|
|
5
41
|
exports.minaValidators = {
|
|
6
|
-
isValidMinaPayment:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
isValidMinaPayment: function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
43
|
+
var protocol, metadata, addressPattern, amountPattern, payment;
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
return __generator(this, function (_d) {
|
|
46
|
+
switch (_d.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
if (typeof value !== 'object') {
|
|
49
|
+
return [2 /*return*/, 'not an object'];
|
|
50
|
+
}
|
|
51
|
+
protocol = (0, MinaProtocol_1.createMinaProtocol)();
|
|
52
|
+
return [4 /*yield*/, protocol.getMetadata()];
|
|
53
|
+
case 1:
|
|
54
|
+
metadata = _d.sent();
|
|
55
|
+
addressPattern = RegExp((_c = (_b = (_a = metadata.account) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b.regex) !== null && _c !== void 0 ? _c : '.*');
|
|
56
|
+
amountPattern = RegExp('d+');
|
|
57
|
+
payment = value;
|
|
58
|
+
if (typeof payment.to !== 'string' || !addressPattern.test(payment.to)) {
|
|
59
|
+
return [2 /*return*/, 'not a valid Mina `to` address'];
|
|
60
|
+
}
|
|
61
|
+
if (typeof payment.from !== 'string' || !addressPattern.test(payment.from)) {
|
|
62
|
+
return [2 /*return*/, 'not a valid Mina `from` address'];
|
|
63
|
+
}
|
|
64
|
+
if (typeof payment.amount !== 'string' || !amountPattern.test(payment.amount)) {
|
|
65
|
+
return [2 /*return*/, 'not a valid amount'];
|
|
66
|
+
}
|
|
67
|
+
if (typeof payment.fee !== 'string' || !amountPattern.test(payment.fee)) {
|
|
68
|
+
return [2 /*return*/, 'not a valid fee'];
|
|
69
|
+
}
|
|
70
|
+
if (typeof payment.nonce !== 'string' || !amountPattern.test(payment.nonce) || parseInt(payment.nonce, 10) < 0) {
|
|
71
|
+
return [2 /*return*/, 'not a valid nonce'];
|
|
72
|
+
}
|
|
73
|
+
if (typeof payment.memo !== 'undefined' && typeof payment.memo !== 'string') {
|
|
74
|
+
return [2 /*return*/, 'not a valid memo'];
|
|
75
|
+
}
|
|
76
|
+
if (typeof payment.validUntil !== 'undefined' && (typeof payment.validUntil !== 'string' || !amountPattern.test(payment.validUntil))) {
|
|
77
|
+
return [2 /*return*/, 'not a valid timestamp'];
|
|
78
|
+
}
|
|
79
|
+
return [2 /*return*/, null];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}); },
|
|
83
|
+
isValidMinaSignature: function (value) {
|
|
39
84
|
if (typeof value !== 'object') {
|
|
40
85
|
return 'not an object';
|
|
41
86
|
}
|
|
42
|
-
|
|
87
|
+
var signature = value;
|
|
43
88
|
if (signature.type === 'raw') {
|
|
44
89
|
if (typeof signature.value !== 'string') {
|
|
45
90
|
return 'not a valid Mina raw signature';
|
|
@@ -57,7 +102,7 @@ exports.minaValidators = {
|
|
|
57
102
|
}
|
|
58
103
|
return 'not a valid Mina signature type';
|
|
59
104
|
},
|
|
60
|
-
isValidMinaNetworkType: (value)
|
|
105
|
+
isValidMinaNetworkType: function (value) {
|
|
61
106
|
if (!value) {
|
|
62
107
|
return null;
|
|
63
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/validators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/validators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAmE;AA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,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE;YAC9C,OAAO,+BAA+B,CAAA;SACvC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
|
package/v1/types/crypto.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Secp256K1CryptoConfiguration } from '@airgap/module-kit';
|
|
2
|
-
export type MinaCryptoConfiguration = Secp256K1CryptoConfiguration;
|
|
2
|
+
export declare type MinaCryptoConfiguration = Secp256K1CryptoConfiguration;
|
package/v1/types/protocol.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProtocolNetwork } from '@airgap/module-kit';
|
|
2
|
-
export type MinaUnits = 'MINA';
|
|
3
|
-
export type MinaNetworkType = 'mainnet' | 'testnet';
|
|
2
|
+
export declare type MinaUnits = 'MINA';
|
|
3
|
+
export declare type MinaNetworkType = 'mainnet' | 'testnet';
|
|
4
4
|
export interface MinaProtocolNetwork extends ProtocolNetwork {
|
|
5
5
|
blockExplorerApi: string;
|
|
6
6
|
minaType: MinaNetworkType;
|
|
@@ -18,7 +18,7 @@ export interface MinaLegacySignature {
|
|
|
18
18
|
field: string;
|
|
19
19
|
scalar: string;
|
|
20
20
|
}
|
|
21
|
-
export type MinaSignature = MinaRawSignature | MinaLegacySignature;
|
|
21
|
+
export declare type MinaSignature = MinaRawSignature | MinaLegacySignature;
|
|
22
22
|
export interface MinaUnsignedTransaction extends UnsignedTransaction {
|
|
23
23
|
networkType: MinaNetworkType;
|
|
24
24
|
data: MinaPayment;
|
package/v1/utils/key.d.ts
CHANGED