Official Go implementation of the Ethereum protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-ethereum/dist/ethereum.min.js

1 line
13 KiB

require=function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e){var n=function(t){return parseInt(t,16).toString()},r=function(t,e){for(var n=!1,r=0;r<t.length&&!n;r++)n=e(t[r]);return n?r-1:-1},o=function(t,e){return r(t,function(t){return t.name===e})},i=function(t,e){return new Array(e-t.length+1).join("0")+t},a=function(){var t=function(t){return function(e,n){var r=t;if(0!==e.indexOf(r))return!1;var o=32;return"string"===t?web3.fromAscii(n,o).substr(2):(n="number"==typeof n?n.toString(16):"string"==typeof n?web3.toHex(n):0===n.indexOf("0x")?n.substr(2):(+n).toString(16),i(n,2*o))}},e=function(t,e){return function(n,r){if(n!==t)return!1;var o=32;return i(e?e(r):r,2*o)}},n=function(t){return t?"0x1":"0x0"};return[t("uint"),t("int"),t("hash"),t("string"),t("real"),t("ureal"),e("address"),e("bool",n)]},s=a(),u=function(t,e,n){var r="",i=o(t,e);if(-1!==i){for(var a=t[i],u=0;u<a.inputs.length;u++){for(var c=!1,l=0;l<s.length&&!c;l++)c=s[l](a.inputs[u].type,n[u]);c||console.error("unsupported json type: "+a.inputs[u].type),r+=c}return r}},c=function(){var t=function(t){return function(e){var n=t;if(0!==e.indexOf(n))return-1;var r=32;return 2*r}},e=function(t){return function(e){var n=32;return t===e?2*n:-1}},r=function(t){return t.length<=8?+parseInt(t,16):n(t)},o=function(t){return"0x"+t},i=function(t){return"1"===t?!0:!1},a=function(t){return web3.toAscii(t)};return[{padding:t("uint"),format:r},{padding:t("int"),format:r},{padding:t("hash"),format:o},{padding:t("string"),format:a},{padding:t("real"),format:r},{padding:t("ureal"),format:r},{padding:e("address")},{padding:e("bool"),format:i}]},l=c(),h=function(t,e,n){var r=o(t,e);if(-1!==r){n=n.slice(2);for(var i=[],a=t[r],s=0;s<a.outputs.length;s++){for(var u=-1,c=0;c<l.length&&-1===u;c++)u=l[c].padding(a.outputs[s].type);if(-1!==u){var h=n.slice(0,u),f=l[c-1].format;i.push(f?f(h):"0x"+h),n=n.slice(u)}}return i}},f=function(t){var e={};return t.forEach(function(n){e[n.name]=function(){var e=Array.prototype.slice.call(arguments);return u(t,n.name,e)}}),e},p=function(t){var e={};return t.forEach(function(n){e[n.name]=function(e){return h(t,n.name,e)}}),e},d=function(t,e){var n=t[o(t,e)],r=e+"(",i=n.inputs.map(function(t){return t.type});return r+=i.join(","),r+=")",web3.sha3(web3.fromAscii(r))};e.exports={inputParser:f,outputParser:p,methodSignature:d}},{}],2:[function(t,e){var n=function(t){if(!web3.haveProvider()){if(this.sendQueue=[],this.onmessageQueue=[],navigator.qt)return void(this.provider=new web3.providers.QtProvider);t=t||{};var e={httprpc:t.httprpc||"http://localhost:8080",websockets:t.websockets||"ws://localhost:40404/eth"},n=this,r=function(t){o.close(),t?n.provider=new web3.providers.WebSocketProvider(e.websockets):(n.provider=new web3.providers.HttpRpcProvider(e.httprpc),n.poll=n.provider.poll.bind(n.provider)),n.sendQueue.forEach(function(t){n.provider(t)}),n.onmessageQueue.forEach(function(t){n.provider.onmessage=t})},o=new WebSocket(e.websockets);o.onopen=function(){r(!0)},o.onerror=function(){r(!1)}}};n.prototype.send=function(t){return this.provider?void this.provider.send(t):void this.sendQueue.push(t)},Object.defineProperty(n.prototype,"onmessage",{set:function(t){return this.provider?void(this.provider.onmessage=t):void this.onmessageQueue.push(t)}}),e.exports=n},{}],3:[function(t,e){var n=t("./abi"),r=4,o=function(t,e){var o=n.inputParser(e),i=n.outputParser(e),a={};return e.forEach(function(s){a[s.name]=function(){var a=Array.prototype.slice.call(arguments),u=o[s.name].apply(null,a),c=function(t){return i[s.name](t)};return{call:function(o){return o=o||{},o.to=t,n.methodSignature(e,s.name).then(function(t){return o.data=t.slice(0,2+2*r)+u,web3.eth.call(o).