@airgap/aeternity 0.13.7-beta.11 → 0.13.7-beta.13
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-aeternity.min.js +2115 -814
- package/index.d.ts +2 -0
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/utils/create-protocol.d.ts +3 -0
- package/utils/create-protocol.js +16 -0
- package/utils/create-protocol.js.map +1 -0
|
@@ -32105,7 +32105,7 @@ module.exports = function whichTypedArray(value) {
|
|
|
32105
32105
|
},{"available-typed-arrays":29,"call-bind/callBound":78,"es-abstract/helpers/getOwnPropertyDescriptor":116,"for-each":119,"has-tostringtag/shams":125,"is-typed-array":162}],223:[function(require,module,exports){
|
|
32106
32106
|
"use strict";
|
|
32107
32107
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32108
|
-
exports.AeternityAddress = exports.AeternityProtocolNetwork = exports.AeternalBlockExplorer = exports.AeternityProtocolOptions = exports.AeternityCryptoClient = exports.AeternityProtocol = void 0;
|
|
32108
|
+
exports.createProtocolByIdentifier = exports.AeternityAddress = exports.AeternityProtocolNetwork = exports.AeternalBlockExplorer = exports.AeternityProtocolOptions = exports.AeternityCryptoClient = exports.AeternityProtocol = void 0;
|
|
32109
32109
|
var AeternityAddress_1 = require("./protocol/AeternityAddress");
|
|
32110
32110
|
Object.defineProperty(exports, "AeternityAddress", { enumerable: true, get: function () { return AeternityAddress_1.AeternityAddress; } });
|
|
32111
32111
|
var AeternityCryptoClient_1 = require("./protocol/AeternityCryptoClient");
|
|
@@ -32116,8 +32116,10 @@ var AeternityProtocolOptions_1 = require("./protocol/AeternityProtocolOptions");
|
|
|
32116
32116
|
Object.defineProperty(exports, "AeternalBlockExplorer", { enumerable: true, get: function () { return AeternityProtocolOptions_1.AeternalBlockExplorer; } });
|
|
32117
32117
|
Object.defineProperty(exports, "AeternityProtocolNetwork", { enumerable: true, get: function () { return AeternityProtocolOptions_1.AeternityProtocolNetwork; } });
|
|
32118
32118
|
Object.defineProperty(exports, "AeternityProtocolOptions", { enumerable: true, get: function () { return AeternityProtocolOptions_1.AeternityProtocolOptions; } });
|
|
32119
|
+
var create_protocol_1 = require("./utils/create-protocol");
|
|
32120
|
+
Object.defineProperty(exports, "createProtocolByIdentifier", { enumerable: true, get: function () { return create_protocol_1.createProtocolByIdentifier; } });
|
|
32119
32121
|
|
|
32120
|
-
},{"./protocol/AeternityAddress":224,"./protocol/AeternityCryptoClient":225,"./protocol/AeternityProtocol":226,"./protocol/AeternityProtocolOptions":227}],224:[function(require,module,exports){
|
|
32122
|
+
},{"./protocol/AeternityAddress":224,"./protocol/AeternityCryptoClient":225,"./protocol/AeternityProtocol":226,"./protocol/AeternityProtocolOptions":227,"./utils/create-protocol":228}],224:[function(require,module,exports){
|
|
32121
32123
|
(function (Buffer){(function (){
|
|
32122
32124
|
"use strict";
|
|
32123
32125
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -32158,7 +32160,7 @@ var AeternityAddress = /** @class */ (function () {
|
|
|
32158
32160
|
exports.AeternityAddress = AeternityAddress;
|
|
32159
32161
|
|
|
32160
32162
|
}).call(this)}).call(this,require("buffer").Buffer)
|
|
32161
|
-
},{"@airgap/coinlib-core/dependencies/src/bs58check-2.1.2/index":
|
|
32163
|
+
},{"@airgap/coinlib-core/dependencies/src/bs58check-2.1.2/index":273,"buffer":76}],225:[function(require,module,exports){
|
|
32162
32164
|
(function (Buffer){(function (){
|
|
32163
32165
|
"use strict";
|
|
32164
32166
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -32254,7 +32256,7 @@ var AeternityCryptoClient = /** @class */ (function (_super) {
|
|
|
32254
32256
|
exports.AeternityCryptoClient = AeternityCryptoClient;
|
|
32255
32257
|
|
|
32256
32258
|
}).call(this)}).call(this,require("buffer").Buffer)
|
|
32257
|
-
},{"@airgap/coinlib-core/errors":
|
|
32259
|
+
},{"@airgap/coinlib-core/errors":307,"@airgap/coinlib-core/errors/coinlib-error":306,"@airgap/coinlib-core/protocols/Ed25519CryptoClient":310,"@stablelib/ed25519":2,"buffer":76}],226:[function(require,module,exports){
|
|
32258
32260
|
(function (Buffer){(function (){
|
|
32259
32261
|
"use strict";
|
|
32260
32262
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -32954,7 +32956,7 @@ var AeternityProtocol = /** @class */ (function (_super) {
|
|
|
32954
32956
|
exports.AeternityProtocol = AeternityProtocol;
|
|
32955
32957
|
|
|
32956
32958
|
}).call(this)}).call(this,require("buffer").Buffer)
|
|
32957
|
-
},{"./AeternityAddress":224,"./AeternityCryptoClient":225,"./AeternityProtocolOptions":227,"@airgap/coinlib-core/dependencies/src/axios-0.19.0/index":
|
|
32959
|
+
},{"./AeternityAddress":224,"./AeternityCryptoClient":225,"./AeternityProtocolOptions":227,"@airgap/coinlib-core/dependencies/src/axios-0.19.0/index":234,"@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber":260,"@airgap/coinlib-core/dependencies/src/bip39-2.5.0/index":262,"@airgap/coinlib-core/dependencies/src/bs58check-2.1.2/index":273,"@airgap/coinlib-core/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/index":281,"@airgap/coinlib-core/dependencies/src/rlp-2.2.3/index":293,"@airgap/coinlib-core/errors":307,"@airgap/coinlib-core/errors/coinlib-error":306,"@airgap/coinlib-core/protocols/NonExtendedProtocol":312,"@airgap/coinlib-core/utils/ProtocolSymbols":317,"@airgap/coinlib-core/utils/base64Check":319,"@airgap/coinlib-core/utils/hex":321,"@stablelib/ed25519":2,"buffer":76}],227:[function(require,module,exports){
|
|
32958
32960
|
"use strict";
|
|
32959
32961
|
var __extends = (this && this.__extends) || (function () {
|
|
32960
32962
|
var extendStatics = function (d, b) {
|
|
@@ -33062,240 +33064,684 @@ var AeternityProtocolOptions = /** @class */ (function () {
|
|
|
33062
33064
|
}());
|
|
33063
33065
|
exports.AeternityProtocolOptions = AeternityProtocolOptions;
|
|
33064
33066
|
|
|
33065
|
-
},{"@airgap/coinlib-core/utils/ProtocolNetwork":
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33070
|
-
var
|
|
33071
|
-
|
|
33072
|
-
|
|
33073
|
-
|
|
33074
|
-
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
33079
|
-
var requestData = config.data;
|
|
33080
|
-
var requestHeaders = config.headers;
|
|
33081
|
-
|
|
33082
|
-
if (utils.isFormData(requestData)) {
|
|
33083
|
-
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
33067
|
+
},{"@airgap/coinlib-core/utils/ProtocolNetwork":316}],228:[function(require,module,exports){
|
|
33068
|
+
"use strict";
|
|
33069
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33070
|
+
exports.createProtocolByIdentifier = void 0;
|
|
33071
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
33072
|
+
var AeternityProtocol_1 = require("../protocol/AeternityProtocol");
|
|
33073
|
+
// tslint:disable-next-line: cyclomatic-complexity
|
|
33074
|
+
function createProtocolByIdentifier(identifier, options) {
|
|
33075
|
+
switch (identifier) {
|
|
33076
|
+
case coinlib_core_1.MainProtocolSymbols.AE:
|
|
33077
|
+
return new AeternityProtocol_1.AeternityProtocol(options);
|
|
33078
|
+
default:
|
|
33079
|
+
throw new Error("Unkown protocol identifier " + identifier + ".");
|
|
33084
33080
|
}
|
|
33081
|
+
}
|
|
33082
|
+
exports.createProtocolByIdentifier = createProtocolByIdentifier;
|
|
33085
33083
|
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
|
-
|
|
33089
|
-
|
|
33090
|
-
|
|
33091
|
-
|
|
33092
|
-
|
|
33084
|
+
},{"../protocol/AeternityProtocol":226,"@airgap/coinlib-core":308}],229:[function(require,module,exports){
|
|
33085
|
+
"use strict";
|
|
33086
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33087
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33088
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33089
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
33090
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33091
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33092
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33093
|
+
});
|
|
33094
|
+
};
|
|
33095
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33096
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
33097
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33098
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33099
|
+
function step(op) {
|
|
33100
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
33101
|
+
while (_) try {
|
|
33102
|
+
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;
|
|
33103
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33104
|
+
switch (op[0]) {
|
|
33105
|
+
case 0: case 1: t = op; break;
|
|
33106
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33107
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
33108
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
33109
|
+
default:
|
|
33110
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33111
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
33112
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33113
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33114
|
+
if (t[2]) _.ops.pop();
|
|
33115
|
+
_.trys.pop(); continue;
|
|
33116
|
+
}
|
|
33117
|
+
op = body.call(thisArg, _);
|
|
33118
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
33119
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
33093
33120
|
}
|
|
33094
|
-
|
|
33095
|
-
|
|
33096
|
-
|
|
33097
|
-
|
|
33098
|
-
|
|
33099
|
-
|
|
33100
|
-
|
|
33101
|
-
|
|
33102
|
-
|
|
33103
|
-
|
|
33104
|
-
|
|
33105
|
-
|
|
33106
|
-
|
|
33107
|
-
|
|
33108
|
-
|
|
33109
|
-
|
|
33110
|
-
|
|
33111
|
-
|
|
33112
|
-
|
|
33113
|
-
|
|
33114
|
-
|
|
33115
|
-
|
|
33116
|
-
|
|
33117
|
-
|
|
33118
|
-
|
|
33119
|
-
|
|
33120
|
-
|
|
33121
|
-
|
|
33122
|
-
|
|
33123
|
-
|
|
33124
|
-
|
|
33125
|
-
|
|
33126
|
-
settle(resolve, reject, response);
|
|
33127
|
-
|
|
33128
|
-
// Clean up request
|
|
33129
|
-
request = null;
|
|
33121
|
+
};
|
|
33122
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33123
|
+
exports.Action = exports.ActionState = void 0;
|
|
33124
|
+
var errors_1 = require("../errors");
|
|
33125
|
+
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
33126
|
+
var StateMachine_1 = require("./StateMachine");
|
|
33127
|
+
var ActionState;
|
|
33128
|
+
(function (ActionState) {
|
|
33129
|
+
ActionState[ActionState["READY"] = 0] = "READY";
|
|
33130
|
+
ActionState[ActionState["EXECUTING"] = 1] = "EXECUTING";
|
|
33131
|
+
ActionState[ActionState["COMPLETED"] = 2] = "COMPLETED";
|
|
33132
|
+
ActionState[ActionState["CANCELLED"] = 3] = "CANCELLED";
|
|
33133
|
+
})(ActionState = exports.ActionState || (exports.ActionState = {}));
|
|
33134
|
+
var Action = /** @class */ (function () {
|
|
33135
|
+
function Action(context) {
|
|
33136
|
+
this.stateMachine = new StateMachine_1.StateMachine(ActionState.READY, new Map([
|
|
33137
|
+
[ActionState.READY, []],
|
|
33138
|
+
[ActionState.EXECUTING, [ActionState.READY]],
|
|
33139
|
+
[ActionState.COMPLETED, [ActionState.EXECUTING]],
|
|
33140
|
+
[ActionState.CANCELLED, [ActionState.READY, ActionState.EXECUTING]]
|
|
33141
|
+
]));
|
|
33142
|
+
this.context = context;
|
|
33143
|
+
}
|
|
33144
|
+
Object.defineProperty(Action.prototype, "identifier", {
|
|
33145
|
+
get: function () {
|
|
33146
|
+
return 'action';
|
|
33147
|
+
},
|
|
33148
|
+
enumerable: false,
|
|
33149
|
+
configurable: true
|
|
33150
|
+
});
|
|
33151
|
+
Action.prototype.getState = function () {
|
|
33152
|
+
return this.stateMachine.getState();
|
|
33130
33153
|
};
|
|
33131
|
-
|
|
33132
|
-
|
|
33133
|
-
|
|
33134
|
-
|
|
33135
|
-
|
|
33136
|
-
|
|
33137
|
-
|
|
33138
|
-
|
|
33139
|
-
|
|
33140
|
-
|
|
33141
|
-
|
|
33154
|
+
Action.prototype.start = function () {
|
|
33155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
33156
|
+
var result, error_1;
|
|
33157
|
+
return __generator(this, function (_a) {
|
|
33158
|
+
switch (_a.label) {
|
|
33159
|
+
case 0:
|
|
33160
|
+
_a.trys.push([0, 2, , 3]);
|
|
33161
|
+
this.stateMachine.transitionTo(ActionState.EXECUTING);
|
|
33162
|
+
return [4 /*yield*/, this.perform()];
|
|
33163
|
+
case 1:
|
|
33164
|
+
result = _a.sent();
|
|
33165
|
+
this.handleSuccess(result);
|
|
33166
|
+
return [3 /*break*/, 3];
|
|
33167
|
+
case 2:
|
|
33168
|
+
error_1 = _a.sent();
|
|
33169
|
+
this.handleError(error_1);
|
|
33170
|
+
return [3 /*break*/, 3];
|
|
33171
|
+
case 3: return [2 /*return*/];
|
|
33172
|
+
}
|
|
33173
|
+
});
|
|
33174
|
+
});
|
|
33142
33175
|
};
|
|
33143
|
-
|
|
33144
|
-
|
|
33145
|
-
|
|
33146
|
-
|
|
33147
|
-
|
|
33148
|
-
reject(createError('Network Error', config, null, request));
|
|
33149
|
-
|
|
33150
|
-
// Clean up request
|
|
33151
|
-
request = null;
|
|
33176
|
+
Action.prototype.cancel = function () {
|
|
33177
|
+
this.stateMachine.transitionTo(ActionState.CANCELLED);
|
|
33178
|
+
if (this.onCancel) {
|
|
33179
|
+
this.onCancel();
|
|
33180
|
+
}
|
|
33152
33181
|
};
|
|
33153
|
-
|
|
33154
|
-
|
|
33155
|
-
request.ontimeout = function handleTimeout() {
|
|
33156
|
-
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
|
|
33157
|
-
request));
|
|
33158
|
-
|
|
33159
|
-
// Clean up request
|
|
33160
|
-
request = null;
|
|
33182
|
+
Action.prototype.addValidTransition = function (from, to) {
|
|
33183
|
+
this.stateMachine.addValidStateTransition(from, to);
|
|
33161
33184
|
};
|
|
33162
|
-
|
|
33163
|
-
|
|
33164
|
-
|
|
33165
|
-
|
|
33166
|
-
|
|
33167
|
-
var cookies = require('./../helpers/cookies');
|
|
33168
|
-
|
|
33169
|
-
// Add xsrf header
|
|
33170
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
|
|
33171
|
-
cookies.read(config.xsrfCookieName) :
|
|
33172
|
-
undefined;
|
|
33173
|
-
|
|
33174
|
-
if (xsrfValue) {
|
|
33175
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
33176
|
-
}
|
|
33177
|
-
}
|
|
33178
|
-
|
|
33179
|
-
// Add headers to the request
|
|
33180
|
-
if ('setRequestHeader' in request) {
|
|
33181
|
-
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
33182
|
-
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
|
33183
|
-
// Remove Content-Type if data is undefined
|
|
33184
|
-
delete requestHeaders[key];
|
|
33185
|
-
} else {
|
|
33186
|
-
// Otherwise add header to the request
|
|
33187
|
-
request.setRequestHeader(key, val);
|
|
33185
|
+
Action.prototype.handleSuccess = function (result) {
|
|
33186
|
+
this.result = result;
|
|
33187
|
+
this.stateMachine.transitionTo(ActionState.COMPLETED);
|
|
33188
|
+
if (this.onComplete) {
|
|
33189
|
+
this.onComplete(result);
|
|
33188
33190
|
}
|
|
33189
|
-
|
|
33190
|
-
|
|
33191
|
-
|
|
33192
|
-
|
|
33193
|
-
|
|
33194
|
-
|
|
33195
|
-
}
|
|
33196
|
-
|
|
33197
|
-
// Add responseType to request if needed
|
|
33198
|
-
if (config.responseType) {
|
|
33199
|
-
try {
|
|
33200
|
-
request.responseType = config.responseType;
|
|
33201
|
-
} catch (e) {
|
|
33202
|
-
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
|
|
33203
|
-
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
|
|
33204
|
-
if (config.responseType !== 'json') {
|
|
33205
|
-
throw e;
|
|
33191
|
+
};
|
|
33192
|
+
Action.prototype.handleError = function (error) {
|
|
33193
|
+
this.error = error;
|
|
33194
|
+
this.stateMachine.transitionTo(ActionState.COMPLETED);
|
|
33195
|
+
if (this.onError) {
|
|
33196
|
+
this.onError(error);
|
|
33206
33197
|
}
|
|
33207
|
-
|
|
33208
|
-
}
|
|
33198
|
+
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.ACTIONS, error.message);
|
|
33199
|
+
};
|
|
33200
|
+
return Action;
|
|
33201
|
+
}());
|
|
33202
|
+
exports.Action = Action;
|
|
33209
33203
|
|
|
33210
|
-
|
|
33211
|
-
|
|
33212
|
-
|
|
33204
|
+
},{"../errors":307,"../errors/coinlib-error":306,"./StateMachine":233}],230:[function(require,module,exports){
|
|
33205
|
+
"use strict";
|
|
33206
|
+
var __extends = (this && this.__extends) || (function () {
|
|
33207
|
+
var extendStatics = function (d, b) {
|
|
33208
|
+
extendStatics = Object.setPrototypeOf ||
|
|
33209
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
33210
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
33211
|
+
return extendStatics(d, b);
|
|
33212
|
+
};
|
|
33213
|
+
return function (d, b) {
|
|
33214
|
+
extendStatics(d, b);
|
|
33215
|
+
function __() { this.constructor = d; }
|
|
33216
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33217
|
+
};
|
|
33218
|
+
})();
|
|
33219
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33220
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33221
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33222
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
33223
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33224
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33225
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33226
|
+
});
|
|
33227
|
+
};
|
|
33228
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33229
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
33230
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33231
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33232
|
+
function step(op) {
|
|
33233
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
33234
|
+
while (_) try {
|
|
33235
|
+
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;
|
|
33236
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33237
|
+
switch (op[0]) {
|
|
33238
|
+
case 0: case 1: t = op; break;
|
|
33239
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33240
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
33241
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
33242
|
+
default:
|
|
33243
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33244
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
33245
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33246
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33247
|
+
if (t[2]) _.ops.pop();
|
|
33248
|
+
_.trys.pop(); continue;
|
|
33249
|
+
}
|
|
33250
|
+
op = body.call(thisArg, _);
|
|
33251
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
33252
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
33213
33253
|
}
|
|
33214
|
-
|
|
33215
|
-
|
|
33216
|
-
|
|
33217
|
-
|
|
33254
|
+
};
|
|
33255
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33256
|
+
exports.LinkedAction = void 0;
|
|
33257
|
+
var Action_1 = require("./Action");
|
|
33258
|
+
var LinkedAction = /** @class */ (function (_super) {
|
|
33259
|
+
__extends(LinkedAction, _super);
|
|
33260
|
+
function LinkedAction(action, linkedActionType) {
|
|
33261
|
+
var _this = _super.call(this) || this;
|
|
33262
|
+
_this.linkedActionType = linkedActionType;
|
|
33263
|
+
_this.action = action;
|
|
33264
|
+
return _this;
|
|
33218
33265
|
}
|
|
33219
|
-
|
|
33220
|
-
|
|
33221
|
-
|
|
33222
|
-
|
|
33223
|
-
|
|
33224
|
-
|
|
33266
|
+
LinkedAction.prototype.getLinkedAction = function () {
|
|
33267
|
+
return this.linkedAction;
|
|
33268
|
+
};
|
|
33269
|
+
LinkedAction.prototype.perform = function () {
|
|
33270
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
33271
|
+
return __generator(this, function (_a) {
|
|
33272
|
+
switch (_a.label) {
|
|
33273
|
+
case 0: return [4 /*yield*/, this.action.start()];
|
|
33274
|
+
case 1:
|
|
33275
|
+
_a.sent();
|
|
33276
|
+
this.linkedAction = new this.linkedActionType(this.action.result);
|
|
33277
|
+
return [4 /*yield*/, this.linkedAction.start()];
|
|
33278
|
+
case 2:
|
|
33279
|
+
_a.sent();
|
|
33280
|
+
return [2 /*return*/, this.linkedAction.result];
|
|
33281
|
+
}
|
|
33282
|
+
});
|
|
33283
|
+
});
|
|
33284
|
+
};
|
|
33285
|
+
LinkedAction.prototype.cancel = function () {
|
|
33286
|
+
if (this.action.getState() === Action_1.ActionState.EXECUTING) {
|
|
33287
|
+
this.action.cancel();
|
|
33288
|
+
}
|
|
33289
|
+
else if (this.linkedAction !== undefined && this.linkedAction.getState() === Action_1.ActionState.EXECUTING) {
|
|
33290
|
+
this.linkedAction.cancel();
|
|
33225
33291
|
}
|
|
33292
|
+
_super.prototype.cancel.call(this);
|
|
33293
|
+
};
|
|
33294
|
+
return LinkedAction;
|
|
33295
|
+
}(Action_1.Action));
|
|
33296
|
+
exports.LinkedAction = LinkedAction;
|
|
33226
33297
|
|
|
33227
|
-
|
|
33228
|
-
|
|
33229
|
-
|
|
33230
|
-
|
|
33231
|
-
|
|
33298
|
+
},{"./Action":229}],231:[function(require,module,exports){
|
|
33299
|
+
"use strict";
|
|
33300
|
+
var __extends = (this && this.__extends) || (function () {
|
|
33301
|
+
var extendStatics = function (d, b) {
|
|
33302
|
+
extendStatics = Object.setPrototypeOf ||
|
|
33303
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
33304
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
33305
|
+
return extendStatics(d, b);
|
|
33306
|
+
};
|
|
33307
|
+
return function (d, b) {
|
|
33308
|
+
extendStatics(d, b);
|
|
33309
|
+
function __() { this.constructor = d; }
|
|
33310
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33311
|
+
};
|
|
33312
|
+
})();
|
|
33313
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33314
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33315
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33316
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
33317
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33318
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33319
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33320
|
+
});
|
|
33321
|
+
};
|
|
33322
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33323
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
33324
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33325
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33326
|
+
function step(op) {
|
|
33327
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
33328
|
+
while (_) try {
|
|
33329
|
+
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;
|
|
33330
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33331
|
+
switch (op[0]) {
|
|
33332
|
+
case 0: case 1: t = op; break;
|
|
33333
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33334
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
33335
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
33336
|
+
default:
|
|
33337
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33338
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
33339
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33340
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33341
|
+
if (t[2]) _.ops.pop();
|
|
33342
|
+
_.trys.pop(); continue;
|
|
33343
|
+
}
|
|
33344
|
+
op = body.call(thisArg, _);
|
|
33345
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
33346
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
33232
33347
|
}
|
|
33233
|
-
|
|
33234
|
-
|
|
33235
|
-
|
|
33348
|
+
};
|
|
33349
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33350
|
+
exports.RepeatableAction = void 0;
|
|
33351
|
+
var Action_1 = require("./Action");
|
|
33352
|
+
var RepeatableAction = /** @class */ (function (_super) {
|
|
33353
|
+
__extends(RepeatableAction, _super);
|
|
33354
|
+
function RepeatableAction(context, actionFactory) {
|
|
33355
|
+
var _this = _super.call(this, context) || this;
|
|
33356
|
+
_this.actionFactory = actionFactory;
|
|
33357
|
+
_this.addValidTransition(Action_1.ActionState.EXECUTING, Action_1.ActionState.EXECUTING);
|
|
33358
|
+
_this.addValidTransition(Action_1.ActionState.COMPLETED, Action_1.ActionState.EXECUTING);
|
|
33359
|
+
_this.addValidTransition(Action_1.ActionState.CANCELLED, Action_1.ActionState.EXECUTING);
|
|
33360
|
+
return _this;
|
|
33236
33361
|
}
|
|
33362
|
+
RepeatableAction.prototype.perform = function () {
|
|
33363
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
33364
|
+
return __generator(this, function (_a) {
|
|
33365
|
+
switch (_a.label) {
|
|
33366
|
+
case 0:
|
|
33367
|
+
if (this.innerAction !== undefined && this.innerAction.getState() === Action_1.ActionState.EXECUTING) {
|
|
33368
|
+
this.innerAction.cancel();
|
|
33369
|
+
}
|
|
33370
|
+
this.innerAction = this.actionFactory();
|
|
33371
|
+
return [4 /*yield*/, this.innerAction.start()];
|
|
33372
|
+
case 1:
|
|
33373
|
+
_a.sent();
|
|
33374
|
+
return [2 /*return*/, this.innerAction.result];
|
|
33375
|
+
}
|
|
33376
|
+
});
|
|
33377
|
+
});
|
|
33378
|
+
};
|
|
33379
|
+
RepeatableAction.prototype.cancel = function () {
|
|
33380
|
+
if (this.innerAction !== undefined && this.innerAction.getState() === Action_1.ActionState.EXECUTING) {
|
|
33381
|
+
this.innerAction.cancel();
|
|
33382
|
+
}
|
|
33383
|
+
_super.prototype.cancel.call(this);
|
|
33384
|
+
};
|
|
33385
|
+
return RepeatableAction;
|
|
33386
|
+
}(Action_1.Action));
|
|
33387
|
+
exports.RepeatableAction = RepeatableAction;
|
|
33237
33388
|
|
|
33238
|
-
|
|
33239
|
-
|
|
33240
|
-
|
|
33389
|
+
},{"./Action":229}],232:[function(require,module,exports){
|
|
33390
|
+
"use strict";
|
|
33391
|
+
var __extends = (this && this.__extends) || (function () {
|
|
33392
|
+
var extendStatics = function (d, b) {
|
|
33393
|
+
extendStatics = Object.setPrototypeOf ||
|
|
33394
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
33395
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
33396
|
+
return extendStatics(d, b);
|
|
33397
|
+
};
|
|
33398
|
+
return function (d, b) {
|
|
33399
|
+
extendStatics(d, b);
|
|
33400
|
+
function __() { this.constructor = d; }
|
|
33401
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33402
|
+
};
|
|
33403
|
+
})();
|
|
33404
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
33405
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33406
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33407
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
33408
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33409
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33410
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33411
|
+
});
|
|
33412
|
+
};
|
|
33413
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33414
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
33415
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
33416
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33417
|
+
function step(op) {
|
|
33418
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
33419
|
+
while (_) try {
|
|
33420
|
+
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;
|
|
33421
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33422
|
+
switch (op[0]) {
|
|
33423
|
+
case 0: case 1: t = op; break;
|
|
33424
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33425
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
33426
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
33427
|
+
default:
|
|
33428
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33429
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
33430
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33431
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33432
|
+
if (t[2]) _.ops.pop();
|
|
33433
|
+
_.trys.pop(); continue;
|
|
33434
|
+
}
|
|
33435
|
+
op = body.call(thisArg, _);
|
|
33436
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
33437
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
33438
|
+
}
|
|
33241
33439
|
};
|
|
33440
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33441
|
+
exports.SimpleAction = void 0;
|
|
33442
|
+
var Action_1 = require("./Action");
|
|
33443
|
+
var SimpleAction = /** @class */ (function (_super) {
|
|
33444
|
+
__extends(SimpleAction, _super);
|
|
33445
|
+
function SimpleAction(promise) {
|
|
33446
|
+
var _this = _super.call(this) || this;
|
|
33447
|
+
_this.promise = promise;
|
|
33448
|
+
return _this;
|
|
33449
|
+
}
|
|
33450
|
+
Object.defineProperty(SimpleAction.prototype, "identifier", {
|
|
33451
|
+
get: function () {
|
|
33452
|
+
return 'simple-action';
|
|
33453
|
+
},
|
|
33454
|
+
enumerable: false,
|
|
33455
|
+
configurable: true
|
|
33456
|
+
});
|
|
33457
|
+
SimpleAction.prototype.perform = function () {
|
|
33458
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
33459
|
+
return __generator(this, function (_a) {
|
|
33460
|
+
return [2 /*return*/, this.promise()];
|
|
33461
|
+
});
|
|
33462
|
+
});
|
|
33463
|
+
};
|
|
33464
|
+
return SimpleAction;
|
|
33465
|
+
}(Action_1.Action));
|
|
33466
|
+
exports.SimpleAction = SimpleAction;
|
|
33467
|
+
|
|
33468
|
+
},{"./Action":229}],233:[function(require,module,exports){
|
|
33469
|
+
"use strict";
|
|
33470
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33471
|
+
exports.StateMachine = void 0;
|
|
33472
|
+
var errors_1 = require("../errors");
|
|
33473
|
+
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
33474
|
+
var StateMachine = /** @class */ (function () {
|
|
33475
|
+
function StateMachine(initialState, validTransitions) {
|
|
33476
|
+
this.state = initialState;
|
|
33477
|
+
this.validTransitions = validTransitions;
|
|
33478
|
+
}
|
|
33479
|
+
StateMachine.prototype.transitionTo = function (state) {
|
|
33480
|
+
if (this.canTransitionTo(state)) {
|
|
33481
|
+
this.state = state;
|
|
33482
|
+
}
|
|
33483
|
+
else {
|
|
33484
|
+
throw new errors_1.OperationFailedError(coinlib_error_1.Domain.ACTIONS, "Invalid state transition: " + this.state + " -> " + state);
|
|
33485
|
+
}
|
|
33486
|
+
};
|
|
33487
|
+
StateMachine.prototype.getState = function () {
|
|
33488
|
+
return this.state;
|
|
33489
|
+
};
|
|
33490
|
+
StateMachine.prototype.addValidStateTransition = function (from, to) {
|
|
33491
|
+
var states = this.validTransitions.get(to);
|
|
33492
|
+
if (states !== undefined && states.indexOf(from) === -1) {
|
|
33493
|
+
states.push(from);
|
|
33494
|
+
this.validTransitions.set(to, states);
|
|
33495
|
+
}
|
|
33496
|
+
else {
|
|
33497
|
+
this.validTransitions.set(to, [from]);
|
|
33498
|
+
}
|
|
33499
|
+
};
|
|
33500
|
+
StateMachine.prototype.canTransitionTo = function (state) {
|
|
33501
|
+
var states = this.validTransitions.get(state);
|
|
33502
|
+
if (states !== undefined) {
|
|
33503
|
+
return states.indexOf(this.state) !== -1;
|
|
33504
|
+
}
|
|
33505
|
+
return false;
|
|
33506
|
+
};
|
|
33507
|
+
return StateMachine;
|
|
33508
|
+
}());
|
|
33509
|
+
exports.StateMachine = StateMachine;
|
|
33242
33510
|
|
|
33243
|
-
},{"../
|
|
33511
|
+
},{"../errors":307,"../errors/coinlib-error":306}],234:[function(require,module,exports){
|
|
33512
|
+
module.exports = require('./lib/axios');
|
|
33513
|
+
},{"./lib/axios":236}],235:[function(require,module,exports){
|
|
33244
33514
|
'use strict';
|
|
33245
33515
|
|
|
33246
|
-
var utils = require('
|
|
33247
|
-
var
|
|
33248
|
-
var
|
|
33249
|
-
var
|
|
33250
|
-
var
|
|
33516
|
+
var utils = require('./../utils');
|
|
33517
|
+
var settle = require('./../core/settle');
|
|
33518
|
+
var buildURL = require('./../helpers/buildURL');
|
|
33519
|
+
var parseHeaders = require('./../helpers/parseHeaders');
|
|
33520
|
+
var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
|
|
33521
|
+
var createError = require('../core/createError');
|
|
33251
33522
|
|
|
33252
|
-
|
|
33253
|
-
|
|
33254
|
-
|
|
33255
|
-
|
|
33256
|
-
* @return {Axios} A new instance of Axios
|
|
33257
|
-
*/
|
|
33258
|
-
function createInstance(defaultConfig) {
|
|
33259
|
-
var context = new Axios(defaultConfig);
|
|
33260
|
-
var instance = bind(Axios.prototype.request, context);
|
|
33523
|
+
module.exports = function xhrAdapter(config) {
|
|
33524
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
33525
|
+
var requestData = config.data;
|
|
33526
|
+
var requestHeaders = config.headers;
|
|
33261
33527
|
|
|
33262
|
-
|
|
33263
|
-
|
|
33528
|
+
if (utils.isFormData(requestData)) {
|
|
33529
|
+
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
33530
|
+
}
|
|
33264
33531
|
|
|
33265
|
-
|
|
33266
|
-
utils.extend(instance, context);
|
|
33532
|
+
var request = new XMLHttpRequest();
|
|
33267
33533
|
|
|
33268
|
-
|
|
33269
|
-
|
|
33534
|
+
// HTTP basic authentication
|
|
33535
|
+
if (config.auth) {
|
|
33536
|
+
var username = config.auth.username || '';
|
|
33537
|
+
var password = config.auth.password || '';
|
|
33538
|
+
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
|
33539
|
+
}
|
|
33270
33540
|
|
|
33271
|
-
|
|
33272
|
-
var axios = createInstance(defaults);
|
|
33541
|
+
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
|
|
33273
33542
|
|
|
33274
|
-
//
|
|
33275
|
-
|
|
33543
|
+
// Set the request timeout in MS
|
|
33544
|
+
request.timeout = config.timeout;
|
|
33276
33545
|
|
|
33277
|
-
//
|
|
33278
|
-
|
|
33279
|
-
|
|
33280
|
-
|
|
33546
|
+
// Listen for ready state
|
|
33547
|
+
request.onreadystatechange = function handleLoad() {
|
|
33548
|
+
if (!request || request.readyState !== 4) {
|
|
33549
|
+
return;
|
|
33550
|
+
}
|
|
33281
33551
|
|
|
33282
|
-
//
|
|
33283
|
-
|
|
33284
|
-
|
|
33285
|
-
|
|
33552
|
+
// The request errored out and we didn't get a response, this will be
|
|
33553
|
+
// handled by onerror instead
|
|
33554
|
+
// With one exception: request that using file: protocol, most browsers
|
|
33555
|
+
// will return status as 0 even though it's a successful request
|
|
33556
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
33557
|
+
return;
|
|
33558
|
+
}
|
|
33286
33559
|
|
|
33287
|
-
//
|
|
33288
|
-
|
|
33289
|
-
|
|
33290
|
-
|
|
33291
|
-
|
|
33560
|
+
// Prepare the response
|
|
33561
|
+
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
|
33562
|
+
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
|
|
33563
|
+
var response = {
|
|
33564
|
+
data: responseData,
|
|
33565
|
+
status: request.status,
|
|
33566
|
+
statusText: request.statusText,
|
|
33567
|
+
headers: responseHeaders,
|
|
33568
|
+
config: config,
|
|
33569
|
+
request: request
|
|
33570
|
+
};
|
|
33292
33571
|
|
|
33293
|
-
|
|
33572
|
+
settle(resolve, reject, response);
|
|
33573
|
+
|
|
33574
|
+
// Clean up request
|
|
33575
|
+
request = null;
|
|
33576
|
+
};
|
|
33577
|
+
|
|
33578
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
33579
|
+
request.onabort = function handleAbort() {
|
|
33580
|
+
if (!request) {
|
|
33581
|
+
return;
|
|
33582
|
+
}
|
|
33583
|
+
|
|
33584
|
+
reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
|
33585
|
+
|
|
33586
|
+
// Clean up request
|
|
33587
|
+
request = null;
|
|
33588
|
+
};
|
|
33589
|
+
|
|
33590
|
+
// Handle low level network errors
|
|
33591
|
+
request.onerror = function handleError() {
|
|
33592
|
+
// Real errors are hidden from us by the browser
|
|
33593
|
+
// onerror should only fire if it's a network error
|
|
33594
|
+
reject(createError('Network Error', config, null, request));
|
|
33595
|
+
|
|
33596
|
+
// Clean up request
|
|
33597
|
+
request = null;
|
|
33598
|
+
};
|
|
33599
|
+
|
|
33600
|
+
// Handle timeout
|
|
33601
|
+
request.ontimeout = function handleTimeout() {
|
|
33602
|
+
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
|
|
33603
|
+
request));
|
|
33604
|
+
|
|
33605
|
+
// Clean up request
|
|
33606
|
+
request = null;
|
|
33607
|
+
};
|
|
33608
|
+
|
|
33609
|
+
// Add xsrf header
|
|
33610
|
+
// This is only done if running in a standard browser environment.
|
|
33611
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
33612
|
+
if (utils.isStandardBrowserEnv()) {
|
|
33613
|
+
var cookies = require('./../helpers/cookies');
|
|
33614
|
+
|
|
33615
|
+
// Add xsrf header
|
|
33616
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
|
|
33617
|
+
cookies.read(config.xsrfCookieName) :
|
|
33618
|
+
undefined;
|
|
33619
|
+
|
|
33620
|
+
if (xsrfValue) {
|
|
33621
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
33622
|
+
}
|
|
33623
|
+
}
|
|
33624
|
+
|
|
33625
|
+
// Add headers to the request
|
|
33626
|
+
if ('setRequestHeader' in request) {
|
|
33627
|
+
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
33628
|
+
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
|
33629
|
+
// Remove Content-Type if data is undefined
|
|
33630
|
+
delete requestHeaders[key];
|
|
33631
|
+
} else {
|
|
33632
|
+
// Otherwise add header to the request
|
|
33633
|
+
request.setRequestHeader(key, val);
|
|
33634
|
+
}
|
|
33635
|
+
});
|
|
33636
|
+
}
|
|
33637
|
+
|
|
33638
|
+
// Add withCredentials to request if needed
|
|
33639
|
+
if (config.withCredentials) {
|
|
33640
|
+
request.withCredentials = true;
|
|
33641
|
+
}
|
|
33642
|
+
|
|
33643
|
+
// Add responseType to request if needed
|
|
33644
|
+
if (config.responseType) {
|
|
33645
|
+
try {
|
|
33646
|
+
request.responseType = config.responseType;
|
|
33647
|
+
} catch (e) {
|
|
33648
|
+
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
|
|
33649
|
+
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
|
|
33650
|
+
if (config.responseType !== 'json') {
|
|
33651
|
+
throw e;
|
|
33652
|
+
}
|
|
33653
|
+
}
|
|
33654
|
+
}
|
|
33655
|
+
|
|
33656
|
+
// Handle progress if needed
|
|
33657
|
+
if (typeof config.onDownloadProgress === 'function') {
|
|
33658
|
+
request.addEventListener('progress', config.onDownloadProgress);
|
|
33659
|
+
}
|
|
33660
|
+
|
|
33661
|
+
// Not all browsers support upload events
|
|
33662
|
+
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
|
33663
|
+
request.upload.addEventListener('progress', config.onUploadProgress);
|
|
33664
|
+
}
|
|
33665
|
+
|
|
33666
|
+
if (config.cancelToken) {
|
|
33667
|
+
// Handle cancellation
|
|
33668
|
+
config.cancelToken.promise.then(function onCanceled(cancel) {
|
|
33669
|
+
if (!request) {
|
|
33670
|
+
return;
|
|
33671
|
+
}
|
|
33672
|
+
|
|
33673
|
+
request.abort();
|
|
33674
|
+
reject(cancel);
|
|
33675
|
+
// Clean up request
|
|
33676
|
+
request = null;
|
|
33677
|
+
});
|
|
33678
|
+
}
|
|
33679
|
+
|
|
33680
|
+
if (requestData === undefined) {
|
|
33681
|
+
requestData = null;
|
|
33682
|
+
}
|
|
33683
|
+
|
|
33684
|
+
// Send the request
|
|
33685
|
+
request.send(requestData);
|
|
33686
|
+
});
|
|
33687
|
+
};
|
|
33688
|
+
|
|
33689
|
+
},{"../core/createError":242,"./../core/settle":246,"./../helpers/buildURL":250,"./../helpers/cookies":252,"./../helpers/isURLSameOrigin":254,"./../helpers/parseHeaders":256,"./../utils":258}],236:[function(require,module,exports){
|
|
33690
|
+
'use strict';
|
|
33691
|
+
|
|
33692
|
+
var utils = require('./utils');
|
|
33693
|
+
var bind = require('./helpers/bind');
|
|
33694
|
+
var Axios = require('./core/Axios');
|
|
33695
|
+
var mergeConfig = require('./core/mergeConfig');
|
|
33696
|
+
var defaults = require('./defaults');
|
|
33697
|
+
|
|
33698
|
+
/**
|
|
33699
|
+
* Create an instance of Axios
|
|
33700
|
+
*
|
|
33701
|
+
* @param {Object} defaultConfig The default config for the instance
|
|
33702
|
+
* @return {Axios} A new instance of Axios
|
|
33703
|
+
*/
|
|
33704
|
+
function createInstance(defaultConfig) {
|
|
33705
|
+
var context = new Axios(defaultConfig);
|
|
33706
|
+
var instance = bind(Axios.prototype.request, context);
|
|
33707
|
+
|
|
33708
|
+
// Copy axios.prototype to instance
|
|
33709
|
+
utils.extend(instance, Axios.prototype, context);
|
|
33710
|
+
|
|
33711
|
+
// Copy context to instance
|
|
33712
|
+
utils.extend(instance, context);
|
|
33713
|
+
|
|
33714
|
+
return instance;
|
|
33715
|
+
}
|
|
33716
|
+
|
|
33717
|
+
// Create the default instance to be exported
|
|
33718
|
+
var axios = createInstance(defaults);
|
|
33719
|
+
|
|
33720
|
+
// Expose Axios class to allow class inheritance
|
|
33721
|
+
axios.Axios = Axios;
|
|
33722
|
+
|
|
33723
|
+
// Factory for creating new instances
|
|
33724
|
+
axios.create = function create(instanceConfig) {
|
|
33725
|
+
return createInstance(mergeConfig(axios.defaults, instanceConfig));
|
|
33726
|
+
};
|
|
33727
|
+
|
|
33728
|
+
// Expose Cancel & CancelToken
|
|
33729
|
+
axios.Cancel = require('./cancel/Cancel');
|
|
33730
|
+
axios.CancelToken = require('./cancel/CancelToken');
|
|
33731
|
+
axios.isCancel = require('./cancel/isCancel');
|
|
33732
|
+
|
|
33733
|
+
// Expose all/spread
|
|
33734
|
+
axios.all = function all(promises) {
|
|
33735
|
+
return Promise.all(promises);
|
|
33736
|
+
};
|
|
33737
|
+
axios.spread = require('./helpers/spread');
|
|
33738
|
+
|
|
33739
|
+
module.exports = axios;
|
|
33294
33740
|
|
|
33295
33741
|
// Allow use of default import syntax in TypeScript
|
|
33296
33742
|
module.exports.default = axios;
|
|
33297
33743
|
|
|
33298
|
-
},{"./cancel/Cancel":
|
|
33744
|
+
},{"./cancel/Cancel":237,"./cancel/CancelToken":238,"./cancel/isCancel":239,"./core/Axios":240,"./core/mergeConfig":245,"./defaults":248,"./helpers/bind":249,"./helpers/spread":257,"./utils":258}],237:[function(require,module,exports){
|
|
33299
33745
|
'use strict';
|
|
33300
33746
|
|
|
33301
33747
|
/**
|
|
@@ -33316,7 +33762,7 @@ Cancel.prototype.__CANCEL__ = true;
|
|
|
33316
33762
|
|
|
33317
33763
|
module.exports = Cancel;
|
|
33318
33764
|
|
|
33319
|
-
},{}],
|
|
33765
|
+
},{}],238:[function(require,module,exports){
|
|
33320
33766
|
'use strict';
|
|
33321
33767
|
|
|
33322
33768
|
var Cancel = require('./Cancel');
|
|
@@ -33375,14 +33821,14 @@ CancelToken.source = function source() {
|
|
|
33375
33821
|
|
|
33376
33822
|
module.exports = CancelToken;
|
|
33377
33823
|
|
|
33378
|
-
},{"./Cancel":
|
|
33824
|
+
},{"./Cancel":237}],239:[function(require,module,exports){
|
|
33379
33825
|
'use strict';
|
|
33380
33826
|
|
|
33381
33827
|
module.exports = function isCancel(value) {
|
|
33382
33828
|
return !!(value && value.__CANCEL__);
|
|
33383
33829
|
};
|
|
33384
33830
|
|
|
33385
|
-
},{}],
|
|
33831
|
+
},{}],240:[function(require,module,exports){
|
|
33386
33832
|
'use strict';
|
|
33387
33833
|
|
|
33388
33834
|
var utils = require('./../utils');
|
|
@@ -33470,7 +33916,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
33470
33916
|
|
|
33471
33917
|
module.exports = Axios;
|
|
33472
33918
|
|
|
33473
|
-
},{"../helpers/buildURL":
|
|
33919
|
+
},{"../helpers/buildURL":250,"./../utils":258,"./InterceptorManager":241,"./dispatchRequest":243,"./mergeConfig":245}],241:[function(require,module,exports){
|
|
33474
33920
|
'use strict';
|
|
33475
33921
|
|
|
33476
33922
|
var utils = require('./../utils');
|
|
@@ -33524,7 +33970,7 @@ InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
|
33524
33970
|
|
|
33525
33971
|
module.exports = InterceptorManager;
|
|
33526
33972
|
|
|
33527
|
-
},{"./../utils":
|
|
33973
|
+
},{"./../utils":258}],242:[function(require,module,exports){
|
|
33528
33974
|
'use strict';
|
|
33529
33975
|
|
|
33530
33976
|
var enhanceError = require('./enhanceError');
|
|
@@ -33544,7 +33990,7 @@ module.exports = function createError(message, config, code, request, response)
|
|
|
33544
33990
|
return enhanceError(error, config, code, request, response);
|
|
33545
33991
|
};
|
|
33546
33992
|
|
|
33547
|
-
},{"./enhanceError":
|
|
33993
|
+
},{"./enhanceError":244}],243:[function(require,module,exports){
|
|
33548
33994
|
'use strict';
|
|
33549
33995
|
|
|
33550
33996
|
var utils = require('./../utils');
|
|
@@ -33632,7 +34078,7 @@ module.exports = function dispatchRequest(config) {
|
|
|
33632
34078
|
});
|
|
33633
34079
|
};
|
|
33634
34080
|
|
|
33635
|
-
},{"../cancel/isCancel":
|
|
34081
|
+
},{"../cancel/isCancel":239,"../defaults":248,"./../helpers/combineURLs":251,"./../helpers/isAbsoluteURL":253,"./../utils":258,"./transformData":247}],244:[function(require,module,exports){
|
|
33636
34082
|
'use strict';
|
|
33637
34083
|
|
|
33638
34084
|
/**
|
|
@@ -33676,7 +34122,7 @@ module.exports = function enhanceError(error, config, code, request, response) {
|
|
|
33676
34122
|
return error;
|
|
33677
34123
|
};
|
|
33678
34124
|
|
|
33679
|
-
},{}],
|
|
34125
|
+
},{}],245:[function(require,module,exports){
|
|
33680
34126
|
'use strict';
|
|
33681
34127
|
|
|
33682
34128
|
var utils = require('../utils');
|
|
@@ -33729,7 +34175,7 @@ module.exports = function mergeConfig(config1, config2) {
|
|
|
33729
34175
|
return config;
|
|
33730
34176
|
};
|
|
33731
34177
|
|
|
33732
|
-
},{"../utils":
|
|
34178
|
+
},{"../utils":258}],246:[function(require,module,exports){
|
|
33733
34179
|
'use strict';
|
|
33734
34180
|
|
|
33735
34181
|
var createError = require('./createError');
|
|
@@ -33756,7 +34202,7 @@ module.exports = function settle(resolve, reject, response) {
|
|
|
33756
34202
|
}
|
|
33757
34203
|
};
|
|
33758
34204
|
|
|
33759
|
-
},{"./createError":
|
|
34205
|
+
},{"./createError":242}],247:[function(require,module,exports){
|
|
33760
34206
|
'use strict';
|
|
33761
34207
|
|
|
33762
34208
|
var utils = require('./../utils');
|
|
@@ -33778,7 +34224,7 @@ module.exports = function transformData(data, headers, fns) {
|
|
|
33778
34224
|
return data;
|
|
33779
34225
|
};
|
|
33780
34226
|
|
|
33781
|
-
},{"./../utils":
|
|
34227
|
+
},{"./../utils":258}],248:[function(require,module,exports){
|
|
33782
34228
|
(function (process){(function (){
|
|
33783
34229
|
'use strict';
|
|
33784
34230
|
|
|
@@ -33880,7 +34326,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
|
33880
34326
|
module.exports = defaults;
|
|
33881
34327
|
|
|
33882
34328
|
}).call(this)}).call(this,require('_process'))
|
|
33883
|
-
},{"./adapters/http":
|
|
34329
|
+
},{"./adapters/http":235,"./adapters/xhr":235,"./helpers/normalizeHeaderName":255,"./utils":258,"_process":180}],249:[function(require,module,exports){
|
|
33884
34330
|
'use strict';
|
|
33885
34331
|
|
|
33886
34332
|
module.exports = function bind(fn, thisArg) {
|
|
@@ -33893,7 +34339,7 @@ module.exports = function bind(fn, thisArg) {
|
|
|
33893
34339
|
};
|
|
33894
34340
|
};
|
|
33895
34341
|
|
|
33896
|
-
},{}],
|
|
34342
|
+
},{}],250:[function(require,module,exports){
|
|
33897
34343
|
'use strict';
|
|
33898
34344
|
|
|
33899
34345
|
var utils = require('./../utils');
|
|
@@ -33966,7 +34412,7 @@ module.exports = function buildURL(url, params, paramsSerializer) {
|
|
|
33966
34412
|
return url;
|
|
33967
34413
|
};
|
|
33968
34414
|
|
|
33969
|
-
},{"./../utils":
|
|
34415
|
+
},{"./../utils":258}],251:[function(require,module,exports){
|
|
33970
34416
|
'use strict';
|
|
33971
34417
|
|
|
33972
34418
|
/**
|
|
@@ -33982,7 +34428,7 @@ module.exports = function combineURLs(baseURL, relativeURL) {
|
|
|
33982
34428
|
: baseURL;
|
|
33983
34429
|
};
|
|
33984
34430
|
|
|
33985
|
-
},{}],
|
|
34431
|
+
},{}],252:[function(require,module,exports){
|
|
33986
34432
|
'use strict';
|
|
33987
34433
|
|
|
33988
34434
|
var utils = require('./../utils');
|
|
@@ -34037,7 +34483,7 @@ module.exports = (
|
|
|
34037
34483
|
})()
|
|
34038
34484
|
);
|
|
34039
34485
|
|
|
34040
|
-
},{"./../utils":
|
|
34486
|
+
},{"./../utils":258}],253:[function(require,module,exports){
|
|
34041
34487
|
'use strict';
|
|
34042
34488
|
|
|
34043
34489
|
/**
|
|
@@ -34053,7 +34499,7 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
34053
34499
|
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
34054
34500
|
};
|
|
34055
34501
|
|
|
34056
|
-
},{}],
|
|
34502
|
+
},{}],254:[function(require,module,exports){
|
|
34057
34503
|
'use strict';
|
|
34058
34504
|
|
|
34059
34505
|
var utils = require('./../utils');
|
|
@@ -34123,7 +34569,7 @@ module.exports = (
|
|
|
34123
34569
|
})()
|
|
34124
34570
|
);
|
|
34125
34571
|
|
|
34126
|
-
},{"./../utils":
|
|
34572
|
+
},{"./../utils":258}],255:[function(require,module,exports){
|
|
34127
34573
|
'use strict';
|
|
34128
34574
|
|
|
34129
34575
|
var utils = require('../utils');
|
|
@@ -34137,7 +34583,7 @@ module.exports = function normalizeHeaderName(headers, normalizedName) {
|
|
|
34137
34583
|
});
|
|
34138
34584
|
};
|
|
34139
34585
|
|
|
34140
|
-
},{"../utils":
|
|
34586
|
+
},{"../utils":258}],256:[function(require,module,exports){
|
|
34141
34587
|
'use strict';
|
|
34142
34588
|
|
|
34143
34589
|
var utils = require('./../utils');
|
|
@@ -34192,7 +34638,7 @@ module.exports = function parseHeaders(headers) {
|
|
|
34192
34638
|
return parsed;
|
|
34193
34639
|
};
|
|
34194
34640
|
|
|
34195
|
-
},{"./../utils":
|
|
34641
|
+
},{"./../utils":258}],257:[function(require,module,exports){
|
|
34196
34642
|
'use strict';
|
|
34197
34643
|
|
|
34198
34644
|
/**
|
|
@@ -34221,7 +34667,7 @@ module.exports = function spread(callback) {
|
|
|
34221
34667
|
};
|
|
34222
34668
|
};
|
|
34223
34669
|
|
|
34224
|
-
},{}],
|
|
34670
|
+
},{}],258:[function(require,module,exports){
|
|
34225
34671
|
'use strict';
|
|
34226
34672
|
|
|
34227
34673
|
var bind = require('./helpers/bind');
|
|
@@ -34557,7 +35003,7 @@ module.exports = {
|
|
|
34557
35003
|
trim: trim
|
|
34558
35004
|
};
|
|
34559
35005
|
|
|
34560
|
-
},{"../../is-buffer-2.0.3/index":
|
|
35006
|
+
},{"../../is-buffer-2.0.3/index":284,"./helpers/bind":249}],259:[function(require,module,exports){
|
|
34561
35007
|
'use strict'
|
|
34562
35008
|
// base-x encoding / decoding
|
|
34563
35009
|
// Copyright (c) 2018 base-x contributors
|
|
@@ -34679,7 +35125,7 @@ function base (ALPHABET) {
|
|
|
34679
35125
|
}
|
|
34680
35126
|
module.exports = base
|
|
34681
35127
|
|
|
34682
|
-
},{"../../safe-buffer-5.2.0/index":
|
|
35128
|
+
},{"../../safe-buffer-5.2.0/index":294}],260:[function(require,module,exports){
|
|
34683
35129
|
;(function (globalObject) {
|
|
34684
35130
|
'use strict';
|
|
34685
35131
|
|
|
@@ -37583,7 +38029,7 @@ module.exports = base
|
|
|
37583
38029
|
}
|
|
37584
38030
|
})(this);
|
|
37585
38031
|
|
|
37586
|
-
},{}],
|
|
38032
|
+
},{}],261:[function(require,module,exports){
|
|
37587
38033
|
/*
|
|
37588
38034
|
* Bitcoin BIP32 path helpers
|
|
37589
38035
|
* (C) 2016 Alex Beregszaszi
|
|
@@ -37681,7 +38127,7 @@ BIPPath.prototype.inspect = function () {
|
|
|
37681
38127
|
|
|
37682
38128
|
module.exports = BIPPath
|
|
37683
38129
|
|
|
37684
|
-
},{}],
|
|
38130
|
+
},{}],262:[function(require,module,exports){
|
|
37685
38131
|
var Buffer = require('../safe-buffer-5.2.0/index').Buffer
|
|
37686
38132
|
var createHash = require('../create-hash-1.2.0/browser')
|
|
37687
38133
|
var pbkdf2 = require('../pbkdf2-3.0.17/index').pbkdf2Sync
|
|
@@ -37836,7 +38282,7 @@ module.exports = {
|
|
|
37836
38282
|
}
|
|
37837
38283
|
}
|
|
37838
38284
|
|
|
37839
|
-
},{"../create-hash-1.2.0/browser":
|
|
38285
|
+
},{"../create-hash-1.2.0/browser":275,"../pbkdf2-3.0.17/index":286,"../randombytes-2.1.0/browser":291,"../safe-buffer-5.2.0/index":294,"../unorm-1.6.0/lib/unorm":305,"./wordlists/chinese_simplified.json":263,"./wordlists/chinese_traditional.json":264,"./wordlists/english.json":265,"./wordlists/french.json":266,"./wordlists/italian.json":267,"./wordlists/japanese.json":268,"./wordlists/korean.json":269,"./wordlists/spanish.json":270}],263:[function(require,module,exports){
|
|
37840
38286
|
module.exports=[
|
|
37841
38287
|
"的",
|
|
37842
38288
|
"一",
|
|
@@ -39887,7 +40333,7 @@ module.exports=[
|
|
|
39887
40333
|
"矮",
|
|
39888
40334
|
"歇"
|
|
39889
40335
|
]
|
|
39890
|
-
},{}],
|
|
40336
|
+
},{}],264:[function(require,module,exports){
|
|
39891
40337
|
module.exports=[
|
|
39892
40338
|
"的",
|
|
39893
40339
|
"一",
|
|
@@ -41938,7 +42384,7 @@ module.exports=[
|
|
|
41938
42384
|
"矮",
|
|
41939
42385
|
"歇"
|
|
41940
42386
|
]
|
|
41941
|
-
},{}],
|
|
42387
|
+
},{}],265:[function(require,module,exports){
|
|
41942
42388
|
module.exports=[
|
|
41943
42389
|
"abandon",
|
|
41944
42390
|
"ability",
|
|
@@ -43989,7 +44435,7 @@ module.exports=[
|
|
|
43989
44435
|
"zone",
|
|
43990
44436
|
"zoo"
|
|
43991
44437
|
]
|
|
43992
|
-
},{}],
|
|
44438
|
+
},{}],266:[function(require,module,exports){
|
|
43993
44439
|
module.exports=[
|
|
43994
44440
|
"abaisser",
|
|
43995
44441
|
"abandon",
|
|
@@ -46040,7 +46486,7 @@ module.exports=[
|
|
|
46040
46486
|
"zeste",
|
|
46041
46487
|
"zoologie"
|
|
46042
46488
|
]
|
|
46043
|
-
},{}],
|
|
46489
|
+
},{}],267:[function(require,module,exports){
|
|
46044
46490
|
module.exports=[
|
|
46045
46491
|
"abaco",
|
|
46046
46492
|
"abbaglio",
|
|
@@ -48091,7 +48537,7 @@ module.exports=[
|
|
|
48091
48537
|
"zulu",
|
|
48092
48538
|
"zuppa"
|
|
48093
48539
|
]
|
|
48094
|
-
},{}],
|
|
48540
|
+
},{}],268:[function(require,module,exports){
|
|
48095
48541
|
module.exports=[
|
|
48096
48542
|
"あいこくしん",
|
|
48097
48543
|
"あいさつ",
|
|
@@ -50142,7 +50588,7 @@ module.exports=[
|
|
|
50142
50588
|
"わらう",
|
|
50143
50589
|
"われる"
|
|
50144
50590
|
]
|
|
50145
|
-
},{}],
|
|
50591
|
+
},{}],269:[function(require,module,exports){
|
|
50146
50592
|
module.exports=[
|
|
50147
50593
|
"가격",
|
|
50148
50594
|
"가끔",
|
|
@@ -52193,7 +52639,7 @@ module.exports=[
|
|
|
52193
52639
|
"흰색",
|
|
52194
52640
|
"힘껏"
|
|
52195
52641
|
]
|
|
52196
|
-
},{}],
|
|
52642
|
+
},{}],270:[function(require,module,exports){
|
|
52197
52643
|
module.exports=[
|
|
52198
52644
|
"ábaco",
|
|
52199
52645
|
"abdomen",
|
|
@@ -54244,13 +54690,13 @@ module.exports=[
|
|
|
54244
54690
|
"zumo",
|
|
54245
54691
|
"zurdo"
|
|
54246
54692
|
]
|
|
54247
|
-
},{}],
|
|
54693
|
+
},{}],271:[function(require,module,exports){
|
|
54248
54694
|
var basex = require('../base-x-3.0.7/src/index')
|
|
54249
54695
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
|
|
54250
54696
|
|
|
54251
54697
|
module.exports = basex(ALPHABET)
|
|
54252
54698
|
|
|
54253
|
-
},{"../base-x-3.0.7/src/index":
|
|
54699
|
+
},{"../base-x-3.0.7/src/index":259}],272:[function(require,module,exports){
|
|
54254
54700
|
'use strict'
|
|
54255
54701
|
|
|
54256
54702
|
var base58 = require('../bs58-4.0.1/index')
|
|
@@ -54302,7 +54748,7 @@ module.exports = function (checksumFn) {
|
|
|
54302
54748
|
}
|
|
54303
54749
|
}
|
|
54304
54750
|
|
|
54305
|
-
},{"../bs58-4.0.1/index":
|
|
54751
|
+
},{"../bs58-4.0.1/index":271,"../safe-buffer-5.2.0/index":294}],273:[function(require,module,exports){
|
|
54306
54752
|
'use strict'
|
|
54307
54753
|
|
|
54308
54754
|
var createHash = require('../create-hash-1.2.0/browser')
|
|
@@ -54316,7 +54762,7 @@ function sha256x2 (buffer) {
|
|
|
54316
54762
|
|
|
54317
54763
|
module.exports = bs58checkBase(sha256x2)
|
|
54318
54764
|
|
|
54319
|
-
},{"../create-hash-1.2.0/browser":
|
|
54765
|
+
},{"../create-hash-1.2.0/browser":275,"./base":272}],274:[function(require,module,exports){
|
|
54320
54766
|
var Buffer = require('../safe-buffer-5.2.0/index').Buffer
|
|
54321
54767
|
var Transform = require('stream').Transform
|
|
54322
54768
|
var StringDecoder = require('string_decoder').StringDecoder
|
|
@@ -54417,7 +54863,7 @@ CipherBase.prototype._toString = function (value, enc, fin) {
|
|
|
54417
54863
|
|
|
54418
54864
|
module.exports = CipherBase
|
|
54419
54865
|
|
|
54420
|
-
},{"../inherits-2.0.4/inherits":
|
|
54866
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"stream":201,"string_decoder":216}],275:[function(require,module,exports){
|
|
54421
54867
|
'use strict'
|
|
54422
54868
|
var inherits = require('../inherits-2.0.4/inherits')
|
|
54423
54869
|
var MD5 = require('../md5.js-1.3.5/index')
|
|
@@ -54449,10 +54895,10 @@ module.exports = function createHash (alg) {
|
|
|
54449
54895
|
return new Hash(sha(alg))
|
|
54450
54896
|
}
|
|
54451
54897
|
|
|
54452
|
-
},{"../cipher-base-1.0.4/index":
|
|
54898
|
+
},{"../cipher-base-1.0.4/index":274,"../inherits-2.0.4/inherits":282,"../md5.js-1.3.5/index":285,"../ripemd160-2.0.2/index":292,"../sha.js-2.4.11/index":296}],276:[function(require,module,exports){
|
|
54453
54899
|
module.exports = require('crypto').createHash
|
|
54454
54900
|
|
|
54455
|
-
},{"crypto":87}],
|
|
54901
|
+
},{"crypto":87}],277:[function(require,module,exports){
|
|
54456
54902
|
(function (Buffer){(function (){
|
|
54457
54903
|
'use strict';
|
|
54458
54904
|
var createHash = require('../create-hash-1.2.0/browser')
|
|
@@ -54524,7 +54970,7 @@ module.exports = function createHmac(alg, key) {
|
|
|
54524
54970
|
}
|
|
54525
54971
|
|
|
54526
54972
|
}).call(this)}).call(this,require("buffer").Buffer)
|
|
54527
|
-
},{"../create-hash-1.2.0/browser":
|
|
54973
|
+
},{"../create-hash-1.2.0/browser":275,"../inherits-2.0.4/inherits":282,"buffer":76,"stream":201}],278:[function(require,module,exports){
|
|
54528
54974
|
'use strict'
|
|
54529
54975
|
var Buffer = require('../safe-buffer-5.2.0/index').Buffer
|
|
54530
54976
|
var Transform = require('stream').Transform
|
|
@@ -54621,7 +55067,7 @@ HashBase.prototype._digest = function () {
|
|
|
54621
55067
|
|
|
54622
55068
|
module.exports = HashBase
|
|
54623
55069
|
|
|
54624
|
-
},{"../inherits-2.0.4/inherits":
|
|
55070
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"stream":201}],279:[function(require,module,exports){
|
|
54625
55071
|
(function (Buffer){(function (){
|
|
54626
55072
|
"use strict";
|
|
54627
55073
|
/*
|
|
@@ -54721,7 +55167,7 @@ function derivePathFromSeed(path, seed) {
|
|
|
54721
55167
|
exports.derivePathFromSeed = derivePathFromSeed;
|
|
54722
55168
|
|
|
54723
55169
|
}).call(this)}).call(this,require("buffer").Buffer)
|
|
54724
|
-
},{"../../bip32-path-0.4.2/index":
|
|
55170
|
+
},{"../../bip32-path-0.4.2/index":261,"../../tweetnacl-1.0.1/nacl":303,"../../tweetnacl-auth-1.0.1/nacl-auth":304,"buffer":76}],280:[function(require,module,exports){
|
|
54725
55171
|
"use strict";
|
|
54726
55172
|
/*
|
|
54727
55173
|
* ISC License (ISC)
|
|
@@ -54759,7 +55205,7 @@ function getHDWalletAccounts(wallet, accountCount) {
|
|
|
54759
55205
|
}
|
|
54760
55206
|
exports.getHDWalletAccounts = getHDWalletAccounts;
|
|
54761
55207
|
|
|
54762
|
-
},{"./hd-key":
|
|
55208
|
+
},{"./hd-key":279}],281:[function(require,module,exports){
|
|
54763
55209
|
"use strict";
|
|
54764
55210
|
/*
|
|
54765
55211
|
* ISC License (ISC)
|
|
@@ -54790,7 +55236,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
54790
55236
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54791
55237
|
__exportStar(require("./hd-wallet"), exports);
|
|
54792
55238
|
|
|
54793
|
-
},{"./hd-wallet":
|
|
55239
|
+
},{"./hd-wallet":280}],282:[function(require,module,exports){
|
|
54794
55240
|
try {
|
|
54795
55241
|
var util = require('util');
|
|
54796
55242
|
/* istanbul ignore next */
|
|
@@ -54801,9 +55247,9 @@ try {
|
|
|
54801
55247
|
module.exports = require('./inherits_browser.js');
|
|
54802
55248
|
}
|
|
54803
55249
|
|
|
54804
|
-
},{"./inherits_browser.js":
|
|
55250
|
+
},{"./inherits_browser.js":283,"util":221}],283:[function(require,module,exports){
|
|
54805
55251
|
arguments[4][157][0].apply(exports,arguments)
|
|
54806
|
-
},{"dup":157}],
|
|
55252
|
+
},{"dup":157}],284:[function(require,module,exports){
|
|
54807
55253
|
/*!
|
|
54808
55254
|
* Determine if an object is a Buffer
|
|
54809
55255
|
*
|
|
@@ -54816,7 +55262,7 @@ module.exports = function isBuffer (obj) {
|
|
|
54816
55262
|
typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
|
54817
55263
|
}
|
|
54818
55264
|
|
|
54819
|
-
},{}],
|
|
55265
|
+
},{}],285:[function(require,module,exports){
|
|
54820
55266
|
'use strict'
|
|
54821
55267
|
var inherits = require('../inherits-2.0.4/inherits')
|
|
54822
55268
|
var HashBase = require('../hash-base-3.0.4/index')
|
|
@@ -54964,7 +55410,7 @@ function fnI (a, b, c, d, m, k, s) {
|
|
|
54964
55410
|
|
|
54965
55411
|
module.exports = MD5
|
|
54966
55412
|
|
|
54967
|
-
},{"../hash-base-3.0.4/index":
|
|
55413
|
+
},{"../hash-base-3.0.4/index":278,"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294}],286:[function(require,module,exports){
|
|
54968
55414
|
var checkParameters = require('./lib/precondition')
|
|
54969
55415
|
var native = require('crypto')
|
|
54970
55416
|
|
|
@@ -54997,7 +55443,7 @@ if (!native.pbkdf2Sync || native.pbkdf2Sync.toString().indexOf('keylen, digest')
|
|
|
54997
55443
|
exports.pbkdf2 = nativePBKDF2
|
|
54998
55444
|
}
|
|
54999
55445
|
|
|
55000
|
-
},{"./lib/async":
|
|
55446
|
+
},{"./lib/async":287,"./lib/precondition":289,"./lib/sync":290,"crypto":87}],287:[function(require,module,exports){
|
|
55001
55447
|
(function (process,global){(function (){
|
|
55002
55448
|
var checkParameters = require('./precondition')
|
|
55003
55449
|
var defaultEncoding = require('./default-encoding')
|
|
@@ -55101,7 +55547,7 @@ module.exports = function (password, salt, iterations, keylen, digest, callback)
|
|
|
55101
55547
|
}
|
|
55102
55548
|
|
|
55103
55549
|
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
55104
|
-
},{"../../safe-buffer-5.2.0/index":
|
|
55550
|
+
},{"../../safe-buffer-5.2.0/index":294,"./default-encoding":288,"./precondition":289,"./sync":290,"_process":180}],288:[function(require,module,exports){
|
|
55105
55551
|
(function (process){(function (){
|
|
55106
55552
|
var defaultEncoding
|
|
55107
55553
|
/* istanbul ignore next */
|
|
@@ -55115,7 +55561,7 @@ if (process.browser) {
|
|
|
55115
55561
|
module.exports = defaultEncoding
|
|
55116
55562
|
|
|
55117
55563
|
}).call(this)}).call(this,require('_process'))
|
|
55118
|
-
},{"_process":180}],
|
|
55564
|
+
},{"_process":180}],289:[function(require,module,exports){
|
|
55119
55565
|
(function (Buffer){(function (){
|
|
55120
55566
|
var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
|
|
55121
55567
|
|
|
@@ -55147,7 +55593,7 @@ module.exports = function (password, salt, iterations, keylen) {
|
|
|
55147
55593
|
}
|
|
55148
55594
|
|
|
55149
55595
|
}).call(this)}).call(this,{"isBuffer":require("../../../../../../../node_modules/is-buffer/index.js")})
|
|
55150
|
-
},{"../../../../../../../node_modules/is-buffer/index.js":159}],
|
|
55596
|
+
},{"../../../../../../../node_modules/is-buffer/index.js":159}],290:[function(require,module,exports){
|
|
55151
55597
|
var sizes = {
|
|
55152
55598
|
md5: 16,
|
|
55153
55599
|
sha1: 20,
|
|
@@ -55200,7 +55646,7 @@ function pbkdf2 (password, salt, iterations, keylen, digest) {
|
|
|
55200
55646
|
|
|
55201
55647
|
module.exports = pbkdf2
|
|
55202
55648
|
|
|
55203
|
-
},{"../../create-hmac-1.1.4/browser":
|
|
55649
|
+
},{"../../create-hmac-1.1.4/browser":277,"../../safe-buffer-5.2.0/index":294,"../lib/default-encoding":288,"../lib/precondition":289}],291:[function(require,module,exports){
|
|
55204
55650
|
(function (process,global){(function (){
|
|
55205
55651
|
'use strict'
|
|
55206
55652
|
|
|
@@ -55254,7 +55700,7 @@ function randomBytes (size, cb) {
|
|
|
55254
55700
|
}
|
|
55255
55701
|
|
|
55256
55702
|
}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
55257
|
-
},{"../safe-buffer-5.2.0/index":
|
|
55703
|
+
},{"../safe-buffer-5.2.0/index":294,"_process":180}],292:[function(require,module,exports){
|
|
55258
55704
|
'use strict'
|
|
55259
55705
|
var Buffer = require('buffer').Buffer
|
|
55260
55706
|
var inherits = require('../inherits-2.0.4/inherits')
|
|
@@ -55419,7 +55865,7 @@ function fn5 (a, b, c, d, e, m, k, s) {
|
|
|
55419
55865
|
|
|
55420
55866
|
module.exports = RIPEMD160
|
|
55421
55867
|
|
|
55422
|
-
},{"../hash-base-3.0.4/index":
|
|
55868
|
+
},{"../hash-base-3.0.4/index":278,"../inherits-2.0.4/inherits":282,"buffer":76}],293:[function(require,module,exports){
|
|
55423
55869
|
const assert = require('assert')
|
|
55424
55870
|
const Buffer = require('../safe-buffer-5.2.0/index').Buffer
|
|
55425
55871
|
/**
|
|
@@ -55651,7 +56097,7 @@ function toBuffer (v) {
|
|
|
55651
56097
|
return v
|
|
55652
56098
|
}
|
|
55653
56099
|
|
|
55654
|
-
},{"../safe-buffer-5.2.0/index":
|
|
56100
|
+
},{"../safe-buffer-5.2.0/index":294,"assert":25}],294:[function(require,module,exports){
|
|
55655
56101
|
/* eslint-disable node/no-deprecated-api */
|
|
55656
56102
|
var buffer = require('buffer')
|
|
55657
56103
|
var Buffer = buffer.Buffer
|
|
@@ -55717,7 +56163,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
|
|
|
55717
56163
|
return buffer.SlowBuffer(size)
|
|
55718
56164
|
}
|
|
55719
56165
|
|
|
55720
|
-
},{"buffer":76}],
|
|
56166
|
+
},{"buffer":76}],295:[function(require,module,exports){
|
|
55721
56167
|
var Buffer = require('../safe-buffer-5.2.0/index').Buffer
|
|
55722
56168
|
|
|
55723
56169
|
// prototype class for hash functions
|
|
@@ -55800,7 +56246,7 @@ Hash.prototype._update = function () {
|
|
|
55800
56246
|
|
|
55801
56247
|
module.exports = Hash
|
|
55802
56248
|
|
|
55803
|
-
},{"../safe-buffer-5.2.0/index":
|
|
56249
|
+
},{"../safe-buffer-5.2.0/index":294}],296:[function(require,module,exports){
|
|
55804
56250
|
'use strict'
|
|
55805
56251
|
var exports = (module.exports = function SHA(algorithm) {
|
|
55806
56252
|
algorithm = algorithm.toLowerCase()
|
|
@@ -55818,7 +56264,7 @@ exports.sha256 = require('./sha256')
|
|
|
55818
56264
|
exports.sha384 = require('./sha384')
|
|
55819
56265
|
exports.sha512 = require('./sha512')
|
|
55820
56266
|
|
|
55821
|
-
},{"./sha":
|
|
56267
|
+
},{"./sha":297,"./sha1":298,"./sha224":299,"./sha256":300,"./sha384":301,"./sha512":302}],297:[function(require,module,exports){
|
|
55822
56268
|
/*
|
|
55823
56269
|
* A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
|
|
55824
56270
|
* in FIPS PUB 180-1
|
|
@@ -55914,7 +56360,7 @@ Sha.prototype._hash = function () {
|
|
|
55914
56360
|
|
|
55915
56361
|
module.exports = Sha
|
|
55916
56362
|
|
|
55917
|
-
},{"../inherits-2.0.4/inherits":
|
|
56363
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"./hash":295}],298:[function(require,module,exports){
|
|
55918
56364
|
/*
|
|
55919
56365
|
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
|
|
55920
56366
|
* in FIPS PUB 180-1
|
|
@@ -56015,7 +56461,7 @@ Sha1.prototype._hash = function () {
|
|
|
56015
56461
|
|
|
56016
56462
|
module.exports = Sha1
|
|
56017
56463
|
|
|
56018
|
-
},{"../inherits-2.0.4/inherits":
|
|
56464
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"./hash":295}],299:[function(require,module,exports){
|
|
56019
56465
|
/**
|
|
56020
56466
|
* A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
|
|
56021
56467
|
* in FIPS 180-2
|
|
@@ -56070,7 +56516,7 @@ Sha224.prototype._hash = function () {
|
|
|
56070
56516
|
|
|
56071
56517
|
module.exports = Sha224
|
|
56072
56518
|
|
|
56073
|
-
},{"../inherits-2.0.4/inherits":
|
|
56519
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"./hash":295,"./sha256":300}],300:[function(require,module,exports){
|
|
56074
56520
|
/**
|
|
56075
56521
|
* A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
|
|
56076
56522
|
* in FIPS 180-2
|
|
@@ -56207,7 +56653,7 @@ Sha256.prototype._hash = function () {
|
|
|
56207
56653
|
|
|
56208
56654
|
module.exports = Sha256
|
|
56209
56655
|
|
|
56210
|
-
},{"../inherits-2.0.4/inherits":
|
|
56656
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"./hash":295}],301:[function(require,module,exports){
|
|
56211
56657
|
var inherits = require('../inherits-2.0.4/inherits')
|
|
56212
56658
|
var SHA512 = require('./sha512')
|
|
56213
56659
|
var Hash = require('./hash')
|
|
@@ -56266,7 +56712,7 @@ Sha384.prototype._hash = function () {
|
|
|
56266
56712
|
|
|
56267
56713
|
module.exports = Sha384
|
|
56268
56714
|
|
|
56269
|
-
},{"../inherits-2.0.4/inherits":
|
|
56715
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"./hash":295,"./sha512":302}],302:[function(require,module,exports){
|
|
56270
56716
|
var inherits = require('../inherits-2.0.4/inherits')
|
|
56271
56717
|
var Hash = require('./hash')
|
|
56272
56718
|
var Buffer = require('../safe-buffer-5.2.0/index').Buffer
|
|
@@ -56528,7 +56974,7 @@ Sha512.prototype._hash = function () {
|
|
|
56528
56974
|
|
|
56529
56975
|
module.exports = Sha512
|
|
56530
56976
|
|
|
56531
|
-
},{"../inherits-2.0.4/inherits":
|
|
56977
|
+
},{"../inherits-2.0.4/inherits":282,"../safe-buffer-5.2.0/index":294,"./hash":295}],303:[function(require,module,exports){
|
|
56532
56978
|
(function(nacl) {
|
|
56533
56979
|
'use strict';
|
|
56534
56980
|
|
|
@@ -57694,7 +58140,7 @@ nacl.setPRNG = function(fn) {
|
|
|
57694
58140
|
|
|
57695
58141
|
})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
|
|
57696
58142
|
|
|
57697
|
-
},{"crypto":87}],
|
|
58143
|
+
},{"crypto":87}],304:[function(require,module,exports){
|
|
57698
58144
|
(function(root, f) {
|
|
57699
58145
|
'use strict';
|
|
57700
58146
|
if (typeof module !== 'undefined' && module.exports) module.exports = f(require('../tweetnacl-1.0.1/nacl'));
|
|
@@ -57743,7 +58189,7 @@ nacl.setPRNG = function(fn) {
|
|
|
57743
58189
|
|
|
57744
58190
|
}));
|
|
57745
58191
|
|
|
57746
|
-
},{"../tweetnacl-1.0.1/nacl":
|
|
58192
|
+
},{"../tweetnacl-1.0.1/nacl":303}],305:[function(require,module,exports){
|
|
57747
58193
|
(function (root) {
|
|
57748
58194
|
"use strict";
|
|
57749
58195
|
|
|
@@ -58197,7 +58643,7 @@ UChar.udata={
|
|
|
58197
58643
|
}
|
|
58198
58644
|
}(this));
|
|
58199
58645
|
|
|
58200
|
-
},{}],
|
|
58646
|
+
},{}],306:[function(require,module,exports){
|
|
58201
58647
|
"use strict";
|
|
58202
58648
|
var __extends = (this && this.__extends) || (function () {
|
|
58203
58649
|
var extendStatics = function (d, b) {
|
|
@@ -58257,7 +58703,7 @@ var CoinlibAssertionError = /** @class */ (function (_super) {
|
|
|
58257
58703
|
}(Error));
|
|
58258
58704
|
exports.CoinlibAssertionError = CoinlibAssertionError;
|
|
58259
58705
|
|
|
58260
|
-
},{}],
|
|
58706
|
+
},{}],307:[function(require,module,exports){
|
|
58261
58707
|
"use strict";
|
|
58262
58708
|
var __extends = (this && this.__extends) || (function () {
|
|
58263
58709
|
var extendStatics = function (d, b) {
|
|
@@ -58521,23 +58967,829 @@ var InvalidHexString = /** @class */ (function (_super) {
|
|
|
58521
58967
|
function InvalidHexString(description) {
|
|
58522
58968
|
return _super.call(this, SerializerErrorType.INVALID_HEX_STRING, description) || this;
|
|
58523
58969
|
}
|
|
58524
|
-
return InvalidHexString;
|
|
58525
|
-
}(SerializerError));
|
|
58526
|
-
exports.InvalidHexString = InvalidHexString;
|
|
58527
|
-
/**
|
|
58528
|
-
* Gets thrown if the string starts with "0x". This causes problems with RLP
|
|
58529
|
-
*/
|
|
58530
|
-
var InvalidString = /** @class */ (function (_super) {
|
|
58531
|
-
__extends(InvalidString, _super);
|
|
58532
|
-
function InvalidString(description) {
|
|
58533
|
-
return _super.call(this, SerializerErrorType.INVALID_STRING, description) || this;
|
|
58970
|
+
return InvalidHexString;
|
|
58971
|
+
}(SerializerError));
|
|
58972
|
+
exports.InvalidHexString = InvalidHexString;
|
|
58973
|
+
/**
|
|
58974
|
+
* Gets thrown if the string starts with "0x". This causes problems with RLP
|
|
58975
|
+
*/
|
|
58976
|
+
var InvalidString = /** @class */ (function (_super) {
|
|
58977
|
+
__extends(InvalidString, _super);
|
|
58978
|
+
function InvalidString(description) {
|
|
58979
|
+
return _super.call(this, SerializerErrorType.INVALID_STRING, description) || this;
|
|
58980
|
+
}
|
|
58981
|
+
return InvalidString;
|
|
58982
|
+
}(SerializerError));
|
|
58983
|
+
exports.InvalidString = InvalidString;
|
|
58984
|
+
|
|
58985
|
+
},{"./coinlib-error":306}],308:[function(require,module,exports){
|
|
58986
|
+
"use strict";
|
|
58987
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58988
|
+
exports.bufferFrom = exports.assertNever = exports.SubProtocolType = exports.TimeInterval = exports.Domain = exports.TransactionError = exports.BalanceError = exports.ProtocolErrorType = exports.SerializerErrorType = exports.CoinlibError = exports.NetworkError = exports.ProtocolNotSupported = exports.SerializerVersionMismatch = exports.TypeNotSupported = exports.isSubProtocolSymbol = exports.isMainProtocolSymbol = exports.isProtocolSymbol = exports.isNetworkEqual = exports.SimpleAction = exports.LinkedAction = exports.RepeatableAction = exports.Action = exports.NetworkType = exports.SubProtocolSymbols = exports.MainProtocolSymbols = exports.ProtocolNetwork = exports.ProtocolBlockExplorer = exports.CryptoClient = exports.AirGapNFTWallet = exports.AirGapWalletStatus = exports.AirGapCoinWallet = exports.AirGapMarketWallet = exports.AirGapWallet = void 0;
|
|
58989
|
+
var Action_1 = require("./actions/Action");
|
|
58990
|
+
Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return Action_1.Action; } });
|
|
58991
|
+
var LinkedAction_1 = require("./actions/LinkedAction");
|
|
58992
|
+
Object.defineProperty(exports, "LinkedAction", { enumerable: true, get: function () { return LinkedAction_1.LinkedAction; } });
|
|
58993
|
+
var RepeatableAction_1 = require("./actions/RepeatableAction");
|
|
58994
|
+
Object.defineProperty(exports, "RepeatableAction", { enumerable: true, get: function () { return RepeatableAction_1.RepeatableAction; } });
|
|
58995
|
+
var SimpleAction_1 = require("./actions/SimpleAction");
|
|
58996
|
+
Object.defineProperty(exports, "SimpleAction", { enumerable: true, get: function () { return SimpleAction_1.SimpleAction; } });
|
|
58997
|
+
var errors_1 = require("./errors");
|
|
58998
|
+
Object.defineProperty(exports, "BalanceError", { enumerable: true, get: function () { return errors_1.BalanceError; } });
|
|
58999
|
+
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return errors_1.NetworkError; } });
|
|
59000
|
+
Object.defineProperty(exports, "ProtocolErrorType", { enumerable: true, get: function () { return errors_1.ProtocolErrorType; } });
|
|
59001
|
+
Object.defineProperty(exports, "ProtocolNotSupported", { enumerable: true, get: function () { return errors_1.ProtocolNotSupported; } });
|
|
59002
|
+
Object.defineProperty(exports, "SerializerErrorType", { enumerable: true, get: function () { return errors_1.SerializerErrorType; } });
|
|
59003
|
+
Object.defineProperty(exports, "SerializerVersionMismatch", { enumerable: true, get: function () { return errors_1.SerializerVersionMismatch; } });
|
|
59004
|
+
Object.defineProperty(exports, "TransactionError", { enumerable: true, get: function () { return errors_1.TransactionError; } });
|
|
59005
|
+
Object.defineProperty(exports, "TypeNotSupported", { enumerable: true, get: function () { return errors_1.TypeNotSupported; } });
|
|
59006
|
+
var coinlib_error_1 = require("./errors/coinlib-error");
|
|
59007
|
+
Object.defineProperty(exports, "CoinlibError", { enumerable: true, get: function () { return coinlib_error_1.CoinlibError; } });
|
|
59008
|
+
Object.defineProperty(exports, "Domain", { enumerable: true, get: function () { return coinlib_error_1.Domain; } });
|
|
59009
|
+
var CryptoClient_1 = require("./protocols/CryptoClient");
|
|
59010
|
+
Object.defineProperty(exports, "CryptoClient", { enumerable: true, get: function () { return CryptoClient_1.CryptoClient; } });
|
|
59011
|
+
var ICoinSubProtocol_1 = require("./protocols/ICoinSubProtocol");
|
|
59012
|
+
Object.defineProperty(exports, "SubProtocolType", { enumerable: true, get: function () { return ICoinSubProtocol_1.SubProtocolType; } });
|
|
59013
|
+
var assert_1 = require("./utils/assert");
|
|
59014
|
+
Object.defineProperty(exports, "assertNever", { enumerable: true, get: function () { return assert_1.assertNever; } });
|
|
59015
|
+
var buffer_1 = require("./utils/buffer");
|
|
59016
|
+
Object.defineProperty(exports, "bufferFrom", { enumerable: true, get: function () { return buffer_1.bufferFrom; } });
|
|
59017
|
+
var Network_1 = require("./utils/Network");
|
|
59018
|
+
Object.defineProperty(exports, "isNetworkEqual", { enumerable: true, get: function () { return Network_1.isNetworkEqual; } });
|
|
59019
|
+
var ProtocolBlockExplorer_1 = require("./utils/ProtocolBlockExplorer");
|
|
59020
|
+
Object.defineProperty(exports, "ProtocolBlockExplorer", { enumerable: true, get: function () { return ProtocolBlockExplorer_1.ProtocolBlockExplorer; } });
|
|
59021
|
+
var ProtocolNetwork_1 = require("./utils/ProtocolNetwork");
|
|
59022
|
+
Object.defineProperty(exports, "NetworkType", { enumerable: true, get: function () { return ProtocolNetwork_1.NetworkType; } });
|
|
59023
|
+
Object.defineProperty(exports, "ProtocolNetwork", { enumerable: true, get: function () { return ProtocolNetwork_1.ProtocolNetwork; } });
|
|
59024
|
+
var ProtocolSymbols_1 = require("./utils/ProtocolSymbols");
|
|
59025
|
+
Object.defineProperty(exports, "isMainProtocolSymbol", { enumerable: true, get: function () { return ProtocolSymbols_1.isMainProtocolSymbol; } });
|
|
59026
|
+
Object.defineProperty(exports, "isProtocolSymbol", { enumerable: true, get: function () { return ProtocolSymbols_1.isProtocolSymbol; } });
|
|
59027
|
+
Object.defineProperty(exports, "isSubProtocolSymbol", { enumerable: true, get: function () { return ProtocolSymbols_1.isSubProtocolSymbol; } });
|
|
59028
|
+
Object.defineProperty(exports, "MainProtocolSymbols", { enumerable: true, get: function () { return ProtocolSymbols_1.MainProtocolSymbols; } });
|
|
59029
|
+
Object.defineProperty(exports, "SubProtocolSymbols", { enumerable: true, get: function () { return ProtocolSymbols_1.SubProtocolSymbols; } });
|
|
59030
|
+
var AirGapCoinWallet_1 = require("./wallet/AirGapCoinWallet");
|
|
59031
|
+
Object.defineProperty(exports, "AirGapCoinWallet", { enumerable: true, get: function () { return AirGapCoinWallet_1.AirGapCoinWallet; } });
|
|
59032
|
+
Object.defineProperty(exports, "TimeInterval", { enumerable: true, get: function () { return AirGapCoinWallet_1.TimeInterval; } });
|
|
59033
|
+
var AirGapMarketWallet_1 = require("./wallet/AirGapMarketWallet");
|
|
59034
|
+
Object.defineProperty(exports, "AirGapMarketWallet", { enumerable: true, get: function () { return AirGapMarketWallet_1.AirGapMarketWallet; } });
|
|
59035
|
+
var AirGapNFTWallet_1 = require("./wallet/AirGapNFTWallet");
|
|
59036
|
+
Object.defineProperty(exports, "AirGapNFTWallet", { enumerable: true, get: function () { return AirGapNFTWallet_1.AirGapNFTWallet; } });
|
|
59037
|
+
var AirGapWallet_1 = require("./wallet/AirGapWallet");
|
|
59038
|
+
Object.defineProperty(exports, "AirGapWallet", { enumerable: true, get: function () { return AirGapWallet_1.AirGapWallet; } });
|
|
59039
|
+
Object.defineProperty(exports, "AirGapWalletStatus", { enumerable: true, get: function () { return AirGapWallet_1.AirGapWalletStatus; } });
|
|
59040
|
+
|
|
59041
|
+
},{"./actions/Action":229,"./actions/LinkedAction":230,"./actions/RepeatableAction":231,"./actions/SimpleAction":232,"./errors":307,"./errors/coinlib-error":306,"./protocols/CryptoClient":309,"./protocols/ICoinSubProtocol":311,"./utils/Network":314,"./utils/ProtocolBlockExplorer":315,"./utils/ProtocolNetwork":316,"./utils/ProtocolSymbols":317,"./utils/assert":318,"./utils/buffer":320,"./wallet/AirGapCoinWallet":323,"./wallet/AirGapMarketWallet":324,"./wallet/AirGapNFTWallet":325,"./wallet/AirGapWallet":326}],309:[function(require,module,exports){
|
|
59042
|
+
"use strict";
|
|
59043
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
59044
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
59045
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
59046
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
59047
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
59048
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
59049
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59050
|
+
});
|
|
59051
|
+
};
|
|
59052
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
59053
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
59054
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
59055
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
59056
|
+
function step(op) {
|
|
59057
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
59058
|
+
while (_) try {
|
|
59059
|
+
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;
|
|
59060
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59061
|
+
switch (op[0]) {
|
|
59062
|
+
case 0: case 1: t = op; break;
|
|
59063
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
59064
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
59065
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59066
|
+
default:
|
|
59067
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
59068
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
59069
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59070
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
59071
|
+
if (t[2]) _.ops.pop();
|
|
59072
|
+
_.trys.pop(); continue;
|
|
59073
|
+
}
|
|
59074
|
+
op = body.call(thisArg, _);
|
|
59075
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59076
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59077
|
+
}
|
|
59078
|
+
};
|
|
59079
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59080
|
+
exports.CryptoClient = void 0;
|
|
59081
|
+
var errors_1 = require("../errors");
|
|
59082
|
+
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
59083
|
+
var AES_1 = require("../utils/AES");
|
|
59084
|
+
var CryptoClient = /** @class */ (function () {
|
|
59085
|
+
function CryptoClient() {
|
|
59086
|
+
}
|
|
59087
|
+
CryptoClient.prototype.encryptAES = function (payload, privateKey) {
|
|
59088
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59089
|
+
return __generator(this, function (_a) {
|
|
59090
|
+
return [2 /*return*/, new AES_1.AES().encryptString(payload, privateKey)];
|
|
59091
|
+
});
|
|
59092
|
+
});
|
|
59093
|
+
};
|
|
59094
|
+
CryptoClient.prototype.decryptAES = function (encryptedPayload, privateKey) {
|
|
59095
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59096
|
+
return __generator(this, function (_a) {
|
|
59097
|
+
return [2 /*return*/, new AES_1.AES().decryptString(encryptedPayload, privateKey)];
|
|
59098
|
+
});
|
|
59099
|
+
});
|
|
59100
|
+
};
|
|
59101
|
+
CryptoClient.prototype.encryptAsymmetric = function (payload, publicKey) {
|
|
59102
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59103
|
+
return __generator(this, function (_a) {
|
|
59104
|
+
throw new errors_1.NotImplementedError(coinlib_error_1.Domain.UTILS, "encryptAsymmetric() not Implemented");
|
|
59105
|
+
});
|
|
59106
|
+
});
|
|
59107
|
+
};
|
|
59108
|
+
CryptoClient.prototype.decryptAsymmetric = function (encryptedPayload, keypair) {
|
|
59109
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59110
|
+
return __generator(this, function (_a) {
|
|
59111
|
+
throw new errors_1.NotImplementedError(coinlib_error_1.Domain.UTILS, "decryptAsymmetric() not Implemented");
|
|
59112
|
+
});
|
|
59113
|
+
});
|
|
59114
|
+
};
|
|
59115
|
+
CryptoClient.prototype.recoverPublicKeyFromSignature = function () {
|
|
59116
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59117
|
+
return __generator(this, function (_a) {
|
|
59118
|
+
throw new errors_1.NotImplementedError(coinlib_error_1.Domain.UTILS, "Recovering public key from signature not supported");
|
|
59119
|
+
});
|
|
59120
|
+
});
|
|
59121
|
+
};
|
|
59122
|
+
return CryptoClient;
|
|
59123
|
+
}());
|
|
59124
|
+
exports.CryptoClient = CryptoClient;
|
|
59125
|
+
|
|
59126
|
+
},{"../errors":307,"../errors/coinlib-error":306,"../utils/AES":313}],310:[function(require,module,exports){
|
|
59127
|
+
(function (Buffer){(function (){
|
|
59128
|
+
"use strict";
|
|
59129
|
+
var __extends = (this && this.__extends) || (function () {
|
|
59130
|
+
var extendStatics = function (d, b) {
|
|
59131
|
+
extendStatics = Object.setPrototypeOf ||
|
|
59132
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
59133
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
59134
|
+
return extendStatics(d, b);
|
|
59135
|
+
};
|
|
59136
|
+
return function (d, b) {
|
|
59137
|
+
extendStatics(d, b);
|
|
59138
|
+
function __() { this.constructor = d; }
|
|
59139
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
59140
|
+
};
|
|
59141
|
+
})();
|
|
59142
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
59143
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
59144
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
59145
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
59146
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
59147
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
59148
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59149
|
+
});
|
|
59150
|
+
};
|
|
59151
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
59152
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
59153
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
59154
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
59155
|
+
function step(op) {
|
|
59156
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
59157
|
+
while (_) try {
|
|
59158
|
+
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;
|
|
59159
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59160
|
+
switch (op[0]) {
|
|
59161
|
+
case 0: case 1: t = op; break;
|
|
59162
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
59163
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
59164
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59165
|
+
default:
|
|
59166
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
59167
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
59168
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59169
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
59170
|
+
if (t[2]) _.ops.pop();
|
|
59171
|
+
_.trys.pop(); continue;
|
|
59172
|
+
}
|
|
59173
|
+
op = body.call(thisArg, _);
|
|
59174
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59175
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59176
|
+
}
|
|
59177
|
+
};
|
|
59178
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59179
|
+
exports.Ed25519CryptoClient = void 0;
|
|
59180
|
+
var bytes_1 = require("@stablelib/bytes");
|
|
59181
|
+
var blake2b_1 = require("@stablelib/blake2b");
|
|
59182
|
+
var ed25519_1 = require("@stablelib/ed25519");
|
|
59183
|
+
var nacl_1 = require("@stablelib/nacl");
|
|
59184
|
+
var utf8_1 = require("@stablelib/utf8");
|
|
59185
|
+
var hex_1 = require("../utils/hex");
|
|
59186
|
+
var CryptoClient_1 = require("./CryptoClient");
|
|
59187
|
+
function toHex(value) {
|
|
59188
|
+
return Buffer.from(value).toString('hex');
|
|
59189
|
+
}
|
|
59190
|
+
var Ed25519CryptoClient = /** @class */ (function (_super) {
|
|
59191
|
+
__extends(Ed25519CryptoClient, _super);
|
|
59192
|
+
function Ed25519CryptoClient() {
|
|
59193
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
59194
|
+
}
|
|
59195
|
+
Ed25519CryptoClient.prototype.encryptAsymmetric = function (payload, publicKey) {
|
|
59196
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59197
|
+
var kxOtherPublicKey, keypair, state, nonce, encryptedMessage;
|
|
59198
|
+
return __generator(this, function (_a) {
|
|
59199
|
+
kxOtherPublicKey = ed25519_1.convertPublicKeyToX25519(Buffer.from(publicKey, 'hex'));
|
|
59200
|
+
keypair = nacl_1.generateKeyPair();
|
|
59201
|
+
state = new blake2b_1.BLAKE2b(24);
|
|
59202
|
+
nonce = state.update(keypair.publicKey, 32).update(kxOtherPublicKey, 32).digest();
|
|
59203
|
+
encryptedMessage = nacl_1.box(kxOtherPublicKey, keypair.secretKey, nonce, hex_1.isHex(payload) ? Buffer.from(payload, 'hex') : utf8_1.encode(payload));
|
|
59204
|
+
return [2 /*return*/, toHex(bytes_1.concat(keypair.publicKey, encryptedMessage))];
|
|
59205
|
+
});
|
|
59206
|
+
});
|
|
59207
|
+
};
|
|
59208
|
+
Ed25519CryptoClient.prototype.decryptAsymmetric = function (encryptedPayload, keypair) {
|
|
59209
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59210
|
+
var kxSelfPrivateKey, kxSelfPublicKey, encryptedPayloadBytes, kxOtherPublicKey, ciphertext, state, nonce, decryptedMessage;
|
|
59211
|
+
return __generator(this, function (_a) {
|
|
59212
|
+
kxSelfPrivateKey = ed25519_1.convertSecretKeyToX25519(Buffer.from(keypair.privateKey, 'hex')) // Secret bytes to scalar bytes
|
|
59213
|
+
;
|
|
59214
|
+
kxSelfPublicKey = ed25519_1.convertPublicKeyToX25519(Buffer.from(keypair.publicKey, 'hex')) // Secret bytes to scalar bytes
|
|
59215
|
+
;
|
|
59216
|
+
encryptedPayloadBytes = Buffer.from(encryptedPayload, hex_1.isHex(encryptedPayload) ? 'hex' : 'utf-8');
|
|
59217
|
+
kxOtherPublicKey = encryptedPayloadBytes.slice(0, 32);
|
|
59218
|
+
ciphertext = encryptedPayloadBytes.slice(32);
|
|
59219
|
+
state = new blake2b_1.BLAKE2b(24);
|
|
59220
|
+
nonce = state.update(kxOtherPublicKey, 32).update(kxSelfPublicKey, 32).digest();
|
|
59221
|
+
decryptedMessage = nacl_1.openBox(kxOtherPublicKey, kxSelfPrivateKey, nonce, ciphertext);
|
|
59222
|
+
if (decryptedMessage === null) {
|
|
59223
|
+
throw new Error('Ed25519 decryption failed.');
|
|
59224
|
+
}
|
|
59225
|
+
return [2 /*return*/, Buffer.from(decryptedMessage).toString()];
|
|
59226
|
+
});
|
|
59227
|
+
});
|
|
59228
|
+
};
|
|
59229
|
+
return Ed25519CryptoClient;
|
|
59230
|
+
}(CryptoClient_1.CryptoClient));
|
|
59231
|
+
exports.Ed25519CryptoClient = Ed25519CryptoClient;
|
|
59232
|
+
|
|
59233
|
+
}).call(this)}).call(this,require("buffer").Buffer)
|
|
59234
|
+
},{"../utils/hex":321,"./CryptoClient":309,"@stablelib/blake2b":328,"@stablelib/bytes":329,"@stablelib/ed25519":331,"@stablelib/nacl":334,"@stablelib/utf8":343,"buffer":76}],311:[function(require,module,exports){
|
|
59235
|
+
"use strict";
|
|
59236
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59237
|
+
exports.SubProtocolType = void 0;
|
|
59238
|
+
var SubProtocolType;
|
|
59239
|
+
(function (SubProtocolType) {
|
|
59240
|
+
SubProtocolType["ACCOUNT"] = "account";
|
|
59241
|
+
SubProtocolType["TOKEN"] = "token";
|
|
59242
|
+
})(SubProtocolType = exports.SubProtocolType || (exports.SubProtocolType = {}));
|
|
59243
|
+
|
|
59244
|
+
},{}],312:[function(require,module,exports){
|
|
59245
|
+
"use strict";
|
|
59246
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59247
|
+
exports.NonExtendedProtocol = void 0;
|
|
59248
|
+
var NonExtendedProtocol = /** @class */ (function () {
|
|
59249
|
+
function NonExtendedProtocol() {
|
|
59250
|
+
}
|
|
59251
|
+
NonExtendedProtocol.prototype.getExtendedPrivateKeyFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
59252
|
+
throw Promise.reject('extended private key support not implemented');
|
|
59253
|
+
};
|
|
59254
|
+
NonExtendedProtocol.prototype.getExtendedPrivateKeyFromHexSecret = function (secret, derivationPath) {
|
|
59255
|
+
throw Promise.reject('extended private key support not implemented');
|
|
59256
|
+
};
|
|
59257
|
+
NonExtendedProtocol.prototype.getBalanceOfExtendedPublicKey = function (extendedPublicKey, offset) {
|
|
59258
|
+
return Promise.reject('extended public balance not implemented');
|
|
59259
|
+
};
|
|
59260
|
+
NonExtendedProtocol.prototype.signWithExtendedPrivateKey = function (extendedPrivateKey, transaction, childDerivationPath) {
|
|
59261
|
+
return Promise.reject('extended private key signing for not implemented');
|
|
59262
|
+
};
|
|
59263
|
+
NonExtendedProtocol.prototype.getAddressFromExtendedPublicKey = function (extendedPublicKey, visibilityDerivationIndex, addressDerivationIndex) {
|
|
59264
|
+
return Promise.resolve({
|
|
59265
|
+
address: '',
|
|
59266
|
+
cursor: { hasNext: false }
|
|
59267
|
+
});
|
|
59268
|
+
};
|
|
59269
|
+
NonExtendedProtocol.prototype.getAddressesFromExtendedPublicKey = function (extendedPublicKey, visibilityDerivationIndex, addressCount, offset) {
|
|
59270
|
+
return Promise.resolve([]);
|
|
59271
|
+
};
|
|
59272
|
+
NonExtendedProtocol.prototype.estimateMaxTransactionValueFromExtendedPublicKey = function (extendedPublicKey, recipients, fee) {
|
|
59273
|
+
return Promise.reject('estimating max value using extended public key not implemented');
|
|
59274
|
+
};
|
|
59275
|
+
NonExtendedProtocol.prototype.estimateFeeDefaultsFromExtendedPublicKey = function (publicKey, recipients, values, data) {
|
|
59276
|
+
return Promise.reject('estimating fee defaults using extended public key not implemented');
|
|
59277
|
+
};
|
|
59278
|
+
NonExtendedProtocol.prototype.getTransactionsFromExtendedPublicKey = function (extendedPublicKey, limit, cursor) {
|
|
59279
|
+
return Promise.reject('fetching txs using extended public key not implemented');
|
|
59280
|
+
};
|
|
59281
|
+
NonExtendedProtocol.prototype.prepareTransactionFromExtendedPublicKey = function (extendedPublicKey, offset, recipients, values, fee) {
|
|
59282
|
+
return Promise.reject('extended public key tx not implemented');
|
|
59283
|
+
};
|
|
59284
|
+
return NonExtendedProtocol;
|
|
59285
|
+
}());
|
|
59286
|
+
exports.NonExtendedProtocol = NonExtendedProtocol;
|
|
59287
|
+
|
|
59288
|
+
},{}],313:[function(require,module,exports){
|
|
59289
|
+
(function (Buffer){(function (){
|
|
59290
|
+
"use strict";
|
|
59291
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
59292
|
+
if (k2 === undefined) k2 = k;
|
|
59293
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
59294
|
+
}) : (function(o, m, k, k2) {
|
|
59295
|
+
if (k2 === undefined) k2 = k;
|
|
59296
|
+
o[k2] = m[k];
|
|
59297
|
+
}));
|
|
59298
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
59299
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
59300
|
+
}) : function(o, v) {
|
|
59301
|
+
o["default"] = v;
|
|
59302
|
+
});
|
|
59303
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
59304
|
+
if (mod && mod.__esModule) return mod;
|
|
59305
|
+
var result = {};
|
|
59306
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
59307
|
+
__setModuleDefault(result, mod);
|
|
59308
|
+
return result;
|
|
59309
|
+
};
|
|
59310
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
59311
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
59312
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
59313
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
59314
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
59315
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
59316
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59317
|
+
});
|
|
59318
|
+
};
|
|
59319
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
59320
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
59321
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
59322
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
59323
|
+
function step(op) {
|
|
59324
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
59325
|
+
while (_) try {
|
|
59326
|
+
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;
|
|
59327
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59328
|
+
switch (op[0]) {
|
|
59329
|
+
case 0: case 1: t = op; break;
|
|
59330
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
59331
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
59332
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59333
|
+
default:
|
|
59334
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
59335
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
59336
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59337
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
59338
|
+
if (t[2]) _.ops.pop();
|
|
59339
|
+
_.trys.pop(); continue;
|
|
59340
|
+
}
|
|
59341
|
+
op = body.call(thisArg, _);
|
|
59342
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59343
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59344
|
+
}
|
|
59345
|
+
};
|
|
59346
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59347
|
+
exports.AES = void 0;
|
|
59348
|
+
var crypto = __importStar(require("crypto"));
|
|
59349
|
+
var errors_1 = require("../errors");
|
|
59350
|
+
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
59351
|
+
var hex_1 = require("./hex");
|
|
59352
|
+
// https://github.com/microsoft/botbuilder-js/blob/master/libraries/botframework-config/src/encrypt.ts#L20
|
|
59353
|
+
var AES = /** @class */ (function () {
|
|
59354
|
+
function AES(AES_KEY_SIZE, KEY_DERIVATION_ITERATION_COUNT, ALGORITHM, encoding) {
|
|
59355
|
+
if (AES_KEY_SIZE === void 0) { AES_KEY_SIZE = 256; }
|
|
59356
|
+
if (KEY_DERIVATION_ITERATION_COUNT === void 0) { KEY_DERIVATION_ITERATION_COUNT = 10000; }
|
|
59357
|
+
if (ALGORITHM === void 0) { ALGORITHM = 'aes-256-gcm'; }
|
|
59358
|
+
if (encoding === void 0) { encoding = 'hex'; }
|
|
59359
|
+
this.AES_KEY_SIZE = AES_KEY_SIZE;
|
|
59360
|
+
this.KEY_DERIVATION_ITERATION_COUNT = KEY_DERIVATION_ITERATION_COUNT;
|
|
59361
|
+
this.ALGORITHM = ALGORITHM;
|
|
59362
|
+
this.encoding = encoding;
|
|
59363
|
+
}
|
|
59364
|
+
AES.prototype.encryptString = function (plainText, privateKey) {
|
|
59365
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59366
|
+
var keyBytes, ivBytes, ivText, cipher, encryptedValue, authTagText;
|
|
59367
|
+
return __generator(this, function (_a) {
|
|
59368
|
+
switch (_a.label) {
|
|
59369
|
+
case 0:
|
|
59370
|
+
if (!plainText || plainText.length === 0) {
|
|
59371
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'you must pass an input message');
|
|
59372
|
+
}
|
|
59373
|
+
if (!privateKey || privateKey.length === 0) {
|
|
59374
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'you must pass a privateKey');
|
|
59375
|
+
}
|
|
59376
|
+
return [4 /*yield*/, this.deriveKeyFromPrivateKey(privateKey)
|
|
59377
|
+
// Generates 16 byte cryptographically strong pseudo-random data as IV
|
|
59378
|
+
// https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback
|
|
59379
|
+
];
|
|
59380
|
+
case 1:
|
|
59381
|
+
keyBytes = _a.sent();
|
|
59382
|
+
ivBytes = crypto.randomBytes(16);
|
|
59383
|
+
ivText = ivBytes.toString(this.encoding);
|
|
59384
|
+
cipher = crypto.createCipheriv(this.ALGORITHM, keyBytes, ivBytes);
|
|
59385
|
+
encryptedValue = cipher.update(plainText, 'utf8', this.encoding);
|
|
59386
|
+
encryptedValue += cipher.final(this.encoding);
|
|
59387
|
+
authTagText = cipher.getAuthTag().toString(this.encoding);
|
|
59388
|
+
return [2 /*return*/, ivText + "!" + encryptedValue + "!" + authTagText];
|
|
59389
|
+
}
|
|
59390
|
+
});
|
|
59391
|
+
});
|
|
59392
|
+
};
|
|
59393
|
+
AES.prototype.decryptString = function (encryptedValue, privateKey) {
|
|
59394
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59395
|
+
var parts, ivText, encryptedText, authTagText, ivBytes, keyBytes, authTagBytes, decipher, value;
|
|
59396
|
+
return __generator(this, function (_a) {
|
|
59397
|
+
switch (_a.label) {
|
|
59398
|
+
case 0:
|
|
59399
|
+
if (!encryptedValue || encryptedValue.length === 0) {
|
|
59400
|
+
return [2 /*return*/, encryptedValue];
|
|
59401
|
+
}
|
|
59402
|
+
if (!privateKey || privateKey.length === 0) {
|
|
59403
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'you must pass a privateKey');
|
|
59404
|
+
}
|
|
59405
|
+
parts = encryptedValue.split('!');
|
|
59406
|
+
if (parts.length !== 3) {
|
|
59407
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'The encrypted value is not in a valid format');
|
|
59408
|
+
}
|
|
59409
|
+
ivText = parts[0];
|
|
59410
|
+
encryptedText = parts[1];
|
|
59411
|
+
authTagText = parts[2];
|
|
59412
|
+
ivBytes = Buffer.from(ivText, this.encoding);
|
|
59413
|
+
return [4 /*yield*/, this.deriveKeyFromPrivateKey(privateKey)];
|
|
59414
|
+
case 1:
|
|
59415
|
+
keyBytes = _a.sent();
|
|
59416
|
+
authTagBytes = Buffer.from(authTagText, this.encoding);
|
|
59417
|
+
if (ivBytes.length !== 16) {
|
|
59418
|
+
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, 'The IV length is invalid');
|
|
59419
|
+
}
|
|
59420
|
+
if (keyBytes.length !== 32) {
|
|
59421
|
+
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, 'The key length is invalid');
|
|
59422
|
+
}
|
|
59423
|
+
if (authTagBytes.length !== 16) {
|
|
59424
|
+
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, 'The authtag length is invalid');
|
|
59425
|
+
}
|
|
59426
|
+
decipher = crypto.createDecipheriv(this.ALGORITHM, keyBytes, ivBytes);
|
|
59427
|
+
decipher.setAuthTag(authTagBytes);
|
|
59428
|
+
value = decipher.update(encryptedText, this.encoding, 'utf8');
|
|
59429
|
+
value += decipher.final('utf8');
|
|
59430
|
+
return [2 /*return*/, value];
|
|
59431
|
+
}
|
|
59432
|
+
});
|
|
59433
|
+
});
|
|
59434
|
+
};
|
|
59435
|
+
AES.prototype.deriveKeyFromPrivateKey = function (privateKey) {
|
|
59436
|
+
var _this = this;
|
|
59437
|
+
var password = hex_1.isHex(privateKey) ? Buffer.from(privateKey, 'hex') : privateKey;
|
|
59438
|
+
return new Promise(function (resolve, reject) {
|
|
59439
|
+
crypto.pbkdf2(password, '', _this.KEY_DERIVATION_ITERATION_COUNT, 32, 'sha512', function (pbkdf2Error, key) {
|
|
59440
|
+
if (pbkdf2Error) {
|
|
59441
|
+
reject(pbkdf2Error);
|
|
59442
|
+
}
|
|
59443
|
+
resolve(key);
|
|
59444
|
+
});
|
|
59445
|
+
});
|
|
59446
|
+
};
|
|
59447
|
+
return AES;
|
|
59448
|
+
}());
|
|
59449
|
+
exports.AES = AES;
|
|
59450
|
+
|
|
59451
|
+
}).call(this)}).call(this,require("buffer").Buffer)
|
|
59452
|
+
},{"../errors":307,"../errors/coinlib-error":306,"./hex":321,"buffer":76,"crypto":87}],314:[function(require,module,exports){
|
|
59453
|
+
"use strict";
|
|
59454
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59455
|
+
exports.isNetworkEqual = void 0;
|
|
59456
|
+
var isNetworkEqual = function (network1, network2) {
|
|
59457
|
+
return network1.name === network2.name && network1.type === network2.type && network1.rpcUrl === network2.rpcUrl;
|
|
59458
|
+
};
|
|
59459
|
+
exports.isNetworkEqual = isNetworkEqual;
|
|
59460
|
+
|
|
59461
|
+
},{}],315:[function(require,module,exports){
|
|
59462
|
+
"use strict";
|
|
59463
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59464
|
+
exports.ProtocolBlockExplorer = void 0;
|
|
59465
|
+
var ProtocolBlockExplorer = /** @class */ (function () {
|
|
59466
|
+
function ProtocolBlockExplorer(blockExplorer) {
|
|
59467
|
+
this.blockExplorer = blockExplorer;
|
|
59468
|
+
}
|
|
59469
|
+
return ProtocolBlockExplorer;
|
|
59470
|
+
}());
|
|
59471
|
+
exports.ProtocolBlockExplorer = ProtocolBlockExplorer;
|
|
59472
|
+
|
|
59473
|
+
},{}],316:[function(require,module,exports){
|
|
59474
|
+
"use strict";
|
|
59475
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59476
|
+
exports.ProtocolNetwork = exports.NetworkType = void 0;
|
|
59477
|
+
var createHash = require("../dependencies/src/create-hash-1.2.0/index");
|
|
59478
|
+
var sha256hashShort = function (input) {
|
|
59479
|
+
var hash = createHash('sha256');
|
|
59480
|
+
hash.update(input);
|
|
59481
|
+
return hash.digest('base64').slice(0, 10);
|
|
59482
|
+
};
|
|
59483
|
+
var NetworkType;
|
|
59484
|
+
(function (NetworkType) {
|
|
59485
|
+
NetworkType["MAINNET"] = "MAINNET";
|
|
59486
|
+
NetworkType["TESTNET"] = "TESTNET";
|
|
59487
|
+
NetworkType["CUSTOM"] = "CUSTOM";
|
|
59488
|
+
})(NetworkType = exports.NetworkType || (exports.NetworkType = {}));
|
|
59489
|
+
var ProtocolNetwork = /** @class */ (function () {
|
|
59490
|
+
function ProtocolNetwork(name, type, rpcUrl, blockExplorer, extras) {
|
|
59491
|
+
this.name = name;
|
|
59492
|
+
this.type = type;
|
|
59493
|
+
this.rpcUrl = rpcUrl;
|
|
59494
|
+
this.blockExplorer = blockExplorer;
|
|
59495
|
+
this.extras = extras;
|
|
59496
|
+
}
|
|
59497
|
+
Object.defineProperty(ProtocolNetwork.prototype, "identifier", {
|
|
59498
|
+
get: function () {
|
|
59499
|
+
var hashed = sha256hashShort(this.name + "-" + this.rpcUrl);
|
|
59500
|
+
return this.type + "-" + hashed;
|
|
59501
|
+
},
|
|
59502
|
+
enumerable: false,
|
|
59503
|
+
configurable: true
|
|
59504
|
+
});
|
|
59505
|
+
return ProtocolNetwork;
|
|
59506
|
+
}());
|
|
59507
|
+
exports.ProtocolNetwork = ProtocolNetwork;
|
|
59508
|
+
|
|
59509
|
+
},{"../dependencies/src/create-hash-1.2.0/index":276}],317:[function(require,module,exports){
|
|
59510
|
+
"use strict";
|
|
59511
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59512
|
+
exports.isProtocolSymbol = exports.isSubProtocolSymbol = exports.isMainProtocolSymbol = exports.SubProtocolSymbols = exports.MainProtocolSymbols = void 0;
|
|
59513
|
+
var MainProtocolSymbols;
|
|
59514
|
+
(function (MainProtocolSymbols) {
|
|
59515
|
+
MainProtocolSymbols["AE"] = "ae";
|
|
59516
|
+
MainProtocolSymbols["BTC"] = "btc";
|
|
59517
|
+
MainProtocolSymbols["BTC_SEGWIT"] = "btc_segwit";
|
|
59518
|
+
MainProtocolSymbols["ETH"] = "eth";
|
|
59519
|
+
MainProtocolSymbols["XTZ"] = "xtz";
|
|
59520
|
+
MainProtocolSymbols["XTZ_SHIELDED"] = "xtz_shielded";
|
|
59521
|
+
MainProtocolSymbols["GRS"] = "grs";
|
|
59522
|
+
MainProtocolSymbols["COSMOS"] = "cosmos";
|
|
59523
|
+
MainProtocolSymbols["POLKADOT"] = "polkadot";
|
|
59524
|
+
MainProtocolSymbols["KUSAMA"] = "kusama";
|
|
59525
|
+
MainProtocolSymbols["MOONBASE"] = "moonbase";
|
|
59526
|
+
MainProtocolSymbols["MOONRIVER"] = "moonriver";
|
|
59527
|
+
MainProtocolSymbols["MOONBEAM"] = "moonbeam";
|
|
59528
|
+
MainProtocolSymbols["ASTAR"] = "astar";
|
|
59529
|
+
MainProtocolSymbols["SHIDEN"] = "shiden";
|
|
59530
|
+
})(MainProtocolSymbols = exports.MainProtocolSymbols || (exports.MainProtocolSymbols = {}));
|
|
59531
|
+
var SubProtocolSymbols;
|
|
59532
|
+
(function (SubProtocolSymbols) {
|
|
59533
|
+
SubProtocolSymbols["XTZ_KT"] = "xtz-kt";
|
|
59534
|
+
SubProtocolSymbols["XTZ_BTC"] = "xtz-btc";
|
|
59535
|
+
SubProtocolSymbols["XTZ_USD"] = "xtz-usd";
|
|
59536
|
+
SubProtocolSymbols["XTZ_KUSD"] = "xtz-kusd";
|
|
59537
|
+
SubProtocolSymbols["XTZ_STKR"] = "xtz-stkr";
|
|
59538
|
+
SubProtocolSymbols["XTZ_ETHTZ"] = "xtz-eth";
|
|
59539
|
+
SubProtocolSymbols["XTZ_UUSD"] = "xtz-uusd";
|
|
59540
|
+
SubProtocolSymbols["XTZ_YOU"] = "xtz-you";
|
|
59541
|
+
SubProtocolSymbols["XTZ_W"] = "xtz-w";
|
|
59542
|
+
SubProtocolSymbols["XTZ_UDEFI"] = "xtz-udefi";
|
|
59543
|
+
SubProtocolSymbols["XTZ_UBTC"] = "xtz-ubtc";
|
|
59544
|
+
SubProtocolSymbols["XTZ_CTEZ"] = "xtz-ctez";
|
|
59545
|
+
SubProtocolSymbols["XTZ_PLENTY"] = "xtz-plenty";
|
|
59546
|
+
SubProtocolSymbols["XTZ_WRAP"] = "xtz-wrap";
|
|
59547
|
+
SubProtocolSymbols["XTZ_QUIPU"] = "xtz-quipu";
|
|
59548
|
+
SubProtocolSymbols["XTZ_DOGA"] = "xtz-doga";
|
|
59549
|
+
SubProtocolSymbols["XTZ_BTC_TEZ"] = "xtz-btc-tez";
|
|
59550
|
+
SubProtocolSymbols["XTZ_USDT"] = "xtz-usdt";
|
|
59551
|
+
SubProtocolSymbols["XTZ_SIRS"] = "xtz-sirs";
|
|
59552
|
+
SubProtocolSymbols["ETH_ERC20"] = "eth-erc20";
|
|
59553
|
+
SubProtocolSymbols["ETH_ERC20_XCHF"] = "eth-erc20-xchf";
|
|
59554
|
+
})(SubProtocolSymbols = exports.SubProtocolSymbols || (exports.SubProtocolSymbols = {}));
|
|
59555
|
+
function isMainProtocolSymbol(identifier) {
|
|
59556
|
+
return Object.values(MainProtocolSymbols).includes(identifier);
|
|
59557
|
+
}
|
|
59558
|
+
exports.isMainProtocolSymbol = isMainProtocolSymbol;
|
|
59559
|
+
function isSubProtocolSymbol(identifier) {
|
|
59560
|
+
return Object.values(SubProtocolSymbols).includes(identifier);
|
|
59561
|
+
}
|
|
59562
|
+
exports.isSubProtocolSymbol = isSubProtocolSymbol;
|
|
59563
|
+
function isProtocolSymbol(identifier) {
|
|
59564
|
+
return isMainProtocolSymbol(identifier) || isSubProtocolSymbol(identifier);
|
|
59565
|
+
}
|
|
59566
|
+
exports.isProtocolSymbol = isProtocolSymbol;
|
|
59567
|
+
|
|
59568
|
+
},{}],318:[function(require,module,exports){
|
|
59569
|
+
"use strict";
|
|
59570
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59571
|
+
exports.assertFields = exports.assertNever = void 0;
|
|
59572
|
+
var errors_1 = require("../errors");
|
|
59573
|
+
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
59574
|
+
var assertNever = function (x) { return undefined; };
|
|
59575
|
+
exports.assertNever = assertNever;
|
|
59576
|
+
function assertFields(name, object) {
|
|
59577
|
+
var fields = [];
|
|
59578
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
59579
|
+
fields[_i - 2] = arguments[_i];
|
|
59580
|
+
}
|
|
59581
|
+
fields.forEach(function (field) {
|
|
59582
|
+
if (object[field] === undefined || object[field] === null) {
|
|
59583
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, name + ", required: " + fields.join(', ') + ", but " + field + " is missing.");
|
|
59584
|
+
}
|
|
59585
|
+
});
|
|
59586
|
+
}
|
|
59587
|
+
exports.assertFields = assertFields;
|
|
59588
|
+
|
|
59589
|
+
},{"../errors":307,"../errors/coinlib-error":306}],319:[function(require,module,exports){
|
|
59590
|
+
(function (Buffer){(function (){
|
|
59591
|
+
"use strict";
|
|
59592
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59593
|
+
var createHash = require("../dependencies/src/create-hash-1.2.0/index");
|
|
59594
|
+
var errors_1 = require("../errors");
|
|
59595
|
+
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
59596
|
+
var sha256hash = function (input) {
|
|
59597
|
+
var hash = createHash('sha256');
|
|
59598
|
+
hash.update(input);
|
|
59599
|
+
return hash.digest();
|
|
59600
|
+
};
|
|
59601
|
+
var checkSum = function (payload) {
|
|
59602
|
+
return sha256hash(sha256hash(payload)).slice(0, 4);
|
|
59603
|
+
};
|
|
59604
|
+
var bs64check = {
|
|
59605
|
+
encode: function (input) {
|
|
59606
|
+
if (!Buffer.isBuffer(input)) {
|
|
59607
|
+
input = Buffer.from(input);
|
|
59608
|
+
}
|
|
59609
|
+
var checksum = checkSum(input);
|
|
59610
|
+
var payloadWithChecksum = Buffer.concat([input, checksum], input.length + 4);
|
|
59611
|
+
return payloadWithChecksum.toString('base64');
|
|
59612
|
+
},
|
|
59613
|
+
decode: function (input) {
|
|
59614
|
+
if (!Buffer.isBuffer(input)) {
|
|
59615
|
+
input = Buffer.from(input, 'base64');
|
|
59616
|
+
}
|
|
59617
|
+
var payload = input.slice(0, -4);
|
|
59618
|
+
var checksum = input.slice(-4);
|
|
59619
|
+
var newChecksum = checkSum(payload);
|
|
59620
|
+
// tslint:disable-next-line:no-bitwise
|
|
59621
|
+
if ((checksum[0] ^ newChecksum[0]) | (checksum[1] ^ newChecksum[1]) | (checksum[2] ^ newChecksum[2]) | (checksum[3] ^ newChecksum[3])) {
|
|
59622
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'bs64check checksum does not match');
|
|
59623
|
+
}
|
|
59624
|
+
return payload;
|
|
59625
|
+
},
|
|
59626
|
+
checkSum: checkSum
|
|
59627
|
+
};
|
|
59628
|
+
exports.default = bs64check;
|
|
59629
|
+
|
|
59630
|
+
}).call(this)}).call(this,require("buffer").Buffer)
|
|
59631
|
+
},{"../dependencies/src/create-hash-1.2.0/index":276,"../errors":307,"../errors/coinlib-error":306,"buffer":76}],320:[function(require,module,exports){
|
|
59632
|
+
(function (Buffer){(function (){
|
|
59633
|
+
"use strict";
|
|
59634
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59635
|
+
exports.bufferFrom = void 0;
|
|
59636
|
+
var bufferFrom = function (data, encoding) {
|
|
59637
|
+
return Buffer.from(data, encoding);
|
|
59638
|
+
};
|
|
59639
|
+
exports.bufferFrom = bufferFrom;
|
|
59640
|
+
|
|
59641
|
+
}).call(this)}).call(this,require("buffer").Buffer)
|
|
59642
|
+
},{"buffer":76}],321:[function(require,module,exports){
|
|
59643
|
+
(function (Buffer){(function (){
|
|
59644
|
+
"use strict";
|
|
59645
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59646
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59647
|
+
};
|
|
59648
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59649
|
+
exports.changeEndianness = exports.bytesToHex = exports.hexToBytes = exports.toHexString = exports.toHexStringRaw = exports.toHexBuffer = exports.isHex = exports.stripHexPrefix = exports.addHexPrefix = void 0;
|
|
59650
|
+
var bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
59651
|
+
var padStart_1 = require("./padStart");
|
|
59652
|
+
var HEX_PREFIX = '0x';
|
|
59653
|
+
var HEX_REGEX = new RegExp("^(" + HEX_PREFIX + ")?[0-9a-fA-F]*$");
|
|
59654
|
+
function hasPrefix(value) {
|
|
59655
|
+
return value.startsWith(HEX_PREFIX);
|
|
59656
|
+
}
|
|
59657
|
+
function addHexPrefix(raw) {
|
|
59658
|
+
return hasPrefix(raw) ? raw : HEX_PREFIX + raw;
|
|
59659
|
+
}
|
|
59660
|
+
exports.addHexPrefix = addHexPrefix;
|
|
59661
|
+
function stripHexPrefix(hex) {
|
|
59662
|
+
return hasPrefix(hex) ? hex.substring(2) : hex;
|
|
59663
|
+
}
|
|
59664
|
+
exports.stripHexPrefix = stripHexPrefix;
|
|
59665
|
+
function isHex(value) {
|
|
59666
|
+
return HEX_REGEX.test(value);
|
|
59667
|
+
}
|
|
59668
|
+
exports.isHex = isHex;
|
|
59669
|
+
function toHexBuffer(value, bitLength, encoding) {
|
|
59670
|
+
if (bitLength === void 0) { bitLength = 8; }
|
|
59671
|
+
if (encoding === void 0) { encoding = 'default'; }
|
|
59672
|
+
return Buffer.from(toHexStringRaw(value, bitLength, encoding), 'hex');
|
|
59673
|
+
}
|
|
59674
|
+
exports.toHexBuffer = toHexBuffer;
|
|
59675
|
+
function toHexStringRaw(value, bitLength, encoding) {
|
|
59676
|
+
if (bitLength === void 0) { bitLength = 8; }
|
|
59677
|
+
if (encoding === void 0) { encoding = '2sComplement'; }
|
|
59678
|
+
if (new bignumber_1.default(value).isPositive()) {
|
|
59679
|
+
return toHexStringRawPositive(value, bitLength);
|
|
59680
|
+
}
|
|
59681
|
+
else {
|
|
59682
|
+
return toHexStringRawNegative(value, bitLength, encoding);
|
|
59683
|
+
}
|
|
59684
|
+
}
|
|
59685
|
+
exports.toHexStringRaw = toHexStringRaw;
|
|
59686
|
+
function toHexString(value, bitLength, encoding) {
|
|
59687
|
+
if (bitLength === void 0) { bitLength = 8; }
|
|
59688
|
+
if (encoding === void 0) { encoding = 'default'; }
|
|
59689
|
+
return addHexPrefix(toHexStringRaw(value, bitLength, encoding));
|
|
59690
|
+
}
|
|
59691
|
+
exports.toHexString = toHexString;
|
|
59692
|
+
function hexToBytes(hex, bitLength) {
|
|
59693
|
+
var byteLength = bitLength !== undefined ? Math.ceil(bitLength / 8) : undefined;
|
|
59694
|
+
var buffer;
|
|
59695
|
+
if (typeof hex === 'string' && isHex(hex)) {
|
|
59696
|
+
buffer = Buffer.from(stripHexPrefix(hex), 'hex');
|
|
59697
|
+
}
|
|
59698
|
+
else if (!(typeof hex === 'string')) {
|
|
59699
|
+
buffer = Buffer.from(hex);
|
|
59700
|
+
}
|
|
59701
|
+
else {
|
|
59702
|
+
buffer = Buffer.from([0]);
|
|
59703
|
+
}
|
|
59704
|
+
if (byteLength !== undefined && buffer.length < byteLength) {
|
|
59705
|
+
var newBuffer = Buffer.alloc(byteLength, 0);
|
|
59706
|
+
var offset = newBuffer.length - buffer.length;
|
|
59707
|
+
buffer.copy(newBuffer, offset);
|
|
59708
|
+
return newBuffer;
|
|
59709
|
+
}
|
|
59710
|
+
else {
|
|
59711
|
+
return buffer;
|
|
59712
|
+
}
|
|
59713
|
+
}
|
|
59714
|
+
exports.hexToBytes = hexToBytes;
|
|
59715
|
+
function bytesToHex(bytes, config) {
|
|
59716
|
+
var hex;
|
|
59717
|
+
if (typeof bytes === 'string') {
|
|
59718
|
+
hex = bytes;
|
|
59719
|
+
}
|
|
59720
|
+
else {
|
|
59721
|
+
var buffer = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes);
|
|
59722
|
+
hex = buffer.toString('hex');
|
|
59723
|
+
}
|
|
59724
|
+
return (config === null || config === void 0 ? void 0 : config.withPrefix) ? addHexPrefix(hex) : hex;
|
|
59725
|
+
}
|
|
59726
|
+
exports.bytesToHex = bytesToHex;
|
|
59727
|
+
function changeEndianness(hex) {
|
|
59728
|
+
var _hex = stripHexPrefix(hex);
|
|
59729
|
+
_hex = _hex.length % 2 !== 0 ? '0' + _hex : _hex;
|
|
59730
|
+
var bytes = _hex.match(/.{2}/g) || [];
|
|
59731
|
+
return bytes.reverse().join('');
|
|
59732
|
+
}
|
|
59733
|
+
exports.changeEndianness = changeEndianness;
|
|
59734
|
+
function toHexStringRawPositive(value, bitLength) {
|
|
59735
|
+
var hexString = value.toString(16);
|
|
59736
|
+
return fillToTargetLength(hexString, bitLength);
|
|
59737
|
+
}
|
|
59738
|
+
function toHexStringRawNegative(value, bitLength, encoding) {
|
|
59739
|
+
// tslint:disable-next-line: switch-default
|
|
59740
|
+
switch (encoding) {
|
|
59741
|
+
case 'default':
|
|
59742
|
+
var hexString = value.toString(16);
|
|
59743
|
+
return hexString.startsWith('-') ? "-" + fillToTargetLength(hexString.substr(1), bitLength) : fillToTargetLength(hexString, bitLength);
|
|
59744
|
+
case '2sComplement':
|
|
59745
|
+
var value2sComplement = new bignumber_1.default(2).pow(bitLength).minus(new bignumber_1.default(value).abs());
|
|
59746
|
+
return value2sComplement.toString(16);
|
|
59747
|
+
}
|
|
59748
|
+
}
|
|
59749
|
+
function fillToTargetLength(hexString, bitLength) {
|
|
59750
|
+
var nibbleLength = Math.ceil(bitLength / 4);
|
|
59751
|
+
var targetLength = hexString.length >= nibbleLength ? hexString.length : nibbleLength;
|
|
59752
|
+
targetLength = targetLength % 2 === 0 ? targetLength : targetLength + 1;
|
|
59753
|
+
return padStart_1.padStart(hexString, targetLength, '0');
|
|
59754
|
+
}
|
|
59755
|
+
|
|
59756
|
+
}).call(this)}).call(this,require("buffer").Buffer)
|
|
59757
|
+
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":260,"./padStart":322,"buffer":76}],322:[function(require,module,exports){
|
|
59758
|
+
"use strict";
|
|
59759
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59760
|
+
exports.padStart = void 0;
|
|
59761
|
+
function padStart(targetString, targetLength, padString) {
|
|
59762
|
+
// truncate if number, or convert non-number to 0
|
|
59763
|
+
targetLength = targetLength >> 0;
|
|
59764
|
+
if (targetString.length >= targetLength) {
|
|
59765
|
+
return targetString;
|
|
58534
59766
|
}
|
|
58535
|
-
|
|
58536
|
-
|
|
58537
|
-
|
|
59767
|
+
else {
|
|
59768
|
+
targetLength = targetLength - targetString.length;
|
|
59769
|
+
if (targetLength > padString.length) {
|
|
59770
|
+
// append to original to ensure we are longer than needed
|
|
59771
|
+
padString += padString.repeat(targetLength / padString.length);
|
|
59772
|
+
}
|
|
59773
|
+
return padString.slice(0, targetLength) + targetString;
|
|
59774
|
+
}
|
|
59775
|
+
}
|
|
59776
|
+
exports.padStart = padStart;
|
|
58538
59777
|
|
|
58539
|
-
},{
|
|
59778
|
+
},{}],323:[function(require,module,exports){
|
|
58540
59779
|
"use strict";
|
|
59780
|
+
var __extends = (this && this.__extends) || (function () {
|
|
59781
|
+
var extendStatics = function (d, b) {
|
|
59782
|
+
extendStatics = Object.setPrototypeOf ||
|
|
59783
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
59784
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
59785
|
+
return extendStatics(d, b);
|
|
59786
|
+
};
|
|
59787
|
+
return function (d, b) {
|
|
59788
|
+
extendStatics(d, b);
|
|
59789
|
+
function __() { this.constructor = d; }
|
|
59790
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
59791
|
+
};
|
|
59792
|
+
})();
|
|
58541
59793
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
58542
59794
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
58543
59795
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -58574,55 +59826,154 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
58574
59826
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
58575
59827
|
}
|
|
58576
59828
|
};
|
|
59829
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59830
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59831
|
+
};
|
|
58577
59832
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58578
|
-
exports.
|
|
58579
|
-
var
|
|
58580
|
-
var
|
|
58581
|
-
var
|
|
58582
|
-
var
|
|
58583
|
-
|
|
59833
|
+
exports.AirGapCoinWallet = exports.TimeInterval = void 0;
|
|
59834
|
+
var bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
59835
|
+
var ProtocolNetwork_1 = require("../utils/ProtocolNetwork");
|
|
59836
|
+
var ProtocolSymbols_1 = require("../utils/ProtocolSymbols");
|
|
59837
|
+
var AirGapMarketWallet_1 = require("./AirGapMarketWallet");
|
|
59838
|
+
var TimeInterval;
|
|
59839
|
+
(function (TimeInterval) {
|
|
59840
|
+
TimeInterval["HOURS"] = "24h";
|
|
59841
|
+
TimeInterval["DAYS"] = "7d";
|
|
59842
|
+
TimeInterval["MONTH"] = "30d";
|
|
59843
|
+
})(TimeInterval = exports.TimeInterval || (exports.TimeInterval = {}));
|
|
59844
|
+
var AirGapCoinWallet = /** @class */ (function (_super) {
|
|
59845
|
+
__extends(AirGapCoinWallet, _super);
|
|
59846
|
+
function AirGapCoinWallet() {
|
|
59847
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
58584
59848
|
}
|
|
58585
|
-
|
|
58586
|
-
return
|
|
58587
|
-
return __generator(this, function (_a) {
|
|
58588
|
-
return [2 /*return*/, new AES_1.AES().encryptString(payload, privateKey)];
|
|
58589
|
-
});
|
|
58590
|
-
});
|
|
59849
|
+
AirGapCoinWallet.prototype.getCurrentBalance = function () {
|
|
59850
|
+
return this.currentBalance;
|
|
58591
59851
|
};
|
|
58592
|
-
|
|
59852
|
+
AirGapCoinWallet.prototype.setCurrentBalance = function (balance) {
|
|
59853
|
+
this.currentBalance = balance;
|
|
59854
|
+
};
|
|
59855
|
+
AirGapCoinWallet.prototype.getCurrentMarketPrice = function () {
|
|
59856
|
+
return this.currentMarketPrice;
|
|
59857
|
+
};
|
|
59858
|
+
AirGapCoinWallet.prototype.setCurrentMarketPrice = function (marketPrice) {
|
|
58593
59859
|
return __awaiter(this, void 0, void 0, function () {
|
|
58594
|
-
|
|
58595
|
-
|
|
59860
|
+
var _a;
|
|
59861
|
+
return __generator(this, function (_b) {
|
|
59862
|
+
switch (_b.label) {
|
|
59863
|
+
case 0:
|
|
59864
|
+
_a = this;
|
|
59865
|
+
return [4 /*yield*/, this.protocol.getOptions()];
|
|
59866
|
+
case 1:
|
|
59867
|
+
_a.currentMarketPrice = (_b.sent()).network.type === ProtocolNetwork_1.NetworkType.MAINNET ? marketPrice : new bignumber_1.default(0);
|
|
59868
|
+
return [2 /*return*/];
|
|
59869
|
+
}
|
|
58596
59870
|
});
|
|
58597
59871
|
});
|
|
58598
59872
|
};
|
|
58599
|
-
|
|
59873
|
+
AirGapCoinWallet.prototype._synchronize = function () {
|
|
58600
59874
|
return __awaiter(this, void 0, void 0, function () {
|
|
58601
|
-
|
|
58602
|
-
|
|
59875
|
+
var _a, balance, marketPrice;
|
|
59876
|
+
return __generator(this, function (_b) {
|
|
59877
|
+
switch (_b.label) {
|
|
59878
|
+
case 0: return [4 /*yield*/, Promise.all([this.balanceOf(), this.fetchCurrentMarketPrice()])];
|
|
59879
|
+
case 1:
|
|
59880
|
+
_a = _b.sent(), balance = _a[0], marketPrice = _a[1];
|
|
59881
|
+
this.setCurrentBalance(balance);
|
|
59882
|
+
return [4 /*yield*/, this.setCurrentMarketPrice(marketPrice)];
|
|
59883
|
+
case 2:
|
|
59884
|
+
_b.sent();
|
|
59885
|
+
return [2 /*return*/];
|
|
59886
|
+
}
|
|
58603
59887
|
});
|
|
58604
59888
|
});
|
|
58605
59889
|
};
|
|
58606
|
-
|
|
59890
|
+
AirGapCoinWallet.prototype.reset = function () {
|
|
59891
|
+
this.currentBalance = undefined;
|
|
59892
|
+
this.currentMarketPrice = undefined;
|
|
59893
|
+
};
|
|
59894
|
+
AirGapCoinWallet.prototype.fetchCurrentMarketPrice = function (baseSymbol) {
|
|
59895
|
+
if (baseSymbol === void 0) { baseSymbol = 'USD'; }
|
|
58607
59896
|
return __awaiter(this, void 0, void 0, function () {
|
|
59897
|
+
var marketPrice;
|
|
58608
59898
|
return __generator(this, function (_a) {
|
|
58609
|
-
|
|
59899
|
+
switch (_a.label) {
|
|
59900
|
+
case 0: return [4 /*yield*/, this.priceService.getCurrentMarketPrice(this.protocol, baseSymbol)];
|
|
59901
|
+
case 1:
|
|
59902
|
+
marketPrice = _a.sent();
|
|
59903
|
+
return [4 /*yield*/, this.setCurrentMarketPrice(marketPrice)];
|
|
59904
|
+
case 2:
|
|
59905
|
+
_a.sent();
|
|
59906
|
+
return [2 /*return*/, marketPrice];
|
|
59907
|
+
}
|
|
58610
59908
|
});
|
|
58611
59909
|
});
|
|
58612
59910
|
};
|
|
58613
|
-
|
|
59911
|
+
AirGapCoinWallet.prototype.balanceOf = function () {
|
|
58614
59912
|
return __awaiter(this, void 0, void 0, function () {
|
|
58615
|
-
|
|
58616
|
-
|
|
59913
|
+
var protocolIdentifier, result, _a, _b, _c, _d, _e;
|
|
59914
|
+
return __generator(this, function (_f) {
|
|
59915
|
+
switch (_f.label) {
|
|
59916
|
+
case 0: return [4 /*yield*/, this.protocol.getIdentifier()];
|
|
59917
|
+
case 1:
|
|
59918
|
+
protocolIdentifier = _f.sent();
|
|
59919
|
+
if (!((protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC ||
|
|
59920
|
+
protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_SEGWIT ||
|
|
59921
|
+
protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.GRS) &&
|
|
59922
|
+
this.isExtendedPublicKey)) return [3 /*break*/, 3];
|
|
59923
|
+
_a = bignumber_1.default.bind;
|
|
59924
|
+
return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0)];
|
|
59925
|
+
case 2:
|
|
59926
|
+
// TODO: Remove and test
|
|
59927
|
+
/*
|
|
59928
|
+
We should remove this if BTC also uses blockbook. (And change the order of the if/else below)
|
|
59929
|
+
|
|
59930
|
+
The problem is that we have addresses cached for all protocols. But blockbook (grs) doesn't allow
|
|
59931
|
+
multiple addresses to be checked at once, so we need to xPub key there (or we would do 100s of requests).
|
|
59932
|
+
|
|
59933
|
+
We can also not simply change the order of the following if/else, because then it would use the xPub method for
|
|
59934
|
+
BTC as well, which results in the addresses being derived again, which causes massive lags in the apps.
|
|
59935
|
+
*/
|
|
59936
|
+
result = new (_a.apply(bignumber_1.default, [void 0, _f.sent()]))();
|
|
59937
|
+
return [3 /*break*/, 11];
|
|
59938
|
+
case 3:
|
|
59939
|
+
if (!(protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.XTZ_SHIELDED) /* TODO: cover ALL sapling protocols */) return [3 /*break*/, 5]; /* TODO: cover ALL sapling protocols */
|
|
59940
|
+
_b = bignumber_1.default.bind;
|
|
59941
|
+
return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey)];
|
|
59942
|
+
case 4:
|
|
59943
|
+
result = new (_b.apply(bignumber_1.default, [void 0, _f.sent()]))();
|
|
59944
|
+
return [3 /*break*/, 11];
|
|
59945
|
+
case 5:
|
|
59946
|
+
if (!(this.addresses.length > 0)) return [3 /*break*/, 7];
|
|
59947
|
+
_c = bignumber_1.default.bind;
|
|
59948
|
+
return [4 /*yield*/, this.protocol.getBalanceOfAddresses(this.addressesToCheck())];
|
|
59949
|
+
case 6:
|
|
59950
|
+
result = new (_c.apply(bignumber_1.default, [void 0, _f.sent()]))();
|
|
59951
|
+
return [3 /*break*/, 11];
|
|
59952
|
+
case 7:
|
|
59953
|
+
if (!this.isExtendedPublicKey) return [3 /*break*/, 9];
|
|
59954
|
+
_d = bignumber_1.default.bind;
|
|
59955
|
+
return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0)];
|
|
59956
|
+
case 8:
|
|
59957
|
+
result = new (_d.apply(bignumber_1.default, [void 0, _f.sent()]))();
|
|
59958
|
+
return [3 /*break*/, 11];
|
|
59959
|
+
case 9:
|
|
59960
|
+
_e = bignumber_1.default.bind;
|
|
59961
|
+
return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey)];
|
|
59962
|
+
case 10:
|
|
59963
|
+
result = new (_e.apply(bignumber_1.default, [void 0, _f.sent()]))();
|
|
59964
|
+
_f.label = 11;
|
|
59965
|
+
case 11:
|
|
59966
|
+
this.setCurrentBalance(result);
|
|
59967
|
+
return [2 /*return*/, result];
|
|
59968
|
+
}
|
|
58617
59969
|
});
|
|
58618
59970
|
});
|
|
58619
59971
|
};
|
|
58620
|
-
return
|
|
58621
|
-
}());
|
|
58622
|
-
exports.
|
|
59972
|
+
return AirGapCoinWallet;
|
|
59973
|
+
}(AirGapMarketWallet_1.AirGapMarketWallet));
|
|
59974
|
+
exports.AirGapCoinWallet = AirGapCoinWallet;
|
|
58623
59975
|
|
|
58624
|
-
},{"../
|
|
58625
|
-
(function (Buffer){(function (){
|
|
59976
|
+
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":260,"../utils/ProtocolNetwork":316,"../utils/ProtocolSymbols":317,"./AirGapMarketWallet":324}],324:[function(require,module,exports){
|
|
58626
59977
|
"use strict";
|
|
58627
59978
|
var __extends = (this && this.__extends) || (function () {
|
|
58628
59979
|
var extendStatics = function (d, b) {
|
|
@@ -58673,128 +60024,187 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
58673
60024
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
58674
60025
|
}
|
|
58675
60026
|
};
|
|
60027
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
60028
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60029
|
+
};
|
|
58676
60030
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58677
|
-
exports.
|
|
58678
|
-
var
|
|
58679
|
-
var
|
|
58680
|
-
var
|
|
58681
|
-
var
|
|
58682
|
-
|
|
58683
|
-
|
|
58684
|
-
var
|
|
58685
|
-
|
|
58686
|
-
|
|
58687
|
-
|
|
58688
|
-
|
|
58689
|
-
|
|
58690
|
-
|
|
58691
|
-
|
|
60031
|
+
exports.AirGapMarketWallet = void 0;
|
|
60032
|
+
var bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
60033
|
+
var ProtocolSymbols_1 = require("../utils/ProtocolSymbols");
|
|
60034
|
+
var AirGapWallet_1 = require("./AirGapWallet");
|
|
60035
|
+
var AirGapMarketWallet = /** @class */ (function (_super) {
|
|
60036
|
+
__extends(AirGapMarketWallet, _super);
|
|
60037
|
+
function AirGapMarketWallet(protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, priceService, addressIndex) {
|
|
60038
|
+
var _this = _super.call(this, protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, addressIndex) || this;
|
|
60039
|
+
_this.protocol = protocol;
|
|
60040
|
+
_this.publicKey = publicKey;
|
|
60041
|
+
_this.isExtendedPublicKey = isExtendedPublicKey;
|
|
60042
|
+
_this.derivationPath = derivationPath;
|
|
60043
|
+
_this.masterFingerprint = masterFingerprint;
|
|
60044
|
+
_this.status = status;
|
|
60045
|
+
_this.priceService = priceService;
|
|
60046
|
+
_this.addressIndex = addressIndex;
|
|
60047
|
+
return _this;
|
|
58692
60048
|
}
|
|
58693
|
-
|
|
60049
|
+
AirGapMarketWallet.prototype.addressesToCheck = function () {
|
|
60050
|
+
var addressesToReceive = this.addressIndex !== undefined ? [this.addresses[this.addressIndex]] : this.addresses;
|
|
60051
|
+
return addressesToReceive;
|
|
60052
|
+
};
|
|
60053
|
+
AirGapMarketWallet.prototype.setProtocol = function (protocol) {
|
|
58694
60054
|
return __awaiter(this, void 0, void 0, function () {
|
|
58695
|
-
var kxOtherPublicKey, keypair, state, nonce, encryptedMessage;
|
|
58696
60055
|
return __generator(this, function (_a) {
|
|
58697
|
-
|
|
58698
|
-
|
|
58699
|
-
|
|
58700
|
-
|
|
58701
|
-
|
|
58702
|
-
|
|
60056
|
+
switch (_a.label) {
|
|
60057
|
+
case 0: return [4 /*yield*/, _super.prototype.setProtocol.call(this, protocol)];
|
|
60058
|
+
case 1:
|
|
60059
|
+
_a.sent();
|
|
60060
|
+
this.reset();
|
|
60061
|
+
return [4 /*yield*/, this.synchronize()];
|
|
60062
|
+
case 2:
|
|
60063
|
+
_a.sent();
|
|
60064
|
+
return [2 /*return*/];
|
|
60065
|
+
}
|
|
58703
60066
|
});
|
|
58704
60067
|
});
|
|
58705
60068
|
};
|
|
58706
|
-
|
|
60069
|
+
AirGapMarketWallet.prototype.synchronize = function () {
|
|
60070
|
+
var args = [];
|
|
60071
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
60072
|
+
args[_i] = arguments[_i];
|
|
60073
|
+
}
|
|
58707
60074
|
return __awaiter(this, void 0, void 0, function () {
|
|
58708
|
-
var
|
|
60075
|
+
var _this = this;
|
|
58709
60076
|
return __generator(this, function (_a) {
|
|
58710
|
-
|
|
58711
|
-
|
|
58712
|
-
|
|
58713
|
-
|
|
58714
|
-
encryptedPayloadBytes = Buffer.from(encryptedPayload, hex_1.isHex(encryptedPayload) ? 'hex' : 'utf-8');
|
|
58715
|
-
kxOtherPublicKey = encryptedPayloadBytes.slice(0, 32);
|
|
58716
|
-
ciphertext = encryptedPayloadBytes.slice(32);
|
|
58717
|
-
state = new blake2b_1.BLAKE2b(24);
|
|
58718
|
-
nonce = state.update(kxOtherPublicKey, 32).update(kxSelfPublicKey, 32).digest();
|
|
58719
|
-
decryptedMessage = nacl_1.openBox(kxOtherPublicKey, kxSelfPrivateKey, nonce, ciphertext);
|
|
58720
|
-
if (decryptedMessage === null) {
|
|
58721
|
-
throw new Error('Ed25519 decryption failed.');
|
|
60077
|
+
if (this.synchronizePromise === undefined) {
|
|
60078
|
+
this.synchronizePromise = this._synchronize.apply(this, args).finally(function () {
|
|
60079
|
+
_this.synchronizePromise = undefined;
|
|
60080
|
+
});
|
|
58722
60081
|
}
|
|
58723
|
-
return [2 /*return*/,
|
|
60082
|
+
return [2 /*return*/, this.synchronizePromise];
|
|
58724
60083
|
});
|
|
58725
60084
|
});
|
|
58726
60085
|
};
|
|
58727
|
-
|
|
58728
|
-
|
|
58729
|
-
|
|
58730
|
-
|
|
58731
|
-
|
|
58732
|
-
|
|
58733
|
-
|
|
58734
|
-
|
|
58735
|
-
|
|
58736
|
-
|
|
58737
|
-
|
|
58738
|
-
|
|
58739
|
-
|
|
58740
|
-
|
|
58741
|
-
|
|
58742
|
-
|
|
58743
|
-
|
|
58744
|
-
|
|
58745
|
-
|
|
58746
|
-
|
|
58747
|
-
|
|
58748
|
-
|
|
58749
|
-
|
|
58750
|
-
|
|
58751
|
-
|
|
58752
|
-
|
|
58753
|
-
|
|
58754
|
-
|
|
60086
|
+
AirGapMarketWallet.prototype.fetchTransactions = function (limit, cursor) {
|
|
60087
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60088
|
+
var protocolIdentifier, transactionResult;
|
|
60089
|
+
return __generator(this, function (_a) {
|
|
60090
|
+
switch (_a.label) {
|
|
60091
|
+
case 0: return [4 /*yield*/, this.protocol.getIdentifier()
|
|
60092
|
+
// let transactions: IAirGapTransaction[] = []
|
|
60093
|
+
];
|
|
60094
|
+
case 1:
|
|
60095
|
+
protocolIdentifier = _a.sent();
|
|
60096
|
+
if (!((protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC ||
|
|
60097
|
+
protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.BTC_SEGWIT ||
|
|
60098
|
+
protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.GRS) &&
|
|
60099
|
+
this.isExtendedPublicKey)) return [3 /*break*/, 3];
|
|
60100
|
+
return [4 /*yield*/, this.protocol.getTransactionsFromExtendedPublicKey(this.publicKey, limit, cursor)];
|
|
60101
|
+
case 2:
|
|
60102
|
+
// TODO: Remove and test
|
|
60103
|
+
/*
|
|
60104
|
+
We should remove this if BTC also uses blockbook. (And change the order of the if/else below)
|
|
60105
|
+
|
|
60106
|
+
The problem is that we have addresses cached for all protocols. But blockbook (grs) doesn't allow
|
|
60107
|
+
multiple addresses to be checked at once, so we need to xPub key there (or we would do 100s of requests).
|
|
60108
|
+
|
|
60109
|
+
We can also not simply change the order of the following if/else, because then it would use the xPub method for
|
|
60110
|
+
BTC as well, which results in the addresses being derived again, which causes massive lags in the apps.
|
|
60111
|
+
*/
|
|
60112
|
+
transactionResult = _a.sent();
|
|
60113
|
+
return [3 /*break*/, 11];
|
|
60114
|
+
case 3:
|
|
60115
|
+
if (!(protocolIdentifier === ProtocolSymbols_1.MainProtocolSymbols.XTZ_SHIELDED) /* TODO: cover ALL sapling protocols */) return [3 /*break*/, 5]; /* TODO: cover ALL sapling protocols */
|
|
60116
|
+
return [4 /*yield*/, this.protocol.getTransactionsFromPublicKey(this.publicKey, limit, cursor)];
|
|
60117
|
+
case 4:
|
|
60118
|
+
transactionResult = _a.sent();
|
|
60119
|
+
return [3 /*break*/, 11];
|
|
60120
|
+
case 5:
|
|
60121
|
+
if (!(this.addresses.length > 0)) return [3 /*break*/, 7];
|
|
60122
|
+
return [4 /*yield*/, this.protocol.getTransactionsFromAddresses(this.addressesToCheck(), limit, cursor)];
|
|
60123
|
+
case 6:
|
|
60124
|
+
transactionResult = _a.sent();
|
|
60125
|
+
return [3 /*break*/, 11];
|
|
60126
|
+
case 7:
|
|
60127
|
+
if (!this.isExtendedPublicKey) return [3 /*break*/, 9];
|
|
60128
|
+
return [4 /*yield*/, this.protocol.getTransactionsFromExtendedPublicKey(this.publicKey, limit, cursor)];
|
|
60129
|
+
case 8:
|
|
60130
|
+
transactionResult = _a.sent();
|
|
60131
|
+
return [3 /*break*/, 11];
|
|
60132
|
+
case 9: return [4 /*yield*/, this.protocol.getTransactionsFromPublicKey(this.publicKey, limit, cursor)];
|
|
60133
|
+
case 10:
|
|
60134
|
+
transactionResult = _a.sent();
|
|
60135
|
+
_a.label = 11;
|
|
60136
|
+
case 11: return [2 /*return*/, transactionResult];
|
|
60137
|
+
}
|
|
60138
|
+
});
|
|
58755
60139
|
});
|
|
58756
60140
|
};
|
|
58757
|
-
|
|
58758
|
-
|
|
58759
|
-
|
|
58760
|
-
|
|
58761
|
-
|
|
58762
|
-
|
|
58763
|
-
|
|
58764
|
-
|
|
60141
|
+
AirGapMarketWallet.prototype.prepareTransaction = function (recipients, values, fee, data) {
|
|
60142
|
+
if (this.isExtendedPublicKey) {
|
|
60143
|
+
return this.protocol.prepareTransactionFromExtendedPublicKey(this.publicKey, 0, recipients, values, fee, data);
|
|
60144
|
+
}
|
|
60145
|
+
else {
|
|
60146
|
+
if (this.addressIndex) {
|
|
60147
|
+
data = Object.assign(data, { addressIndex: this.addressIndex });
|
|
60148
|
+
}
|
|
60149
|
+
return this.protocol.prepareTransactionFromPublicKey(this.publicKey, recipients, values, fee, data);
|
|
60150
|
+
}
|
|
58765
60151
|
};
|
|
58766
|
-
|
|
58767
|
-
return
|
|
60152
|
+
AirGapMarketWallet.prototype.getMaxTransferValue = function (recipients, fee, data) {
|
|
60153
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60154
|
+
var _a, _b;
|
|
60155
|
+
return __generator(this, function (_c) {
|
|
60156
|
+
switch (_c.label) {
|
|
60157
|
+
case 0:
|
|
60158
|
+
if (!this.isExtendedPublicKey) return [3 /*break*/, 2];
|
|
60159
|
+
_a = bignumber_1.default.bind;
|
|
60160
|
+
return [4 /*yield*/, this.protocol.estimateMaxTransactionValueFromExtendedPublicKey(this.publicKey, recipients, fee, data)];
|
|
60161
|
+
case 1: return [2 /*return*/, new (_a.apply(bignumber_1.default, [void 0, _c.sent()]))()];
|
|
60162
|
+
case 2:
|
|
60163
|
+
if (this.addressIndex) {
|
|
60164
|
+
data = Object.assign(data, { addressIndex: this.addressIndex });
|
|
60165
|
+
}
|
|
60166
|
+
_b = bignumber_1.default.bind;
|
|
60167
|
+
return [4 /*yield*/, this.protocol.estimateMaxTransactionValueFromPublicKey(this.publicKey, recipients, fee, data)];
|
|
60168
|
+
case 3: return [2 /*return*/, new (_b.apply(bignumber_1.default, [void 0, _c.sent()]))()];
|
|
60169
|
+
}
|
|
60170
|
+
});
|
|
60171
|
+
});
|
|
58768
60172
|
};
|
|
58769
|
-
|
|
58770
|
-
return
|
|
60173
|
+
AirGapMarketWallet.prototype.estimateFees = function (recipients, values, data) {
|
|
60174
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60175
|
+
return __generator(this, function (_a) {
|
|
60176
|
+
if (this.isExtendedPublicKey) {
|
|
60177
|
+
return [2 /*return*/, this.protocol.estimateFeeDefaultsFromExtendedPublicKey(this.publicKey, recipients, values, data)];
|
|
60178
|
+
}
|
|
60179
|
+
else {
|
|
60180
|
+
if (this.addressIndex) {
|
|
60181
|
+
data = Object.assign(data, { addressIndex: this.addressIndex });
|
|
60182
|
+
}
|
|
60183
|
+
return [2 /*return*/, this.protocol.estimateFeeDefaultsFromPublicKey(this.publicKey, recipients, values, data)];
|
|
60184
|
+
}
|
|
60185
|
+
return [2 /*return*/];
|
|
60186
|
+
});
|
|
60187
|
+
});
|
|
58771
60188
|
};
|
|
58772
|
-
return
|
|
58773
|
-
}());
|
|
58774
|
-
exports.
|
|
60189
|
+
return AirGapMarketWallet;
|
|
60190
|
+
}(AirGapWallet_1.AirGapWallet));
|
|
60191
|
+
exports.AirGapMarketWallet = AirGapMarketWallet;
|
|
58775
60192
|
|
|
58776
|
-
},{}],
|
|
58777
|
-
|
|
58778
|
-
|
|
58779
|
-
var
|
|
58780
|
-
|
|
58781
|
-
|
|
58782
|
-
|
|
58783
|
-
|
|
58784
|
-
|
|
58785
|
-
|
|
58786
|
-
|
|
58787
|
-
|
|
58788
|
-
|
|
58789
|
-
|
|
58790
|
-
});
|
|
58791
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
58792
|
-
if (mod && mod.__esModule) return mod;
|
|
58793
|
-
var result = {};
|
|
58794
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
58795
|
-
__setModuleDefault(result, mod);
|
|
58796
|
-
return result;
|
|
58797
|
-
};
|
|
60193
|
+
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":260,"../utils/ProtocolSymbols":317,"./AirGapWallet":326}],325:[function(require,module,exports){
|
|
60194
|
+
"use strict";
|
|
60195
|
+
var __extends = (this && this.__extends) || (function () {
|
|
60196
|
+
var extendStatics = function (d, b) {
|
|
60197
|
+
extendStatics = Object.setPrototypeOf ||
|
|
60198
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
60199
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
60200
|
+
return extendStatics(d, b);
|
|
60201
|
+
};
|
|
60202
|
+
return function (d, b) {
|
|
60203
|
+
extendStatics(d, b);
|
|
60204
|
+
function __() { this.constructor = d; }
|
|
60205
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
60206
|
+
};
|
|
60207
|
+
})();
|
|
58798
60208
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
58799
60209
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
58800
60210
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -58825,394 +60235,285 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
58825
60235
|
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58826
60236
|
if (t[2]) _.ops.pop();
|
|
58827
60237
|
_.trys.pop(); continue;
|
|
58828
|
-
}
|
|
58829
|
-
op = body.call(thisArg, _);
|
|
58830
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58831
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
58832
|
-
}
|
|
58833
|
-
};
|
|
58834
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58835
|
-
exports.AES = void 0;
|
|
58836
|
-
var crypto = __importStar(require("crypto"));
|
|
58837
|
-
var errors_1 = require("../errors");
|
|
58838
|
-
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
58839
|
-
var hex_1 = require("./hex");
|
|
58840
|
-
// https://github.com/microsoft/botbuilder-js/blob/master/libraries/botframework-config/src/encrypt.ts#L20
|
|
58841
|
-
var AES = /** @class */ (function () {
|
|
58842
|
-
function AES(AES_KEY_SIZE, KEY_DERIVATION_ITERATION_COUNT, ALGORITHM, encoding) {
|
|
58843
|
-
if (AES_KEY_SIZE === void 0) { AES_KEY_SIZE = 256; }
|
|
58844
|
-
if (KEY_DERIVATION_ITERATION_COUNT === void 0) { KEY_DERIVATION_ITERATION_COUNT = 10000; }
|
|
58845
|
-
if (ALGORITHM === void 0) { ALGORITHM = 'aes-256-gcm'; }
|
|
58846
|
-
if (encoding === void 0) { encoding = 'hex'; }
|
|
58847
|
-
this.AES_KEY_SIZE = AES_KEY_SIZE;
|
|
58848
|
-
this.KEY_DERIVATION_ITERATION_COUNT = KEY_DERIVATION_ITERATION_COUNT;
|
|
58849
|
-
this.ALGORITHM = ALGORITHM;
|
|
58850
|
-
this.encoding = encoding;
|
|
58851
|
-
}
|
|
58852
|
-
AES.prototype.encryptString = function (plainText, privateKey) {
|
|
58853
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
58854
|
-
var keyBytes, ivBytes, ivText, cipher, encryptedValue, authTagText;
|
|
58855
|
-
return __generator(this, function (_a) {
|
|
58856
|
-
switch (_a.label) {
|
|
58857
|
-
case 0:
|
|
58858
|
-
if (!plainText || plainText.length === 0) {
|
|
58859
|
-
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'you must pass an input message');
|
|
58860
|
-
}
|
|
58861
|
-
if (!privateKey || privateKey.length === 0) {
|
|
58862
|
-
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'you must pass a privateKey');
|
|
58863
|
-
}
|
|
58864
|
-
return [4 /*yield*/, this.deriveKeyFromPrivateKey(privateKey)
|
|
58865
|
-
// Generates 16 byte cryptographically strong pseudo-random data as IV
|
|
58866
|
-
// https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback
|
|
58867
|
-
];
|
|
58868
|
-
case 1:
|
|
58869
|
-
keyBytes = _a.sent();
|
|
58870
|
-
ivBytes = crypto.randomBytes(16);
|
|
58871
|
-
ivText = ivBytes.toString(this.encoding);
|
|
58872
|
-
cipher = crypto.createCipheriv(this.ALGORITHM, keyBytes, ivBytes);
|
|
58873
|
-
encryptedValue = cipher.update(plainText, 'utf8', this.encoding);
|
|
58874
|
-
encryptedValue += cipher.final(this.encoding);
|
|
58875
|
-
authTagText = cipher.getAuthTag().toString(this.encoding);
|
|
58876
|
-
return [2 /*return*/, ivText + "!" + encryptedValue + "!" + authTagText];
|
|
58877
|
-
}
|
|
58878
|
-
});
|
|
58879
|
-
});
|
|
58880
|
-
};
|
|
58881
|
-
AES.prototype.decryptString = function (encryptedValue, privateKey) {
|
|
58882
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
58883
|
-
var parts, ivText, encryptedText, authTagText, ivBytes, keyBytes, authTagBytes, decipher, value;
|
|
58884
|
-
return __generator(this, function (_a) {
|
|
58885
|
-
switch (_a.label) {
|
|
58886
|
-
case 0:
|
|
58887
|
-
if (!encryptedValue || encryptedValue.length === 0) {
|
|
58888
|
-
return [2 /*return*/, encryptedValue];
|
|
58889
|
-
}
|
|
58890
|
-
if (!privateKey || privateKey.length === 0) {
|
|
58891
|
-
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'you must pass a privateKey');
|
|
58892
|
-
}
|
|
58893
|
-
parts = encryptedValue.split('!');
|
|
58894
|
-
if (parts.length !== 3) {
|
|
58895
|
-
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'The encrypted value is not in a valid format');
|
|
58896
|
-
}
|
|
58897
|
-
ivText = parts[0];
|
|
58898
|
-
encryptedText = parts[1];
|
|
58899
|
-
authTagText = parts[2];
|
|
58900
|
-
ivBytes = Buffer.from(ivText, this.encoding);
|
|
58901
|
-
return [4 /*yield*/, this.deriveKeyFromPrivateKey(privateKey)];
|
|
58902
|
-
case 1:
|
|
58903
|
-
keyBytes = _a.sent();
|
|
58904
|
-
authTagBytes = Buffer.from(authTagText, this.encoding);
|
|
58905
|
-
if (ivBytes.length !== 16) {
|
|
58906
|
-
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, 'The IV length is invalid');
|
|
58907
|
-
}
|
|
58908
|
-
if (keyBytes.length !== 32) {
|
|
58909
|
-
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, 'The key length is invalid');
|
|
58910
|
-
}
|
|
58911
|
-
if (authTagBytes.length !== 16) {
|
|
58912
|
-
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.UTILS, 'The authtag length is invalid');
|
|
58913
|
-
}
|
|
58914
|
-
decipher = crypto.createDecipheriv(this.ALGORITHM, keyBytes, ivBytes);
|
|
58915
|
-
decipher.setAuthTag(authTagBytes);
|
|
58916
|
-
value = decipher.update(encryptedText, this.encoding, 'utf8');
|
|
58917
|
-
value += decipher.final('utf8');
|
|
58918
|
-
return [2 /*return*/, value];
|
|
58919
|
-
}
|
|
58920
|
-
});
|
|
58921
|
-
});
|
|
58922
|
-
};
|
|
58923
|
-
AES.prototype.deriveKeyFromPrivateKey = function (privateKey) {
|
|
58924
|
-
var _this = this;
|
|
58925
|
-
var password = hex_1.isHex(privateKey) ? Buffer.from(privateKey, 'hex') : privateKey;
|
|
58926
|
-
return new Promise(function (resolve, reject) {
|
|
58927
|
-
crypto.pbkdf2(password, '', _this.KEY_DERIVATION_ITERATION_COUNT, 32, 'sha512', function (pbkdf2Error, key) {
|
|
58928
|
-
if (pbkdf2Error) {
|
|
58929
|
-
reject(pbkdf2Error);
|
|
58930
|
-
}
|
|
58931
|
-
resolve(key);
|
|
58932
|
-
});
|
|
58933
|
-
});
|
|
58934
|
-
};
|
|
58935
|
-
return AES;
|
|
58936
|
-
}());
|
|
58937
|
-
exports.AES = AES;
|
|
58938
|
-
|
|
58939
|
-
}).call(this)}).call(this,require("buffer").Buffer)
|
|
58940
|
-
},{"../errors":301,"../errors/coinlib-error":300,"./hex":309,"buffer":76,"crypto":87}],306:[function(require,module,exports){
|
|
58941
|
-
"use strict";
|
|
58942
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58943
|
-
exports.ProtocolNetwork = exports.NetworkType = void 0;
|
|
58944
|
-
var createHash = require("../dependencies/src/create-hash-1.2.0/index");
|
|
58945
|
-
var sha256hashShort = function (input) {
|
|
58946
|
-
var hash = createHash('sha256');
|
|
58947
|
-
hash.update(input);
|
|
58948
|
-
return hash.digest('base64').slice(0, 10);
|
|
58949
|
-
};
|
|
58950
|
-
var NetworkType;
|
|
58951
|
-
(function (NetworkType) {
|
|
58952
|
-
NetworkType["MAINNET"] = "MAINNET";
|
|
58953
|
-
NetworkType["TESTNET"] = "TESTNET";
|
|
58954
|
-
NetworkType["CUSTOM"] = "CUSTOM";
|
|
58955
|
-
})(NetworkType = exports.NetworkType || (exports.NetworkType = {}));
|
|
58956
|
-
var ProtocolNetwork = /** @class */ (function () {
|
|
58957
|
-
function ProtocolNetwork(name, type, rpcUrl, blockExplorer, extras) {
|
|
58958
|
-
this.name = name;
|
|
58959
|
-
this.type = type;
|
|
58960
|
-
this.rpcUrl = rpcUrl;
|
|
58961
|
-
this.blockExplorer = blockExplorer;
|
|
58962
|
-
this.extras = extras;
|
|
58963
|
-
}
|
|
58964
|
-
Object.defineProperty(ProtocolNetwork.prototype, "identifier", {
|
|
58965
|
-
get: function () {
|
|
58966
|
-
var hashed = sha256hashShort(this.name + "-" + this.rpcUrl);
|
|
58967
|
-
return this.type + "-" + hashed;
|
|
58968
|
-
},
|
|
58969
|
-
enumerable: false,
|
|
58970
|
-
configurable: true
|
|
58971
|
-
});
|
|
58972
|
-
return ProtocolNetwork;
|
|
58973
|
-
}());
|
|
58974
|
-
exports.ProtocolNetwork = ProtocolNetwork;
|
|
58975
|
-
|
|
58976
|
-
},{"../dependencies/src/create-hash-1.2.0/index":270}],307:[function(require,module,exports){
|
|
58977
|
-
"use strict";
|
|
58978
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58979
|
-
exports.isProtocolSymbol = exports.isSubProtocolSymbol = exports.isMainProtocolSymbol = exports.SubProtocolSymbols = exports.MainProtocolSymbols = void 0;
|
|
58980
|
-
var MainProtocolSymbols;
|
|
58981
|
-
(function (MainProtocolSymbols) {
|
|
58982
|
-
MainProtocolSymbols["AE"] = "ae";
|
|
58983
|
-
MainProtocolSymbols["BTC"] = "btc";
|
|
58984
|
-
MainProtocolSymbols["BTC_SEGWIT"] = "btc_segwit";
|
|
58985
|
-
MainProtocolSymbols["ETH"] = "eth";
|
|
58986
|
-
MainProtocolSymbols["XTZ"] = "xtz";
|
|
58987
|
-
MainProtocolSymbols["XTZ_SHIELDED"] = "xtz_shielded";
|
|
58988
|
-
MainProtocolSymbols["GRS"] = "grs";
|
|
58989
|
-
MainProtocolSymbols["COSMOS"] = "cosmos";
|
|
58990
|
-
MainProtocolSymbols["POLKADOT"] = "polkadot";
|
|
58991
|
-
MainProtocolSymbols["KUSAMA"] = "kusama";
|
|
58992
|
-
MainProtocolSymbols["MOONBASE"] = "moonbase";
|
|
58993
|
-
MainProtocolSymbols["MOONRIVER"] = "moonriver";
|
|
58994
|
-
MainProtocolSymbols["MOONBEAM"] = "moonbeam";
|
|
58995
|
-
MainProtocolSymbols["ASTAR"] = "astar";
|
|
58996
|
-
MainProtocolSymbols["SHIDEN"] = "shiden";
|
|
58997
|
-
})(MainProtocolSymbols = exports.MainProtocolSymbols || (exports.MainProtocolSymbols = {}));
|
|
58998
|
-
var SubProtocolSymbols;
|
|
58999
|
-
(function (SubProtocolSymbols) {
|
|
59000
|
-
SubProtocolSymbols["XTZ_KT"] = "xtz-kt";
|
|
59001
|
-
SubProtocolSymbols["XTZ_BTC"] = "xtz-btc";
|
|
59002
|
-
SubProtocolSymbols["XTZ_USD"] = "xtz-usd";
|
|
59003
|
-
SubProtocolSymbols["XTZ_KUSD"] = "xtz-kusd";
|
|
59004
|
-
SubProtocolSymbols["XTZ_STKR"] = "xtz-stkr";
|
|
59005
|
-
SubProtocolSymbols["XTZ_ETHTZ"] = "xtz-eth";
|
|
59006
|
-
SubProtocolSymbols["XTZ_UUSD"] = "xtz-uusd";
|
|
59007
|
-
SubProtocolSymbols["XTZ_YOU"] = "xtz-you";
|
|
59008
|
-
SubProtocolSymbols["XTZ_W"] = "xtz-w";
|
|
59009
|
-
SubProtocolSymbols["XTZ_UDEFI"] = "xtz-udefi";
|
|
59010
|
-
SubProtocolSymbols["XTZ_UBTC"] = "xtz-ubtc";
|
|
59011
|
-
SubProtocolSymbols["XTZ_CTEZ"] = "xtz-ctez";
|
|
59012
|
-
SubProtocolSymbols["XTZ_PLENTY"] = "xtz-plenty";
|
|
59013
|
-
SubProtocolSymbols["XTZ_WRAP"] = "xtz-wrap";
|
|
59014
|
-
SubProtocolSymbols["XTZ_QUIPU"] = "xtz-quipu";
|
|
59015
|
-
SubProtocolSymbols["XTZ_DOGA"] = "xtz-doga";
|
|
59016
|
-
SubProtocolSymbols["XTZ_BTC_TEZ"] = "xtz-btc-tez";
|
|
59017
|
-
SubProtocolSymbols["XTZ_USDT"] = "xtz-usdt";
|
|
59018
|
-
SubProtocolSymbols["XTZ_SIRS"] = "xtz-sirs";
|
|
59019
|
-
SubProtocolSymbols["ETH_ERC20"] = "eth-erc20";
|
|
59020
|
-
SubProtocolSymbols["ETH_ERC20_XCHF"] = "eth-erc20-xchf";
|
|
59021
|
-
})(SubProtocolSymbols = exports.SubProtocolSymbols || (exports.SubProtocolSymbols = {}));
|
|
59022
|
-
function isMainProtocolSymbol(identifier) {
|
|
59023
|
-
return Object.values(MainProtocolSymbols).includes(identifier);
|
|
59024
|
-
}
|
|
59025
|
-
exports.isMainProtocolSymbol = isMainProtocolSymbol;
|
|
59026
|
-
function isSubProtocolSymbol(identifier) {
|
|
59027
|
-
return Object.values(SubProtocolSymbols).includes(identifier);
|
|
59028
|
-
}
|
|
59029
|
-
exports.isSubProtocolSymbol = isSubProtocolSymbol;
|
|
59030
|
-
function isProtocolSymbol(identifier) {
|
|
59031
|
-
return isMainProtocolSymbol(identifier) || isSubProtocolSymbol(identifier);
|
|
59032
|
-
}
|
|
59033
|
-
exports.isProtocolSymbol = isProtocolSymbol;
|
|
59034
|
-
|
|
59035
|
-
},{}],308:[function(require,module,exports){
|
|
59036
|
-
(function (Buffer){(function (){
|
|
59037
|
-
"use strict";
|
|
59038
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59039
|
-
var createHash = require("../dependencies/src/create-hash-1.2.0/index");
|
|
59040
|
-
var errors_1 = require("../errors");
|
|
59041
|
-
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
59042
|
-
var sha256hash = function (input) {
|
|
59043
|
-
var hash = createHash('sha256');
|
|
59044
|
-
hash.update(input);
|
|
59045
|
-
return hash.digest();
|
|
59046
|
-
};
|
|
59047
|
-
var checkSum = function (payload) {
|
|
59048
|
-
return sha256hash(sha256hash(payload)).slice(0, 4);
|
|
59049
|
-
};
|
|
59050
|
-
var bs64check = {
|
|
59051
|
-
encode: function (input) {
|
|
59052
|
-
if (!Buffer.isBuffer(input)) {
|
|
59053
|
-
input = Buffer.from(input);
|
|
59054
|
-
}
|
|
59055
|
-
var checksum = checkSum(input);
|
|
59056
|
-
var payloadWithChecksum = Buffer.concat([input, checksum], input.length + 4);
|
|
59057
|
-
return payloadWithChecksum.toString('base64');
|
|
59058
|
-
},
|
|
59059
|
-
decode: function (input) {
|
|
59060
|
-
if (!Buffer.isBuffer(input)) {
|
|
59061
|
-
input = Buffer.from(input, 'base64');
|
|
59062
|
-
}
|
|
59063
|
-
var payload = input.slice(0, -4);
|
|
59064
|
-
var checksum = input.slice(-4);
|
|
59065
|
-
var newChecksum = checkSum(payload);
|
|
59066
|
-
// tslint:disable-next-line:no-bitwise
|
|
59067
|
-
if ((checksum[0] ^ newChecksum[0]) | (checksum[1] ^ newChecksum[1]) | (checksum[2] ^ newChecksum[2]) | (checksum[3] ^ newChecksum[3])) {
|
|
59068
|
-
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.UTILS, 'bs64check checksum does not match');
|
|
59069
|
-
}
|
|
59070
|
-
return payload;
|
|
59071
|
-
},
|
|
59072
|
-
checkSum: checkSum
|
|
60238
|
+
}
|
|
60239
|
+
op = body.call(thisArg, _);
|
|
60240
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60241
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
60242
|
+
}
|
|
59073
60243
|
};
|
|
59074
|
-
exports.default = bs64check;
|
|
59075
|
-
|
|
59076
|
-
}).call(this)}).call(this,require("buffer").Buffer)
|
|
59077
|
-
},{"../dependencies/src/create-hash-1.2.0/index":270,"../errors":301,"../errors/coinlib-error":300,"buffer":76}],309:[function(require,module,exports){
|
|
59078
|
-
(function (Buffer){(function (){
|
|
59079
|
-
"use strict";
|
|
59080
60244
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59081
60245
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
59082
60246
|
};
|
|
59083
60247
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59084
|
-
exports.
|
|
60248
|
+
exports.AirGapNFTWallet = void 0;
|
|
59085
60249
|
var bignumber_1 = __importDefault(require("../dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
59086
|
-
var
|
|
59087
|
-
var
|
|
59088
|
-
var
|
|
59089
|
-
|
|
59090
|
-
|
|
59091
|
-
|
|
59092
|
-
|
|
59093
|
-
|
|
59094
|
-
|
|
59095
|
-
exports.addHexPrefix = addHexPrefix;
|
|
59096
|
-
function stripHexPrefix(hex) {
|
|
59097
|
-
return hasPrefix(hex) ? hex.substring(2) : hex;
|
|
59098
|
-
}
|
|
59099
|
-
exports.stripHexPrefix = stripHexPrefix;
|
|
59100
|
-
function isHex(value) {
|
|
59101
|
-
return HEX_REGEX.test(value);
|
|
59102
|
-
}
|
|
59103
|
-
exports.isHex = isHex;
|
|
59104
|
-
function toHexBuffer(value, bitLength, encoding) {
|
|
59105
|
-
if (bitLength === void 0) { bitLength = 8; }
|
|
59106
|
-
if (encoding === void 0) { encoding = 'default'; }
|
|
59107
|
-
return Buffer.from(toHexStringRaw(value, bitLength, encoding), 'hex');
|
|
59108
|
-
}
|
|
59109
|
-
exports.toHexBuffer = toHexBuffer;
|
|
59110
|
-
function toHexStringRaw(value, bitLength, encoding) {
|
|
59111
|
-
if (bitLength === void 0) { bitLength = 8; }
|
|
59112
|
-
if (encoding === void 0) { encoding = '2sComplement'; }
|
|
59113
|
-
if (new bignumber_1.default(value).isPositive()) {
|
|
59114
|
-
return toHexStringRawPositive(value, bitLength);
|
|
59115
|
-
}
|
|
59116
|
-
else {
|
|
59117
|
-
return toHexStringRawNegative(value, bitLength, encoding);
|
|
59118
|
-
}
|
|
59119
|
-
}
|
|
59120
|
-
exports.toHexStringRaw = toHexStringRaw;
|
|
59121
|
-
function toHexString(value, bitLength, encoding) {
|
|
59122
|
-
if (bitLength === void 0) { bitLength = 8; }
|
|
59123
|
-
if (encoding === void 0) { encoding = 'default'; }
|
|
59124
|
-
return addHexPrefix(toHexStringRaw(value, bitLength, encoding));
|
|
59125
|
-
}
|
|
59126
|
-
exports.toHexString = toHexString;
|
|
59127
|
-
function hexToBytes(hex, bitLength) {
|
|
59128
|
-
var byteLength = bitLength !== undefined ? Math.ceil(bitLength / 8) : undefined;
|
|
59129
|
-
var buffer;
|
|
59130
|
-
if (typeof hex === 'string' && isHex(hex)) {
|
|
59131
|
-
buffer = Buffer.from(stripHexPrefix(hex), 'hex');
|
|
59132
|
-
}
|
|
59133
|
-
else if (!(typeof hex === 'string')) {
|
|
59134
|
-
buffer = Buffer.from(hex);
|
|
59135
|
-
}
|
|
59136
|
-
else {
|
|
59137
|
-
buffer = Buffer.from([0]);
|
|
59138
|
-
}
|
|
59139
|
-
if (byteLength !== undefined && buffer.length < byteLength) {
|
|
59140
|
-
var newBuffer = Buffer.alloc(byteLength, 0);
|
|
59141
|
-
var offset = newBuffer.length - buffer.length;
|
|
59142
|
-
buffer.copy(newBuffer, offset);
|
|
59143
|
-
return newBuffer;
|
|
59144
|
-
}
|
|
59145
|
-
else {
|
|
59146
|
-
return buffer;
|
|
59147
|
-
}
|
|
59148
|
-
}
|
|
59149
|
-
exports.hexToBytes = hexToBytes;
|
|
59150
|
-
function bytesToHex(bytes, config) {
|
|
59151
|
-
var hex;
|
|
59152
|
-
if (typeof bytes === 'string') {
|
|
59153
|
-
hex = bytes;
|
|
59154
|
-
}
|
|
59155
|
-
else {
|
|
59156
|
-
var buffer = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes);
|
|
59157
|
-
hex = buffer.toString('hex');
|
|
59158
|
-
}
|
|
59159
|
-
return (config === null || config === void 0 ? void 0 : config.withPrefix) ? addHexPrefix(hex) : hex;
|
|
59160
|
-
}
|
|
59161
|
-
exports.bytesToHex = bytesToHex;
|
|
59162
|
-
function changeEndianness(hex) {
|
|
59163
|
-
var _hex = stripHexPrefix(hex);
|
|
59164
|
-
_hex = _hex.length % 2 !== 0 ? '0' + _hex : _hex;
|
|
59165
|
-
var bytes = _hex.match(/.{2}/g) || [];
|
|
59166
|
-
return bytes.reverse().join('');
|
|
59167
|
-
}
|
|
59168
|
-
exports.changeEndianness = changeEndianness;
|
|
59169
|
-
function toHexStringRawPositive(value, bitLength) {
|
|
59170
|
-
var hexString = value.toString(16);
|
|
59171
|
-
return fillToTargetLength(hexString, bitLength);
|
|
59172
|
-
}
|
|
59173
|
-
function toHexStringRawNegative(value, bitLength, encoding) {
|
|
59174
|
-
// tslint:disable-next-line: switch-default
|
|
59175
|
-
switch (encoding) {
|
|
59176
|
-
case 'default':
|
|
59177
|
-
var hexString = value.toString(16);
|
|
59178
|
-
return hexString.startsWith('-') ? "-" + fillToTargetLength(hexString.substr(1), bitLength) : fillToTargetLength(hexString, bitLength);
|
|
59179
|
-
case '2sComplement':
|
|
59180
|
-
var value2sComplement = new bignumber_1.default(2).pow(bitLength).minus(new bignumber_1.default(value).abs());
|
|
59181
|
-
return value2sComplement.toString(16);
|
|
60250
|
+
var ProtocolNetwork_1 = require("../utils/ProtocolNetwork");
|
|
60251
|
+
var AirGapMarketWallet_1 = require("./AirGapMarketWallet");
|
|
60252
|
+
var AirGapNFTWallet = /** @class */ (function (_super) {
|
|
60253
|
+
__extends(AirGapNFTWallet, _super);
|
|
60254
|
+
function AirGapNFTWallet() {
|
|
60255
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
60256
|
+
_this.currentBalance = {};
|
|
60257
|
+
_this.currentMarketPrice = {};
|
|
60258
|
+
return _this;
|
|
59182
60259
|
}
|
|
59183
|
-
|
|
59184
|
-
|
|
59185
|
-
|
|
59186
|
-
|
|
59187
|
-
|
|
59188
|
-
|
|
59189
|
-
|
|
60260
|
+
AirGapNFTWallet.prototype.getCurrentBalance = function (assetID) {
|
|
60261
|
+
return this.currentBalance[assetID];
|
|
60262
|
+
};
|
|
60263
|
+
AirGapNFTWallet.prototype.setCurrentBalance = function (balance, assetID) {
|
|
60264
|
+
this.currentBalance[assetID] = balance;
|
|
60265
|
+
};
|
|
60266
|
+
AirGapNFTWallet.prototype.getCurrentMarketPrice = function (assetID) {
|
|
60267
|
+
return this.currentMarketPrice[assetID];
|
|
60268
|
+
};
|
|
60269
|
+
AirGapNFTWallet.prototype.setCurrentMarketPrice = function (marketPrice, assetID) {
|
|
60270
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60271
|
+
var _a, _b;
|
|
60272
|
+
return __generator(this, function (_c) {
|
|
60273
|
+
switch (_c.label) {
|
|
60274
|
+
case 0:
|
|
60275
|
+
_a = this.getCurrentMarketPrice;
|
|
60276
|
+
_b = assetID;
|
|
60277
|
+
return [4 /*yield*/, this.protocol.getOptions()];
|
|
60278
|
+
case 1:
|
|
60279
|
+
_a[_b] =
|
|
60280
|
+
(_c.sent()).network.type === ProtocolNetwork_1.NetworkType.MAINNET ? marketPrice : new bignumber_1.default(0);
|
|
60281
|
+
return [2 /*return*/];
|
|
60282
|
+
}
|
|
60283
|
+
});
|
|
60284
|
+
});
|
|
60285
|
+
};
|
|
60286
|
+
AirGapNFTWallet.prototype.synchronize = function (assetsID) {
|
|
60287
|
+
if (assetsID === void 0) { assetsID = []; }
|
|
60288
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60289
|
+
return __generator(this, function (_a) {
|
|
60290
|
+
return [2 /*return*/, _super.prototype.synchronize.call(this, assetsID)];
|
|
60291
|
+
});
|
|
60292
|
+
});
|
|
60293
|
+
};
|
|
60294
|
+
AirGapNFTWallet.prototype._synchronize = function (assetIDs) {
|
|
60295
|
+
if (assetIDs === void 0) { assetIDs = []; }
|
|
60296
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60297
|
+
var _this = this;
|
|
60298
|
+
return __generator(this, function (_a) {
|
|
60299
|
+
switch (_a.label) {
|
|
60300
|
+
case 0: return [4 /*yield*/, Promise.all(assetIDs.map(function (assetID) { return __awaiter(_this, void 0, void 0, function () {
|
|
60301
|
+
var _a, balance, marketPrice;
|
|
60302
|
+
return __generator(this, function (_b) {
|
|
60303
|
+
switch (_b.label) {
|
|
60304
|
+
case 0: return [4 /*yield*/, Promise.all([this.balanceOf(assetID), this.fetchCurrentMarketPrice(assetID)])];
|
|
60305
|
+
case 1:
|
|
60306
|
+
_a = _b.sent(), balance = _a[0], marketPrice = _a[1];
|
|
60307
|
+
this.setCurrentBalance(balance, assetID);
|
|
60308
|
+
return [4 /*yield*/, this.setCurrentMarketPrice(marketPrice, assetID)];
|
|
60309
|
+
case 2:
|
|
60310
|
+
_b.sent();
|
|
60311
|
+
return [2 /*return*/];
|
|
60312
|
+
}
|
|
60313
|
+
});
|
|
60314
|
+
}); }))];
|
|
60315
|
+
case 1:
|
|
60316
|
+
_a.sent();
|
|
60317
|
+
return [2 /*return*/];
|
|
60318
|
+
}
|
|
60319
|
+
});
|
|
60320
|
+
});
|
|
60321
|
+
};
|
|
60322
|
+
AirGapNFTWallet.prototype.reset = function () {
|
|
60323
|
+
this.currentBalance = {};
|
|
60324
|
+
this.currentMarketPrice = {};
|
|
60325
|
+
};
|
|
60326
|
+
AirGapNFTWallet.prototype.fetchCurrentMarketPrice = function (assetID, _baseSymbol) {
|
|
60327
|
+
if (_baseSymbol === void 0) { _baseSymbol = 'USD'; }
|
|
60328
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60329
|
+
var result;
|
|
60330
|
+
return __generator(this, function (_a) {
|
|
60331
|
+
switch (_a.label) {
|
|
60332
|
+
case 0:
|
|
60333
|
+
result = new bignumber_1.default(0);
|
|
60334
|
+
return [4 /*yield*/, this.setCurrentMarketPrice(result, assetID)];
|
|
60335
|
+
case 1:
|
|
60336
|
+
_a.sent();
|
|
60337
|
+
return [2 /*return*/, result];
|
|
60338
|
+
}
|
|
60339
|
+
});
|
|
60340
|
+
});
|
|
60341
|
+
};
|
|
60342
|
+
AirGapNFTWallet.prototype.balanceOf = function (assetID) {
|
|
60343
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60344
|
+
var result, _a, _b;
|
|
60345
|
+
return __generator(this, function (_c) {
|
|
60346
|
+
switch (_c.label) {
|
|
60347
|
+
case 0:
|
|
60348
|
+
if (!this.isExtendedPublicKey) return [3 /*break*/, 2];
|
|
60349
|
+
_a = bignumber_1.default.bind;
|
|
60350
|
+
return [4 /*yield*/, this.protocol.getBalanceOfExtendedPublicKey(this.publicKey, 0, { assetID: assetID })];
|
|
60351
|
+
case 1:
|
|
60352
|
+
result = new (_a.apply(bignumber_1.default, [void 0, _c.sent()]))();
|
|
60353
|
+
return [3 /*break*/, 4];
|
|
60354
|
+
case 2:
|
|
60355
|
+
_b = bignumber_1.default.bind;
|
|
60356
|
+
return [4 /*yield*/, this.protocol.getBalanceOfPublicKey(this.publicKey, { addressIndex: this.addressIndex, assetID: assetID })];
|
|
60357
|
+
case 3:
|
|
60358
|
+
result = new (_b.apply(bignumber_1.default, [void 0, _c.sent()]))();
|
|
60359
|
+
_c.label = 4;
|
|
60360
|
+
case 4:
|
|
60361
|
+
this.setCurrentBalance(result, assetID);
|
|
60362
|
+
return [2 /*return*/, result];
|
|
60363
|
+
}
|
|
60364
|
+
});
|
|
60365
|
+
});
|
|
60366
|
+
};
|
|
60367
|
+
return AirGapNFTWallet;
|
|
60368
|
+
}(AirGapMarketWallet_1.AirGapMarketWallet));
|
|
60369
|
+
exports.AirGapNFTWallet = AirGapNFTWallet;
|
|
59190
60370
|
|
|
59191
|
-
}
|
|
59192
|
-
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":254,"./padStart":310,"buffer":76}],310:[function(require,module,exports){
|
|
60371
|
+
},{"../dependencies/src/bignumber.js-9.0.0/bignumber":260,"../utils/ProtocolNetwork":316,"./AirGapMarketWallet":324}],326:[function(require,module,exports){
|
|
59193
60372
|
"use strict";
|
|
59194
|
-
|
|
59195
|
-
|
|
59196
|
-
function
|
|
59197
|
-
|
|
59198
|
-
|
|
59199
|
-
|
|
59200
|
-
|
|
59201
|
-
}
|
|
59202
|
-
|
|
59203
|
-
|
|
59204
|
-
|
|
59205
|
-
|
|
59206
|
-
|
|
59207
|
-
|
|
59208
|
-
|
|
60373
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
60374
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
60375
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
60376
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
60377
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
60378
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
60379
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60380
|
+
});
|
|
60381
|
+
};
|
|
60382
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
60383
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
60384
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
60385
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
60386
|
+
function step(op) {
|
|
60387
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
60388
|
+
while (_) try {
|
|
60389
|
+
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;
|
|
60390
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
60391
|
+
switch (op[0]) {
|
|
60392
|
+
case 0: case 1: t = op; break;
|
|
60393
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
60394
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
60395
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
60396
|
+
default:
|
|
60397
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60398
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
60399
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
60400
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60401
|
+
if (t[2]) _.ops.pop();
|
|
60402
|
+
_.trys.pop(); continue;
|
|
60403
|
+
}
|
|
60404
|
+
op = body.call(thisArg, _);
|
|
60405
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60406
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59209
60407
|
}
|
|
59210
|
-
}
|
|
59211
|
-
exports
|
|
60408
|
+
};
|
|
60409
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60410
|
+
exports.AirGapWallet = exports.AirGapWalletStatus = void 0;
|
|
60411
|
+
var errors_1 = require("../errors");
|
|
60412
|
+
var coinlib_error_1 = require("../errors/coinlib-error");
|
|
60413
|
+
var AirGapWalletStatus;
|
|
60414
|
+
(function (AirGapWalletStatus) {
|
|
60415
|
+
AirGapWalletStatus["ACTIVE"] = "active";
|
|
60416
|
+
AirGapWalletStatus["HIDDEN"] = "hidden";
|
|
60417
|
+
AirGapWalletStatus["DELETED"] = "deleted";
|
|
60418
|
+
AirGapWalletStatus["TRANSIENT"] = "transient";
|
|
60419
|
+
})(AirGapWalletStatus = exports.AirGapWalletStatus || (exports.AirGapWalletStatus = {}));
|
|
60420
|
+
var AirGapWallet = /** @class */ (function () {
|
|
60421
|
+
function AirGapWallet(protocol, publicKey, isExtendedPublicKey, derivationPath, masterFingerprint, status, addressIndex) {
|
|
60422
|
+
this.protocol = protocol;
|
|
60423
|
+
this.publicKey = publicKey;
|
|
60424
|
+
this.isExtendedPublicKey = isExtendedPublicKey;
|
|
60425
|
+
this.derivationPath = derivationPath;
|
|
60426
|
+
this.masterFingerprint = masterFingerprint;
|
|
60427
|
+
this.status = status;
|
|
60428
|
+
this.addressIndex = addressIndex;
|
|
60429
|
+
this.addresses = []; // used for cache
|
|
60430
|
+
}
|
|
60431
|
+
Object.defineProperty(AirGapWallet.prototype, "receivingPublicAddress", {
|
|
60432
|
+
get: function () {
|
|
60433
|
+
return this.addresses[this.addressIndex !== undefined ? this.addressIndex : 0];
|
|
60434
|
+
},
|
|
60435
|
+
enumerable: false,
|
|
60436
|
+
configurable: true
|
|
60437
|
+
});
|
|
60438
|
+
AirGapWallet.prototype.setProtocol = function (protocol) {
|
|
60439
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60440
|
+
var _a;
|
|
60441
|
+
return __generator(this, function (_b) {
|
|
60442
|
+
switch (_b.label) {
|
|
60443
|
+
case 0: return [4 /*yield*/, this.protocol.getIdentifier()];
|
|
60444
|
+
case 1:
|
|
60445
|
+
_a = (_b.sent());
|
|
60446
|
+
return [4 /*yield*/, protocol.getIdentifier()];
|
|
60447
|
+
case 2:
|
|
60448
|
+
if (_a !== (_b.sent())) {
|
|
60449
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.WALLET, 'Can only set same protocol with a different network');
|
|
60450
|
+
}
|
|
60451
|
+
this.protocol = protocol;
|
|
60452
|
+
return [2 /*return*/];
|
|
60453
|
+
}
|
|
60454
|
+
});
|
|
60455
|
+
});
|
|
60456
|
+
};
|
|
60457
|
+
AirGapWallet.prototype.deriveAddresses = function (amount) {
|
|
60458
|
+
if (amount === void 0) { amount = 50; }
|
|
60459
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60460
|
+
var addresses, parts, offset;
|
|
60461
|
+
return __generator(this, function (_a) {
|
|
60462
|
+
switch (_a.label) {
|
|
60463
|
+
case 0:
|
|
60464
|
+
if (!this.isExtendedPublicKey) return [3 /*break*/, 2];
|
|
60465
|
+
parts = this.derivationPath.split('/');
|
|
60466
|
+
offset = 0;
|
|
60467
|
+
if (!parts[parts.length - 1].endsWith("'")) {
|
|
60468
|
+
offset = Number.parseInt(parts[parts.length - 1], 10);
|
|
60469
|
+
}
|
|
60470
|
+
return [4 /*yield*/, Promise.all([
|
|
60471
|
+
this.protocol.getAddressesFromExtendedPublicKey(this.publicKey, 0, amount, offset),
|
|
60472
|
+
this.protocol.getAddressesFromExtendedPublicKey(this.publicKey, 1, amount, offset)
|
|
60473
|
+
])];
|
|
60474
|
+
case 1:
|
|
60475
|
+
addresses = (_a.sent()).reduce(function (flatten, next) { return flatten.concat(next); }, []);
|
|
60476
|
+
return [3 /*break*/, 4];
|
|
60477
|
+
case 2: return [4 /*yield*/, this.protocol.getAddressesFromPublicKey(this.publicKey)];
|
|
60478
|
+
case 3:
|
|
60479
|
+
addresses = _a.sent();
|
|
60480
|
+
_a.label = 4;
|
|
60481
|
+
case 4: return [2 /*return*/, addresses.map(function (address) { return address.address; })];
|
|
60482
|
+
}
|
|
60483
|
+
});
|
|
60484
|
+
});
|
|
60485
|
+
};
|
|
60486
|
+
AirGapWallet.prototype.toJSON = function () {
|
|
60487
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60488
|
+
var _a;
|
|
60489
|
+
return __generator(this, function (_b) {
|
|
60490
|
+
switch (_b.label) {
|
|
60491
|
+
case 0:
|
|
60492
|
+
_a = {};
|
|
60493
|
+
return [4 /*yield*/, this.protocol.getIdentifier()];
|
|
60494
|
+
case 1:
|
|
60495
|
+
_a.protocolIdentifier = _b.sent();
|
|
60496
|
+
return [4 /*yield*/, this.protocol.getOptions()];
|
|
60497
|
+
case 2: return [2 /*return*/, (_a.networkIdentifier = (_b.sent()).network.identifier,
|
|
60498
|
+
_a.publicKey = this.publicKey,
|
|
60499
|
+
_a.isExtendedPublicKey = this.isExtendedPublicKey,
|
|
60500
|
+
_a.derivationPath = this.derivationPath,
|
|
60501
|
+
_a.addresses = this.addresses,
|
|
60502
|
+
_a.masterFingerprint = this.masterFingerprint,
|
|
60503
|
+
_a.status = this.status,
|
|
60504
|
+
_a.addressIndex = this.addressIndex,
|
|
60505
|
+
_a)];
|
|
60506
|
+
}
|
|
60507
|
+
});
|
|
60508
|
+
});
|
|
60509
|
+
};
|
|
60510
|
+
return AirGapWallet;
|
|
60511
|
+
}());
|
|
60512
|
+
exports.AirGapWallet = AirGapWallet;
|
|
59212
60513
|
|
|
59213
|
-
},{}],
|
|
60514
|
+
},{"../errors":307,"../errors/coinlib-error":306}],327:[function(require,module,exports){
|
|
59214
60515
|
arguments[4][1][0].apply(exports,arguments)
|
|
59215
|
-
},{"@stablelib/int":
|
|
60516
|
+
},{"@stablelib/int":332,"dup":1}],328:[function(require,module,exports){
|
|
59216
60517
|
"use strict";
|
|
59217
60518
|
// Copyright (C) 2017 Dmitry Chestnykh
|
|
59218
60519
|
// MIT License. See LICENSE file for details.
|
|
@@ -59667,7 +60968,7 @@ function hash(data, digestLength, config) {
|
|
|
59667
60968
|
}
|
|
59668
60969
|
exports.hash = hash;
|
|
59669
60970
|
|
|
59670
|
-
},{"@stablelib/binary":
|
|
60971
|
+
},{"@stablelib/binary":327,"@stablelib/wipe":344}],329:[function(require,module,exports){
|
|
59671
60972
|
"use strict";
|
|
59672
60973
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
59673
60974
|
// MIT License. See LICENSE file for details.
|
|
@@ -59691,7 +60992,7 @@ function concat() {
|
|
|
59691
60992
|
}
|
|
59692
60993
|
exports.concat = concat;
|
|
59693
60994
|
|
|
59694
|
-
},{}],
|
|
60995
|
+
},{}],330:[function(require,module,exports){
|
|
59695
60996
|
"use strict";
|
|
59696
60997
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
59697
60998
|
// MIT License. See LICENSE file for details.
|
|
@@ -59754,11 +61055,11 @@ function equal(a, b) {
|
|
|
59754
61055
|
}
|
|
59755
61056
|
exports.equal = equal;
|
|
59756
61057
|
|
|
59757
|
-
},{}],
|
|
61058
|
+
},{}],331:[function(require,module,exports){
|
|
59758
61059
|
arguments[4][2][0].apply(exports,arguments)
|
|
59759
|
-
},{"@stablelib/random":
|
|
61060
|
+
},{"@stablelib/random":337,"@stablelib/sha512":342,"@stablelib/wipe":344,"dup":2}],332:[function(require,module,exports){
|
|
59760
61061
|
arguments[4][3][0].apply(exports,arguments)
|
|
59761
|
-
},{"dup":3}],
|
|
61062
|
+
},{"dup":3}],333:[function(require,module,exports){
|
|
59762
61063
|
"use strict";
|
|
59763
61064
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
59764
61065
|
// MIT License. See LICENSE file for details.
|
|
@@ -59794,7 +61095,7 @@ function openBox(theirPublicKey, mySecretKey, nonce, data) {
|
|
|
59794
61095
|
}
|
|
59795
61096
|
exports.openBox = openBox;
|
|
59796
61097
|
|
|
59797
|
-
},{"./secretbox":
|
|
61098
|
+
},{"./secretbox":335,"@stablelib/wipe":344,"@stablelib/x25519":345,"@stablelib/xsalsa20":346}],334:[function(require,module,exports){
|
|
59798
61099
|
"use strict";
|
|
59799
61100
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
59800
61101
|
// MIT License. See LICENSE file for details.
|
|
@@ -59819,7 +61120,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59819
61120
|
__exportStar(require("./box"), exports);
|
|
59820
61121
|
__exportStar(require("./secretbox"), exports);
|
|
59821
61122
|
|
|
59822
|
-
},{"./box":
|
|
61123
|
+
},{"./box":333,"./secretbox":335}],335:[function(require,module,exports){
|
|
59823
61124
|
"use strict";
|
|
59824
61125
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
59825
61126
|
// MIT License. See LICENSE file for details.
|
|
@@ -59921,7 +61222,7 @@ function generateKey(prng) {
|
|
|
59921
61222
|
}
|
|
59922
61223
|
exports.generateKey = generateKey;
|
|
59923
61224
|
|
|
59924
|
-
},{"@stablelib/poly1305":
|
|
61225
|
+
},{"@stablelib/poly1305":336,"@stablelib/random":337,"@stablelib/wipe":344,"@stablelib/xsalsa20":346}],336:[function(require,module,exports){
|
|
59925
61226
|
"use strict";
|
|
59926
61227
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
59927
61228
|
// MIT License. See LICENSE file for details.
|
|
@@ -60344,15 +61645,15 @@ function equal(a, b) {
|
|
|
60344
61645
|
}
|
|
60345
61646
|
exports.equal = equal;
|
|
60346
61647
|
|
|
60347
|
-
},{"@stablelib/constant-time":
|
|
61648
|
+
},{"@stablelib/constant-time":330,"@stablelib/wipe":344}],337:[function(require,module,exports){
|
|
60348
61649
|
arguments[4][4][0].apply(exports,arguments)
|
|
60349
|
-
},{"./source/system":
|
|
61650
|
+
},{"./source/system":340,"@stablelib/binary":327,"@stablelib/wipe":344,"dup":4}],338:[function(require,module,exports){
|
|
60350
61651
|
arguments[4][5][0].apply(exports,arguments)
|
|
60351
|
-
},{"dup":5}],
|
|
61652
|
+
},{"dup":5}],339:[function(require,module,exports){
|
|
60352
61653
|
arguments[4][6][0].apply(exports,arguments)
|
|
60353
|
-
},{"@stablelib/wipe":
|
|
61654
|
+
},{"@stablelib/wipe":344,"crypto":33,"dup":6}],340:[function(require,module,exports){
|
|
60354
61655
|
arguments[4][7][0].apply(exports,arguments)
|
|
60355
|
-
},{"./browser":
|
|
61656
|
+
},{"./browser":338,"./node":339,"dup":7}],341:[function(require,module,exports){
|
|
60356
61657
|
"use strict";
|
|
60357
61658
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
60358
61659
|
// MIT License. See LICENSE file for details.
|
|
@@ -60579,9 +61880,9 @@ function incrementCounter(counter, pos, len) {
|
|
|
60579
61880
|
}
|
|
60580
61881
|
}
|
|
60581
61882
|
|
|
60582
|
-
},{"@stablelib/binary":
|
|
61883
|
+
},{"@stablelib/binary":327,"@stablelib/wipe":344}],342:[function(require,module,exports){
|
|
60583
61884
|
arguments[4][8][0].apply(exports,arguments)
|
|
60584
|
-
},{"@stablelib/binary":
|
|
61885
|
+
},{"@stablelib/binary":327,"@stablelib/wipe":344,"dup":8}],343:[function(require,module,exports){
|
|
60585
61886
|
"use strict";
|
|
60586
61887
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
60587
61888
|
// MIT License. See LICENSE file for details.
|
|
@@ -60731,9 +62032,9 @@ function decode(arr) {
|
|
|
60731
62032
|
}
|
|
60732
62033
|
exports.decode = decode;
|
|
60733
62034
|
|
|
60734
|
-
},{}],
|
|
62035
|
+
},{}],344:[function(require,module,exports){
|
|
60735
62036
|
arguments[4][9][0].apply(exports,arguments)
|
|
60736
|
-
},{"dup":9}],
|
|
62037
|
+
},{"dup":9}],345:[function(require,module,exports){
|
|
60737
62038
|
"use strict";
|
|
60738
62039
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
60739
62040
|
// MIT License. See LICENSE file for details.
|
|
@@ -61370,7 +62671,7 @@ function sharedKey(mySecretKey, theirPublicKey, rejectZero = false) {
|
|
|
61370
62671
|
}
|
|
61371
62672
|
exports.sharedKey = sharedKey;
|
|
61372
62673
|
|
|
61373
|
-
},{"@stablelib/random":
|
|
62674
|
+
},{"@stablelib/random":337,"@stablelib/wipe":344}],346:[function(require,module,exports){
|
|
61374
62675
|
"use strict";
|
|
61375
62676
|
// Copyright (C) 2016 Dmitry Chestnykh
|
|
61376
62677
|
// MIT License. See LICENSE file for details.
|
|
@@ -61533,5 +62834,5 @@ function hsalsa(key, src, dst) {
|
|
|
61533
62834
|
}
|
|
61534
62835
|
exports.hsalsa = hsalsa;
|
|
61535
62836
|
|
|
61536
|
-
},{"@stablelib/binary":
|
|
62837
|
+
},{"@stablelib/binary":327,"@stablelib/salsa20":341,"@stablelib/wipe":344}]},{},[223])(223)
|
|
61537
62838
|
});
|