scatterjs-core
Advanced tools
Comparing version 2.7.16 to 2.7.17
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),PluginTypes=_interopRequireWildcard(require("../plugins/PluginTypes")),_Plugin2=_interopRequireDefault(require("../plugins/Plugin")),_Blockchains=require("../models/Blockchains"),_WalletInterface=_interopRequireWildcard(require("../models/WalletInterface")),_SocketService=_interopRequireDefault(require("../services/SocketService")),isAvailable=!1;"undefined"!=typeof window&&"undefined"!=typeof document&&document.addEventListener("scatterLoaded",function(){return isAvailable=!0});var pollExistence=/*#__PURE__*/function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){var b,c,d=arguments;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<d.length&&void 0!==d[0]?d[0]:null,c=1<d.length&&void 0!==d[1]?d[1]:0,a.abrupt("return",new Promise(function(a){return b||(b=a),isAvailable?b(!0):5<c?b(!1):void setTimeout(function(){return pollExistence(b,c+1)},100)}));case 3:case"end":return a.stop();}},a,this)}));return function(){return a.apply(this,arguments)}}(),Extension=/*#__PURE__*/function(a){function b(a,c){var d;return(0,_classCallCheck2.default)(this,b),d=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(b).call(this,_Blockchains.Blockchains.EOS,PluginTypes.WALLET_SUPPORT)),d.name="ScatterExtension",d.context=a,d.holderFns=c,d}return(0,_inherits2.default)(b,a),(0,_createClass2.default)(b,[{key:"connect",value:function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){var b=this;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",new Promise(/*#__PURE__*/function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(c){var d;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,pollExistence();case 2:d=a.sent,d&&(!b.holderFns.get().wallet&&(b.holderFns.get().wallet=b.name),c(!0));case 4:case"end":return a.stop();}},a,this)}));return function(){return a.apply(this,arguments)}}()));case 1:case"end":return a.stop();}},a,this)}));return function b(){return a.apply(this,arguments)}}()},{key:"runBeforeInterfacing",value:function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){var b,c,d,e,f=this;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=this.context.network,b&&(c=window.scatter.getIdentity.bind(window.scatter),d=window.scatter.useIdentity.bind(window.scatter),window.scatter.getIdentity=function(a){return c(a?a:{accounts:[b]}).then(function(a){return f.holderFns.get().identity=a,d(a),a})},e=window.scatter.suggestNetwork.bind(window.scatter),window.scatter.suggestNetwork=function(a){return e(a?a:b)}),this.holderFns.get().wallet===this.name&&(window.scatter.wallet=this.name),this.holderFns.set(window.scatter),this.context=this.holderFns.get(),a.abrupt("return",!0);case 6:case"end":return a.stop();}},a,this)}));return function b(){return a.apply(this,arguments)}}()},{key:"runAfterInterfacing",value:function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return this.context.isExtension=!0,this.context.connect=this.connect,a.abrupt("return",!0);case 3:case"end":return a.stop();}},a,this)}));return function b(){return a.apply(this,arguments)}}()},{key:"methods",value:function a(){return(0,_defineProperty2.default)({},_WalletInterface.WALLET_METHODS.getIdentity,function(){console.log("getid")})}}]),b}(_Plugin2.default);exports.default=Extension; | ||
"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),PluginTypes=_interopRequireWildcard(require("../plugins/PluginTypes")),_Plugin2=_interopRequireDefault(require("../plugins/Plugin")),_Blockchains=require("../models/Blockchains"),_WalletInterface=_interopRequireWildcard(require("../models/WalletInterface")),_SocketService=_interopRequireDefault(require("../services/SocketService")),isAvailable=!1;"undefined"!=typeof window&&"undefined"!=typeof document&&("undefined"==typeof window.scatter?document.addEventListener("scatterLoaded",function(){return isAvailable=!0}):isAvailable=!0);var pollExistence=/*#__PURE__*/function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){var b,c,d=arguments;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<d.length&&void 0!==d[0]?d[0]:null,c=1<d.length&&void 0!==d[1]?d[1]:0,a.abrupt("return",new Promise(function(a){return b||(b=a),isAvailable?b(!0):5<c?b(!1):void setTimeout(function(){return pollExistence(b,c+1)},100)}));case 3:case"end":return a.stop();}},a,this)}));return function(){return a.apply(this,arguments)}}(),Extension=/*#__PURE__*/function(a){function b(a,c){var d;return(0,_classCallCheck2.default)(this,b),d=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(b).call(this,_Blockchains.Blockchains.EOS,PluginTypes.WALLET_SUPPORT)),d.name="ScatterExtension",d.context=a,d.holderFns=c,d}return(0,_inherits2.default)(b,a),(0,_createClass2.default)(b,[{key:"connect",value:function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){var b=this;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",new Promise(/*#__PURE__*/function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(c){var d;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,pollExistence();case 2:d=a.sent,d&&(!b.holderFns.get().wallet&&(b.holderFns.get().wallet=b.name),c(!0));case 4:case"end":return a.stop();}},a,this)}));return function(){return a.apply(this,arguments)}}()));case 1:case"end":return a.stop();}},a,this)}));return function b(){return a.apply(this,arguments)}}()},{key:"runBeforeInterfacing",value:function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){var b,c,d,e,f=this;return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=this.context.network,b&&(c=window.scatter.getIdentity.bind(window.scatter),d=window.scatter.useIdentity.bind(window.scatter),window.scatter.getIdentity=function(a){return c(a?a:{accounts:[b]}).then(function(a){return f.holderFns.get().identity=a,d(a),a})},e=window.scatter.suggestNetwork.bind(window.scatter),window.scatter.suggestNetwork=function(a){return e(a?a:b)}),this.holderFns.get().wallet===this.name&&(window.scatter.wallet=this.name),this.holderFns.set(window.scatter),this.context=this.holderFns.get(),a.abrupt("return",!0);case 6:case"end":return a.stop();}},a,this)}));return function b(){return a.apply(this,arguments)}}()},{key:"runAfterInterfacing",value:function(){var a=(0,_asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function a(){return _regenerator.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return this.context.isExtension=!0,this.context.connect=this.connect,a.abrupt("return",!0);case 3:case"end":return a.stop();}},a,this)}));return function b(){return a.apply(this,arguments)}}()},{key:"methods",value:function a(){return(0,_defineProperty2.default)({},_WalletInterface.WALLET_METHODS.getIdentity,function(){console.log("getid")})}}]),b}(_Plugin2.default);exports.default=Extension; |
{ | ||
"name": "scatterjs-core", | ||
"version": "2.7.16", | ||
"version": "2.7.17", | ||
"main": "dist/index.js", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "8e02bba47a9c958291788b58477af840b3717fc3" | ||
"gitHead": "81469083eb6527ecb71413888d3c8ec8cfc5ae8c" | ||
} |
@@ -10,3 +10,4 @@ import * as PluginTypes from "../plugins/PluginTypes"; | ||
if(typeof window !== 'undefined' && typeof document !== 'undefined') { | ||
document.addEventListener('scatterLoaded', () => isAvailable = true); | ||
if(typeof window.scatter !== 'undefined') isAvailable = true; | ||
else document.addEventListener('scatterLoaded', () => isAvailable = true); | ||
} | ||
@@ -13,0 +14,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71906
915