Comparing version 0.0.94 to 1.0.0
/*! For license information please see MinaData.js.LICENSE.txt */ | ||
var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{O:()=>G});var r={presets:{accountBalance:{description:"Retrieve current balance of given account.",input:{query:{cmd:"query q($publicKey: PublicKey!) {\naccount(publicKey: $publicKey) {\nbalance {\nblockHeight\ntotal\nstateHash\n}nonce\n}}",schema:"proxy"},variables:{publicKey:{default:{berkeley:"B62qnEdPB1V5YPEcGaETb19naLJV6sWdveCZEjSLhcVyrPcPWHkGGax"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0}}},expect:{key:"account",type:"hash"}},transactionsFromSender:{description:"Retrieve transactions which was sended by given address",input:{query:{cmd:"query q($senderAddress: String!, $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, sortBy: $sortBy, query: {from: $senderAddress}) {\n from\n to\n amount\n memo\n hash\n dateTime\n block {\n commandTransactionCount\n blockHeight\n }\n nonce\n fee\n }\n}",schema:"standard"},variables:{senderAddress:{default:{berkeley:"B62qnEdPB1V5YPEcGaETb19naLJV6sWdveCZEjSLhcVyrPcPWHkGGax"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:2},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},expect:{key:"transactions",type:"array"}},transactionsFromReceiver:{description:"Retrieve ",input:{query:{cmd:"query q($receiverAddress: String!, $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, sortBy: $sortBy, query: {receiver: {publicKey: $receiverAddress}}) {\n from\n to\n amount\n memo\n hash\n dateTime\n block {\n commandTransactionCount\n blockHeight\n }\n nonce\n }\n}",schema:"standard"},variables:{receiverAddress:{default:{berkeley:"B62qqhjvvE3dwiX2hF2cZRfmHA7euo8MrzvZhPHgXJNb57vuiWePAWC"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:2},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},expect:{key:"transactions",type:"array"}},transactionsSenderToReceiver:{description:"Retrieve transactions which took place between 2 given addresses",input:{query:{cmd:"query q($senderAddress: String!, $receiverAddress: String!, $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, sortBy: $sortBy, query: {from: $senderAddress, to: $receiverAddress}) {\n from\n to\n amount\n memo\n hash\n dateTime\n block {\n commandTransactionCount\n blockHeight\n }\n nonce\n fee\n }\n}",schema:"standard"},variables:{senderAddress:{default:{berkeley:"B62qqhjvvE3dwiX2hF2cZRfmHA7euo8MrzvZhPHgXJNb57vuiWePAWC"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},receiverAddress:{default:{berkeley:"B62qkFUnG64NjiRoghwpdFmVGm6fiZiSxiyphmV2juXFypLivqV35S3"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:2},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},expect:{key:"transactions",type:"array"}},transactionByHash:{description:"Retrieve transaction data using a given transaction hash.",input:{query:{cmd:"query q($hash: String!) {\n transaction(query: {hash: $hash}) {\n hash\n dateTime\n blockHeight\n from\n nonce\n to\n toAccount {\n token\n }\n }\n}",schema:"standard"},variables:{hash:{default:{berkeley:"5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1"},description:"Set the transaction hash string.",validation:"regexs__transactionHash",required:!0}}},expect:{key:"transaction",type:"hash"}},latestBlockHeight:{description:"Retrieve the most recent block height from the selected blockchain.",input:{query:{cmd:"query q($blockHeight_lt: Int) {\n block(query: {blockHeight_lt: $blockHeight_lt}) {\n blockHeight\n dateTime\n }\n}",schema:"standard"},variables:{blockHeight_lt:{default:{berkeley:999999999},description:"Set the highest block height.",validation:"regexs__blockHeight_lt",required:!1}}},expect:{key:"block",type:"hash"}},latestBlockHeights:{description:"Retrieve the most recent block height from the selected blockchain.",input:{query:{cmd:"query q($limit: Int) {\n blocks(limit: $limit, sortBy: BLOCKHEIGHT_DESC) {\n blockHeight\n protocolState {\n consensusState {\n slotSinceGenesis\n slot\n }\n }\n dateTime\n receivedTime\n }\n}",schema:"standard"},variables:{limit:{default:{berkeley:10},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1}}},expect:{key:"blocks",type:"array"}},transactionsFromMemo:{description:"Retrieve transaction which memoHash has not a certain value, can be useful to find not empty memo fields.",input:{query:{cmd:"query g($memoHash: [String], $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, query: {memo_nin: $memoHash}, sortBy: $sortBy) {\n memo\n hash\n dateTime\n receiver {\n publicKey\n }\n from\n }\n}",schema:"standard"},variables:{memoHash:{default:{berkeley:"E4Yd67s51QN9DZVDy8JKPEoNGykMsYQ5KRiKpZHiLZTjA8dB9SnFT"},description:"Expects an encoded base58 string.",validation:"regexs__memoHash",required:!0},limit:{default:{berkeley:3},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},expect:{key:"transactions",type:"array"}},eventFromTransactionHash:{description:"Retreive the event which is attached to an transaction",input:{query:{cmd:"query q($hash: String!) {\n event(query: {zkAppCommandHash: {hash: $hash}}) {\n dateTime\n blockHeight\n event\n zkAppCommandHash {\n zkappCommand {\n accountUpdates {\n body {\n publicKey\n }\n }\n memo\n feePayer {\n body {\n publicKey\n }\n }\n }\n hash\n }\n }\n}",schema:"standard"},variables:{hash:{default:{berkeley:"5JvLQnkBhcqNNsCi3fVgKdbmYkhykZvE1GZNGixUPngjq3vHyMmf"},description:"Set the transaction hash string.",validation:"regexs__transactionHash",required:!0}}},expect:{key:"event",type:"hash"}},eventsFromContract:{description:"Retrieve the latest events from a Mina contract.",input:{query:{cmd:"query q($limit: Int!, $blockHeight_lt: Int!, $creator: String!) {\n events(query: {blockHeight_lt: $blockHeight_lt, blockStateHash: {creator: $creator}}, sortBy: BLOCKHEIGHT_DESC, limit: $limit) {\n blockHeight\n dateTime\n event\n blockStateHash {\n creatorAccount {\n publicKey\n }\n }\n }\n}",schema:"standard"},variables:{creator:{default:{berkeley:"B62qnLVz8wM7MfJsuYbjFf4UWbwrUBEL5ZdawExxxFhnGXB6siqokyM"},description:"Set the creator's address as the minimum address.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:10},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},blockHeight_lt:{default:{berkeley:999999999},description:"highest block",validation:"regexs__blockHeight_lt",required:!1}}},expect:{key:"events",type:"array"}}},regexs:{transactionHash:{regex:/^[a-zA-Z0-9]{52}$/,description:"Allowed is only a string consisting of 52 alphanumeric characters, including both letters and numbers.",post:"string"},memoString:{regex:"",desciption:"",post:"string"},memoHash:{regex:/^E4[1-9A-HJ-NP-Za-km-z]{51}$/,description:'Allowed are only strings that start with "E4" followed by exactly 51 characters from the base58 set, which excludes the numbers 0, and the letters O, I, and l.',post:"string"},blockHeight_lt:{regex:/^(0|[1-9]\d{0,8})$/,description:"Allowed is only a non-negative integer up to 9 digits long, not starting with any zeros unless it is the number zero itself.",post:"number"},limit:{regex:/[0-9]{0,2}/,description:"Allowed is only a number up to two digits long, which can be any value from 0 to 99.",post:"number"},minaPublicKey:{regex:/^B62[1-9A-HJ-NP-Za-km-z]{0,}$/,description:"Allowed is only a string that starts with 'B62' followed by a sequence of base58 characters, with no specified maximum length.",post:"string"},blockHeightSorting:{regex:/^(BLOCKHEIGHT_DESC|BLOCKHEIGHT_ASC)$/,description:"Allowed is only the specific text 'BLOCKHEIGHT_DESC' or 'BLOCKHEIGHT_ASC', representing sorting directions for block height.",post:"string"}}};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){var t=e.messages,r=void 0===t?[]:t,i=e.comments;return[[void 0===i?[]:i,"Comment",!1],[r,"Error",!0]].forEach((function(e,t){var r,i,o=(i=3,function(e){if(Array.isArray(e))return e}(r=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(r,i)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(r,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],s=o[1],c=o[2];a.forEach((function(e,t,r){0===t&&console.log("\n".concat(s).concat(r.length>1?"s":"",":")),console.log(" - ".concat(e)),r.length-1===t&&!0===c&&process.exit(1)}))})),!0}var o={event:{singleFetch:"status",subgroup:"subgroup"},render:{frameInterval:1e3,delayBetweenRequests:1e4,singleMaxInSeconds:30},network:{berkeley:{explorer:{transaction:"https://berkeley.minaexplorer.com/transaction/",wallet:"https://berkeley.minaexplorer.com/wallet/"},graphQl:{proxy:["https://proxy.berkeley.minaexplorer.com/"],standard:["https://berkeley.graphql.minaexplorer.com"]}}}};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(){s=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),s=new A(n||[]);return i(a,"_invoke",{value:H(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var f="suspendedStart",y="suspendedYield",b="executing",m="completed",v={};function g(){}function w(){}function k(){}var x={};h(x,c,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(T([])));E&&E!==r&&n.call(E,c)&&(x=E);var _=k.prototype=g.prototype=Object.create(x);function j(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function q(e,t){function r(i,o,s,c){var u=p(e[i],e,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==a(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function H(t,r,n){var i=f;return function(o,a){if(i===b)throw new Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=O(s,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=b;var u=p(t,r,n);if("normal"===u.type){if(i=n.done?m:y,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=m,n.method="throw",n.arg=u.arg)}}}function O(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function T(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(a(t)+" is not iterable")}return w.prototype=k,i(_,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:w,configurable:!0}),w.displayName=h(k,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,h(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},j(q.prototype),h(q.prototype,u,(function(){return this})),t.AsyncIterator=q,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new q(d(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},j(_),h(_,l,"Generator"),h(_,c,(function(){return this})),h(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=T,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(B),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function c(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==a(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===a(i)?i:String(i)),n)}var i}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return y(e,arguments,v(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),m(r,e)},f(e)}function y(e,t,r){return y=b()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&m(i,r.prototype),i},y.apply(null,arguments)}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t){k(e,t),t.add(e)}function w(e,t,r){k(e,t),t.set(e,r)}function k(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function x(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,_(e,t,"get"))}function S(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function E(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,_(e,t,"set"),r),r}function _(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var j=new WeakMap,q=new WeakMap,H=new WeakMap,O=new WeakMap,P=new WeakSet,B=new WeakSet,A=new WeakSet,T=new WeakSet,L=new WeakSet,$=new WeakSet,I=new WeakSet,C=new WeakSet,K=new WeakSet,G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(G,f(EventTarget));var t,n,l,h,y,k,_=(y=G,k=b(),function(){var e,t=v(y);if(k){var r=v(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}(this,e)});function G(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,G),g(p(e=_.call(this)),K),g(p(e),C),g(p(e),I),g(p(e),$),g(p(e),L),g(p(e),T),g(p(e),A),g(p(e),B),g(p(e),P),w(p(e),j,{writable:!0,value:void 0}),w(p(e),q,{writable:!0,value:void 0}),w(p(e),H,{writable:!0,value:void 0}),w(p(e),O,{writable:!0,value:void 0}),E(p(e),q,t),E(p(e),j,o),e}return t=G,n=[{key:"init",value:function(e){var t=e.network,n=u(S(this,T,M).call(this,{network:t}),2);return i({messages:n[0],comments:n[1]}),E(this,H,{environment:!0,nonce:0,subgroups:{},network:t}),S(this,B,F).call(this,{presets:r}),this}},{key:"getPresets",value:function(){return Object.keys(x(this,O))}},{key:"getPreset",value:function(e){var t=e.key,r=u(S(this,L,N).call(this,{key:t}),2);return i({messages:r[0],comments:r[1]}),x(this,O)[t]}},{key:"getData",value:(l=s().mark((function e(t){var r,n,o,a,c,l,h,d,p,f,y,b,m,v,g,w,k,E;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.preset,n=t.userVars,o=t.subgroup,a="".concat(a=void 0===o?"default":o),c=this.validateGetData({preset:r,userVars:n}),l=u(c,2),h=l[0],d=l[1],i({messages:h,comments:d}),p=x(this,H).nonce,x(this,H).nonce++,Object.hasOwn(x(this,H).subgroups,a)||(x(this,H).subgroups[a]={time:performance.now(),ids:{}},S(this,C,Z).call(this,{subgroup:a,status:"started",data:null})),x(this,H).subgroups[a].ids[p]=-1,f=S(this,A,R).call(this,{preset:r,userVars:n}),S(this,K,z).call(this,{eventId:p,preset:r,status:"started",subgroup:a,data:null}),y=null,e.prev=11,b=performance.now(),e.next=15,fetch(f.fetch.url,{method:f.fetch.method,headers:f.fetch.headers,body:f.fetch.data});case 15:return m=e.sent,e.next=18,m.json();case 18:y=e.sent,v=performance.now(),g=v-b,S(this,K,z).call(this,{eventId:p,preset:r,status:"success (".concat(Math.floor(g)," ms)"),subgroup:a,data:JSON.stringify(y)}),x(this,H).subgroups[a].ids[p]=1,e.next=30;break;case 25:e.prev=25,e.t0=e.catch(11),console.log("Following error occured: ".concat(e.t0)),S(this,K,z).call(this,{eventId:p,preset:r,status:"failed!",subgroup:a,data:null}),x(this,H).subgroups[a].ids[p]=0;case 30:return Object.entries(x(this,H).subgroups[a].ids).every((function(e){var t=u(e,2);return t[0],-1!==t[1]}))?(w=Object.entries(x(this,H).subgroups[a].ids).every((function(e){var t=u(e,2);return t[0],1===t[1]})),k=performance.now(),E=Math.floor(k-x(this,H).subgroups[a].time),S(this,C,Z).call(this,{subgroup:a,status:w?"success! (".concat(E," ms)"):"failed!",data:JSON.stringify(x(this,H).subgroups[a].ids)})):console.log("outsude"),e.abrupt("return",[p,y]);case 33:case"end":return e.stop()}}),e,this,[[11,25]])})),h=function(){var e=this,t=arguments;return new Promise((function(r,n){var i=l.apply(e,t);function o(e){c(i,r,n,o,a,"next",e)}function a(e){c(i,r,n,o,a,"throw",e)}o(void 0)}))},function(e){return h.apply(this,arguments)})}],n&&d(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),G}();function F(e){var t=e.presets,r=u(S(this,I,V).call(this,{presets:t}),2);return i({messages:r[0],comments:r[1]}),E(this,O,Object.entries(t.presets).reduce((function(e,r,n){var i=u(r,2),o=i[0],a=i[1];return e[o]=a,e[o].input.variables=Object.entries(e[o].input.variables).reduce((function(e,r,n){var i=u(r,2),o=i[0],a=i[1];return e[o]=a,e[o].validation=function(e){var t=e.data,r=e.keyPath,n=e.separator,i=void 0===n?"__":n;if("string"==typeof r)return r.split(i).reduce((function(e,t,r){if(e&&e.hasOwnProperty(t))return e[t]}),t);console.log("KeyPath: ".concat(r,' is not a "string".'))}({data:t,keyPath:e[o].validation}),e}),{}),e}),{})),!0}function R(e){var t=this,r=e.preset,n=e.userVars;x(this,q)&&console.log("");var i=this.getPreset({key:r}),o=i.input.query.schema,a=x(this,H).network,s=x(this,j).network[a].graphQl[o][0],c={};return c.query=x(this,O)[r].input.query.cmd,c.variables=Object.entries(i.input.variables).reduce((function(e,i,o){var s=u(i,2),c=s[0],l=(s[1],x(t,O)[r].input.variables[c]);if(Object.hasOwn(n,c))switch(l.validation.post){case"string":e[c]="".concat(n[c]);break;case"number":e[c]=parseInt(n[c]);break;default:console.log("Something went wrong.")}else e[c]=l.default[a];return e}),{}),{fetch:{method:"post",maxBodyLength:1/0,url:s,headers:{"Content-Type":"application/json",Accept:"application/json"},data:JSON.stringify(c)}}}function M(e){var t=e.network,r=[];return Object.keys(x(this,j).network).includes(t)||r.push('Network "'.concat(t,'" does not exist.')),[r,[]]}function N(e){var t=e.key,r=[],n=this.getPresets();return n.includes(t)||r.push('Key "key" with value "'.concat(t,'" not a valid preset key. Use ').concat(n.join(", ")," instead.")),[r,[]]}function W(e){var t=this,r=e.presetValue,n=e.presetKey,i=function(e){return e&&"object"===a(e)&&!Array.isArray(e)},o=function(e,t,r){return!!e.hasOwnProperty(t)&&a(e[t])===r},s=[];return i(r)?o(n,"description","string")||[[!o(r,"description","string"),'["'.concat(n,'"]["description"] should be type of string.')],[!o(r,"input","object"),'["'.concat(n,'"]["input"] should be type of object.')],[!o(r,"expect","object"),'["'.concat(n,'"]["expect"] should be type of object.')]].forEach((function(e){var t=u(e,2),r=t[0],n=t[1];return r?s.push(n):""})):s.push('["'.concat(n,'"] should be type of object.')),0===s.length&&[[!o(r.input,"query","object"),'["'.concat(n,'"]["input"]["query"] should be type of object.')],[!o(r.input,"variables","object"),'["'.concat(n,'"]["input"]["variables"] should be type of object.')]].forEach((function(e){var t=u(e,2),r=t[0],n=t[1];return r?s.push(n):""})),0===s.length&&["cmd","schema"].forEach((function(e){if("string"!=typeof r.input.query[e]&&s.push('["'.concat(n,'"]["input"]["query"]["').concat(e,'"] is not type of string.')),"schema"===e){var i=Object.keys(x(t,j).network[x(t,H).network].graphQl);i.includes(r.input.query[e])||s.push('["'.concat(n,'"]["input"]["query"]["').concat(e,'"] value is not accepted. Use ').concat(i.join(", ")," instead."))}})),0===s.length&&Object.entries(r.input.variables).forEach((function(e){var t=u(e,2),r=t[0],a=t[1];i(a)?[[!o(a,"description","string"),'["'.concat(n,'"]["input"]["variables"]["').concat(r,'"]["description"] should be type of string.')],[!o(a,"validation","string"),'["'.concat(n,'"]["input"]["variables"]["').concat(r,'"]["regex"] should be type of string.')],[!o(a,"required","boolean"),'["'.concat(n,'"]["input"]["variables"]["').concat(r,'"]["required"] should be type of boolean.')]].forEach((function(e){var t=u(e,2),r=t[0],n=t[1];return r?s.push(n):""})):s.push('["'.concat(n,'"]["input"]["variables"]["').concat(r,'"] should be type of object.'))})),0===s.length&&[[!o(r.expect,"key","string"),'["'.concat(n,'"]["expect"]["key"] should be type of string.')],[!o(r.expect,"type","string"),'["'.concat(n,'"]["expect"]["type"] should be type of string.')]].forEach((function(e){var t=u(e,2),r=t[0],n=t[1];return r?s.push(n):""})),[s,[]]}function V(e){var t,r=this,n=e.presets,i=function(e,t,r){return!!e.hasOwnProperty(t)&&a(e[t])===r},o=[],s=[];if(!(t=n)||"object"!==a(t)||Array.isArray(t))o.push("Presets should be an object");else if(i(n,"presets","object"))if(i(n,"regexs","object")){var c=Object.entries(n.presets).reduce((function(e,t,n){var i=u(t,2),o=i[0],a=i[1],s=u(S(r,$,W).call(r,{presetValue:a,presetKey:o}),2);return[s[0],s[1]].forEach((function(t,r){var n,i;t.length>0&&(n=e[r]).push.apply(n,function(e){if(Array.isArray(e))return h(e)}(i=t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||l(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())})),e}),[o,s]),d=u(c,2);o=d[0],s=d[1]}else o.push('Key "regex" is not type object');else o.push('Key "presets" is not type object');return[o,s]}function Z(e){var t=e.subgroup,r=e.status,n=e.data,i=new CustomEvent(x(this,j).event.subgroup,{detail:{subgroup:t,status:r,data:n}});return this.dispatchEvent(i),!0}function z(e){var t=e.eventId,r=e.preset,n=e.status,i=e.subgroup,o=e.data,a=new CustomEvent(x(this,j).event.singleFetch,{detail:{eventId:t,preset:r,subgroup:i,status:n,data:o}});return this.dispatchEvent(a),!0}var D=t.O;export{D as MinaData}; | ||
var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{O:()=>$});var r={presets:{accountBalance:{description:"Retrieve current balance of given account.",input:{query:{cmd:"query q($publicKey: PublicKey!) {\naccount(publicKey: $publicKey) {\nbalance {\nblockHeight\ntotal\nstateHash\n}nonce\n}}",schema:"proxy"},variables:{publicKey:{default:{berkeley:"B62qnEdPB1V5YPEcGaETb19naLJV6sWdveCZEjSLhcVyrPcPWHkGGax"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0}}},output:{key:"account",type:"hash"}},transactionsFromSender:{description:"Retrieve transactions which was sended by given address",input:{query:{cmd:"query q($senderAddress: String!, $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, sortBy: $sortBy, query: {from: $senderAddress}) {\n from\n to\n amount\n memo\n hash\n dateTime\n block {\n commandTransactionCount\n blockHeight\n }\n nonce\n fee\n }\n}",schema:"standard"},variables:{senderAddress:{default:{berkeley:"B62qnEdPB1V5YPEcGaETb19naLJV6sWdveCZEjSLhcVyrPcPWHkGGax"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:2},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},output:{key:"transactions",type:"array"}},transactionsFromReceiver:{description:"Retrieve ",input:{query:{cmd:"query q($receiverAddress: String!, $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, sortBy: $sortBy, query: {receiver: {publicKey: $receiverAddress}}) {\n from\n to\n amount\n memo\n hash\n dateTime\n block {\n commandTransactionCount\n blockHeight\n }\n nonce\n }\n}",schema:"standard"},variables:{receiverAddress:{default:{berkeley:"B62qqhjvvE3dwiX2hF2cZRfmHA7euo8MrzvZhPHgXJNb57vuiWePAWC"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:2},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},output:{key:"transactions",type:"array"}},transactionsSenderToReceiver:{description:"Retrieve transactions which took place between 2 given addresses",input:{query:{cmd:"query q($senderAddress: String!, $receiverAddress: String!, $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, sortBy: $sortBy, query: {from: $senderAddress, to: $receiverAddress}) {\n from\n to\n amount\n memo\n hash\n dateTime\n block {\n commandTransactionCount\n blockHeight\n }\n nonce\n fee\n }\n}",schema:"standard"},variables:{senderAddress:{default:{berkeley:"B62qqhjvvE3dwiX2hF2cZRfmHA7euo8MrzvZhPHgXJNb57vuiWePAWC"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},receiverAddress:{default:{berkeley:"B62qkFUnG64NjiRoghwpdFmVGm6fiZiSxiyphmV2juXFypLivqV35S3"},description:"Set the mina address public key.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:2},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},output:{key:"transactions",type:"array"}},transactionByHash:{description:"Retrieve transaction data using a given transaction hash.",input:{query:{cmd:"query q($hash: String!) {\n transaction(query: {hash: $hash}) {\n hash\n dateTime\n blockHeight\n from\n nonce\n to\n toAccount {\n token\n }\n }\n}",schema:"standard"},variables:{hash:{default:{berkeley:"5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1"},description:"Set the transaction hash string.",validation:"regexs__transactionHash",required:!0}}},output:{key:"transaction",type:"hash"}},latestBlockHeight:{description:"Retrieve the most recent block height from the selected blockchain.",input:{query:{cmd:"query q($blockHeight_lt: Int) {\n block(query: {blockHeight_lt: $blockHeight_lt}) {\n blockHeight\n dateTime\n }\n}",schema:"standard"},variables:{blockHeight_lt:{default:{berkeley:999999999},description:"Set the highest block height.",validation:"regexs__blockHeight_lt",required:!1}}},output:{key:"block",type:"hash"}},latestBlockHeights:{description:"Retrieve the most recent block height from the selected blockchain.",input:{query:{cmd:"query q($limit: Int) {\n blocks(limit: $limit, sortBy: BLOCKHEIGHT_DESC) {\n blockHeight\n protocolState {\n consensusState {\n slotSinceGenesis\n slot\n }\n }\n dateTime\n receivedTime\n }\n}",schema:"standard"},variables:{limit:{default:{berkeley:10},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1}}},output:{key:"blocks",type:"array"}},transactionsFromMemo:{description:"Retrieve transaction which memoHash has not a certain value, can be useful to find not empty memo fields.",input:{query:{cmd:"query g($memoHash: [String], $limit: Int!, $sortBy: TransactionSortByInput!) {\n transactions(limit: $limit, query: {memo_nin: $memoHash}, sortBy: $sortBy) {\n memo\n hash\n dateTime\n receiver {\n publicKey\n }\n from\n }\n}",schema:"standard"},variables:{memoHash:{default:{berkeley:"E4Yd67s51QN9DZVDy8JKPEoNGykMsYQ5KRiKpZHiLZTjA8dB9SnFT"},description:"Expects an encoded base58 string.",validation:"regexs__memoHash",required:!0},limit:{default:{berkeley:3},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},sortBy:{default:{berkeley:"BLOCKHEIGHT_DESC"},description:"Set the sorting type between ascending and descending.",validation:"regexs__blockHeightSorting",required:!1}}},output:{key:"transactions",type:"array"}},eventFromTransactionHash:{description:"Retreive the event which is attached to an transaction",input:{query:{cmd:"query q($hash: String!) {\n event(query: {zkAppCommandHash: {hash: $hash}}) {\n dateTime\n blockHeight\n event\n zkAppCommandHash {\n zkappCommand {\n accountUpdates {\n body {\n publicKey\n }\n }\n memo\n feePayer {\n body {\n publicKey\n }\n }\n }\n hash\n }\n }\n}",schema:"standard"},variables:{hash:{default:{berkeley:"5JvLQnkBhcqNNsCi3fVgKdbmYkhykZvE1GZNGixUPngjq3vHyMmf"},description:"Set the transaction hash string.",validation:"regexs__transactionHash",required:!0}}},output:{key:"event",type:"hash"}},eventsFromContract:{description:"Retrieve the latest events from a Mina contract.",input:{query:{cmd:"query q($limit: Int!, $blockHeight_lt: Int!, $creator: String!) {\n events(query: {blockHeight_lt: $blockHeight_lt, blockStateHash: {creator: $creator}}, sortBy: BLOCKHEIGHT_DESC, limit: $limit) {\n blockHeight\n dateTime\n event\n blockStateHash {\n creatorAccount {\n publicKey\n }\n }\n }\n}",schema:"standard"},variables:{creator:{default:{berkeley:"B62qnLVz8wM7MfJsuYbjFf4UWbwrUBEL5ZdawExxxFhnGXB6siqokyM"},description:"Set the creator's address as the minimum address.",validation:"regexs__minaPublicKey",required:!0},limit:{default:{berkeley:10},description:"Set a limit on how many results will be shown.",validation:"regexs__limit",required:!1},blockHeight_lt:{default:{berkeley:999999999},description:"highest block",validation:"regexs__blockHeight_lt",required:!1}}},output:{key:"events",type:"array"}}},regexs:{transactionHash:{regex:/^[a-zA-Z0-9]{52}$/,description:"Allowed is only a string consisting of 52 alphanumeric characters, including both letters and numbers.",post:"string"},memoString:{regex:"",desciption:"",post:"string"},memoHash:{regex:/^E4[1-9A-HJ-NP-Za-km-z]{51}$/,description:'Allowed are only strings that start with "E4" followed by exactly 51 characters from the base58 set, which excludes the numbers 0, and the letters O, I, and l.',post:"string"},blockHeight_lt:{regex:/^(0|[1-9]\d{0,8})$/,description:"Allowed is only a non-negative integer up to 9 digits long, not starting with any zeros unless it is the number zero itself.",post:"integer"},limit:{regex:/[0-9]{0,2}/,description:"Allowed is only a number up to two digits long, which can be any value from 0 to 99.",post:"integer"},minaPublicKey:{regex:/^B62[1-9A-HJ-NP-Za-km-z]{52}$/,description:"Allowed is only a string that starts with 'B62' followed by a sequence of base58 characters, with no specified maximum length.",post:"string"},blockHeightSorting:{regex:/^(BLOCKHEIGHT_DESC|BLOCKHEIGHT_ASC)$/,description:"Allowed is only the specific text 'BLOCKHEIGHT_DESC' or 'BLOCKHEIGHT_ASC', representing sorting directions for block height.",post:"string"}}};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){var t=e.messages,r=void 0===t?[]:t,i=e.comments;return[[void 0===i?[]:i,"Comment",!1],[r,"Error",!0]].forEach((function(e,t){var r,i,o=(i=3,function(e){if(Array.isArray(e))return e}(r=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(r,i)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(r,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],s=o[1],c=o[2];a.forEach((function(e,t,r){0===t&&console.log("\n".concat(s).concat(r.length>1?"s":"",":")),console.log(" - ".concat(e)),r.length-1===t&&!0===c&&process.exit(1)}))})),!0}var o={event:{singleFetch:"status",subgroup:"subgroup"},render:{frameInterval:1e3,delayBetweenRequests:1e4,singleMaxInSeconds:30},network:{default:"berkeley",berkeley:{explorer:{transaction:"https://berkeley.minaexplorer.com/transaction/",wallet:"https://berkeley.minaexplorer.com/wallet/"},graphQl:{proxy:["https://proxy.berkeley.minaexplorer.com/"],standard:["https://berkeley.graphql.minaexplorer.com"]}}}};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(){c=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),s=new T(n||[]);return i(a,"_invoke",{value:H(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var y="suspendedStart",f="suspendedYield",m="executing",v="completed",b={};function g(){}function w(){}function k(){}var x={};h(x,s,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(B([])));j&&j!==r&&n.call(j,s)&&(x=j);var q=k.prototype=g.prototype=Object.create(x);function E(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(i,o,s,c){var u=p(e[i],e,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==a(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return o=o?o.then(i,i):i()}})}function H(t,r,n){var i=y;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=O(s,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var u=p(t,r,n);if("normal"===u.type){if(i=n.done?v:f,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}function O(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function B(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(a(t)+" is not iterable")}return w.prototype=k,i(q,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:w,configurable:!0}),w.displayName=h(k,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,h(e,l,"GeneratorFunction")),e.prototype=Object.create(q),e},t.awrap=function(e){return{__await:e}},E(_.prototype),h(_.prototype,u,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new _(d(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(q),h(q,l,"Generator"),h(q,s,(function(){return this})),h(q,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=B,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:B(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function u(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function y(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:String(t)}function f(e,t){v(e,t),t.add(e)}function m(e,t,r){v(e,t),t.set(e,r)}function v(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function b(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,k(e,t,"get"))}function g(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}function w(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,k(e,t,"set"),r),r}function k(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}var x=new WeakMap,S=new WeakMap,j=new WeakMap,q=new WeakMap,E=new WeakMap,_=new WeakSet,H=new WeakSet,O=new WeakSet,A=new WeakSet,P=new WeakSet,T=new WeakSet,B=new WeakSet,L=new WeakSet,$=function(){function e(t){var r=t.debug,n=void 0===r||r,i=t.networkName,a=t.graphQl;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,L),f(this,B),f(this,T),f(this,P),f(this,A),f(this,O),f(this,H),f(this,_),m(this,x,{writable:!0,value:void 0}),m(this,S,{writable:!0,value:void 0}),m(this,j,{writable:!0,value:void 0}),m(this,q,{writable:!0,value:void 0}),m(this,E,{writable:!0,value:void 0}),w(this,S,n),w(this,x,o),g(this,_,K).call(this,{networkName:i,graphQl:a}),!0}var t,r,n,h;return t=e,r=[{key:"getPresets",value:function(){return Object.keys(b(this,q))}},{key:"getPreset",value:function(e){var t=e.key,r=l(g(this,T,W).call(this,{key:t}),2);return i({messages:r[0],comments:r[1]}),b(this,q)[t]}},{key:"getData",value:(n=c().mark((function e(t){var r,n,o,a,s,u,h,d,p,y,f,m,v,w,k,x,S;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.preset,n=t.userVars,o=t.subgroup,a="".concat(a=void 0===o?"default":o),s=performance.now(),u=this.validateGetData({preset:r,userVars:n}),h=l(u,2),d=h[0],p=h[1],i({messages:d,comments:p}),y=b(this,j).nonce,b(this,j).nonce++,Object.hasOwn(b(this,j).subgroups,a)||(b(this,j).subgroups[a]={startTime:s,ids:{}}),b(this,j).subgroups[a].ids[y]=-1,f={data:null,status:{code:null,text:null}},e.prev=10,m=g(this,A,G).call(this,{preset:r,userVars:n}),e.next=14,fetch(m.fetch.url,{method:m.fetch.method,headers:m.fetch.headers,body:m.fetch.data});case 14:return v=e.sent,e.next=17,v.json();case 17:w=e.sent,k=g(this,H,C).call(this,{data:w.data,preset:r}),x=l(k,2),S=x[0],x[1],f.data=w.data,b(this,j).subgroups[a].ids[y]=1,0===S.length?(f.status.code=200,f.status.text="Success (".concat(Math.floor(performance.now()-s)," ms)!")):(f.status.code=404,f.status.text="Data not found (".concat(Math.floor(performance.now()-s)," ms)!")),e.next=29;break;case 24:e.prev=24,e.t0=e.catch(10),console.log("Following error occured: ".concat(e.t0)),f.status.code=400,f.status.text="Error (".concat(Math.floor(performance.now()-s)," ms): ").concat(e.t0);case 29:return e.abrupt("return",f);case 30:case"end":return e.stop()}}),e,this,[[10,24]])})),h=function(){var e=this,t=arguments;return new Promise((function(r,i){var o=n.apply(e,t);function a(e){u(o,r,i,a,s,"next",e)}function s(e){u(o,r,i,a,s,"throw",e)}a(void 0)}))},function(e){return h.apply(this,arguments)})},{key:"validateGetData",value:function(e){var t=this,r=e.preset,n=e.userVars,i=[],o=[],c=l(g(this,T,W).call(this,{key:r}),2),u=c[0],h=c[1];if(i.push.apply(i,s(u)),o.push.apply(o,s(h)),0===i.length){var d=this.getPreset({key:r}).input.query.schema;Object.hasOwn(b(this,E).graphQl,d)?0===b(this,E).graphQl[d].length&&i.push("Preset is for network '".concat(b(this,j).networkName,"' not available.")):i.push("Preset '".concat(r,"' GraphQl type of '").concat(d,"' not known.")),(null===n||"object"!==a(n)||Array.isArray(n))&&i.push("Key 'userVars' is not type object.")}if(0===i.length){var p=Object.entries(b(this,q)[r].input.variables).reduce((function(e,t,r){var n=l(t,2),i=n[0];return n[1].required?e.required.push(i):e.default.push(i),e.all.push(i),e}),{required:[],default:[],all:[]});Object.keys(n).map((function(e){!p.all.includes(e)&&o.push("The key '".concat(e,"' is not known as valid input and will ignored."))})),p.default.forEach((function(e){if(Object.hasOwn(n,e)){if(!b(t,q)[r].input.variables[e].validation.regex.test(n[e])){var a=b(t,q)[r].input.variables[e].validation.description;i.push("The key '".concat(e,"' with the value '").concat(n[e]," is not valid. ").concat(a))}}else{var s=b(t,q)[r].input.variables[e].default[b(t,j).networkName];o.push("The key '".concat(e,"' is not set, will use default parameter '").concat(s,"' instead."))}})),p.required.forEach((function(e){if(Object.hasOwn(n,e)){if(!b(t,q)[r].input.variables[e].validation.regex.test(n[e])){var o=b(t,q)[r].input.variables[e].validation.description;i.push("The key '".concat(e,"' with the value '").concat(n[e],"' is not valid. ").concat(o))}}else i.push("The key '".concat(e,"' is missing."))}))}return[i,o,null]}}],r&&p(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function K(e){var t=e.networkName,n=e.graphQl,o=l(g(this,P,N).call(this,{networkName:t,graphQl:n}),2);return i({messages:o[0],comments:o[1]}),w(this,E,JSON.parse(JSON.stringify(b(this,x).network[t]))),void 0!==n&&(b(this,E).graphQl=n),w(this,j,{environment:!0,nonce:0,subgroups:{},networkName:t}),g(this,O,I).call(this,{presets:r}),this}function C(e){var t=e.preset,r=e.data,n=[],i=this.getPreset({key:t}),o=i.output.key;if(!Object.hasOwn(r,o))return n.push('Response does not include "'.concat(o,'" as a key.')),n;var s=i.output.type;switch(s){case"hash":("object"!==a(r[o])||Array.isArray(r[o]))&&n.push('Response does not include expected type of "'.concat(s,'"'));break;case"array":Array.isArray(r[o])||n.push('Response does not include expected type of "'.concat(s,'"'))}return[n,[]]}function I(e){var t=e.presets,r=l(g(this,L,Q).call(this,{presets:t}),2);return i({messages:r[0],comments:r[1]}),w(this,q,Object.entries(t.presets).reduce((function(e,r,n){var i=l(r,2),o=i[0],a=i[1];return e[o]=a,e[o].input.variables=Object.entries(e[o].input.variables).reduce((function(e,r,n){var i=l(r,2),o=i[0],a=i[1];return e[o]=a,e[o].validation=function(e){var t=e.data,r=e.keyPath,n=e.separator,i=void 0===n?"__":n;if("string"==typeof r)return r.split(i).reduce((function(e,t,r){if(e&&e.hasOwnProperty(t))return e[t]}),t);console.log("KeyPath: ".concat(r,' is not a "string".'))}({data:t,keyPath:e[o].validation}),e}),{}),e}),{})),!0}function G(e){var t=this,r=e.preset,n=e.userVars;b(this,S)&&console.log("");var i=this.getPreset({key:r}),o=i.input.query.schema,a=b(this,j).networkName,s=b(this,E).graphQl[o][0],c={};return c.query=b(this,q)[r].input.query.cmd,c.variables=Object.entries(i.input.variables).reduce((function(e,i,o){var s=l(i,2),c=s[0],u=(s[1],b(t,q)[r].input.variables[c]);if(Object.hasOwn(n,c))switch(u.validation.post){case"string":e[c]="".concat(n[c]);break;case"integer":e[c]=parseInt(n[c]);break;default:console.log("Something went wrong.")}else e[c]=u.default[a];return e}),{}),{fetch:{method:"post",maxBodyLength:1/0,url:s,headers:{"Content-Type":"application/json",Accept:"application/json"},data:JSON.stringify(c)}}}function N(e){var t=e.networkName,r=e.graphQl,n=[],i=Object.keys(b(this,x).network);return void 0===t?n.push("Key 'networkName' is type of 'undefined'."):"string"!=typeof t?n.push("Key 'networkName' is not type of 'string'."):i.includes(t)||n.push("Key 'networkName' with the value '".concat(t,"' in not valid. Choose from ").concat(i.map((function(e){return"'".concat(e,"'")})).join(", ")," instead.")),void 0===r||(r.constructor!==Object?n.push("Key 'graphQl' with the value '".concat(r,"' is not type of 'object'.")):Object.keys(r).includes("proxy")&&Object.keys(r).includes("standard")?Array.isArray(r.proxy)&&Array.isArray(r.standard)?0===r.proxy.length||0===!r.standard.length?n.push("Key 'graphQl' with the keys 'standard' and 'proxy' is empty."):r.proxy.map((function(e){return"string"==typeof e})).every((function(e){return e}))&&r.standard.map((function(e){return"string"==typeof e})).every((function(e){return e}))?r.proxy.map((function(e){return e.startsWith("https://")})).every((function(e){return e}))&&r.standard.map((function(e){return e.startsWith("https://")})).every((function(e){return e}))||n.push("Key 'graphQl' with the keys 'standard' and 'proxy' are not type of 'array of url strings'."):n.push("Key 'graphQl' with the keys 'standard' and 'proxy' are not type of 'array of strings'."):n.push("Key 'graphQl' with the keys 'standard' and 'proxy' are not type of array."):n.push("Key 'graphQl' with the keys ".concat(Object.keys(r).map((function(e){return"'".concat(e,"'")})).join(", ")," missing 'standard' and/or 'proxy'."))),[n,[]]}function W(e){var t=e.key,r=[],n=this.getPresets();return n.includes(t)||r.push('Key "key/preset" with value "'.concat(t,'" not a valid preset key. Use ').concat(n.join(", ")," instead.")),[r,[]]}function M(e){var t=this,r=e.presetValue,n=e.presetKey,i=function(e){return e&&"object"===a(e)&&!Array.isArray(e)},o=function(e,t,r){return!!e.hasOwnProperty(t)&&a(e[t])===r},s=[];return i(r)?o(n,"description","string")||[[!o(r,"description","string"),'["'.concat(n,'"]["description"] should be type of string.')],[!o(r,"input","object"),'["'.concat(n,'"]["input"] should be type of object.')],[!o(r,"output","object"),'["'.concat(n,'"]["expect"] should be type of object.')]].forEach((function(e){var t=l(e,2),r=t[0],n=t[1];return r?s.push(n):""})):s.push('["'.concat(n,'"] should be type of object.')),0===s.length&&[[!o(r.input,"query","object"),'["'.concat(n,'"]["input"]["query"] should be type of object.')],[!o(r.input,"variables","object"),'["'.concat(n,'"]["input"]["variables"] should be type of object.')]].forEach((function(e){var t=l(e,2),r=t[0],n=t[1];return r?s.push(n):""})),0===s.length&&["cmd","schema"].forEach((function(e){if("string"!=typeof r.input.query[e]&&s.push('["'.concat(n,'"]["input"]["query"]["').concat(e,'"] is not type of string.')),"schema"===e){var i=Object.keys(b(t,E).graphQl);i.includes(r.input.query[e])||s.push('["'.concat(n,'"]["input"]["query"]["').concat(e,'"] value is not accepted. Use ').concat(i.join(", ")," instead."))}})),0===s.length&&Object.entries(r.input.variables).forEach((function(e){var t=l(e,2),r=t[0],a=t[1];i(a)?[[!o(a,"description","string"),'["'.concat(n,'"]["input"]["variables"]["').concat(r,'"]["description"] should be type of string.')],[!o(a,"required","boolean"),'["'.concat(n,'"]["input"]["variables"]["').concat(r,'"]["required"] should be type of boolean.')]].forEach((function(e){var t=l(e,2),r=t[0],n=t[1];return r?s.push(n):""})):s.push('["'.concat(n,'"]["input"]["variables"]["').concat(r,'"] should be type of object.'))})),0===s.length&&[[!o(r.output,"key","string"),'["'.concat(n,'"]["expect"]["key"] should be type of string.')],[!o(r.output,"type","string"),'["'.concat(n,'"]["expect"]["type"] should be type of string.')]].forEach((function(e){var t=l(e,2),r=t[0],n=t[1];return r?s.push(n):""})),[s,[]]}function Q(e){var t,r=this,n=e.presets,i=function(e,t,r){return!!e.hasOwnProperty(t)&&a(e[t])===r},o=[],c=[];if(!(t=n)||"object"!==a(t)||Array.isArray(t))o.push("Presets should be an object");else if(i(n,"presets","object"))if(i(n,"regexs","object")){var u=Object.entries(n.presets).reduce((function(e,t,n){var i=l(t,2),o=i[0],a=i[1],c=l(g(r,B,M).call(r,{presetValue:a,presetKey:o}),2);return[c[0],c[1]].forEach((function(t,r){var n;t.length>0&&(n=e[r]).push.apply(n,s(t))})),e}),[o,c]),h=l(u,2);o=h[0],c=h[1]}else o.push('Key "regex" is not type object');else o.push('Key "presets" is not type object');return[o,c]}var V=t.O;export{V as MinaData}; |
{ | ||
"name": "minadata", | ||
"version": "0.0.94", | ||
"version": "1.0.0", | ||
"description": "MinaData simplifies the retrieval of transaction data on the Mina blockchain. In doing so, it directly fetches data through the native GraphQL interfaces of the Archive Node. MinaData aims to assist you in quickly launching user interfaces.", | ||
@@ -21,5 +21,3 @@ "main": "src/MinaData.mjs", | ||
}, | ||
"dependencies": { | ||
"node-fetch": "^3.3.2" | ||
} | ||
"dependencies": {} | ||
} |
@@ -22,7 +22,13 @@ ![CircleCI](https://img.shields.io/circleci/build/github/EasyMina/minaData/main) | ||
const minaData = new MinaData() | ||
minaData.init( { | ||
'network': 'berkeley' | ||
const minaData = new MinaData( { | ||
'networkName': 'berkeley' | ||
/* | ||
'graphQl': { | ||
'proxy': [ 'https://proxy.berkeley.minaexplorer.com/' ], | ||
'standard': [ 'https://berkeley.graphql.minaexplorer.com' ], | ||
} | ||
*/ | ||
} ) | ||
minaData.getData( { | ||
@@ -32,4 +38,3 @@ 'preset': 'transactionByHash', | ||
'hash': '5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1' | ||
}, | ||
'network': 'berkeley' | ||
} | ||
} ) | ||
@@ -82,4 +87,3 @@ ``` | ||
'creator': 'B62qnLVz8wM7MfJsuYbjFf4UWbwrUBEL5ZdawExxxFhnGXB6siqokyM' | ||
}, | ||
'network': 'berkeley' | ||
} | ||
}) | ||
@@ -105,4 +109,6 @@ ``` | ||
const minaData = new MinaData() | ||
minaData.init( {} ) | ||
const minaData = new MinaData( { | ||
'networkName': 'berkeley' | ||
} ) | ||
minaData | ||
@@ -113,4 +119,3 @@ .getData( { | ||
'hash': '5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1' | ||
}, | ||
'network': 'berkeley' | ||
} | ||
} ) | ||
@@ -129,3 +134,3 @@ .then( result => { | ||
``` | ||
npx webpack --config webpack.config.js | ||
npx webpack | ||
``` | ||
@@ -132,0 +137,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
2
134
121413
18
1212
- Removednode-fetch@^3.3.2
- Removeddata-uri-to-buffer@4.0.1(transitive)
- Removedfetch-blob@3.2.0(transitive)
- Removedformdata-polyfill@4.0.10(transitive)
- Removednode-domexception@1.0.0(transitive)
- Removednode-fetch@3.3.2(transitive)
- Removedweb-streams-polyfill@3.3.3(transitive)