@airgap/astar 0.13.7-beta.21 → 0.13.7-beta.23
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-astar.min.js +16565 -4330
- package/index.d.ts +1 -5
- package/index.js +15 -17
- package/index.js.map +1 -1
- package/package.json +3 -1
- package/v0/index.d.ts +5 -0
- package/v0/index.js +31 -0
- package/v0/index.js.map +1 -0
- package/{protocol → v0/protocol}/astar/AstarProtocol.d.ts +3 -3
- package/{protocol → v0/protocol}/astar/AstarProtocol.js +3 -1
- package/v0/protocol/astar/AstarProtocol.js.map +1 -0
- package/{protocol → v0/protocol}/astar/AstarProtocolOptions.d.ts +3 -3
- package/{protocol → v0/protocol}/astar/AstarProtocolOptions.js +7 -5
- package/v0/protocol/astar/AstarProtocolOptions.js.map +1 -0
- package/{protocol → v0/protocol}/shiden/ShidenProtocol.d.ts +2 -2
- package/{protocol → v0/protocol}/shiden/ShidenProtocol.js +2 -0
- package/v0/protocol/shiden/ShidenProtocol.js.map +1 -0
- package/{protocol → v0/protocol}/shiden/ShidenProtocolOptions.d.ts +1 -1
- package/{protocol → v0/protocol}/shiden/ShidenProtocolOptions.js +3 -1
- package/v0/protocol/shiden/ShidenProtocolOptions.js.map +1 -0
- package/v1/block-explorer/SubscanBlockExplorer.d.ts +3 -0
- package/v1/block-explorer/SubscanBlockExplorer.js +16 -0
- package/v1/block-explorer/SubscanBlockExplorer.js.map +1 -0
- package/v1/controller/AstarAccountController.d.ts +5 -0
- package/v1/controller/AstarAccountController.js +28 -0
- package/v1/controller/AstarAccountController.js.map +1 -0
- package/v1/controller/AstarTransactionController.d.ts +5 -0
- package/v1/controller/AstarTransactionController.js +28 -0
- package/v1/controller/AstarTransactionController.js.map +1 -0
- package/v1/index.d.ts +11 -0
- package/v1/index.js +15 -0
- package/v1/index.js.map +1 -0
- package/v1/module/AstarBaseModule.d.ts +15 -0
- package/v1/module/AstarBaseModule.js +82 -0
- package/v1/module/AstarBaseModule.js.map +1 -0
- package/v1/module/AstarModule.d.ts +10 -0
- package/v1/module/AstarModule.js +38 -0
- package/v1/module/AstarModule.js.map +1 -0
- package/v1/module/ShidenModule.d.ts +10 -0
- package/v1/module/ShidenModule.js +38 -0
- package/v1/module/ShidenModule.js.map +1 -0
- package/v1/node/AstarNodeClient.d.ts +4 -0
- package/v1/node/AstarNodeClient.js +28 -0
- package/v1/node/AstarNodeClient.js.map +1 -0
- package/v1/protocol/AstarBaseProtocol.d.ts +12 -0
- package/v1/protocol/AstarBaseProtocol.js +96 -0
- package/v1/protocol/AstarBaseProtocol.js.map +1 -0
- package/v1/protocol/AstarProtocol.d.ts +14 -0
- package/v1/protocol/AstarProtocol.js +117 -0
- package/v1/protocol/AstarProtocol.js.map +1 -0
- package/v1/protocol/ShidenProtocol.d.ts +14 -0
- package/v1/protocol/ShidenProtocol.js +110 -0
- package/v1/protocol/ShidenProtocol.js.map +1 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +7 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +21 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.js.map +1 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-astar.json +36 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-astar.json +19 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -0
- package/v1/serializer/v3/validators/transaction-validator.js +37 -0
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
- package/v1/serializer/v3/validators/validators.d.ts +4 -0
- package/v1/serializer/v3/validators/validators.js +6 -0
- package/v1/serializer/v3/validators/validators.js.map +1 -0
- package/v1/types/configuration.d.ts +4 -0
- package/v1/types/configuration.js +3 -0
- package/v1/types/configuration.js.map +1 -0
- package/v1/types/protocol.d.ts +12 -0
- package/v1/types/protocol.js +3 -0
- package/v1/types/protocol.js.map +1 -0
- package/protocol/astar/AstarProtocol.js.map +0 -1
- package/protocol/astar/AstarProtocolOptions.js.map +0 -1
- package/protocol/shiden/ShidenProtocol.js.map +0 -1
- package/protocol/shiden/ShidenProtocolOptions.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
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.ShidenModule = void 0;
|
|
19
|
+
var SubscanBlockExplorer_1 = require("../block-explorer/SubscanBlockExplorer");
|
|
20
|
+
var ShidenProtocol_1 = require("../protocol/ShidenProtocol");
|
|
21
|
+
var AstarBaseModule_1 = require("./AstarBaseModule");
|
|
22
|
+
var ShidenModule = /** @class */ (function (_super) {
|
|
23
|
+
__extends(ShidenModule, _super);
|
|
24
|
+
function ShidenModule() {
|
|
25
|
+
var _this = _super.call(this, [ShidenProtocol_1.SHIDEN_MAINNET_PROTOCOL_NETWORK]) || this;
|
|
26
|
+
_this.name = 'Shiden';
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
ShidenModule.prototype.createAstarProtocol = function (network) {
|
|
30
|
+
return (0, ShidenProtocol_1.createShidenProtocol)({ network: network });
|
|
31
|
+
};
|
|
32
|
+
ShidenModule.prototype.createAstarBlockExplorer = function (network) {
|
|
33
|
+
return (0, SubscanBlockExplorer_1.createShidenSubscanBlockExplorer)();
|
|
34
|
+
};
|
|
35
|
+
return ShidenModule;
|
|
36
|
+
}(AstarBaseModule_1.AstarBaseModule));
|
|
37
|
+
exports.ShidenModule = ShidenModule;
|
|
38
|
+
//# sourceMappingURL=ShidenModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShidenModule.js","sourceRoot":"","sources":["../../../src/v1/module/ShidenModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,+EAAyF;AAEzF,6DAAkG;AAClG,qDAAmD;AAEnD;IAAkC,gCAAe;IAG/C;QAAA,YACE,kBAAM,CAAC,gDAA+B,CAAC,CAAC,SACzC;QAJkB,UAAI,GAAW,QAAQ,CAAA;;IAI1C,CAAC;IAEM,0CAAmB,GAA1B,UAA2B,OAAqC;QAC9D,OAAO,IAAA,qCAAoB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;IAC1C,CAAC;IAEM,+CAAwB,GAA/B,UAAgC,OAAwB;QACtD,OAAO,IAAA,uDAAgC,GAAE,CAAA;IAC3C,CAAC;IACH,mBAAC;AAAD,CAAC,AAdD,CAAkC,iCAAe,GAchD;AAdY,oCAAY"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.AstarNodeClient = void 0;
|
|
19
|
+
var v1_1 = require("@airgap/substrate/v1");
|
|
20
|
+
var AstarNodeClient = /** @class */ (function (_super) {
|
|
21
|
+
__extends(AstarNodeClient, _super);
|
|
22
|
+
function AstarNodeClient() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return AstarNodeClient;
|
|
26
|
+
}(v1_1.SubstrateCommonNodeClient));
|
|
27
|
+
exports.AstarNodeClient = AstarNodeClient;
|
|
28
|
+
//# sourceMappingURL=AstarNodeClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AstarNodeClient.js","sourceRoot":"","sources":["../../../src/v1/node/AstarNodeClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAgE;AAGhE;IAAqC,mCAAqD;IAA1F;;IAA4F,CAAC;IAAD,sBAAC;AAAD,CAAC,AAA7F,CAAqC,8BAAyB,GAA+B;AAAhF,0CAAe"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SubstrateAccountId, SubstrateProtocol, SubstrateProtocolImpl, SubstrateSS58Address, SubstrateTransactionType } from '@airgap/substrate/v1';
|
|
2
|
+
import { AstarAccountController } from '../controller/AstarAccountController';
|
|
3
|
+
import { AstarTransactionController } from '../controller/AstarTransactionController';
|
|
4
|
+
import { AstarNodeClient } from '../node/AstarNodeClient';
|
|
5
|
+
import { AstarProtocolConfiguration } from '../types/configuration';
|
|
6
|
+
import { AstarBaseProtocolOptions, AstarProtocolNetwork } from '../types/protocol';
|
|
7
|
+
export interface AstarBaseProtocol<_Units extends string = string> extends SubstrateProtocol<_Units, AstarProtocolNetwork> {
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class AstarBaseProtocolImpl<_Units extends string> extends SubstrateProtocolImpl<_Units, AstarProtocolConfiguration, AstarProtocolNetwork, AstarNodeClient, AstarAccountController, AstarTransactionController> implements AstarBaseProtocol<_Units> {
|
|
10
|
+
constructor(options: AstarBaseProtocolOptions<_Units>);
|
|
11
|
+
protected getFutureRequiredTransactions(accountId: SubstrateAccountId<SubstrateSS58Address>, intention: 'transfer' | 'check'): Promise<[SubstrateTransactionType<AstarProtocolConfiguration>, any][]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.AstarBaseProtocolImpl = void 0;
|
|
55
|
+
var v1_1 = require("@airgap/substrate/v1");
|
|
56
|
+
var AstarAccountController_1 = require("../controller/AstarAccountController");
|
|
57
|
+
var AstarTransactionController_1 = require("../controller/AstarTransactionController");
|
|
58
|
+
var AstarNodeClient_1 = require("../node/AstarNodeClient");
|
|
59
|
+
// Implemenation
|
|
60
|
+
var AstarBaseProtocolImpl = /** @class */ (function (_super) {
|
|
61
|
+
__extends(AstarBaseProtocolImpl, _super);
|
|
62
|
+
function AstarBaseProtocolImpl(options) {
|
|
63
|
+
var nodeClient = new AstarNodeClient_1.AstarNodeClient(options.configuration, options.network.rpcUrl);
|
|
64
|
+
var accountController = new AstarAccountController_1.AstarAccountController(options.configuration, nodeClient);
|
|
65
|
+
var transactionController = new AstarTransactionController_1.AstarTransactionController(options.configuration, nodeClient);
|
|
66
|
+
var blockExplorer = new v1_1.SubscanBlockExplorerClient(options.network.blockExplorerApi);
|
|
67
|
+
return _super.call(this, options, nodeClient, accountController, transactionController, blockExplorer) || this;
|
|
68
|
+
}
|
|
69
|
+
AstarBaseProtocolImpl.prototype.getFutureRequiredTransactions = function (accountId, intention) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var balance, transferableBalance, requiredTransactions;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0: return [4 /*yield*/, this.accountController.getBalance(accountId)];
|
|
75
|
+
case 1:
|
|
76
|
+
balance = _a.sent();
|
|
77
|
+
transferableBalance = balance.transferable.minus(balance.existentialDeposit);
|
|
78
|
+
requiredTransactions = [];
|
|
79
|
+
if (intention === 'transfer') {
|
|
80
|
+
requiredTransactions.push([
|
|
81
|
+
'transfer',
|
|
82
|
+
{
|
|
83
|
+
to: v1_1.SubstrateSS58Address.createPlaceholder(),
|
|
84
|
+
value: transferableBalance
|
|
85
|
+
}
|
|
86
|
+
]);
|
|
87
|
+
}
|
|
88
|
+
return [2 /*return*/, requiredTransactions];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
return AstarBaseProtocolImpl;
|
|
94
|
+
}(v1_1.SubstrateProtocolImpl));
|
|
95
|
+
exports.AstarBaseProtocolImpl = AstarBaseProtocolImpl;
|
|
96
|
+
//# sourceMappingURL=AstarBaseProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AstarBaseProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/AstarBaseProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAO6B;AAC7B,+EAA6E;AAC7E,uFAAqF;AACrF,2DAAyD;AAQzD,gBAAgB;AAEhB;IACU,yCAOP;IAGD,+BAAmB,OAAyC;QAC1D,IAAM,UAAU,GAAoB,IAAI,iCAAe,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAEtG,IAAM,iBAAiB,GAA2B,IAAI,+CAAsB,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;QAC/G,IAAM,qBAAqB,GAA+B,IAAI,uDAA0B,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;QAE3H,IAAM,aAAa,GAA+B,IAAI,+BAA0B,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;eAElH,kBAAM,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,aAAa,CAAC;IACrF,CAAC;IAEe,6DAA6B,GAA7C,UACE,SAAmD,EACnD,SAA+B;;;;;4BAEf,qBAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,SAAS,CAAC,EAAA;;wBAA5D,OAAO,GAAG,SAAkD;wBAE5D,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;wBAE5E,oBAAoB,GAAkE,EAAE,CAAA;wBAE9F,IAAI,SAAS,KAAK,UAAU,EAAE;4BAC5B,oBAAoB,CAAC,IAAI,CAAC;gCACxB,UAAU;gCACV;oCACE,EAAE,EAAE,yBAAoB,CAAC,iBAAiB,EAAE;oCAC5C,KAAK,EAAE,mBAAmB;iCAC3B;6BACF,CAAC,CAAA;yBACH;wBAED,sBAAO,oBAAoB,EAAA;;;;KAC5B;IACH,4BAAC;AAAD,CAAC,AA5CD,CACU,0BAAqB,GA2C9B;AA5CqB,sDAAqB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProtocolMetadata, RecursivePartial } from '@airgap/module-kit';
|
|
2
|
+
import { AstarProtocolConfiguration } from '../types/configuration';
|
|
3
|
+
import { AstarProtocolNetwork, AstarProtocolOptions, AstarUnits } from '../types/protocol';
|
|
4
|
+
import { AstarBaseProtocol, AstarBaseProtocolImpl } from './AstarBaseProtocol';
|
|
5
|
+
export interface AstarProtocol extends AstarBaseProtocol<AstarUnits> {
|
|
6
|
+
}
|
|
7
|
+
export declare const ASTAR_METADATA: ProtocolMetadata<AstarUnits>;
|
|
8
|
+
export declare const ASTAR_CONFIGURATION: AstarProtocolConfiguration;
|
|
9
|
+
export declare class AstarProtocolImpl extends AstarBaseProtocolImpl<AstarUnits> implements AstarProtocol {
|
|
10
|
+
constructor(options?: RecursivePartial<AstarProtocolOptions>);
|
|
11
|
+
}
|
|
12
|
+
export declare function createAstarProtocol(options?: RecursivePartial<AstarProtocolOptions>): AstarProtocol;
|
|
13
|
+
export declare const ASTAR_MAINNET_PROTOCOL_NETWORK: AstarProtocolNetwork;
|
|
14
|
+
export declare function createAstarProtocolOptions(network?: Partial<AstarProtocolNetwork>): AstarProtocolOptions;
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.createAstarProtocolOptions = exports.ASTAR_MAINNET_PROTOCOL_NETWORK = exports.createAstarProtocol = exports.AstarProtocolImpl = exports.ASTAR_CONFIGURATION = exports.ASTAR_METADATA = void 0;
|
|
30
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
31
|
+
var AstarBaseProtocol_1 = require("./AstarBaseProtocol");
|
|
32
|
+
// Implementation
|
|
33
|
+
exports.ASTAR_METADATA = {
|
|
34
|
+
identifier: coinlib_core_1.MainProtocolSymbols.ASTAR,
|
|
35
|
+
name: 'Astar',
|
|
36
|
+
units: {
|
|
37
|
+
ASTR: {
|
|
38
|
+
symbol: { value: 'ASTR' },
|
|
39
|
+
decimals: 18
|
|
40
|
+
},
|
|
41
|
+
mASTR: {
|
|
42
|
+
symbol: { value: 'mASTR' },
|
|
43
|
+
decimals: 15
|
|
44
|
+
},
|
|
45
|
+
uASTR: {
|
|
46
|
+
symbol: { value: 'uASTR' },
|
|
47
|
+
decimals: 12
|
|
48
|
+
},
|
|
49
|
+
nASTR: {
|
|
50
|
+
symbol: { value: 'nASTR' },
|
|
51
|
+
decimals: 9
|
|
52
|
+
},
|
|
53
|
+
pASTR: {
|
|
54
|
+
symbol: { value: 'pASTR' },
|
|
55
|
+
decimals: 6
|
|
56
|
+
},
|
|
57
|
+
fASTR: {
|
|
58
|
+
symbol: { value: 'fASTR' },
|
|
59
|
+
decimals: 3
|
|
60
|
+
},
|
|
61
|
+
aASTR: {
|
|
62
|
+
symbol: { value: 'aASTR' },
|
|
63
|
+
decimals: 0
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
mainUnit: 'ASTR',
|
|
67
|
+
account: {
|
|
68
|
+
standardDerivationPath: "m/44'/810'/0'/0/0",
|
|
69
|
+
address: {
|
|
70
|
+
isCaseSensitive: true,
|
|
71
|
+
placeholder: "ABC...",
|
|
72
|
+
regex: '^[a-km-zA-HJ-NP-Z1-9]+$'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.ASTAR_CONFIGURATION = {
|
|
77
|
+
account: {
|
|
78
|
+
type: 'ss58',
|
|
79
|
+
format: 5
|
|
80
|
+
},
|
|
81
|
+
transaction: {
|
|
82
|
+
types: {}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var AstarProtocolImpl = /** @class */ (function (_super) {
|
|
86
|
+
__extends(AstarProtocolImpl, _super);
|
|
87
|
+
function AstarProtocolImpl(options) {
|
|
88
|
+
if (options === void 0) { options = {}; }
|
|
89
|
+
var completeOptions = createAstarProtocolOptions(options.network);
|
|
90
|
+
var metadata = exports.ASTAR_METADATA;
|
|
91
|
+
var configuration = exports.ASTAR_CONFIGURATION;
|
|
92
|
+
return _super.call(this, { metadata: metadata, configuration: configuration, network: completeOptions.network }) || this;
|
|
93
|
+
}
|
|
94
|
+
return AstarProtocolImpl;
|
|
95
|
+
}(AstarBaseProtocol_1.AstarBaseProtocolImpl));
|
|
96
|
+
exports.AstarProtocolImpl = AstarProtocolImpl;
|
|
97
|
+
// Factory
|
|
98
|
+
function createAstarProtocol(options) {
|
|
99
|
+
if (options === void 0) { options = {}; }
|
|
100
|
+
return new AstarProtocolImpl(options);
|
|
101
|
+
}
|
|
102
|
+
exports.createAstarProtocol = createAstarProtocol;
|
|
103
|
+
exports.ASTAR_MAINNET_PROTOCOL_NETWORK = {
|
|
104
|
+
name: 'Mainnet',
|
|
105
|
+
type: 'mainnet',
|
|
106
|
+
rpcUrl: 'https://astar-node.prod.gke.papers.tech',
|
|
107
|
+
blockExplorerApi: 'https://astar.subscan.prod.gke.papers.tech/api/scan'
|
|
108
|
+
};
|
|
109
|
+
var DEFAULT_ASTAR_PROTOCOL_NETWORK = exports.ASTAR_MAINNET_PROTOCOL_NETWORK;
|
|
110
|
+
function createAstarProtocolOptions(network) {
|
|
111
|
+
if (network === void 0) { network = {}; }
|
|
112
|
+
return {
|
|
113
|
+
network: __assign(__assign({}, DEFAULT_ASTAR_PROTOCOL_NETWORK), network)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
exports.createAstarProtocolOptions = createAstarProtocolOptions;
|
|
117
|
+
//# sourceMappingURL=AstarProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AstarProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/AstarProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAI1D,yDAA8E;AAM9E,iBAAiB;AAEJ,QAAA,cAAc,GAAiC;IAC1D,UAAU,EAAE,kCAAmB,CAAC,KAAK;IACrC,IAAI,EAAE,OAAO;IAEb,KAAK,EAAE;QACL,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,QAAQ,EAAE,EAAE;SACb;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YAC1B,QAAQ,EAAE,EAAE;SACb;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YAC1B,QAAQ,EAAE,EAAE;SACb;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YAC1B,QAAQ,EAAE,CAAC;SACZ;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YAC1B,QAAQ,EAAE,CAAC;SACZ;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YAC1B,QAAQ,EAAE,CAAC;SACZ;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YAC1B,QAAQ,EAAE,CAAC;SACZ;KACF;IACD,QAAQ,EAAE,MAAM;IAEhB,OAAO,EAAE;QACP,sBAAsB,EAAE,mBAAmB;QAC3C,OAAO,EAAE;YACP,eAAe,EAAE,IAAI;YACrB,WAAW,EAAE,QAAQ;YACrB,KAAK,EAAE,yBAAyB;SACjC;KACF;CACF,CAAA;AAEY,QAAA,mBAAmB,GAA+B;IAC7D,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,CAAC;KACV;IACD,WAAW,EAAE;QACX,KAAK,EAAE,EAAE;KACV;CACF,CAAA;AAED;IAAuC,qCAAiC;IACtE,2BAAmB,OAAoD;QAApD,wBAAA,EAAA,YAAoD;QACrE,IAAM,eAAe,GAAyB,0BAA0B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAEzF,IAAM,QAAQ,GAAiC,sBAAc,CAAA;QAC7D,IAAM,aAAa,GAA+B,2BAAmB,CAAA;eAErE,kBAAM,EAAE,QAAQ,UAAA,EAAE,aAAa,eAAA,EAAE,OAAO,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC;IACtE,CAAC;IACH,wBAAC;AAAD,CAAC,AATD,CAAuC,yCAAqB,GAS3D;AATY,8CAAiB;AAW9B,UAAU;AAEV,SAAgB,mBAAmB,CAAC,OAAoD;IAApD,wBAAA,EAAA,YAAoD;IACtF,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAA;AACvC,CAAC;AAFD,kDAEC;AAEY,QAAA,8BAA8B,GAAyB;IAClE,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,yCAAyC;IACjD,gBAAgB,EAAE,qDAAqD;CACxE,CAAA;AAED,IAAM,8BAA8B,GAAyB,sCAA8B,CAAA;AAE3F,SAAgB,0BAA0B,CAAC,OAA2C;IAA3C,wBAAA,EAAA,YAA2C;IACpF,OAAO;QACL,OAAO,wBAAO,8BAA8B,GAAK,OAAO,CAAE;KAC3D,CAAA;AACH,CAAC;AAJD,gEAIC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProtocolMetadata, RecursivePartial } from '@airgap/module-kit';
|
|
2
|
+
import { AstarProtocolConfiguration } from '../types/configuration';
|
|
3
|
+
import { AstarProtocolNetwork, AstarProtocolOptions, ShidenUnits } from '../types/protocol';
|
|
4
|
+
import { AstarBaseProtocol, AstarBaseProtocolImpl } from './AstarBaseProtocol';
|
|
5
|
+
export interface ShidenProtocol extends AstarBaseProtocol<ShidenUnits> {
|
|
6
|
+
}
|
|
7
|
+
export declare const SHIDEN_METADATA: ProtocolMetadata<ShidenUnits>;
|
|
8
|
+
export declare const SHIDEN_CONFIGURATION: AstarProtocolConfiguration;
|
|
9
|
+
export declare class ShidenProtocolImpl extends AstarBaseProtocolImpl<ShidenUnits> implements ShidenProtocol {
|
|
10
|
+
constructor(options?: RecursivePartial<AstarProtocolOptions>);
|
|
11
|
+
}
|
|
12
|
+
export declare function createShidenProtocol(options?: RecursivePartial<AstarProtocolOptions>): ShidenProtocol;
|
|
13
|
+
export declare const SHIDEN_MAINNET_PROTOCOL_NETWORK: AstarProtocolNetwork;
|
|
14
|
+
export declare function createShidenProtocolOptions(network?: Partial<AstarProtocolNetwork>): AstarProtocolOptions;
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.createShidenProtocolOptions = exports.SHIDEN_MAINNET_PROTOCOL_NETWORK = exports.createShidenProtocol = exports.ShidenProtocolImpl = exports.SHIDEN_CONFIGURATION = exports.SHIDEN_METADATA = void 0;
|
|
30
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
31
|
+
var AstarBaseProtocol_1 = require("./AstarBaseProtocol");
|
|
32
|
+
var AstarProtocol_1 = require("./AstarProtocol");
|
|
33
|
+
// Implementation
|
|
34
|
+
exports.SHIDEN_METADATA = {
|
|
35
|
+
identifier: coinlib_core_1.MainProtocolSymbols.SHIDEN,
|
|
36
|
+
name: 'Shiden',
|
|
37
|
+
units: {
|
|
38
|
+
SDN: {
|
|
39
|
+
symbol: { value: 'SDN' },
|
|
40
|
+
decimals: 18
|
|
41
|
+
},
|
|
42
|
+
mSDN: {
|
|
43
|
+
symbol: { value: 'mSDN' },
|
|
44
|
+
decimals: 15
|
|
45
|
+
},
|
|
46
|
+
uSDN: {
|
|
47
|
+
symbol: { value: 'uSDN' },
|
|
48
|
+
decimals: 12
|
|
49
|
+
},
|
|
50
|
+
nSDN: {
|
|
51
|
+
symbol: { value: 'nSDN' },
|
|
52
|
+
decimals: 9
|
|
53
|
+
},
|
|
54
|
+
pSDN: {
|
|
55
|
+
symbol: { value: 'pSDN' },
|
|
56
|
+
decimals: 6
|
|
57
|
+
},
|
|
58
|
+
fSDN: {
|
|
59
|
+
symbol: { value: 'fSDN' },
|
|
60
|
+
decimals: 3
|
|
61
|
+
},
|
|
62
|
+
aSDN: {
|
|
63
|
+
symbol: { value: 'aSDN' },
|
|
64
|
+
decimals: 0
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
mainUnit: 'SDN',
|
|
68
|
+
account: {
|
|
69
|
+
standardDerivationPath: "m/44'/810'/0'/0/0",
|
|
70
|
+
address: {
|
|
71
|
+
isCaseSensitive: true,
|
|
72
|
+
placeholder: "ABC...",
|
|
73
|
+
regex: '^[a-km-zA-HJ-NP-Z1-9]+$'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
exports.SHIDEN_CONFIGURATION = AstarProtocol_1.ASTAR_CONFIGURATION;
|
|
78
|
+
var ShidenProtocolImpl = /** @class */ (function (_super) {
|
|
79
|
+
__extends(ShidenProtocolImpl, _super);
|
|
80
|
+
function ShidenProtocolImpl(options) {
|
|
81
|
+
if (options === void 0) { options = {}; }
|
|
82
|
+
var completeOptions = createShidenProtocolOptions(options.network);
|
|
83
|
+
var metadata = exports.SHIDEN_METADATA;
|
|
84
|
+
var configuration = exports.SHIDEN_CONFIGURATION;
|
|
85
|
+
return _super.call(this, { metadata: metadata, configuration: configuration, network: completeOptions.network }) || this;
|
|
86
|
+
}
|
|
87
|
+
return ShidenProtocolImpl;
|
|
88
|
+
}(AstarBaseProtocol_1.AstarBaseProtocolImpl));
|
|
89
|
+
exports.ShidenProtocolImpl = ShidenProtocolImpl;
|
|
90
|
+
// Factory
|
|
91
|
+
function createShidenProtocol(options) {
|
|
92
|
+
if (options === void 0) { options = {}; }
|
|
93
|
+
return new ShidenProtocolImpl(options);
|
|
94
|
+
}
|
|
95
|
+
exports.createShidenProtocol = createShidenProtocol;
|
|
96
|
+
exports.SHIDEN_MAINNET_PROTOCOL_NETWORK = {
|
|
97
|
+
name: 'Mainnet',
|
|
98
|
+
type: 'mainnet',
|
|
99
|
+
rpcUrl: 'https://shiden-node.prod.gke.papers.tech',
|
|
100
|
+
blockExplorerApi: 'https://shiden.subscan.prod.gke.papers.tech/api/scan'
|
|
101
|
+
};
|
|
102
|
+
var DEFAULT_SHIDEN_PROTOCOL_NETWORK = exports.SHIDEN_MAINNET_PROTOCOL_NETWORK;
|
|
103
|
+
function createShidenProtocolOptions(network) {
|
|
104
|
+
if (network === void 0) { network = {}; }
|
|
105
|
+
return {
|
|
106
|
+
network: __assign(__assign({}, DEFAULT_SHIDEN_PROTOCOL_NETWORK), network)
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
exports.createShidenProtocolOptions = createShidenProtocolOptions;
|
|
110
|
+
//# sourceMappingURL=ShidenProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShidenProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/ShidenProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAI1D,yDAA8E;AAC9E,iDAAqD;AAMrD,iBAAiB;AAEJ,QAAA,eAAe,GAAkC;IAC5D,UAAU,EAAE,kCAAmB,CAAC,MAAM;IACtC,IAAI,EAAE,QAAQ;IAEd,KAAK,EAAE;QACL,GAAG,EAAE;YACH,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;YACxB,QAAQ,EAAE,EAAE;SACb;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,QAAQ,EAAE,EAAE;SACb;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,QAAQ,EAAE,EAAE;SACb;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,QAAQ,EAAE,CAAC;SACZ;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,QAAQ,EAAE,CAAC;SACZ;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,QAAQ,EAAE,CAAC;SACZ;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;YACzB,QAAQ,EAAE,CAAC;SACZ;KACF;IACD,QAAQ,EAAE,KAAK;IAEf,OAAO,EAAE;QACP,sBAAsB,EAAE,mBAAmB;QAC3C,OAAO,EAAE;YACP,eAAe,EAAE,IAAI;YACrB,WAAW,EAAE,QAAQ;YACrB,KAAK,EAAE,yBAAyB;SACjC;KACF;CACF,CAAA;AAEY,QAAA,oBAAoB,GAA+B,mCAAmB,CAAA;AAEnF;IAAwC,sCAAkC;IACxE,4BAAmB,OAAoD;QAApD,wBAAA,EAAA,YAAoD;QACrE,IAAM,eAAe,GAAyB,2BAA2B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAE1F,IAAM,QAAQ,GAAkC,uBAAe,CAAA;QAC/D,IAAM,aAAa,GAA+B,4BAAoB,CAAA;eAEtE,kBAAM,EAAE,QAAQ,UAAA,EAAE,aAAa,eAAA,EAAE,OAAO,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC;IACtE,CAAC;IACH,yBAAC;AAAD,CAAC,AATD,CAAwC,yCAAqB,GAS5D;AATY,gDAAkB;AAW/B,UAAU;AAEV,SAAgB,oBAAoB,CAAC,OAAoD;IAApD,wBAAA,EAAA,YAAoD;IACvF,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAA;AACxC,CAAC;AAFD,oDAEC;AAEY,QAAA,+BAA+B,GAAyB;IACnE,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,0CAA0C;IAClD,gBAAgB,EAAE,sDAAsD;CACzE,CAAA;AAED,IAAM,+BAA+B,GAAyB,uCAA+B,CAAA;AAE7F,SAAgB,2BAA2B,CAAC,OAA2C;IAA3C,wBAAA,EAAA,YAA2C;IACrF,OAAO;QACL,OAAO,wBAAO,+BAA+B,GAAK,OAAO,CAAE;KAC5D,CAAA;AACH,CAAC;AAJD,kEAIC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-sign-request-astar.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-request-astar.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-sign-response-astar.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-response-astar.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TransactionValidator, TransactionValidatorFactory } from '@airgap/serializer';
|
|
2
|
+
import { SubstrateTransactionValidator } from '@airgap/substrate/v1';
|
|
3
|
+
export declare class AstarTransactionValidator extends SubstrateTransactionValidator implements TransactionValidator {
|
|
4
|
+
}
|
|
5
|
+
export declare class AstarTransactionValidatorFactory implements TransactionValidatorFactory<AstarTransactionValidator> {
|
|
6
|
+
create(): AstarTransactionValidator;
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.AstarTransactionValidatorFactory = 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
|
+
var AstarTransactionValidatorFactory = /** @class */ (function () {
|
|
29
|
+
function AstarTransactionValidatorFactory() {
|
|
30
|
+
}
|
|
31
|
+
AstarTransactionValidatorFactory.prototype.create = function () {
|
|
32
|
+
return new AstarTransactionValidator();
|
|
33
|
+
};
|
|
34
|
+
return AstarTransactionValidatorFactory;
|
|
35
|
+
}());
|
|
36
|
+
exports.AstarTransactionValidatorFactory = AstarTransactionValidatorFactory;
|
|
37
|
+
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAEtC;IAAA;IAIA,CAAC;IAHQ,iDAAM,GAAb;QACE,OAAO,IAAI,yBAAyB,EAAE,CAAA;IACxC,CAAC;IACH,uCAAC;AAAD,CAAC,AAJD,IAIC;AAJY,4EAAgC"}
|