UNPKG

@dojima-wallet/account

Version:

creates accounts for all layer1, layer2 supported chains.

138 lines (110 loc) 34.2 kB
/* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./lib/arweaveAccount.ts": /*!*******************************!*\ !*** ./lib/arweaveAccount.ts ***! \*******************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar connection_1 = __webpack_require__(/*! @dojima-wallet/connection */ \"@dojima-wallet/connection\");\nvar ArweaveAccount = /** @class */ (function (_super) {\n __extends(ArweaveAccount, _super);\n function ArweaveAccount(mnemonic, network) {\n return _super.call(this, mnemonic, network) || this;\n }\n ArweaveAccount.prototype.getAddress = function () {\n return __awaiter(this, void 0, void 0, function () {\n var address;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.arConnect.getAddress()];\n case 1:\n address = _a.sent();\n return [2 /*return*/, address];\n }\n });\n });\n };\n ArweaveAccount.prototype.getBalance = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n var balance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.arConnect.getBalance(address)];\n case 1:\n balance = _a.sent();\n return [2 /*return*/, balance];\n }\n });\n });\n };\n return ArweaveAccount;\n}(connection_1.ArweaveInit));\nexports[\"default\"] = ArweaveAccount;\n\n\n//# sourceURL=webpack://@dojima-wallet/account/./lib/arweaveAccount.ts?"); /***/ }), /***/ "./lib/dojimaAccount.ts": /*!******************************!*\ !*** ./lib/dojimaAccount.ts ***! \******************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar connection_1 = __webpack_require__(/*! @dojima-wallet/connection */ \"@dojima-wallet/connection\");\nvar DojimaAccount = /** @class */ (function (_super) {\n __extends(DojimaAccount, _super);\n function DojimaAccount(mnemonic, privateKey, network, rpcUrl) {\n return _super.call(this, mnemonic, privateKey, network, rpcUrl) || this;\n }\n DojimaAccount.prototype.getAddress = function () {\n var address = this.dojConnect.getAddress();\n return address;\n };\n DojimaAccount.prototype.getBalance = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n var balance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.dojConnect.getBalance(address)];\n case 1:\n balance = _a.sent();\n return [2 /*return*/, balance];\n }\n });\n });\n };\n return DojimaAccount;\n}(connection_1.DojimaInit));\nexports[\"default\"] = DojimaAccount;\n\n\n//# sourceURL=webpack://@dojima-wallet/account/./lib/dojimaAccount.ts?"); /***/ }), /***/ "./lib/ethereumAccount.ts": /*!********************************!*\ !*** ./lib/ethereumAccount.ts ***! \********************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar connection_1 = __webpack_require__(/*! @dojima-wallet/connection */ \"@dojima-wallet/connection\");\n// import { baseToAsset } from \"@dojima-wallet/utils\";\nvar EthereumAccount = /** @class */ (function (_super) {\n __extends(EthereumAccount, _super);\n function EthereumAccount(mnemonic, privateKey, network, rpcUrl) {\n return _super.call(this, mnemonic, privateKey, network, rpcUrl) || this;\n }\n EthereumAccount.prototype.getAddress = function () {\n var address = this.ethConnect.getAddress();\n return address;\n };\n EthereumAccount.prototype.getBalance = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n var balance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.ethConnect.getBalance(address)];\n case 1:\n balance = _a.sent();\n return [2 /*return*/, balance];\n }\n });\n });\n };\n return EthereumAccount;\n}(connection_1.EthereumInit));\nexports[\"default\"] = EthereumAccount;\n\n\n//# sourceURL=webpack://@dojima-wallet/account/./lib/ethereumAccount.ts?"); /***/ }), /***/ "./lib/hermesAccount.ts": /*!******************************!*\ !*** ./lib/hermesAccount.ts ***! \******************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar connection_1 = __webpack_require__(/*! @dojima-wallet/connection */ \"@dojima-wallet/connection\");\nvar utils_1 = __webpack_require__(/*! @dojima-wallet/utils */ \"@dojima-wallet/utils\");\nvar HermesAccount = /** @class */ (function (_super) {\n __extends(HermesAccount, _super);\n function HermesAccount(mnemonic, network, apiUrl, rpcUrl) {\n return _super.call(this, mnemonic, network, apiUrl, rpcUrl) || this;\n }\n HermesAccount.prototype.getAddress = function () {\n var address = this.h4sConnect.getAddress();\n return address;\n };\n HermesAccount.prototype.getBalance = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n var balArr, balance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.h4sConnect.getBalance(address, [utils_1.AssetDOJNative])];\n case 1:\n balArr = _a.sent();\n balance = (0, utils_1.baseToAsset)(balArr[0].amount).amount().toNumber();\n return [2 /*return*/, balance];\n }\n });\n });\n };\n return HermesAccount;\n}(connection_1.HermesInit));\nexports[\"default\"] = HermesAccount;\n\n\n//# sourceURL=webpack://@dojima-wallet/account/./lib/hermesAccount.ts?"); /***/ }), /***/ "./lib/index.ts": /*!**********************!*\ !*** ./lib/index.ts ***! \**********************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PolkadotAccount = exports.SolanaAccount = exports.EthereumAccount = exports.HermesAccount = exports.DojimaAccount = exports.ArweaveAccount = void 0;\nvar arweaveAccount_1 = __importDefault(__webpack_require__(/*! ./arweaveAccount */ \"./lib/arweaveAccount.ts\"));\nexports.ArweaveAccount = arweaveAccount_1.default;\n// import BitcoinAccount from \"./bitcoinAccount\";\nvar dojimaAccount_1 = __importDefault(__webpack_require__(/*! ./dojimaAccount */ \"./lib/dojimaAccount.ts\"));\nexports.DojimaAccount = dojimaAccount_1.default;\nvar hermesAccount_1 = __importDefault(__webpack_require__(/*! ./hermesAccount */ \"./lib/hermesAccount.ts\"));\nexports.HermesAccount = hermesAccount_1.default;\nvar ethereumAccount_1 = __importDefault(__webpack_require__(/*! ./ethereumAccount */ \"./lib/ethereumAccount.ts\"));\nexports.EthereumAccount = ethereumAccount_1.default;\nvar solanaAccount_1 = __importDefault(__webpack_require__(/*! ./solanaAccount */ \"./lib/solanaAccount.ts\"));\nexports.SolanaAccount = solanaAccount_1.default;\nvar polkadotAccount_1 = __importDefault(__webpack_require__(/*! ./polkadotAccount */ \"./lib/polkadotAccount.ts\"));\nexports.PolkadotAccount = polkadotAccount_1.default;\n\n\n//# sourceURL=webpack://@dojima-wallet/account/./lib/index.ts?"); /***/ }), /***/ "./lib/polkadotAccount.ts": /*!********************************!*\ !*** ./lib/polkadotAccount.ts ***! \********************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar connection_1 = __webpack_require__(/*! @dojima-wallet/connection */ \"@dojima-wallet/connection\");\nvar PolkadotAccount = /** @class */ (function (_super) {\n __extends(PolkadotAccount, _super);\n function PolkadotAccount(mnemonic, network) {\n return _super.call(this, mnemonic, network) || this;\n }\n PolkadotAccount.prototype.getAddress = function () {\n return __awaiter(this, void 0, void 0, function () {\n var address;\n return __generator(this, function (_a) {\n address = this.dotConnect.getAddress();\n return [2 /*return*/, address];\n });\n });\n };\n PolkadotAccount.prototype.getBalance = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n var balance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.dotConnect.getBalance(address)];\n case 1:\n balance = _a.sent();\n return [2 /*return*/, balance];\n }\n });\n });\n };\n return PolkadotAccount;\n}(connection_1.PolkadotInit));\nexports[\"default\"] = PolkadotAccount;\n\n\n//# sourceURL=webpack://@dojima-wallet/account/./lib/polkadotAccount.ts?"); /***/ }), /***/ "./lib/solanaAccount.ts": /*!******************************!*\ !*** ./lib/solanaAccount.ts ***! \******************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar connection_1 = __webpack_require__(/*! @dojima-wallet/connection */ \"@dojima-wallet/connection\");\nvar SolanaAccount = /** @class */ (function (_super) {\n __extends(SolanaAccount, _super);\n function SolanaAccount(mnemonic, network, endpoint) {\n return _super.call(this, mnemonic, network, endpoint) || this;\n }\n SolanaAccount.prototype.getAddress = function () {\n return __awaiter(this, void 0, void 0, function () {\n var address;\n return __generator(this, function (_a) {\n address = this.solConnect.getAddress();\n return [2 /*return*/, address];\n });\n });\n };\n SolanaAccount.prototype.getBalance = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n var balance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.solConnect.getBalance(address)];\n case 1:\n balance = _a.sent();\n return [2 /*return*/, balance];\n }\n });\n });\n };\n return SolanaAccount;\n}(connection_1.SolanaInit));\nexports[\"default\"] = SolanaAccount;\n\n\n//# sourceURL=webpack://@dojima-wallet/account/./lib/solanaAccount.ts?"); /***/ }), /***/ "@dojima-wallet/connection": /*!********************************************!*\ !*** external "@dojima-wallet/connection" ***! \********************************************/ /***/ ((module) => { module.exports = require("@dojima-wallet/connection"); /***/ }), /***/ "@dojima-wallet/utils": /*!***************************************!*\ !*** external "@dojima-wallet/utils" ***! \***************************************/ /***/ ((module) => { module.exports = require("@dojima-wallet/utils"); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined /******/ var __webpack_exports__ = __webpack_require__("./lib/index.ts"); /******/ module.exports = __webpack_exports__; /******/ /******/ })() ;