!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.o3DapiETH=n():t.o3DapiETH=n()}("undefined"!=typeof self?self:this,function(){return function(t){var n={};function e(c){if(n[c])return n[c].exports;var o=n[c]={i:c,l:!1,exports:{}};return t[c].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,c){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:c})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var c=Object.create(null);if(e.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(c,o,function(n){return t[n]}.bind(null,o));return c},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=6)}([function(t,n,e){"use strict";e.d(n,"d",function(){return c}),e.d(n,"a",function(){return o}),e.d(n,"b",function(){return r}),e.d(n,"c",function(){return u});const c="v1";var o,i,r,u;!function(t){t.ETH="ETH",t.BSC="BSC",t.HECO="HECO"}(o||(o={})),function(t){t.STRING="String",t.BOOLEAN="Boolean",t.HASH160="Hash160",t.HASH256="Hash256",t.INTEGER="Integer",t.BYTEARRAY="ByteArray",t.ARRAY="Array",t.ADDRESS="Address"}(i||(i={})),function(t){t.ethChainId="eth_chainId",t.ethGetBalance="eth_getBalance",t.netVersion="net_version",t.ethRequestAccounts="eth_requestAccounts",t.ethAccounts="eth_accounts",t.ethBlockNumber="eth_blockNumber",t.ethCall="eth_call",t.ethEstimateGas="eth_estimateGas",t.ethGasPrice="eth_gasPrice",t.ethSendTransaction="eth_sendTransaction",t.ethSendRawTransaction="eth_sendRawTransaction",t.ethGetTransactionReceipt="eth_getTransactionReceipt",t.disconnect="disconnect",t.RegisterBlockHeightListener="RegisterBlockHeightListener"}(r||(r={})),function(t){t.READY="READY",t.ACCOUNT_CHANGED="ACCOUNT_CHANGED",t.CONNECTED="CONNECTED",t.DISCONNECTED="DISCONNECTED",t.NETWORK_CHANGED="NETWORK_CHANGED",t.ETH_BLOCK_HEIGHT_CHANGED="ETH_BLOCK_HEIGHT_CHANGED"}(u||(u={}))},function(t,n,e){"use strict";e.d(n,"d",function(){return r}),e.d(n,"a",function(){return u}),e.d(n,"b",function(){return a}),e.d(n,"c",function(){return s});var c=e(2),o=e(0);let i=t=>Promise.reject(new Error("o3-dapi-eth plugin not instanciated."));function r(t,n){return i(Object.assign({},t,{blockchain:n,version:o.d}))}function u(t,n,e){i=t,n({blockchain:e,callback:c.d})}function a(t,n,e){i=t,n({blockchain:e,callback:c.e})}function s(t,n,e){i=t,n({blockchain:e,callback:c.f})}},function(t,n,e){"use strict";(function(t){e.d(n,"a",function(){return s}),e.d(n,"b",function(){return d}),e.d(n,"c",function(){return f}),e.d(n,"g",function(){return h}),e.d(n,"h",function(){return l}),e.d(n,"i",function(){return E}),e.d(n,"d",function(){return b}),e.d(n,"e",function(){return C}),e.d(n,"f",function(){return H});var c=e(0),o=e(1);const i="undefined"!=typeof window?window:t,r={},u={},a={};function s(t,n){const e=r[t]||[];e.push(n),r[t]=e;const u=i._o3dapi.isReady;if(t===c.c.READY&&u){const t=r[c.c.READY];t&&t.forEach(t=>t(u))}t===c.c.ETH_BLOCK_HEIGHT_CHANGED&&Object(o.d)({command:c.b.RegisterBlockHeightListener},c.a.ETH)}function d(t,n){const e=u[t]||[];e.push(n),u[t]=e;const r=i._o3dapi.isReady;if(t===c.c.READY&&r){const t=u[c.c.READY];t&&t.forEach(t=>t(r))}t===c.c.ETH_BLOCK_HEIGHT_CHANGED&&Object(o.d)({command:c.b.RegisterBlockHeightListener},c.a.BSC)}function f(t,n){const e=a[t]||[];e.push(n),a[t]=e;const r=i._o3dapi.isReady;if(t===c.c.READY&&r){const t=a[c.c.READY];t&&t.forEach(t=>t(r))}t===c.c.ETH_BLOCK_HEIGHT_CHANGED&&Object(o.d)({command:c.b.RegisterBlockHeightListener},c.a.HECO)}function h(t){r[t]=[]}function l(t){u[t]=[]}function E(t){a[t]=[]}function b(t,n){const e=r[t];e&&e.forEach(t=>t(n))}function C(t,n){const e=u[t];e&&e.forEach(t=>t(n))}function H(t,n){const e=a[t];e&&e.forEach(t=>t(n))}}).call(this,e(5))},function(t,n,e){"use strict";e.d(n,"a",function(){return i}),e.d(n,"b",function(){return r}),e.d(n,"c",function(){return u});var c=e(1),o=e(0);function i(t){return Object(c.d)({command:t.method,data:t.params},o.a.ETH)}function r(t){return Object(c.d)({command:t.method,data:t.params},o.a.BSC)}function u(t){return Object(c.d)({command:t.method,data:t.params},o.a.HECO)}},function(t,n,e){"use strict";e.d(n,"a",function(){return i}),e.d(n,"b",function(){return r}),e.d(n,"c",function(){return u});var c=e(1),o=e(0);function i(){return Object(c.d)({command:o.b.disconnect},o.a.ETH)}function r(){return Object(c.d)({command:o.b.disconnect},o.a.BSC)}function u(){return Object(c.d)({command:o.b.disconnect},o.a.HECO)}},function(t,n){var e;e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){t.exports=e(7)},function(t,n,e){"use strict";e.r(n),function(t){e.d(n,"ETH",function(){return a}),e.d(n,"BSC",function(){return s}),e.d(n,"HECO",function(){return d});var c=e(3),o=e(0),i=e(1),r=e(2),u=e(4);"undefined"!=typeof window&&window;class a{constructor(t,n,e=o.a.ETH){this.request=c.a,this.disconnect=u.a,this.addEventListener=r.a,this.removeEventListener=r.g,this.Constants={EventName:o.c,Command:o.b},Object(i.a)(t,n,e)}setClientPlugin(t){this.clientPlugin=t}}a.blockchain=o.a.ETH;class s{constructor(t,n,e=o.a.BSC){this.request=c.b,this.disconnect=u.b,this.addEventListener=r.b,this.removeEventListener=r.h,this.Constants={EventName:o.c,Command:o.b},Object(i.b)(t,n,e)}setClientPlugin(t){this.clientPlugin=t}}s.blockchain=o.a.BSC;class d{constructor(t,n,e=o.a.HECO){this.request=c.c,this.disconnect=u.c,this.addEventListener=r.c,this.removeEventListener=r.i,this.Constants={EventName:o.c,Command:o.b},Object(i.c)(t,n,e)}setClientPlugin(t){this.clientPlugin=t}}d.blockchain=o.a.HECO;const f={};f.ETH=a,f.BSC=s,f.HECO=d,n.default=f}.call(this,e(5))}]).default});