@airgap/groestlcoin 0.13.8 → 0.13.9-beta.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/airgap-coinlib-groestlcoin.min.js +16 -0
- package/package.json +5 -5
- package/v1/module/GroestlcoinModule.d.ts +14 -7
- package/v1/module/GroestlcoinModule.js +34 -13
- package/v1/module/GroestlcoinModule.js.map +1 -1
- package/v1/protocol/GroestlcoinProtocol.d.ts +1 -0
- package/v1/protocol/GroestlcoinProtocol.js +7 -0
- package/v1/protocol/GroestlcoinProtocol.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.
|
|
3
|
+
"version": "0.13.9-beta.0",
|
|
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.9-beta.0",
|
|
35
|
+
"@airgap/coinlib-core": "^0.13.9-beta.0",
|
|
36
|
+
"@airgap/module-kit": "^0.13.9-beta.0",
|
|
37
|
+
"@airgap/serializer": "^0.13.9-beta.0"
|
|
38
38
|
},
|
|
39
39
|
"localDependencies": {
|
|
40
40
|
"groestlcoinjs-message": "2.1.0"
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MainProtocolSymbols } from '@airgap/coinlib-core';
|
|
2
|
+
import { AirGapModule, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@airgap/module-kit';
|
|
2
3
|
import { BlockExplorer } from '@airgap/module-kit/block-explorer/block-explorer';
|
|
3
4
|
import { OfflineProtocol, OnlineProtocol } from '@airgap/module-kit/protocol/protocol';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
declare type SupportedProtocols = MainProtocolSymbols.GRS;
|
|
6
|
+
export declare class GroestlcoinModule implements AirGapModule<{
|
|
7
|
+
Protocols: SupportedProtocols;
|
|
8
|
+
}> {
|
|
9
|
+
private readonly networkRegistries;
|
|
10
|
+
readonly supportedProtocols: Record<SupportedProtocols, ProtocolConfiguration>;
|
|
11
|
+
createOfflineProtocol(identifier: SupportedProtocols): Promise<OfflineProtocol | undefined>;
|
|
12
|
+
createOnlineProtocol(identifier: SupportedProtocols, networkId?: string): Promise<OnlineProtocol | undefined>;
|
|
13
|
+
createBlockExplorer(identifier: SupportedProtocols, networkId?: string): Promise<BlockExplorer | undefined>;
|
|
14
|
+
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
15
|
+
private createProtocol;
|
|
10
16
|
}
|
|
17
|
+
export {};
|
|
@@ -42,37 +42,43 @@ 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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
var _a;
|
|
49
|
+
this.networkRegistries = (_a = {},
|
|
50
|
+
_a[coinlib_core_1.MainProtocolSymbols.GRS] = new module_kit_1.ModuleNetworkRegistry({
|
|
51
|
+
supportedNetworks: [GroestlcoinProtocol_1.GROESTLCOIN_MAINNET_PROTOCOL_NETWORK, GroestlcoinProtocol_1.GROESTLCOIN_TESTNET_PROTOCOL_NETWORK]
|
|
52
|
+
}),
|
|
53
|
+
_a);
|
|
54
|
+
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
51
55
|
}
|
|
52
|
-
GroestlcoinModule.prototype.createOfflineProtocol = function () {
|
|
56
|
+
GroestlcoinModule.prototype.createOfflineProtocol = function (identifier) {
|
|
53
57
|
return __awaiter(this, void 0, void 0, function () {
|
|
54
58
|
return __generator(this, function (_a) {
|
|
55
|
-
return [2 /*return*/,
|
|
59
|
+
return [2 /*return*/, this.createProtocol(identifier)];
|
|
56
60
|
});
|
|
57
61
|
});
|
|
58
62
|
};
|
|
59
|
-
GroestlcoinModule.prototype.createOnlineProtocol = function (networkId) {
|
|
63
|
+
GroestlcoinModule.prototype.createOnlineProtocol = function (identifier, networkId) {
|
|
64
|
+
var _a;
|
|
60
65
|
return __awaiter(this, void 0, void 0, function () {
|
|
61
66
|
var network;
|
|
62
|
-
return __generator(this, function (
|
|
63
|
-
network = this.
|
|
67
|
+
return __generator(this, function (_b) {
|
|
68
|
+
network = (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkId);
|
|
64
69
|
if (network === undefined) {
|
|
65
70
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN, 'Protocol network type not supported.');
|
|
66
71
|
}
|
|
67
|
-
return [2 /*return*/, (
|
|
72
|
+
return [2 /*return*/, this.createProtocol(identifier, network)];
|
|
68
73
|
});
|
|
69
74
|
});
|
|
70
75
|
};
|
|
71
|
-
GroestlcoinModule.prototype.createBlockExplorer = function (networkId) {
|
|
76
|
+
GroestlcoinModule.prototype.createBlockExplorer = function (identifier, networkId) {
|
|
77
|
+
var _a;
|
|
72
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
73
79
|
var network;
|
|
74
|
-
return __generator(this, function (
|
|
75
|
-
network = this.
|
|
80
|
+
return __generator(this, function (_b) {
|
|
81
|
+
network = (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkId);
|
|
76
82
|
if (network === undefined) {
|
|
77
83
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN, 'Block Explorer network type not supported.');
|
|
78
84
|
}
|
|
@@ -86,6 +92,21 @@ var GroestlcoinModule = /** @class */ (function () {
|
|
|
86
92
|
});
|
|
87
93
|
});
|
|
88
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
|
+
};
|
|
102
|
+
GroestlcoinModule.prototype.createProtocol = function (identifier, network) {
|
|
103
|
+
switch (identifier) {
|
|
104
|
+
case coinlib_core_1.MainProtocolSymbols.GRS:
|
|
105
|
+
return (0, GroestlcoinProtocol_1.createGroestlcoinProtocol)({ network: network });
|
|
106
|
+
default:
|
|
107
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN, "Protocol ".concat(identifier, " not supported."));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
89
110
|
return GroestlcoinModule;
|
|
90
111
|
}());
|
|
91
112
|
exports.GroestlcoinModule = GroestlcoinModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroestlcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/GroestlcoinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;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4C,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"}
|
|
@@ -26,6 +26,7 @@ export declare class GroestlcoinProtocolImpl implements GroestlcoinProtocol {
|
|
|
26
26
|
encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey | ExtendedPublicKey): Promise<string>;
|
|
27
27
|
getKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<KeyPair>;
|
|
28
28
|
getExtendedKeyPairFromSecret(secret: Secret, derivationPath?: string | undefined): Promise<ExtendedKeyPair>;
|
|
29
|
+
deriveFromExtendedSecretKey(extendedSecretKey: ExtendedSecretKey, visibilityIndex: number, addressIndex: number): Promise<SecretKey>;
|
|
29
30
|
signTransactionWithSecretKey(transaction: GroestlcoinUnsignedTransaction, secretKey: SecretKey | ExtendedSecretKey): Promise<GroestlcoinSignedTransaction>;
|
|
30
31
|
signMessageWithKeyPair(message: string, keyPair: KeyPair | ExtendedKeyPair): Promise<Signature>;
|
|
31
32
|
decryptAsymmetricWithKeyPair(payload: string, keyPair: KeyPair | ExtendedKeyPair): Promise<string>;
|
|
@@ -187,6 +187,13 @@ var GroestlcoinProtocolImpl = /** @class */ (function () {
|
|
|
187
187
|
});
|
|
188
188
|
});
|
|
189
189
|
};
|
|
190
|
+
GroestlcoinProtocolImpl.prototype.deriveFromExtendedSecretKey = function (extendedSecretKey, visibilityIndex, addressIndex) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
192
|
+
return __generator(this, function (_a) {
|
|
193
|
+
return [2 /*return*/, this.bitcoinProtocol.deriveFromExtendedSecretKey(extendedSecretKey, visibilityIndex, addressIndex)];
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
};
|
|
190
197
|
GroestlcoinProtocolImpl.prototype.signTransactionWithSecretKey = function (transaction, secretKey) {
|
|
191
198
|
return __awaiter(this, void 0, void 0, function () {
|
|
192
199
|
return __generator(this, function (_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroestlcoinProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/GroestlcoinProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+EAAiF;AACjF,qDAA0D;AAC1D,aAAa;AACb,iJAAoI;AACpI,aAAa;AACb,4HAA+G;AAC/G,iDAsB2B;AA6B3B,iBAAiB;AAEjB,IAAM,yBAAyB,GAAW,aAAa,CAAA;AAEvD;IAIE,iCAAY,OAAqD;QAgBjE,SAAS;QAEQ,UAAK,GAA4C;YAChE,GAAG,EAAE;gBACH,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;gBACvC,QAAQ,EAAE,CAAC;aACZ;YACD,IAAI,EAAE;gBACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;gBACzB,QAAQ,EAAE,CAAC;aACZ;YACD,OAAO,EAAE;gBACP,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAA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@
|
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,8FAA8F;AAC9F,sDAA8D;AAG9D,iDAAgH;AAIhH,mFAKkD;AAElD,4EAAoF;AACpF,sDAA+D;AAE/D,IAAM,iCAAiC,GAAe,OAAO,CAAC,+DAA+D,CAAC,CAAA;AAC9H,IAAM,kCAAkC,GAAe,OAAO,CAAC,gEAAgE,CAAC,CAAA;AAEhI;IAgBE;QAfgB,YAAO,GAA4B;YACjD;gBACE,IAAI,EAAE,2BAAc,CAAC,sBAAsB;gBAC3C,MAAM,EAAE,EAAE,MAAM,EAAE,iCAAiC,EAAE;gBACrD,kBAAkB,EAAE,kCAAmB,CAAC,GAAG;aAC5C;YACD;gBACE,IAAI,EAAE,2BAAc,CAAC,uBAAuB;gBAC5C,MAAM,EAAE,EAAE,MAAM,EAAE,kCAAkC,EAAE;gBACtD,kBAAkB,EAAE,kCAAmB,CAAC,GAAG;aAC5C;SACF,CAAA;QAEgB,oCAA+B,GAAoC,IAAI,uDAA+B,EAAE,CAAA;QAGvH,MAAM,CAAC,IAAI,CAAC,kCAAqB,CAAC,CAAC,OAAO,CAAC,UAAC,GAAW;YACrD,qBAAU,CAAC,GAAG,CAAC,GAAG,kCAAqB,CAAC,GAAyC,CAAC,CAAA;QACpF,CAAC,CAAC,CAAA;IACJ,CAAC;IAEY,mEAAwB,GAArC,UACE,UAAkB,EAClB,mBAAwC,EACxC,SAAiB,EACjB,WAAoB;;;gBAEpB,QAAQ,UAAU,EAAE;oBAClB,KAAK,kCAAmB,CAAC,GAAG;wBAC1B,sBAAO,IAAA,+DAAu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AAE;oBAClB,KAAK,kCAAmB,CAAC,GAAG;wBAC1B,sBAAO,IAAA,kEAA0C,EAAC,uBAA6D,CAAC,EAAA;oBAClH;wBACE,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,WAAW,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;iBACzF;;;;KACF;IAEY,0EAA+B,GAA5C,UAA6C,UAAkB,EAAE,uBAAgD;;;;;;wBACvG,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"}
|