@airgap/groestlcoin 0.13.8-beta.5 → 0.13.8-beta.7
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/airgap-coinlib-groestlcoin.min.js +16 -0
- package/package.json +5 -5
- package/v1/module/GroestlcoinModule.d.ts +2 -1
- package/v1/module/GroestlcoinModule.js +8 -0
- package/v1/module/GroestlcoinModule.js.map +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-groestlcoin.d.ts +1 -1
- package/v1/serializer/v3/serializer-companion.d.ts +14 -0
- package/v1/serializer/v3/serializer-companion.js +173 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +1 -4
- package/v1/serializer/v3/validators/transaction-validator.js +1 -10
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
|
@@ -30378,6 +30378,15 @@ var BitcoinProtocol = /** @class */ (function () {
|
|
|
30378
30378
|
});
|
|
30379
30379
|
});
|
|
30380
30380
|
};
|
|
30381
|
+
BitcoinProtocol.prototype.getExtendedPublicKeyFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
30382
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
30383
|
+
var secret;
|
|
30384
|
+
return __generator(this, function (_a) {
|
|
30385
|
+
secret = (0, index_2.mnemonicToSeed)(mnemonic, password);
|
|
30386
|
+
return [2 /*return*/, this.getExtendedPublicKeyFromHexSecret(secret, derivationPath)];
|
|
30387
|
+
});
|
|
30388
|
+
});
|
|
30389
|
+
};
|
|
30381
30390
|
BitcoinProtocol.prototype.getExtendedPrivateKeyFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
30382
30391
|
return __awaiter(this, void 0, void 0, function () {
|
|
30383
30392
|
var secret;
|
|
@@ -30405,6 +30414,13 @@ var BitcoinProtocol = /** @class */ (function () {
|
|
|
30405
30414
|
});
|
|
30406
30415
|
});
|
|
30407
30416
|
};
|
|
30417
|
+
BitcoinProtocol.prototype.getExtendedPublicKeyFromHexSecret = function (secret, derivationPath) {
|
|
30418
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
30419
|
+
return __generator(this, function (_a) {
|
|
30420
|
+
return [2 /*return*/, this.getPublicKeyFromHexSecret(secret, derivationPath)];
|
|
30421
|
+
});
|
|
30422
|
+
});
|
|
30423
|
+
};
|
|
30408
30424
|
BitcoinProtocol.prototype.getExtendedPrivateKeyFromHexSecret = function (secret, derivationPath) {
|
|
30409
30425
|
return __awaiter(this, void 0, void 0, function () {
|
|
30410
30426
|
var bitcoinNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/groestlcoin",
|
|
3
|
-
"version": "0.13.8-beta.
|
|
3
|
+
"version": "0.13.8-beta.7",
|
|
4
4
|
"description": "The @airgap/groestlcoin is a Groestlcoin implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
},
|
|
32
32
|
"author": "Papers GmbH <contact@papers.ch> (https://papers.ch)",
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@airgap/bitcoin": "^0.13.
|
|
35
|
-
"@airgap/coinlib-core": "^0.13.
|
|
36
|
-
"@airgap/module-kit": "^0.13.
|
|
37
|
-
"@airgap/serializer": "^0.13.
|
|
34
|
+
"@airgap/bitcoin": "^0.13.8-beta.6",
|
|
35
|
+
"@airgap/coinlib-core": "^0.13.8-beta.6",
|
|
36
|
+
"@airgap/module-kit": "^0.13.8-beta.6",
|
|
37
|
+
"@airgap/serializer": "^0.13.8-beta.6"
|
|
38
38
|
},
|
|
39
39
|
"localDependencies": {
|
|
40
40
|
"groestlcoinjs-message": "2.1.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MainProtocolSymbols } from '@airgap/coinlib-core';
|
|
2
|
-
import { AirGapModule, ProtocolConfiguration } from '@airgap/module-kit';
|
|
2
|
+
import { AirGapModule, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@airgap/module-kit';
|
|
3
3
|
import { BlockExplorer } from '@airgap/module-kit/block-explorer/block-explorer';
|
|
4
4
|
import { OfflineProtocol, OnlineProtocol } from '@airgap/module-kit/protocol/protocol';
|
|
5
5
|
declare type SupportedProtocols = MainProtocolSymbols.GRS;
|
|
@@ -11,6 +11,7 @@ export declare class GroestlcoinModule implements AirGapModule<{
|
|
|
11
11
|
createOfflineProtocol(identifier: SupportedProtocols): Promise<OfflineProtocol | undefined>;
|
|
12
12
|
createOnlineProtocol(identifier: SupportedProtocols, networkId?: string): Promise<OnlineProtocol | undefined>;
|
|
13
13
|
createBlockExplorer(identifier: SupportedProtocols, networkId?: string): Promise<BlockExplorer | undefined>;
|
|
14
|
+
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
14
15
|
private createProtocol;
|
|
15
16
|
}
|
|
16
17
|
export {};
|
|
@@ -42,6 +42,7 @@ var errors_1 = require("@airgap/coinlib-core/errors");
|
|
|
42
42
|
var module_kit_1 = require("@airgap/module-kit");
|
|
43
43
|
var CryptoIDBlockExplorer_1 = require("../block-explorer/CryptoIDBlockExplorer");
|
|
44
44
|
var GroestlcoinProtocol_1 = require("../protocol/GroestlcoinProtocol");
|
|
45
|
+
var serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
45
46
|
var GroestlcoinModule = /** @class */ (function () {
|
|
46
47
|
function GroestlcoinModule() {
|
|
47
48
|
var _a;
|
|
@@ -91,6 +92,13 @@ var GroestlcoinModule = /** @class */ (function () {
|
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
94
|
};
|
|
95
|
+
GroestlcoinModule.prototype.createV3SerializerCompanion = function () {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
return [2 /*return*/, new serializer_companion_1.GroestlcoinV3SerializerCompanion()];
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
94
102
|
GroestlcoinModule.prototype.createProtocol = function (identifier, network) {
|
|
95
103
|
switch (identifier) {
|
|
96
104
|
case coinlib_core_1.MainProtocolSymbols.GRS:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroestlcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/GroestlcoinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"GroestlcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/GroestlcoinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,iDAO2B;AAG3B,iFAAqG;AACrG,uEAIwC;AACxC,8EAAwF;AAIxF;IAAA;;QACmB,sBAAiB;YAChC,GAAC,kCAAmB,CAAC,GAAG,IAAG,IAAI,kCAAqB,CAAC;gBACnD,iBAAiB,EAAE,CAAC,0DAAoC,EAAE,0DAAoC,CAAC;aAChG,CAAC;gBACH;QACe,uBAAkB,GAAsD,IAAA,qCAAwB,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAwC1I,CAAC;IAtCc,iDAAqB,GAAlC,UAAmC,UAA8B;;;gBAC/D,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAA;;;KACvC;IAEY,gDAAoB,GAAjC,UAAkC,UAA8B,EAAE,SAAkB;;;;;gBAC5E,OAAO,GAAgC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,SAAS,CAAC,CAAA;gBACvG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,WAAW,EAAE,sCAAsC,CAAC,CAAA;iBAC9F;gBAED,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;;KAChD;IAEY,+CAAmB,GAAhC,UAAiC,UAA8B,EAAE,SAAkB;;;;;gBAC3E,OAAO,GAAgC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,SAAS,CAAC,CAAA;gBACvG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,WAAW,EAAE,4CAA4C,CAAC,CAAA;iBACpG;gBAED,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;oBAC9B,sBAAO,IAAI,6CAAqB,CAAC,4CAAoB,CAAC,EAAA;iBACvD;qBAAM;oBACL,sBAAO,IAAI,6CAAqB,EAAE,EAAA;iBACnC;;;;KACF;IAEY,uDAA2B,GAAxC;;;gBACE,sBAAO,IAAI,uDAAgC,EAAE,EAAA;;;KAC9C;IAEO,0CAAc,GAAtB,UAAuB,UAA8B,EAAE,OAAyB;QAC9E,QAAQ,UAAU,EAAE;YAClB,KAAK,kCAAmB,CAAC,GAAG;gBAC1B,OAAO,IAAA,+CAAyB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;YAC/C;gBACE,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,WAAW,EAAE,mBAAY,UAAU,oBAAiB,CAAC,CAAA;SACjG;IACH,CAAC;IACH,wBAAC;AAAD,CAAC,AA9CD,IA8CC;AA9CY,8CAAiB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BitcoinTransactionSignRequest } from '@airgap/bitcoin/v1';
|
|
2
2
|
import { GroestlcoinUnsignedTransaction } from '../../../../types/transaction';
|
|
3
3
|
export interface GroestlcoinTransactionSignRequest extends BitcoinTransactionSignRequest {
|
|
4
|
-
transaction: GroestlcoinUnsignedTransaction
|
|
4
|
+
transaction: Omit<GroestlcoinUnsignedTransaction, 'type'>;
|
|
5
5
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AirGapV3SerializerCompanion, SignedTransaction, UnsignedTransaction } from '@airgap/module-kit';
|
|
2
|
+
import { V3SchemaConfiguration } from '@airgap/module-kit/types/serializer';
|
|
3
|
+
import { TransactionSignRequest, TransactionSignResponse } from '@airgap/serializer';
|
|
4
|
+
export declare class GroestlcoinV3SerializerCompanion implements AirGapV3SerializerCompanion {
|
|
5
|
+
readonly schemas: V3SchemaConfiguration[];
|
|
6
|
+
private readonly groestlcoinTransactionValidator;
|
|
7
|
+
constructor();
|
|
8
|
+
toTransactionSignRequest(identifier: string, unsignedTransaction: UnsignedTransaction, publicKey: string, callbackUrl?: string): Promise<TransactionSignRequest>;
|
|
9
|
+
fromTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<UnsignedTransaction>;
|
|
10
|
+
validateTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<boolean>;
|
|
11
|
+
toTransactionSignResponse(identifier: string, signedTransaction: SignedTransaction, accountIdentifier: string): Promise<TransactionSignResponse>;
|
|
12
|
+
fromTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<SignedTransaction>;
|
|
13
|
+
validateTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<boolean>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
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
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.GroestlcoinV3SerializerCompanion = void 0;
|
|
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 groestlcoinTransactionSignRequest = require('./schemas/generated/transaction-sign-request-groestlcoin.json');
|
|
48
|
+
var groestlcoinTransactionSignResponse = require('./schemas/generated/transaction-sign-response-groestlcoin.json');
|
|
49
|
+
var GroestlcoinV3SerializerCompanion = /** @class */ (function () {
|
|
50
|
+
function GroestlcoinV3SerializerCompanion() {
|
|
51
|
+
this.schemas = [
|
|
52
|
+
{
|
|
53
|
+
type: serializer_1.IACMessageType.TransactionSignRequest,
|
|
54
|
+
schema: { schema: groestlcoinTransactionSignRequest },
|
|
55
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.GRS
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: serializer_1.IACMessageType.TransactionSignResponse,
|
|
59
|
+
schema: { schema: groestlcoinTransactionSignResponse },
|
|
60
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.GRS
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
this.groestlcoinTransactionValidator = new transaction_validator_1.GroestlcoinTransactionValidator();
|
|
64
|
+
Object.keys(validators_1.groestlcoinValidators).forEach(function (key) {
|
|
65
|
+
validate_1.validators[key] = validators_1.groestlcoinValidators[key];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
GroestlcoinV3SerializerCompanion.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.GRS:
|
|
73
|
+
return [2 /*return*/, (0, transaction_converter_1.groestlcoinUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl)];
|
|
74
|
+
default:
|
|
75
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.GROESTLCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
76
|
+
}
|
|
77
|
+
return [2 /*return*/];
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
GroestlcoinV3SerializerCompanion.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.GRS:
|
|
86
|
+
return [2 /*return*/, (0, transaction_converter_1.groestlcoinTransactionSignRequestToUnsigned)(transactionSignRequest)];
|
|
87
|
+
default:
|
|
88
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.GROESTLCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
89
|
+
}
|
|
90
|
+
return [2 /*return*/];
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
GroestlcoinV3SerializerCompanion.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.GRS: 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.groestlcoinTransactionValidator.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.GROESTLCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
GroestlcoinV3SerializerCompanion.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.GRS:
|
|
124
|
+
return [2 /*return*/, (0, transaction_converter_1.groestlcoinSignedTransactionToResponse)(signedTransaction, accountIdentifier)];
|
|
125
|
+
default:
|
|
126
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.GROESTLCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
127
|
+
}
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
GroestlcoinV3SerializerCompanion.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.GRS:
|
|
137
|
+
return [2 /*return*/, (0, transaction_converter_1.groestlcoinTransactionSignResponseToSigned)(transactionSignResponse)];
|
|
138
|
+
default:
|
|
139
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.GROESTLCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
140
|
+
}
|
|
141
|
+
return [2 /*return*/];
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
GroestlcoinV3SerializerCompanion.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.GRS: 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.groestlcoinTransactionValidator.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.GROESTLCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
return GroestlcoinV3SerializerCompanion;
|
|
171
|
+
}());
|
|
172
|
+
exports.GroestlcoinV3SerializerCompanion = GroestlcoinV3SerializerCompanion;
|
|
173
|
+
//# sourceMappingURL=serializer-companion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer-companion.js","sourceRoot":"","sources":["../../../../src/v1/serializer/v3/serializer-companion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BACvG,KAAA,UAAU,CAAA;;iCACX,kCAAmB,CAAC,GAAG,CAAC,CAAxB,wBAAuB;;;;;wBAExB,qBAAM,IAAI,CAAC,+BAA+B,CAAC,yBAAyB,CAClE,uBAA6D,CAC9D,EAAA;;wBAFD,SAEC,CAAA;wBAED,sBAAO,IAAI,EAAA;;;wBAEX,sBAAO,KAAK,EAAA;4BAGd,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,WAAW,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;;;;KAE3F;IACH,uCAAC;AAAD,CAAC,AAxGD,IAwGC;AAxGY,4EAAgC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { BitcoinTransactionValidator } from '@airgap/bitcoin/v1';
|
|
2
|
-
import { TransactionValidator
|
|
2
|
+
import { TransactionValidator } from '@airgap/serializer';
|
|
3
3
|
export declare class GroestlcoinTransactionValidator extends BitcoinTransactionValidator implements TransactionValidator {
|
|
4
4
|
}
|
|
5
|
-
export declare class GroestlcoinTransactionValidatorFactory implements TransactionValidatorFactory<GroestlcoinTransactionValidator> {
|
|
6
|
-
create(): GroestlcoinTransactionValidator;
|
|
7
|
-
}
|
|
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.GroestlcoinTransactionValidator = void 0;
|
|
19
19
|
// tslint:disable: max-classes-per-file
|
|
20
20
|
var v1_1 = require("@airgap/bitcoin/v1");
|
|
21
21
|
var GroestlcoinTransactionValidator = /** @class */ (function (_super) {
|
|
@@ -26,13 +26,4 @@ var GroestlcoinTransactionValidator = /** @class */ (function (_super) {
|
|
|
26
26
|
return GroestlcoinTransactionValidator;
|
|
27
27
|
}(v1_1.BitcoinTransactionValidator));
|
|
28
28
|
exports.GroestlcoinTransactionValidator = GroestlcoinTransactionValidator;
|
|
29
|
-
var GroestlcoinTransactionValidatorFactory = /** @class */ (function () {
|
|
30
|
-
function GroestlcoinTransactionValidatorFactory() {
|
|
31
|
-
}
|
|
32
|
-
GroestlcoinTransactionValidatorFactory.prototype.create = function () {
|
|
33
|
-
return new GroestlcoinTransactionValidator();
|
|
34
|
-
};
|
|
35
|
-
return GroestlcoinTransactionValidatorFactory;
|
|
36
|
-
}());
|
|
37
|
-
exports.GroestlcoinTransactionValidatorFactory = GroestlcoinTransactionValidatorFactory;
|
|
38
29
|
//# 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":";;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,yCAAgE;AAGhE;IAAqD,mDAA2B;IAAhF;;IAAkH,CAAC;IAAD,sCAAC;AAAD,CAAC,AAAnH,CAAqD,gCAA2B,GAAmC;AAAtG,0EAA+B
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,yCAAgE;AAGhE;IAAqD,mDAA2B;IAAhF;;IAAkH,CAAC;IAAD,sCAAC;AAAD,CAAC,AAAnH,CAAqD,gCAA2B,GAAmC;AAAtG,0EAA+B"}
|