-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrc__pages__Interface__RPC2.async.js
1 lines (1 loc) · 6.57 KB
/
src__pages__Interface__RPC2.async.js
1
(self.webpackChunk=self.webpackChunk||[]).push([[138],{586:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var r=n(15009),s=n.n(r),i=n(99289),o=n.n(i),p=n(5574),a=n.n(p),c=n(11774),d=n(38345),y=n(59530),u=n(18317),h=n.n(u),l=n(22804),g=(n(15807),n(51877),JSON.parse('{"swagger":"2.0","info":{"title":"RPC API for DFS Chain"},"paths":{"/v2/chain/get_account_rows":{"post":{"summary":"Returns an object containing rows from the account table.","description":"Returns an object containing rows from the account table.","tags":["chain"],"parameters":[{"name":"body","in":"body","schema":{"type":["object","string"],"properties":{"index_position":{"type":"string","description":"Position of the index used, accepted parameters `primary`, `secondary`, `tertiary`, `fourth`, `fifth`, `sixth`, `seventh`, `eighth`, `ninth` , `tenth`"},"key_type":{"type":"string","description":"Type of key specified by index_position (for example - `uint64_t` or `name`)"},"encode_type":{"type":"string"},"lower_bound":{"type":"string"},"upper_bound":{"type":"string"},"limit":{"type":"string"},"reverse":{"type":"string"},"time_limit_ms":{"type":"string"}},"required":["limit"]}}],"responses":{"200":{"description":"Default Response"}}}},"/v2/chain/get_table_rows":{"post":{"summary":"Returns an object containing rows from the specified table.","description":"Returns an object containing rows from the specified table.","tags":["chain"],"parameters":[{"name":"body","in":"body","schema":{"type":["object","string"],"properties":{"json":{"type":"string"},"code":{"type":"string","description":"The name of the smart contract that controls the provided table"},"table":{"type":"string","description":"The name of the table to query"},"scope":{"type":"string","description":"The account to which this data belongs"},"index_position":{"type":"string","description":"Position of the index used, accepted parameters `primary`, `secondary`, `tertiary`, `fourth`, `fifth`, `sixth`, `seventh`, `eighth`, `ninth` , `tenth`"},"key_type":{"type":"string","description":"Type of key specified by index_position (for example - `uint64_t` or `name`)"},"encode_type":{"type":"string"},"lower_bound":{"type":"string"},"primary_lower_bound":{"type":"string"},"upper_bound":{"type":"string"},"limit":{"type":"string"},"reverse":{"type":"string"},"show_payer":{"type":"string"},"time_limit_ms":{"type":"string"}},"required":["code","table","scope"]}}],"responses":{"200":{"description":"Default Response"}}}},"/v2/chain/get_scope_rows":{"post":{"summary":"Returns an object containing rows from the specified table.","description":"Returns an object containing rows from the specified table.","tags":["chain"],"parameters":[{"name":"body","in":"body","schema":{"type":["object","string"],"properties":{"json":{"type":"string"},"code":{"type":"string","description":"The name of the smart contract that controls the provided table"},"table":{"type":"string","description":"The name of the table to query"},"index_position":{"type":"string","description":"Position of the index used, accepted parameters `primary`, `secondary`, `tertiary`, `fourth`, `fifth`, `sixth`, `seventh`, `eighth`, `ninth` , `tenth`"},"key_type":{"type":"string","description":"Type of key specified by index_position (for example - `uint64_t` or `name`)"},"encode_type":{"type":"string"},"lower_bound":{"type":"string"},"primary_lower_bound":{"type":"string"},"upper_bound":{"type":"string"},"limit":{"type":"string"},"reverse":{"type":"string"},"show_payer":{"type":"string"},"time_limit_ms":{"type":"string"}},"required":["code","table"]}}],"responses":{"200":{"description":"Default Response"}}}},"/v2/chain/get_currency_balance_rows":{"post":{"summary":"Retrieves the current balance","description":"Retrieves the current balance","tags":["chain"],"parameters":[{"name":"body","in":"body","schema":{"type":["object","string"],"properties":{"code":{"type":"string","description":"The name of the smart contract that controls the provided table"},"key_type":{"type":"string","description":"Type of key specified by index_position (for example - `uint64_t` or `name`)"},"encode_type":{"type":"string"},"lower_bound":{"type":"string"},"primary_lower_bound":{"type":"string"},"upper_bound":{"type":"string"},"limit":{"type":"string"},"reverse":{"type":"string"},"show_payer":{"type":"string"},"time_limit_ms":{"type":"string"},"symbol":{"type":"string"}},"required":["code","symbol"]}}],"responses":{"200":{"description":"Default Response"}}}},"/v2/node/get_supported_apis":{"get":{"summary":"Get list of supported APIs","tags":["node"],"responses":{"200":{"description":"Default Response"}}}},"/v1/db_size/get":{"post":{"summary":"Retrieves database stats","description":"Retrieves the current balance","tags":["db"],"parameters":[{"name":"body","in":"body","schema":{"type":["object","string"],"properties":{}}}],"responses":{"200":{"description":"Default Response"}}}}},"consumes":["text/plain"],"produces":["application/json"],"flag":false}')),m=n(64119),f=n(80507),b=n(96486),_=n(62435),v=n(86074),w=function(){var e=(0,y.useSelector)((function(e){return e.global.session})),t=(0,_.useState)("https://8.138.81.44"),n=a()(t,1)[0],r=(0,_.useState)((0,b.cloneDeep)(g)),i=a()(r,2),p=i[0],u=i[1],w=(0,_.useReducer)((function(e){return!e}),!1)[1],x=(0,_.useCallback)((function(){return e&&p.flag?(0,v.jsx)(l.Z,{tryItOutEnabled:!0,spec:p,requestSnippetsEnabled:!0,requestInterceptor:function(e){if(e.hasOwnProperty("loadSpec")&&e.loadSpec)return e;var t=h()(e);return e.url=n+(null==t?void 0:t.path),e}}):(0,v.jsx)(v.Fragment,{})}),[e,p,n]),j=(0,_.useCallback)(function(){var e=o()(s()().mark((function e(t,n){var r,i,o,c,d,y,h,l;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p.info.title="RPC API for ".concat(t.chain.name," Chain"),r=new f.lP({url:n}),e.next=4,(0,m.zI)(r.call({method:"GET",path:"/v2/node/get_supported_apis"}));case 4:if(i=e.sent,o=a()(i,2),c=o[0],d=o[1],!c){e.next=13;break}return p.flag=!0,u(p),w(),e.abrupt("return");case 13:d.apis.length&&(y=[],h={},l=g.paths,Object.keys(l).forEach((function(e){d.apis.includes(e)&&y.push(e)})),y.forEach((function(e){h[e]=l[e],h[e].hasOwnProperty("get")&&h[e].hasOwnProperty("head")&&h[e].hasOwnProperty("post")&&(delete h[e].get,delete h[e].head)})),h["/v2/node/get_supported_apis"]=l["/v2/node/get_supported_apis"],h["/v1/db_size/get"]=l["/v1/db_size/get"],p.paths=h),p.flag=!0,u(p),w();case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),[p]);return(0,_.useEffect)((function(){e&&j(e,n)}),[e,j,n]),(0,v.jsx)(c._z,{className:"rpc",ghost:!0,children:(0,v.jsx)(d.Z,{children:(0,v.jsx)(x,{})})})}},51877:function(){},24654:function(){}}]);