@airgap/astar 0.13.11-beta.0 → 0.13.11-beta.1
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 +11 -10
- package/airgap-coinlib-astar.min.js +0 -85373
- package/index.d.ts +0 -1
- package/index.js +0 -18
- package/index.js.map +0 -1
- package/v0/index.d.ts +0 -5
- package/v0/index.js +0 -31
- package/v0/index.js.map +0 -1
- package/v0/protocol/astar/AstarProtocol.d.ts +0 -22
- package/v0/protocol/astar/AstarProtocol.js +0 -79
- package/v0/protocol/astar/AstarProtocol.js.map +0 -1
- package/v0/protocol/astar/AstarProtocolOptions.d.ts +0 -28
- package/v0/protocol/astar/AstarProtocolOptions.js +0 -96
- package/v0/protocol/astar/AstarProtocolOptions.js.map +0 -1
- package/v0/protocol/shiden/ShidenProtocol.d.ts +0 -19
- package/v0/protocol/shiden/ShidenProtocol.js +0 -72
- package/v0/protocol/shiden/ShidenProtocol.js.map +0 -1
- package/v0/protocol/shiden/ShidenProtocolOptions.d.ts +0 -22
- package/v0/protocol/shiden/ShidenProtocolOptions.js +0 -80
- package/v0/protocol/shiden/ShidenProtocolOptions.js.map +0 -1
- package/v1/block-explorer/SubscanBlockExplorer.d.ts +0 -3
- package/v1/block-explorer/SubscanBlockExplorer.js +0 -16
- package/v1/block-explorer/SubscanBlockExplorer.js.map +0 -1
- package/v1/controller/AstarAccountController.d.ts +0 -5
- package/v1/controller/AstarAccountController.js +0 -28
- package/v1/controller/AstarAccountController.js.map +0 -1
- package/v1/controller/AstarTransactionController.d.ts +0 -5
- package/v1/controller/AstarTransactionController.js +0 -28
- package/v1/controller/AstarTransactionController.js.map +0 -1
- package/v1/index.d.ts +0 -10
- package/v1/index.js +0 -13
- package/v1/index.js.map +0 -1
- package/v1/module/AstarModule.d.ts +0 -17
- package/v1/module/AstarModule.js +0 -121
- package/v1/module/AstarModule.js.map +0 -1
- package/v1/module.d.ts +0 -3
- package/v1/module.js +0 -24
- package/v1/module.js.map +0 -1
- package/v1/node/AstarNodeClient.d.ts +0 -4
- package/v1/node/AstarNodeClient.js +0 -28
- package/v1/node/AstarNodeClient.js.map +0 -1
- package/v1/protocol/AstarBaseProtocol.d.ts +0 -12
- package/v1/protocol/AstarBaseProtocol.js +0 -96
- package/v1/protocol/AstarBaseProtocol.js.map +0 -1
- package/v1/protocol/AstarProtocol.d.ts +0 -14
- package/v1/protocol/AstarProtocol.js +0 -117
- package/v1/protocol/AstarProtocol.js.map +0 -1
- package/v1/protocol/ShidenProtocol.d.ts +0 -14
- package/v1/protocol/ShidenProtocol.js +0 -110
- package/v1/protocol/ShidenProtocol.js.map +0 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +0 -7
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +0 -21
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.d.ts +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.d.ts +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.js.map +0 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-astar.json +0 -36
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-astar.json +0 -19
- package/v1/serializer/v3/serializer-companion.d.ts +0 -14
- package/v1/serializer/v3/serializer-companion.js +0 -189
- package/v1/serializer/v3/serializer-companion.js.map +0 -1
- package/v1/serializer/v3/validators/transaction-validator.d.ts +0 -4
- package/v1/serializer/v3/validators/transaction-validator.js +0 -28
- package/v1/serializer/v3/validators/transaction-validator.js.map +0 -1
- package/v1/serializer/v3/validators/validators.d.ts +0 -4
- package/v1/serializer/v3/validators/validators.js +0 -6
- package/v1/serializer/v3/validators/validators.js.map +0 -1
- package/v1/types/configuration.d.ts +0 -4
- package/v1/types/configuration.js +0 -3
- package/v1/types/configuration.js.map +0 -1
- package/v1/types/protocol.d.ts +0 -12
- package/v1/types/protocol.js +0 -3
- package/v1/types/protocol.js.map +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SubstrateSignedTransaction, SubstrateUnsignedTransaction } from '@airgap/substrate/v1';
|
|
2
|
-
import { AstarTransactionSignRequest } from '../definitions/transaction-sign-request-astar';
|
|
3
|
-
import { AstarTransactionSignResponse } from '../definitions/transaction-sign-response-astar';
|
|
4
|
-
export declare function astarUnsignedTransactionToRequest(unsigned: SubstrateUnsignedTransaction, publicKey: string, callbackUrl?: string): AstarTransactionSignRequest;
|
|
5
|
-
export declare function astarSignedTransactionToResponse(signed: SubstrateSignedTransaction, accountIdentifier: string): AstarTransactionSignResponse;
|
|
6
|
-
export declare function astarTransactionSignRequestToUnsigned(request: AstarTransactionSignRequest): SubstrateUnsignedTransaction;
|
|
7
|
-
export declare function astarTransactionSignResponseToSigned(response: AstarTransactionSignResponse): SubstrateSignedTransaction;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.astarTransactionSignResponseToSigned = exports.astarTransactionSignRequestToUnsigned = exports.astarSignedTransactionToResponse = exports.astarUnsignedTransactionToRequest = void 0;
|
|
4
|
-
var v1_1 = require("@airgap/substrate/v1");
|
|
5
|
-
function astarUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
6
|
-
return (0, v1_1.substrateUnsignedTransactionToRequest)(unsigned, publicKey, callbackUrl);
|
|
7
|
-
}
|
|
8
|
-
exports.astarUnsignedTransactionToRequest = astarUnsignedTransactionToRequest;
|
|
9
|
-
function astarSignedTransactionToResponse(signed, accountIdentifier) {
|
|
10
|
-
return (0, v1_1.substrateSignedTransactionToResponse)(signed, accountIdentifier);
|
|
11
|
-
}
|
|
12
|
-
exports.astarSignedTransactionToResponse = astarSignedTransactionToResponse;
|
|
13
|
-
function astarTransactionSignRequestToUnsigned(request) {
|
|
14
|
-
return (0, v1_1.substrateTransactionSignRequestToUnsigned)(request);
|
|
15
|
-
}
|
|
16
|
-
exports.astarTransactionSignRequestToUnsigned = astarTransactionSignRequestToUnsigned;
|
|
17
|
-
function astarTransactionSignResponseToSigned(response) {
|
|
18
|
-
return (0, v1_1.substrateTransactionSignResponseToSigned)(response);
|
|
19
|
-
}
|
|
20
|
-
exports.astarTransactionSignResponseToSigned = astarTransactionSignResponseToSigned;
|
|
21
|
-
//# sourceMappingURL=transaction-converter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":";;;AAAA,2CAO6B;AAK7B,SAAgB,iCAAiC,CAC/C,QAAsC,EACtC,SAAiB,EACjB,WAAoB;IAEpB,OAAO,IAAA,0CAAqC,EAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAA;AAChF,CAAC;AAND,8EAMC;AAED,SAAgB,gCAAgC,CAC9C,MAAkC,EAClC,iBAAyB;IAEzB,OAAO,IAAA,yCAAoC,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;AACxE,CAAC;AALD,4EAKC;AAED,SAAgB,qCAAqC,CAAC,OAAoC;IACxF,OAAO,IAAA,8CAAyC,EAAC,OAAO,CAAC,CAAA;AAC3D,CAAC;AAFD,sFAEC;AAED,SAAgB,oCAAoC,CAAC,QAAsC;IACzF,OAAO,IAAA,6CAAwC,EAAC,QAAQ,CAAC,CAAA;AAC3D,CAAC;AAFD,oFAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-sign-request-astar.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-sign-response-astar.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.ts"],"names":[],"mappings":""}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/AstarTransactionSignRequest",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"definitions": {
|
|
5
|
-
"AstarTransactionSignRequest": {
|
|
6
|
-
"additionalProperties": false,
|
|
7
|
-
"properties": {
|
|
8
|
-
"callbackURL": {
|
|
9
|
-
"type": "string"
|
|
10
|
-
},
|
|
11
|
-
"publicKey": {
|
|
12
|
-
"type": "string"
|
|
13
|
-
},
|
|
14
|
-
"transaction": {
|
|
15
|
-
"$ref": "#/definitions/SubstrateUnsignedTransaction"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"required": ["publicKey", "transaction"],
|
|
19
|
-
"type": "object"
|
|
20
|
-
},
|
|
21
|
-
"SubstrateUnsignedTransaction": {
|
|
22
|
-
"additionalProperties": false,
|
|
23
|
-
"properties": {
|
|
24
|
-
"encoded": {
|
|
25
|
-
"type": "string"
|
|
26
|
-
},
|
|
27
|
-
"type": {
|
|
28
|
-
"enum": ["unsigned"],
|
|
29
|
-
"type": "string"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"required": ["encoded", "type"],
|
|
33
|
-
"type": "object"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/AstarTransactionSignResponse",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"definitions": {
|
|
5
|
-
"AstarTransactionSignResponse": {
|
|
6
|
-
"additionalProperties": false,
|
|
7
|
-
"properties": {
|
|
8
|
-
"accountIdentifier": {
|
|
9
|
-
"type": "string"
|
|
10
|
-
},
|
|
11
|
-
"transaction": {
|
|
12
|
-
"type": "string"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"required": ["accountIdentifier", "transaction"],
|
|
16
|
-
"type": "object"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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 AstarV3SerializerCompanion implements AirGapV3SerializerCompanion {
|
|
5
|
-
readonly schemas: V3SchemaConfiguration[];
|
|
6
|
-
private readonly astarTransactionValidator;
|
|
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
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
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.AstarV3SerializerCompanion = 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 astarTransactionSignRequest = require('./schemas/generated/transaction-sign-request-astar.json');
|
|
48
|
-
var astarTransactionSignResponse = require('./schemas/generated/transaction-sign-response-astar.json');
|
|
49
|
-
var AstarV3SerializerCompanion = /** @class */ (function () {
|
|
50
|
-
function AstarV3SerializerCompanion() {
|
|
51
|
-
this.schemas = [
|
|
52
|
-
{
|
|
53
|
-
type: serializer_1.IACMessageType.TransactionSignRequest,
|
|
54
|
-
schema: { schema: astarTransactionSignRequest },
|
|
55
|
-
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.ASTAR
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
type: serializer_1.IACMessageType.TransactionSignResponse,
|
|
59
|
-
schema: { schema: astarTransactionSignResponse },
|
|
60
|
-
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.ASTAR
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
type: serializer_1.IACMessageType.TransactionSignRequest,
|
|
64
|
-
schema: { schema: astarTransactionSignRequest },
|
|
65
|
-
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.SHIDEN
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
type: serializer_1.IACMessageType.TransactionSignResponse,
|
|
69
|
-
schema: { schema: astarTransactionSignResponse },
|
|
70
|
-
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.SHIDEN
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
this.astarTransactionValidator = new transaction_validator_1.AstarTransactionValidator();
|
|
74
|
-
Object.keys(validators_1.astarValidators).forEach(function (key) {
|
|
75
|
-
validate_1.validators[key] = validators_1.astarValidators[key];
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
AstarV3SerializerCompanion.prototype.toTransactionSignRequest = function (identifier, unsignedTransaction, publicKey, callbackUrl) {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
-
return __generator(this, function (_a) {
|
|
81
|
-
switch (identifier) {
|
|
82
|
-
case coinlib_core_1.MainProtocolSymbols.ASTAR:
|
|
83
|
-
case coinlib_core_1.MainProtocolSymbols.SHIDEN:
|
|
84
|
-
return [2 /*return*/, (0, transaction_converter_1.astarUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl)];
|
|
85
|
-
default:
|
|
86
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported"));
|
|
87
|
-
}
|
|
88
|
-
return [2 /*return*/];
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
AstarV3SerializerCompanion.prototype.fromTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
return __generator(this, function (_a) {
|
|
95
|
-
switch (identifier) {
|
|
96
|
-
case coinlib_core_1.MainProtocolSymbols.ASTAR:
|
|
97
|
-
case coinlib_core_1.MainProtocolSymbols.SHIDEN:
|
|
98
|
-
return [2 /*return*/, (0, transaction_converter_1.astarTransactionSignRequestToUnsigned)(transactionSignRequest)];
|
|
99
|
-
default:
|
|
100
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported"));
|
|
101
|
-
}
|
|
102
|
-
return [2 /*return*/];
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
AstarV3SerializerCompanion.prototype.validateTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
-
var _a, _b;
|
|
109
|
-
return __generator(this, function (_c) {
|
|
110
|
-
switch (_c.label) {
|
|
111
|
-
case 0:
|
|
112
|
-
_a = identifier;
|
|
113
|
-
switch (_a) {
|
|
114
|
-
case coinlib_core_1.MainProtocolSymbols.ASTAR: return [3 /*break*/, 1];
|
|
115
|
-
case coinlib_core_1.MainProtocolSymbols.SHIDEN: return [3 /*break*/, 1];
|
|
116
|
-
}
|
|
117
|
-
return [3 /*break*/, 4];
|
|
118
|
-
case 1:
|
|
119
|
-
_c.trys.push([1, 3, , 4]);
|
|
120
|
-
return [4 /*yield*/, this.astarTransactionValidator.validateUnsignedTransaction(transactionSignRequest)];
|
|
121
|
-
case 2:
|
|
122
|
-
_c.sent();
|
|
123
|
-
return [2 /*return*/, true];
|
|
124
|
-
case 3:
|
|
125
|
-
_b = _c.sent();
|
|
126
|
-
return [2 /*return*/, false];
|
|
127
|
-
case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported"));
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
AstarV3SerializerCompanion.prototype.toTransactionSignResponse = function (identifier, signedTransaction, accountIdentifier) {
|
|
133
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
-
return __generator(this, function (_a) {
|
|
135
|
-
switch (identifier) {
|
|
136
|
-
case coinlib_core_1.MainProtocolSymbols.ASTAR:
|
|
137
|
-
case coinlib_core_1.MainProtocolSymbols.SHIDEN:
|
|
138
|
-
return [2 /*return*/, (0, transaction_converter_1.astarSignedTransactionToResponse)(signedTransaction, accountIdentifier)];
|
|
139
|
-
default:
|
|
140
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported"));
|
|
141
|
-
}
|
|
142
|
-
return [2 /*return*/];
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
AstarV3SerializerCompanion.prototype.fromTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
147
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
148
|
-
return __generator(this, function (_a) {
|
|
149
|
-
switch (identifier) {
|
|
150
|
-
case coinlib_core_1.MainProtocolSymbols.ASTAR:
|
|
151
|
-
case coinlib_core_1.MainProtocolSymbols.SHIDEN:
|
|
152
|
-
return [2 /*return*/, (0, transaction_converter_1.astarTransactionSignResponseToSigned)(transactionSignResponse)];
|
|
153
|
-
default:
|
|
154
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported"));
|
|
155
|
-
}
|
|
156
|
-
return [2 /*return*/];
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
AstarV3SerializerCompanion.prototype.validateTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
161
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
-
var _a, _b;
|
|
163
|
-
return __generator(this, function (_c) {
|
|
164
|
-
switch (_c.label) {
|
|
165
|
-
case 0:
|
|
166
|
-
_a = identifier;
|
|
167
|
-
switch (_a) {
|
|
168
|
-
case coinlib_core_1.MainProtocolSymbols.ASTAR: return [3 /*break*/, 1];
|
|
169
|
-
case coinlib_core_1.MainProtocolSymbols.SHIDEN: return [3 /*break*/, 1];
|
|
170
|
-
}
|
|
171
|
-
return [3 /*break*/, 4];
|
|
172
|
-
case 1:
|
|
173
|
-
_c.trys.push([1, 3, , 4]);
|
|
174
|
-
return [4 /*yield*/, this.astarTransactionValidator.validateSignedTransaction(transactionSignResponse)];
|
|
175
|
-
case 2:
|
|
176
|
-
_c.sent();
|
|
177
|
-
return [2 /*return*/, true];
|
|
178
|
-
case 3:
|
|
179
|
-
_b = _c.sent();
|
|
180
|
-
return [2 /*return*/, false];
|
|
181
|
-
case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.SUBSTRATE, "Protocol ".concat(identifier, " not supported"));
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
return AstarV3SerializerCompanion;
|
|
187
|
-
}());
|
|
188
|
-
exports.AstarV3SerializerCompanion = AstarV3SerializerCompanion;
|
|
189
|
-
//# sourceMappingURL=serializer-companion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAGhH,mFAKkD;AAClD,4EAA8E;AAC9E,sDAAyD;AAEzD,IAAM,2BAA2B,GAAe,OAAO,CAAC,yDAAyD,CAAC,CAAA;AAClH,IAAM,4BAA4B,GAAe,OAAO,CAAC,0DAA0D,CAAC,CAAA;AAEpH;IA0BE;QAzBgB,YAAO,GAA4B;YACjD;gBACE,IAAI,EAAE,2BAAc,CAAC,sBAAsB;gBAC3C,MAAM,EAAE,EAAE,MAAM,EAAE,2BAA2B,EAAE;gBAC/C,kBAAkB,EAAE,kCAAmB,CAAC,KAAK;aAC9C;YACD;gBACE,IAAI,EAAE,2BAAc,CAAC,uBAAuB;gBAC5C,MAAM,EAAE,EAAE,MAAM,EAAE,4BAA4B,EAAE;gBAChD,kBAAkB,EAA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A;;iCACX,kCAAmB,CAAC,KAAK,CAAC,CAA1B,wBAAyB;iCACzB,kCAAmB,CAAC,MAAM,CAAC,CAA3B,wBAA0B;;;;;wBAE3B,qBAAM,IAAI,CAAC,yBAAyB,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,EAAA;;wBAAvF,SAAuF,CAAA;wBAEvF,sBAAO,IAAI,EAAA;;;wBAEX,sBAAO,KAAK,EAAA;4BAGd,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,SAAS,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;;;;KAEzF;IACH,iCAAC;AAAD,CAAC,AAtHD,IAsHC;AAtHY,gEAA0B"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.AstarTransactionValidator = void 0;
|
|
19
|
-
var v1_1 = require("@airgap/substrate/v1");
|
|
20
|
-
var AstarTransactionValidator = /** @class */ (function (_super) {
|
|
21
|
-
__extends(AstarTransactionValidator, _super);
|
|
22
|
-
function AstarTransactionValidator() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return AstarTransactionValidator;
|
|
26
|
-
}(v1_1.SubstrateTransactionValidator));
|
|
27
|
-
exports.AstarTransactionValidator = AstarTransactionValidator;
|
|
28
|
-
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,2CAAoE;AAEpE;IAA+C,6CAA6B;IAA5E;;IAA8G,CAAC;IAAD,gCAAC;AAAD,CAAC,AAA/G,CAA+C,kCAA6B,GAAmC;AAAlG,8DAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/validators.ts"],"names":[],"mappings":";;;AAAA,2CAA0D;AAE7C,QAAA,eAAe,GAAG,wBAAmB,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { SubstrateProtocolConfiguration, SubstrateSS58AccountConfiguration } from '@airgap/substrate/v1';
|
|
2
|
-
export declare type AstarTransactionType = never;
|
|
3
|
-
export interface AstarProtocolConfiguration extends SubstrateProtocolConfiguration<SubstrateSS58AccountConfiguration, AstarTransactionType> {
|
|
4
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/v1/types/configuration.ts"],"names":[],"mappings":""}
|
package/v1/types/protocol.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SubstrateProtocolNetwork, SubstrateProtocolOptions } from '@airgap/substrate/v1';
|
|
2
|
-
import { AstarProtocolConfiguration } from './configuration';
|
|
3
|
-
export declare type AstarUnits = 'ASTR' | 'mASTR' | 'uASTR' | 'nASTR' | 'pASTR' | 'fASTR' | 'aASTR';
|
|
4
|
-
export declare type ShidenUnits = 'SDN' | 'mSDN' | 'uSDN' | 'nSDN' | 'pSDN' | 'fSDN' | 'aSDN';
|
|
5
|
-
export interface AstarProtocolNetwork extends SubstrateProtocolNetwork {
|
|
6
|
-
blockExplorerApi: string;
|
|
7
|
-
}
|
|
8
|
-
export interface AstarProtocolOptions {
|
|
9
|
-
network: AstarProtocolNetwork;
|
|
10
|
-
}
|
|
11
|
-
export interface AstarBaseProtocolOptions<_Units extends string> extends SubstrateProtocolOptions<_Units, AstarProtocolConfiguration, AstarProtocolNetwork> {
|
|
12
|
-
}
|
package/v1/types/protocol.js
DELETED
package/v1/types/protocol.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/v1/types/protocol.ts"],"names":[],"mappings":""}
|