@rango-dev/provider-enkrypt 0.1.2 → 0.1.3-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -4
- package/dist/index.d.ts +2 -2
- package/dist/provider-enkrypt.cjs.development.js +1 -1
- package/dist/provider-enkrypt.cjs.development.js.map +1 -1
- package/dist/provider-enkrypt.cjs.production.min.js +1 -1
- package/dist/provider-enkrypt.cjs.production.min.js.map +1 -1
- package/dist/provider-enkrypt.esm.js +2 -2
- package/dist/provider-enkrypt.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CanSwitchNetwork, Connect, Subscribe, SwitchNetwork, WalletInfo,
|
|
1
|
+
import { CanSwitchNetwork, Connect, Subscribe, SwitchNetwork, WalletInfo, WalletTypes } from '@rango-dev/wallets-shared';
|
|
2
2
|
import { enkrypt as enkrypt_instance } from './helpers';
|
|
3
3
|
import { BlockchainMeta, SignerFactory } from 'rango-types';
|
|
4
4
|
export declare const getInstance: typeof enkrypt_instance;
|
|
5
5
|
export declare const config: {
|
|
6
|
-
type:
|
|
6
|
+
type: WalletTypes;
|
|
7
7
|
};
|
|
8
8
|
export declare const connect: Connect;
|
|
9
9
|
export declare const subscribe: Subscribe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-enkrypt.cjs.development.js","sources":["../src/helpers.ts","../src/signer.ts","../src/index.ts"],"sourcesContent":["export function enkrypt() {\n const { enkrypt } = window;\n const ethereum = enkrypt?.providers?.ethereum;\n if (!ethereum) return null;\n return ethereum;\n}\n","import { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { SignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const signers = new SignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(provider));\n return signers;\n}\n","import {\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n
|
|
1
|
+
{"version":3,"file":"provider-enkrypt.cjs.development.js","sources":["../src/helpers.ts","../src/signer.ts","../src/index.ts"],"sourcesContent":["export function enkrypt() {\n const { enkrypt } = window;\n const ethereum = enkrypt?.providers?.ethereum;\n if (!ethereum) return null;\n return ethereum;\n}\n","import { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { SignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const signers = new SignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(provider));\n return signers;\n}\n","import {\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n WalletTypes,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n} from '@rango-dev/wallets-shared';\nimport { enkrypt as enkrypt_instance } from './helpers';\nimport { BlockchainMeta, SignerFactory, evmBlockchains } from 'rango-types';\nimport signer from './signer';\n\nexport const getInstance = enkrypt_instance;\n\nconst WALLET = WalletTypes.ENKRYPT;\n\nexport const config = {\n type: WALLET,\n};\n\nexport const connect: Connect = async ({ instance }) => {\n let { accounts, chainId } = await getEvmAccounts(instance);\n if (accounts.length > 1) accounts = [instance.selectedAddress];\n\n return {\n accounts,\n chainId,\n };\n};\n\nexport const subscribe: Subscribe = subscribeToEvm;\n\nexport const switchNetwork: SwitchNetwork = switchNetworkForEvm;\n\nexport const canSwitchNetworkTo: CanSwitchNetwork = canSwitchNetworkToEvm;\n\nexport const getSigners: (provider: any) => SignerFactory = signer;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const evms = evmBlockchains(allBlockChains);\n return {\n name: 'Enkrypt',\n img: 'https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/enkrypt.svg',\n installLink: {\n CHROME:\n 'https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh',\n FIREFOX: 'https://addons.mozilla.org/en-US/firefox/addon/enkrypt/',\n BRAVE:\n 'https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh',\n EDGE: 'https://microsoftedge.microsoft.com/addons/detail/enkrypt-ethereum-polkad/gfenajajnjjmmdojhdjmnngomkhlnfjl',\n\n DEFAULT: 'https://www.enkrypt.com/',\n },\n color: '#fff',\n supportedChains: evms,\n };\n};\n"],"names":["enkrypt","_window","window","ethereum","_enkrypt$providers","providers","getSigners","provider","signers","SignerFactory","registerSigner","TxType","EVM","DefaultEvmSigner","getInstance","enkrypt_instance","WALLET","WalletTypes","ENKRYPT","config","type","connect","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref","instance","_yield$getEvmAccounts","accounts","chainId","wrap","_callee$","_context","prev","next","getEvmAccounts","sent","length","selectedAddress","abrupt","stop","_x","apply","arguments","subscribe","subscribeToEvm","switchNetwork","switchNetworkForEvm","canSwitchNetworkTo","canSwitchNetworkToEvm","signer","getWalletInfo","allBlockChains","evms","evmBlockchains","name","img","installLink","CHROME","FIREFOX","BRAVE","EDGE","DEFAULT","color","supportedChains"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAgBA,OAAOA;;EACrB,IA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,EAARA,QAAQ;YACRC,OAAO,EAAPA;WACD;QAAA;QAAA;UAAA,OAAAG,QAAA,CAAAQ,IAAA;;OAAAhB,OAAA;GACF;EAAA,gBARYL,OAAOA,CAAAsB,EAAA;IAAA,OAAArB,KAAA,CAAAsB,KAAA,OAAAC,SAAA;;AAAA,GAQnB;AAED,IAAaC,SAAS,GAAcC;AAEpC,IAAaC,aAAa,GAAkBC;AAE5C,IAAaC,kBAAkB,GAAqBC;AAEpD,IAAa7C,YAAU,GAAqC8C;AAE5D,IAAaC,aAAa,GAAqD,SAAlEA,aAAaA,CACxBC,cAAc;EAEd,IAAMC,IAAI,GAAGC,yBAAc,CAACF,cAAc,CAAC;EAC3C,OAAO;IACLG,IAAI,EAAE,SAAS;IACfC,GAAG,EAAE,oGAAoG;IACzGC,WAAW,EAAE;MACXC,MAAM,EACJ,oFAAoF;MACtFC,OAAO,EAAE,yDAAyD;MAClEC,KAAK,EACH,oFAAoF;MACtFC,IAAI,EAAE,4GAA4G;MAElHC,OAAO,EAAE;KACV;IACDC,KAAK,EAAE,MAAM;IACbC,eAAe,EAAEX;GAClB;AACH,CAAC;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@rango-dev/wallets-shared"),e=require("rango-types"),r=require("@rango-dev/signer-evm");function n(){n=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=Object.create((e&&e.prototype instanceof p?e:p).prototype),a=new O(n||[]);return o(i,"_invoke",{value:b(t,r,a)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function p(){}function d(){}function v(){}var y={};s(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(_([])));m&&m!==e&&r.call(m,a)&&(y=m);var w=v.prototype=p.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var n;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=v,o(w,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},x(E.prototype),s(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,u,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=_,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function o(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function c(t){o(a,n,i,c,u,"next",t)}function u(t){o(a,n,i,c,u,"throw",t)}c(void 0)}))}}var a={type:t.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@rango-dev/wallets-shared"),e=require("rango-types"),r=require("@rango-dev/signer-evm");function n(){n=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=Object.create((e&&e.prototype instanceof p?e:p).prototype),a=new O(n||[]);return o(i,"_invoke",{value:b(t,r,a)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function p(){}function d(){}function v(){}var y={};s(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(_([])));m&&m!==e&&r.call(m,a)&&(y=m);var w=v.prototype=p.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var n;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=k(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function _(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=v,o(w,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=s(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},x(E.prototype),s(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,u,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=_,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function o(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function c(t){o(a,n,i,c,u,"next",t)}function u(t){o(a,n,i,c,u,"throw",t)}c(void 0)}))}}var a={type:t.WalletTypes.ENKRYPT},c=function(){var e=i(n().mark((function e(r){var o,i,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.instance,e.next=3,t.getEvmAccounts(o);case 3:return(a=(i=e.sent).accounts).length>1&&(a=[o.selectedAddress]),e.abrupt("return",{accounts:a,chainId:i.chainId});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=t.subscribeToEvm,s=t.switchNetworkForEvm;exports.canSwitchNetworkTo=t.canSwitchNetworkToEvm,exports.config=a,exports.connect=c,exports.getInstance=function(){var t,e=window.enkrypt;return(null==e||null==(t=e.providers)?void 0:t.ethereum)||null},exports.getSigners=function(t){var n=new e.SignerFactory;return n.registerSigner(e.TransactionType.EVM,new r.DefaultEvmSigner(t)),n},exports.getWalletInfo=function(t){return{name:"Enkrypt",img:"https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/enkrypt.svg",installLink:{CHROME:"https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh",FIREFOX:"https://addons.mozilla.org/en-US/firefox/addon/enkrypt/",BRAVE:"https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh",EDGE:"https://microsoftedge.microsoft.com/addons/detail/enkrypt-ethereum-polkad/gfenajajnjjmmdojhdjmnngomkhlnfjl",DEFAULT:"https://www.enkrypt.com/"},color:"#fff",supportedChains:e.evmBlockchains(t)}},exports.subscribe=u,exports.switchNetwork=s;
|
|
2
2
|
//# sourceMappingURL=provider-enkrypt.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-enkrypt.cjs.production.min.js","sources":["../src/index.ts","../src/helpers.ts","../src/signer.ts"],"sourcesContent":["import {\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n
|
|
1
|
+
{"version":3,"file":"provider-enkrypt.cjs.production.min.js","sources":["../src/index.ts","../src/helpers.ts","../src/signer.ts"],"sourcesContent":["import {\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n WalletTypes,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n} from '@rango-dev/wallets-shared';\nimport { enkrypt as enkrypt_instance } from './helpers';\nimport { BlockchainMeta, SignerFactory, evmBlockchains } from 'rango-types';\nimport signer from './signer';\n\nexport const getInstance = enkrypt_instance;\n\nconst WALLET = WalletTypes.ENKRYPT;\n\nexport const config = {\n type: WALLET,\n};\n\nexport const connect: Connect = async ({ instance }) => {\n let { accounts, chainId } = await getEvmAccounts(instance);\n if (accounts.length > 1) accounts = [instance.selectedAddress];\n\n return {\n accounts,\n chainId,\n };\n};\n\nexport const subscribe: Subscribe = subscribeToEvm;\n\nexport const switchNetwork: SwitchNetwork = switchNetworkForEvm;\n\nexport const canSwitchNetworkTo: CanSwitchNetwork = canSwitchNetworkToEvm;\n\nexport const getSigners: (provider: any) => SignerFactory = signer;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const evms = evmBlockchains(allBlockChains);\n return {\n name: 'Enkrypt',\n img: 'https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/enkrypt.svg',\n installLink: {\n CHROME:\n 'https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh',\n FIREFOX: 'https://addons.mozilla.org/en-US/firefox/addon/enkrypt/',\n BRAVE:\n 'https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh',\n EDGE: 'https://microsoftedge.microsoft.com/addons/detail/enkrypt-ethereum-polkad/gfenajajnjjmmdojhdjmnngomkhlnfjl',\n\n DEFAULT: 'https://www.enkrypt.com/',\n },\n color: '#fff',\n supportedChains: evms,\n };\n};\n","export function enkrypt() {\n const { enkrypt } = window;\n const ethereum = enkrypt?.providers?.ethereum;\n if (!ethereum) return null;\n return ethereum;\n}\n","import { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { SignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const signers = new SignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(provider));\n return signers;\n}\n"],"names":["config","type","WalletTypes","ENKRYPT","connect","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref","instance","_yield$getEvmAccounts","accounts","wrap","_context","prev","next","getEvmAccounts","sent","length","selectedAddress","abrupt","chainId","stop","_x","apply","arguments","subscribe","subscribeToEvm","switchNetwork","switchNetworkForEvm","canSwitchNetworkToEvm","enkrypt","window","_enkrypt$providers","providers","ethereum","provider","signers","SignerFactory","registerSigner","TxType","EVM","DefaultEvmSigner","allBlockChains","name","img","installLink","CHROME","FIREFOX","BRAVE","EDGE","DEFAULT","color","supportedChains","evmBlockchains"],"mappings":"k7NAoBaA,EAAS,CACpBC,KAHaC,cAAYC,SAMdC,aAAO,IAAAC,EAAAC,EAAAC,IAAAC,MAAY,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,EAAAC,EAAA,OAAAN,IAAAO,eAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,OAAiB,OAARN,EAAQD,EAARC,SAAQI,EAAAE,OACbC,iBAAeP,GAAS,OACK,OADzDE,GAAoDD,EAAAG,EAAAI,MAApDN,UACOO,OAAS,IAAGP,EAAW,CAACF,EAASU,kBAAiBN,EAAAO,gBAExD,CACLT,SAAAA,EACAU,QALqBX,EAAPW,UAMf,OAAA,UAAA,OAAAR,EAAAS,UAAAf,OACF,gBARmBgB,GAAA,OAAApB,EAAAqB,WAAAC,eAUPC,EAAuBC,iBAEvBC,EAA+BC,iDAEQC,gGCrC1CC,EAAYC,OAAZD,QAER,aADiBA,UAAOE,EAAPF,EAASG,kBAATD,EAAoBE,WACf,kCCAWC,GACjC,IAAMC,EAAU,IAAIC,gBAEpB,OADAD,EAAQE,eAAeC,kBAAOC,IAAK,IAAIC,mBAAiBN,IACjDC,yBFoCsE,SAC7EM,GAGA,MAAO,CACLC,KAAM,UACNC,IAAK,qGACLC,YAAa,CACXC,OACE,qFACFC,QAAS,0DACTC,MACE,qFACFC,KAAM,6GAENC,QAAS,4BAEXC,MAAO,OACPC,gBAfWC,iBAAeX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { subscribeToEvm, switchNetworkForEvm, canSwitchNetworkToEvm,
|
|
1
|
+
import { subscribeToEvm, switchNetworkForEvm, canSwitchNetworkToEvm, WalletTypes, getEvmAccounts } from '@rango-dev/wallets-shared';
|
|
2
2
|
import { SignerFactory, TransactionType, evmBlockchains } from 'rango-types';
|
|
3
3
|
import { DefaultEvmSigner } from '@rango-dev/signer-evm';
|
|
4
4
|
|
|
@@ -350,7 +350,7 @@ function getSigners(provider) {
|
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
var getInstance = enkrypt;
|
|
353
|
-
var WALLET =
|
|
353
|
+
var WALLET = WalletTypes.ENKRYPT;
|
|
354
354
|
var config = {
|
|
355
355
|
type: WALLET
|
|
356
356
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-enkrypt.esm.js","sources":["../src/helpers.ts","../src/signer.ts","../src/index.ts"],"sourcesContent":["export function enkrypt() {\n const { enkrypt } = window;\n const ethereum = enkrypt?.providers?.ethereum;\n if (!ethereum) return null;\n return ethereum;\n}\n","import { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { SignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const signers = new SignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(provider));\n return signers;\n}\n","import {\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n
|
|
1
|
+
{"version":3,"file":"provider-enkrypt.esm.js","sources":["../src/helpers.ts","../src/signer.ts","../src/index.ts"],"sourcesContent":["export function enkrypt() {\n const { enkrypt } = window;\n const ethereum = enkrypt?.providers?.ethereum;\n if (!ethereum) return null;\n return ethereum;\n}\n","import { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { SignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const signers = new SignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(provider));\n return signers;\n}\n","import {\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n WalletTypes,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n} from '@rango-dev/wallets-shared';\nimport { enkrypt as enkrypt_instance } from './helpers';\nimport { BlockchainMeta, SignerFactory, evmBlockchains } from 'rango-types';\nimport signer from './signer';\n\nexport const getInstance = enkrypt_instance;\n\nconst WALLET = WalletTypes.ENKRYPT;\n\nexport const config = {\n type: WALLET,\n};\n\nexport const connect: Connect = async ({ instance }) => {\n let { accounts, chainId } = await getEvmAccounts(instance);\n if (accounts.length > 1) accounts = [instance.selectedAddress];\n\n return {\n accounts,\n chainId,\n };\n};\n\nexport const subscribe: Subscribe = subscribeToEvm;\n\nexport const switchNetwork: SwitchNetwork = switchNetworkForEvm;\n\nexport const canSwitchNetworkTo: CanSwitchNetwork = canSwitchNetworkToEvm;\n\nexport const getSigners: (provider: any) => SignerFactory = signer;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const evms = evmBlockchains(allBlockChains);\n return {\n name: 'Enkrypt',\n img: 'https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/enkrypt.svg',\n installLink: {\n CHROME:\n 'https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh',\n FIREFOX: 'https://addons.mozilla.org/en-US/firefox/addon/enkrypt/',\n BRAVE:\n 'https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh',\n EDGE: 'https://microsoftedge.microsoft.com/addons/detail/enkrypt-ethereum-polkad/gfenajajnjjmmdojhdjmnngomkhlnfjl',\n\n DEFAULT: 'https://www.enkrypt.com/',\n },\n color: '#fff',\n supportedChains: evms,\n };\n};\n"],"names":["enkrypt","_window","window","ethereum","_enkrypt$providers","providers","getSigners","provider","signers","SignerFactory","registerSigner","TxType","EVM","DefaultEvmSigner","getInstance","enkrypt_instance","WALLET","WalletTypes","ENKRYPT","config","type","connect","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref","instance","_yield$getEvmAccounts","accounts","chainId","wrap","_callee$","_context","prev","next","getEvmAccounts","sent","length","selectedAddress","abrupt","stop","_x","apply","arguments","subscribe","subscribeToEvm","switchNetwork","switchNetworkForEvm","canSwitchNetworkTo","canSwitchNetworkToEvm","signer","getWalletInfo","allBlockChains","evms","evmBlockchains","name","img","installLink","CHROME","FIREFOX","BRAVE","EDGE","DEFAULT","color","supportedChains"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAgBA,OAAOA;;EACrB,IAAAC,OAAA,GAAoBC,MAAM;IAAlBF,OAAO,GAAAC,OAAA,CAAPD,OAAO;EACf,IAAMG,QAAQ,GAAGH,OAAO,qBAAAI,kBAAA,GAAPJ,OAAO,CAAEK,SAAS,qBAAlBD,kBAAA,CAAoBD,QAAQ;EAC7C,IAAI,CAACA,QAAQ,EAAE,OAAO,IAAI;EAC1B,OAAOA,QAAQ;AACjB;;SCFwBG,UAAUA,CAACC,QAAa;EAC9C,IAAMC,OAAO,GAAG,IAAIC,aAAa,EAAE;EACnCD,OAAO,CAACE,cAAc,CAACC,eAAM,CAACC,GAAG,EAAE,IAAIC,gBAAgB,CAACN,QAAQ,CAAC,CAAC;EAClE,OAAOC,OAAO;AAChB;;ICSaM,WAAW,GAAGC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AAI,EAAE,SAAS;IACfC,GAAG,EAAE,oGAAoG;IACzGC,WAAW,EAAE;MACXC,MAAM,EACJ,oFAAoF;MACtFC,OAAO,EAAE,yDAAyD;MAClEC,KAAK,EACH,oFAAoF;MACtFC,IAAI,EAAE,4GAA4G;MAElHC,OAAO,EAAE;KACV;IACDC,KAAK,EAAE,MAAM;IACbC,eAAe,EAAEX;GAClB;AACH,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/provider-enkrypt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "dist/provider-enkrypt.esm.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@rango-dev/signer-evm": "^0.1.
|
|
42
|
+
"@rango-dev/signer-evm": "^0.1.15-next.1",
|
|
43
43
|
"@rango-dev/wallets-shared": "^0.1.14",
|
|
44
44
|
"rango-types": "^0.1.28"
|
|
45
45
|
},
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Subscribe,
|
|
5
5
|
SwitchNetwork,
|
|
6
6
|
WalletInfo,
|
|
7
|
-
|
|
7
|
+
WalletTypes,
|
|
8
8
|
canSwitchNetworkToEvm,
|
|
9
9
|
getEvmAccounts,
|
|
10
10
|
subscribeToEvm,
|
|
@@ -16,7 +16,7 @@ import signer from './signer';
|
|
|
16
16
|
|
|
17
17
|
export const getInstance = enkrypt_instance;
|
|
18
18
|
|
|
19
|
-
const WALLET =
|
|
19
|
+
const WALLET = WalletTypes.ENKRYPT;
|
|
20
20
|
|
|
21
21
|
export const config = {
|
|
22
22
|
type: WALLET,
|