diff --git a/comm.f1874cacf17f3cb1.js b/comm.fa61bdb1fbd07d67.js similarity index 96% rename from comm.f1874cacf17f3cb1.js rename to comm.fa61bdb1fbd07d67.js index fc2497aecdd7..9cfd05319194 100644 --- a/comm.f1874cacf17f3cb1.js +++ b/comm.fa61bdb1fbd07d67.js @@ -1,4 +1,4 @@ -"use strict";(("undefined"!=typeof self?self:this).webpackChunk_polkadot_apps=("undefined"!=typeof self?self:this).webpackChunk_polkadot_apps||[]).push([[136],{53484:(e,t,n)=>{n.r(t),n.d(t,{ApiCtxRoot:()=>O,DEFAULT_AUX:()=>H,DEFAULT_DECIMALS:()=>R,DEFAULT_SS58:()=>$});var a=n(52322),s=n(55573),i=n(59039),r=n(2784),o=n(23729),l=n.n(o),c=n(1719),d=n(42582),u=n(64176),m=n(36733),h=n(3919),p=n(16265),g=n(76833),f=n(345),b=n(50265),x=n(86135),A=n(72489),v=n(11677);const w=(0,A.Rf)(((e,t)=>t?.toString()||e)),y=(0,v.e)("useEndpoint",(function(e){return(0,r.useMemo)((()=>function(e){return w.find((({value:t})=>t===e))||null}(e)),[e])}));var j=n(54371);const k=(0,A.Rf)(((e,t)=>t?.toString()||e)),C=(0,v.e)("usePeopleEndpoint",(function(e){return(0,r.useMemo)((()=>{return t=e,k.find((({info:e,isPeople:n})=>n&&(0,j.H)(e)&&(0,j.H)(t)&&e.toLowerCase().includes(t.toLowerCase())))||null;var t}),[e])}));var N=n(18837),E=n(87206);class S{#e;#t;#n;constructor(e,t,n){this.#e=t,this.#t=n,this.#n=e}async signPayload(e){return new Promise(((t,n)=>{this.#e(this.#n,e,((e,a)=>{a?t(a):n(new Error("Unable to sign"))}))}))}update(e,t){t instanceof this.#n.createClass("Hash")?this.#t(e,"sent",t.toHex()):this.#t(e,t.status.type.toLowerCase(),t)}}var I=n(69187),B=n(16039),D=n(33403),L=n(92730),P=n(30495),V=n(11147),T=n(65968),M=n(68145),F=n(36956),z=n(95267),Z=n(81369);const R=z.statics.registry.createType("u32",12),$=z.statics.registry.createType("u32",M.c.prefix),H=["Aux1","Aux2","Aux3","Aux4","Aux5","Aux6","Aux7","Aux8","Aux9"],q=[],U={hasInjectedAccounts:!1,isApiReady:!1};async function Q(e){try{return await e,(await(0,f.vK)()).map((({address:e,meta:t},n)=>({address:e,meta:(0,D.Z)({},t,{name:`${t.name||"unknown"} (${"polkadot-js"===t.source?"extension":t.source})`,whenCreated:n})})))}catch(e){return console.error("web3Accounts",e),[]}}function O({apiUrl:e,children:t,isElectron:o,store:A}){const{queuePayload:v,queueSetTxStatus:w}=(0,x.L)(),[j,k]=(0,r.useState)(U),[M,O]=(0,r.useState)(!1),[W,G]=(0,r.useState)(!1),[J,K]=(0,r.useState)(null),[Y,X]=(0,r.useState)(),[_]=(0,r.useState)(l().get("localFork")===e),ee=y(e),te=C(ee?.relayName||ee?.info),ne=(0,r.useMemo)((()=>ee?.valueRelay&&(0,T.h)(ee.paraId)&&ee.paraId<2e3?ee.valueRelay:null),[ee]),ae=(0,r.useMemo)((()=>te?.isPeople&&!ee?.isPeople&&te?.providers&&ee?.isPeopleForIdentity?te.providers:null),[ee,te]),se=(0,N.J)(ne),ie=(0,N.J)(ae),re=(0,r.useMemo)((()=>function(e,t){return(n,a)=>`${t?"https://polkadot.js.org/apps/":`${window.location.origin}${window.location.pathname}`}?rpc=${encodeURIComponent(a||e)}#${n}`}(e,o)),[e,o]),oe=ee?.isPeople||(0,T.h)(ee?.paraId)&&ee?.paraId>=2e3||"paseo"===ee?.info?.toLowerCase(),le=(0,r.useMemo)((()=>(0,D.Z)({},j,{api:z.statics.api,apiEndpoint:ee,apiError:J,apiIdentity:"polkadot"===ee?.relayName&&!ee?.isRelay&&se||ee?.isPeopleForIdentity&&ie||z.statics.api,apiRelay:se,apiSystemPeople:ie,apiUrl:e,createLink:re,enableIdentity:oe,extensions:Y,isApiConnected:M,isApiInitialized:W,isElectron:o,isLocalFork:_,isWaitingInjected:!Y})),[J,re,Y,M,W,o,_,j,ee,se,e,ie,oe]);return(0,r.useEffect)((()=>{const t=e=>{console.error(e),K(e.message)};(async function(e,t,a,r){const o=function(){const e=(0,Z.decodeUrlTypes)()||l().get("types",{}),t=Object.keys(e);return t.length&&console.log("Injected types:",t.join(", ")),e}(),m=e.startsWith("light://");let h,p=null;try{m?h=await async function(e){const[t,a,s]=e.split("/");if("substrate-connect"!==t)throw new Error(`Cannot connect to non substrate-connect protocol ${e}`);if(!F.relaySpecs[a]||s&&!F.lightSpecs[a]?.[s])throw new Error(`Unable to construct light chain ${e}`);const r=new c.x(i,F.relaySpecs[a]);if(!s)return r;const o=await n(29038)(`${F.lightSpecs[a][s]}`);return new c.x(i,JSON.stringify(o.default),r)}(e.replace("light://","")):a?(h=await s.FY.fromEndpoint(e),p=h.chain,await(0,s.po)(p,{System:{Account:[[["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"],{data:{free:5e15},providers:1}]]}})):h=new d.U(e),z.statics.api=new u.G({provider:h,registry:z.statics.registry,signer:t,types:o,typesBundle:g.UD}),m&&await h.connect()}catch(e){r(e)}return{fork:p,types:o}})(e,new S(z.statics.registry,v,w),_,t).then((({fork:e,types:n})=>{z.statics.api.on("connected",(()=>O(!0))),z.statics.api.on("disconnected",(()=>O(!1))),z.statics.api.on("error",t),z.statics.api.on("ready",(()=>{const a=(0,f.$y)("polkadot-js/apps");a.then(X).catch(console.error);const s=!!location.href.includes("keyring-type=ethereum");(async function(e,t,n,a,s,i,r=!1){z.statics.registry.register(i);const{injectedAccounts:o,properties:l,systemChain:c,systemChainType:d,systemName:u,systemVersion:g}=await async function(e,t){const[n,a,s,i,r]=await Promise.all([e.rpc.system.chain(),e.rpc.system.chainType?e.rpc.system.chainType():Promise.resolve(z.statics.registry.createType("ChainType","Live")),e.rpc.system.name(),e.rpc.system.version(),Q(t)]);return{injectedAccounts:r.filter((({meta:{source:e}})=>!q.includes(e))),properties:z.statics.registry.createType("ChainProperties",{isEthereum:e.registry.chainIsEthereum,ss58Format:e.registry.chainSS58,tokenDecimals:e.registry.chainDecimals,tokenSymbol:e.registry.chainTokens}),systemChain:(n||"").toString(),systemChainType:a,systemName:s.toString(),systemVersion:i.toString()}}(e,a),f=l.ss58Format.unwrapOr($).toNumber(),x=-1===B.X.prefix?f:B.X.prefix,A=l.tokenSymbol.unwrapOr([L.a.getDefaults().unit,...H]),v=l.tokenDecimals.unwrapOr([R]),w=l.isEthereum.isTrue||p.W.includes(e.runtimeVersion.specName.toString())||r,y=d.isDevelopment||d.isLocal||(0,P.s)(c);console.log(`chain: ${c} (${d.toString()}), ${(0,V.P)(l)}`),z.statics.registry.setChainProperties(z.statics.registry.createType("ChainProperties",{isEthereum:w,ss58Format:x,tokenDecimals:v,tokenSymbol:A})),L.a.setDefaults({decimals:v.map((e=>e.toNumber())),unit:A[0].toString()}),b.k.setAbbr(A[0].toString()),function(){try{return!!I.Nn.keyring}catch{return!1}}()||I.Nn.loadAll({genesisHash:e.genesisHash,genesisHashAdd:t&&(0,T.h)(t.paraId)&&t.paraId<2e3&&t.genesisHashRelay?[t.genesisHashRelay]:[],isDevelopment:y,ss58Format:x,store:s,type:w?"ethereum":"ed25519"},o);const j=Object.keys(e.tx)[0],k=Object.keys(e.tx[j])[0],C=e.tx[j][k],N=e.tx.system?.setCode||C;return(0,m.u)(e.genesisHash.toHex(),h.A),{apiDefaultTx:C,apiDefaultTxSudo:N,chainSS58:f,fork:n,hasInjectedAccounts:0!==o.length,isApiReady:!0,isDevelopment:y,isEthereum:w,specName:e.runtimeVersion.specName.toString(),specVersion:e.runtimeVersion.specVersion.toString(),systemChain:c,systemName:u,systemVersion:g}})(z.statics.api,ee,e,a,A,n,s).then(k).catch(t)})),_&&(l().set("localFork",""),z.statics.api.connect().catch(t)),G(!0)})).catch(t)}),[ee,e,v,w,A,_]),le.isApiInitialized?(0,a.jsx)(E.E.Provider,{value:le,children:t}):null}},94356:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var a=n(52322),s=n(2784),i=n(87206),r=n(48731);function o(e,t={}){class n extends s.PureComponent{component=s.createRef();render(){return(0,a.jsx)(i.E.Consumer,{children:n=>((0,r.hu)(n?.api,"Application root must be wrapped inside 'react-api/Api' to provide API context"),(0,a.jsx)(e,{...t,...n,...this.props,ref:this.component}))})}}return n}},98727:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var a=n(52322),s=n(2784),i=n(17965),r=n(1346),o=n(17751),l=n(48731),c=n(80522),d=n(41186),u=n(94356);const m=()=>{},h=()=>!1,p={};function g(e,{at:t,atProp:n,callOnResult:g,fallbacks:f,isMulti:b=!1,paramName:x,paramPick:A,paramValid:v=!1,params:w=[],propName:y,skipIf:j=h,transform:k=c.default,withIndicator:C=!1}={}){return c=>{class h extends s.Component{state={callResult:void 0,callUpdated:!1,callUpdatedAt:0};destroy;isActive=!1;propName;timerId=-1;constructor(t){super(t);const[,n,a]=e.split(".");this.propName=`${n}_${a}`}componentDidUpdate(e){const t=this.getParams(e),n=this.getParams(this.props);this.isActive&&!(0,d.isEqual)(n,t)&&this.subscribe(n).then(m).catch(m)}componentDidMount(){this.isActive=!0,C&&(this.timerId=window.setInterval((()=>{const e=Date.now()-(this.state.callUpdatedAt||0)<=1500;e!==this.state.callUpdated&&this.nextState({callUpdated:e})}),500)),(0,i.Y)((()=>{this.subscribe(this.getParams(this.props)).then(m).catch(m)}))}componentWillUnmount(){this.isActive=!1,this.unsubscribe().then(m).catch(m),-1!==this.timerId&&clearInterval(this.timerId)}nextState(e){this.isActive&&this.setState(e)}getParams(e){const a=A?A(e):x?e[x]:void 0;return n&&(t=e[n]),!v&&x&&((0,r.o)(a)||(0,o.F)(a))?[!1,[]]:[!0,(0,r.o)(a)?w:w.concat(Array.isArray(a)&&!a.toU8a?a:[a])]}constructApiSection=e=>{const{api:n}=this.props,[a,s,i,...r]=e.split(".");return(0,l.hu)(a.length&&s.length&&i.length&&0===r.length,`Invalid API format, expected .
., found ${e}`),(0,l.hu)(["consts","rpc","query","derive"].includes(a),`Unknown api.${a}, expected consts, rpc, query or derive`),(0,l.hu)(!t||"query"===a,"Only able to do an 'at' query on the api.query interface"),[n[a][s],a,s,i]};getApiMethod(t){if("subscribe"===e){const[e,...n]=t;return[e,n,"subscribe"]}const n=[e].concat(f||[]).map(this.constructApiSection),[a,s,i,c]=n.find((([e])=>!!e))||[{},n[0][1],n[0][2],n[0][3]];(0,l.hu)(a?.[c],`Unable to find api.${s}.${i}.${c}`);const d=a[c].meta;if("query"===s&&d?.type.isMap){const e=t[0];(0,l.hu)(!(0,r.o)(e)&&!(0,o.F)(e)||d.type.asMap.kind.isLinkedMap,`${d.name} expects one argument`)}return[a[c],t,c.startsWith("subscribe")?"subscribe":s]}async subscribe([a,s]){if(!a||j(this.props))return;const{api:i}=this.props;let r;await i.isReady;try{(0,l.hu)(t||!n,"Unable to perform query on non-existent at hash"),r=this.getApiMethod(s)}catch(t){p[t.message]||(console.warn(e,"::",t),p[t.message]=!0)}if(!r)return;const[o,c,d]=r,u=e=>this.triggerUpdate(this.props,e);await this.unsubscribe();try{["derive","subscribe"].includes(d)||"query"===d&&!t&&!n?this.destroy=b?await o.multi(c,u):await o(...c,u):u("consts"===d?o:t?await o.at(t,...c):await o(...c))}catch{}}async unsubscribe(){this.destroy&&(this.destroy(),this.destroy=void 0)}triggerUpdate(e,t){try{const n=(e.transform||k)(t);if(!this.isActive||(0,d.isEqual)(n,this.state.callResult))return;(0,d.triggerChange)(n,g,e.callOnResult),this.nextState({callResult:n,callUpdated:!0,callUpdatedAt:Date.now()})}catch{}}render(){const{callResult:e,callUpdated:t,callUpdatedAt:n}=this.state,s={...this.props,callUpdated:t,callUpdatedAt:n};return(0,r.o)(e)||(s[y||this.propName]=e),(0,a.jsx)(c,{...s})}}return(0,u.default)(h)}}},3364:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(52322),s=(n(2784),n(98727));function i(e,t={}){return(n,i={})=>(0,s.default)(e,{...t,propName:"callResult"})((function({callResult:e,callUpdated:t,children:s,className:r=i.className,label:o=""}){return(0,a.jsxs)("div",{...i,className:[r||"",t?"rx--updated":void 0].join(" "),children:[o,n(e),s]})}))}},5246:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var a=n(98727);function s(...e){return t=>e.reverse().reduce(((e,t)=>Array.isArray(t)?(0,a.default)(...t)(e):(0,a.default)(t)(e)),t)}},69356:(e,t,n)=>{n.r(t),n.d(t,{onlyOnApp:()=>c.onlyOnApp,onlyOnWeb:()=>c.onlyOnWeb,withApi:()=>a.default,withCall:()=>s.default,withCallDiv:()=>i.default,withCalls:()=>r.default,withMulti:()=>o.default,withObservable:()=>l.default});var a=n(94356),s=n(98727),i=n(3364),r=n(5246),o=n(60028),l=n(33989),c=n(35475)},60028:(e,t,n)=>{function a(e,...t){return t.reverse().reduce(((e,t)=>t(e)),e)}n.r(t),n.d(t,{default:()=>a})},33989:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var a=n(52322),s=n(2784),i=n(77984),r=n(47009),o=n(35120),l=n(80522),c=n(41186);function d(e,{callOnResult:t,propName:n="value",transform:d=l.default}={}){return(l,u={},m)=>{class h extends s.Component{isActive=!0;state={callResult:void 0,callUpdated:!1,callUpdatedAt:0,subscriptions:[]};componentDidMount(){this.setState({subscriptions:[e.pipe((0,i.U)(d),(0,r.K)((()=>(0,o.of)(void 0)))).subscribe((e=>this.triggerUpdate(this.props,e))),(0,c.intervalObservable)(this)]})}componentWillUnmount(){this.isActive=!1,this.state.subscriptions.forEach((e=>e.unsubscribe()))}triggerUpdate=(e,n)=>{try{if(!this.isActive||(0,c.isEqual)(n,this.state.callResult))return;(0,c.triggerChange)(n,t,e.callOnResult||u.callOnResult),this.setState({callResult:n,callUpdated:!0,callUpdatedAt:Date.now()})}catch(e){console.error(this.props,e)}};render(){const{children:e}=this.props,{callResult:t,callUpdated:s,callUpdatedAt:i}=this.state,r={...u,...this.props,callUpdated:s,callUpdatedAt:i,[n]:t};return(0,a.jsxs)(l,{...r,children:[m?.(t),e]})}}return h}}},35475:(e,t,n)=>{n.r(t),n.d(t,{onlyOnApp:()=>r,onlyOnWeb:()=>i});var a=n(41186);const s=e=>t=>(0,a.getEnvironment)()===e?t:()=>null,i=s("web"),r=s("app")},57139:(e,t,n)=>{n.r(t),n.d(t,{ApiCtxRoot:()=>a.ApiCtxRoot,DEFAULT_DECIMALS:()=>a.DEFAULT_DECIMALS,DEFAULT_SS58:()=>a.DEFAULT_SS58,statics:()=>i.statics,withApi:()=>s.withApi,withCallDiv:()=>s.withCallDiv,withCalls:()=>s.withCalls,withMulti:()=>s.withMulti,withObservable:()=>s.withObservable});var a=n(53484),s=n(69356),i=n(95267)},36956:(e,t,n)=>{n.r(t),n.d(t,{lightSpecs:()=>r,relaySpecs:()=>o});var a=n(59039),s=n(37178),i=n(15299);const r=Object.entries({kusama:s.specs,polkadot:i.specs}).reduce(((e,[t,n])=>(e[t]=n.reduce(((e,n)=>(e[n]=`./light/${t}/${n}.json`,e)),{}),e)),{}),o={kusama:a.WellKnownChain.ksmcc3,polkadot:a.WellKnownChain.polkadot,rococo:a.WellKnownChain.rococo_v2_2,westend:a.WellKnownChain.westend2}},37178:(e,t,n)=>{n.r(t),n.d(t,{specs:()=>a});const a=["gm","shiden","tinkernet"]},15299:(e,t,n)=>{n.r(t),n.d(t,{specs:()=>a});const a=["astar"]},95267:(e,t,n)=>{n.r(t),n.d(t,{statics:()=>a});const a={api:void 0,registry:new(n(35562).P)}},80522:(e,t,n)=>{function a(e,t){return e}n.r(t),n.d(t,{default:()=>a})},81369:(e,t,n)=>{n.r(t),n.d(t,{decodeUrlTypes:()=>d,encodeUrlTypes:()=>u});var a=n(13824),s=n(85168),i=n(16039),r=n(48731),o=n(56623),l=n(64021),c=n(41444);function d(){const e=s.Z.parse(location.href.split("?")[1]);if(e.types)try{(0,r.hu)(!Array.isArray(e.types),"Expected a single type specification");const t=e.types.split("#"),n=(0,c.tV)(decodeURIComponent(t[0])),s=(0,a.HT)(n);return JSON.parse((0,o.z)(s))}catch(e){console.error(e)}return null}function u(e){const t=(0,l.d)(JSON.stringify(e)),n=(0,a.iZ)(t,{level:9}),s=(0,c.h$)(n);return`${window.location.origin}${window.location.pathname}?rpc=${encodeURIComponent(i.X.apiUrl)}&types=${encodeURIComponent(s)}`}},68372:(e,t,n)=>{n.r(t),n.d(t,{getEnvironment:()=>s});var a=n(34406);function s(){return a?.versions?.electron||"renderer"===window?.process?.type||navigator?.userAgent?.indexOf("Electron")>=0?"app":"web"}},77809:(e,t,n)=>{async function a(e,t,n){return Promise.all(n.map((n=>e(n,...t)))).then((e=>e.map(((e,t)=>[n[t],e]))))}n.r(t),n.d(t,{getHistoric:()=>a})},41186:(e,t,n)=>{n.r(t),n.d(t,{getEnvironment:()=>a.getEnvironment,getHistoric:()=>s.getHistoric,intervalObservable:()=>i.intervalObservable,isEqual:()=>r.isEqual,triggerChange:()=>o.triggerChange});var a=n(68372),s=n(77809),i=n(71951),r=n(65345),o=n(74733)},71951:(e,t,n)=>{n.r(t),n.d(t,{intervalObservable:()=>s});const a=(0,n(487).F)(500);function s(e){return a.subscribe((()=>{const t=Date.now()-(e.state.callUpdatedAt||0)<=1500;t!==e.state.callUpdated&&e.setState({callUpdated:t})}))}},65345:(e,t,n)=>{function a(e,t){return t?t.$$typeof?"":Array.isArray(t)?t.map((e=>a(0,e))):t:t}function s(e,t){return JSON.stringify({test:e},a)===JSON.stringify({test:t},a)}n.r(t),n.d(t,{isEqual:()=>s})},74733:(e,t,n)=>{n.r(t),n.d(t,{triggerChange:()=>i});var a=n(4757),s=n(33661);function i(e,...t){t?.length&&t.forEach((t=>{(0,a.b)(t)?t.next(e):(0,s.m)(t)&&t(e)}))}},13731:(e,t,n)=>{n.d(t,{Z:()=>h,d:()=>m});var a=n(52322),s=n(2784),i=n(56360),r=n(97794),o=n(48801),l=n.n(o),c=n(95292),d=n(25294),u=n(43151);const m=[1,2,4,8,16,32].map(((e,t)=>[t+1,e,new(l())(e)])),h=s.memo((function({className:e="",label:t,onChange:n,value:o,voteLockingPeriod:l}){const{t:h}=(0,u.$)(),p=(0,i.n)(),g=(0,s.useRef)(function(e,t,n){return[{text:n("0.1x voting balance, no lockup period"),value:0},...m.map((([a,s,i])=>({text:n("{{value}}x voting balance, locked for {{duration}}x duration{{period}}",{replace:{duration:s,period:t&&t.gt(c.nw)?` (${(0,r.A)(e,i.mul(t),n)[1]})`:"",value:a}}),value:a})))]}(p,l,h));return(0,a.jsx)(d.Z,{className:e,label:t,onChange:n,options:g.current,value:o})}))},25294:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(52322),s=n(2784),i=n(25650),r=n(31076),o=n(1346),l=n(12493);const c=(0,n(21779).z)(l.Z)` +"use strict";(("undefined"!=typeof self?self:this).webpackChunk_polkadot_apps=("undefined"!=typeof self?self:this).webpackChunk_polkadot_apps||[]).push([[136],{53484:(e,t,n)=>{n.r(t),n.d(t,{ApiCtxRoot:()=>O,DEFAULT_AUX:()=>H,DEFAULT_DECIMALS:()=>R,DEFAULT_SS58:()=>$});var a=n(52322),s=n(55573),i=n(59039),r=n(2784),o=n(23729),l=n.n(o),c=n(1719),d=n(42582),u=n(64176),m=n(36733),h=n(3919),p=n(16265),g=n(76833),f=n(345),b=n(50265),x=n(86135),A=n(72489),v=n(11677);const w=(0,A.Rf)(((e,t)=>t?.toString()||e)),y=(0,v.e)("useEndpoint",(function(e){return(0,r.useMemo)((()=>function(e){return w.find((({value:t})=>t===e))||null}(e)),[e])}));var j=n(54371);const k=(0,A.Rf)(((e,t)=>t?.toString()||e)),C=(0,v.e)("usePeopleEndpoint",(function(e){return(0,r.useMemo)((()=>{return t=e,k.find((({info:e,isPeople:n})=>n&&(0,j.H)(e)&&(0,j.H)(t)&&e.toLowerCase().includes(t.toLowerCase())))||null;var t}),[e])}));var N=n(18837),E=n(87206);class S{#e;#t;#n;constructor(e,t,n){this.#e=t,this.#t=n,this.#n=e}async signPayload(e){return new Promise(((t,n)=>{this.#e(this.#n,e,((e,a)=>{a?t(a):n(new Error("Unable to sign"))}))}))}update(e,t){t instanceof this.#n.createClass("Hash")?this.#t(e,"sent",t.toHex()):this.#t(e,t.status.type.toLowerCase(),t)}}var I=n(69187),B=n(16039),D=n(33403),L=n(92730),P=n(30495),V=n(11147),T=n(65968),M=n(68145),F=n(36956),z=n(95267),Z=n(81369);const R=z.statics.registry.createType("u32",12),$=z.statics.registry.createType("u32",M.c.prefix),H=["Aux1","Aux2","Aux3","Aux4","Aux5","Aux6","Aux7","Aux8","Aux9"],q=[],U={hasInjectedAccounts:!1,isApiReady:!1};async function Q(e){try{return await e,(await(0,f.vK)()).map((({address:e,meta:t},n)=>({address:e,meta:(0,D.Z)({},t,{name:`${t.name||"unknown"} (${"polkadot-js"===t.source?"extension":t.source})`,whenCreated:n})})))}catch(e){return console.error("web3Accounts",e),[]}}function O({apiUrl:e,children:t,isElectron:o,store:A}){const{queuePayload:v,queueSetTxStatus:w}=(0,x.L)(),[j,k]=(0,r.useState)(U),[M,O]=(0,r.useState)(!1),[W,G]=(0,r.useState)(!1),[J,K]=(0,r.useState)(null),[Y,X]=(0,r.useState)(),[_]=(0,r.useState)(l().get("localFork")===e),ee=y(e),te=C(ee?.relayName||ee?.info),ne=(0,r.useMemo)((()=>ee?.valueRelay&&(0,T.h)(ee.paraId)&&ee.paraId<2e3?ee.valueRelay:null),[ee]),ae=(0,r.useMemo)((()=>te?.isPeople&&!ee?.isPeople&&te?.providers&&ee?.isPeopleForIdentity?te.providers:null),[ee,te]),se=(0,N.J)(ne),ie=(0,N.J)(ae),re=(0,r.useMemo)((()=>function(e,t){return(n,a)=>`${t?"https://polkadot.js.org/apps/":`${window.location.origin}${window.location.pathname}`}?rpc=${encodeURIComponent(a||e)}#${n}`}(e,o)),[e,o]),oe=ee?.isPeople||(0,T.h)(ee?.paraId)&&ee?.paraId>=2e3||"paseo"===ee?.info?.toLowerCase(),le=(0,r.useMemo)((()=>(0,D.Z)({},j,{api:z.statics.api,apiEndpoint:ee,apiError:J,apiIdentity:ee?.isPeopleForIdentity&&ie||z.statics.api,apiRelay:se,apiSystemPeople:ie,apiUrl:e,createLink:re,enableIdentity:oe,extensions:Y,isApiConnected:M,isApiInitialized:W,isElectron:o,isLocalFork:_,isWaitingInjected:!Y})),[J,re,Y,M,W,o,_,j,ee,se,e,ie,oe]);return(0,r.useEffect)((()=>{const t=e=>{console.error(e),K(e.message)};(async function(e,t,a,r){const o=function(){const e=(0,Z.decodeUrlTypes)()||l().get("types",{}),t=Object.keys(e);return t.length&&console.log("Injected types:",t.join(", ")),e}(),m=e.startsWith("light://");let h,p=null;try{m?h=await async function(e){const[t,a,s]=e.split("/");if("substrate-connect"!==t)throw new Error(`Cannot connect to non substrate-connect protocol ${e}`);if(!F.relaySpecs[a]||s&&!F.lightSpecs[a]?.[s])throw new Error(`Unable to construct light chain ${e}`);const r=new c.x(i,F.relaySpecs[a]);if(!s)return r;const o=await n(29038)(`${F.lightSpecs[a][s]}`);return new c.x(i,JSON.stringify(o.default),r)}(e.replace("light://","")):a?(h=await s.FY.fromEndpoint(e),p=h.chain,await(0,s.po)(p,{System:{Account:[[["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"],{data:{free:5e15},providers:1}]]}})):h=new d.U(e),z.statics.api=new u.G({provider:h,registry:z.statics.registry,signer:t,types:o,typesBundle:g.UD}),m&&await h.connect()}catch(e){r(e)}return{fork:p,types:o}})(e,new S(z.statics.registry,v,w),_,t).then((({fork:e,types:n})=>{z.statics.api.on("connected",(()=>O(!0))),z.statics.api.on("disconnected",(()=>O(!1))),z.statics.api.on("error",t),z.statics.api.on("ready",(()=>{const a=(0,f.$y)("polkadot-js/apps");a.then(X).catch(console.error);const s=!!location.href.includes("keyring-type=ethereum");(async function(e,t,n,a,s,i,r=!1){z.statics.registry.register(i);const{injectedAccounts:o,properties:l,systemChain:c,systemChainType:d,systemName:u,systemVersion:g}=await async function(e,t){const[n,a,s,i,r]=await Promise.all([e.rpc.system.chain(),e.rpc.system.chainType?e.rpc.system.chainType():Promise.resolve(z.statics.registry.createType("ChainType","Live")),e.rpc.system.name(),e.rpc.system.version(),Q(t)]);return{injectedAccounts:r.filter((({meta:{source:e}})=>!q.includes(e))),properties:z.statics.registry.createType("ChainProperties",{isEthereum:e.registry.chainIsEthereum,ss58Format:e.registry.chainSS58,tokenDecimals:e.registry.chainDecimals,tokenSymbol:e.registry.chainTokens}),systemChain:(n||"").toString(),systemChainType:a,systemName:s.toString(),systemVersion:i.toString()}}(e,a),f=l.ss58Format.unwrapOr($).toNumber(),x=-1===B.X.prefix?f:B.X.prefix,A=l.tokenSymbol.unwrapOr([L.a.getDefaults().unit,...H]),v=l.tokenDecimals.unwrapOr([R]),w=l.isEthereum.isTrue||p.W.includes(e.runtimeVersion.specName.toString())||r,y=d.isDevelopment||d.isLocal||(0,P.s)(c);console.log(`chain: ${c} (${d.toString()}), ${(0,V.P)(l)}`),z.statics.registry.setChainProperties(z.statics.registry.createType("ChainProperties",{isEthereum:w,ss58Format:x,tokenDecimals:v,tokenSymbol:A})),L.a.setDefaults({decimals:v.map((e=>e.toNumber())),unit:A[0].toString()}),b.k.setAbbr(A[0].toString()),function(){try{return!!I.Nn.keyring}catch{return!1}}()||I.Nn.loadAll({genesisHash:e.genesisHash,genesisHashAdd:t&&(0,T.h)(t.paraId)&&t.paraId<2e3&&t.genesisHashRelay?[t.genesisHashRelay]:[],isDevelopment:y,ss58Format:x,store:s,type:w?"ethereum":"ed25519"},o);const j=Object.keys(e.tx)[0],k=Object.keys(e.tx[j])[0],C=e.tx[j][k],N=e.tx.system?.setCode||C;return(0,m.u)(e.genesisHash.toHex(),h.A),{apiDefaultTx:C,apiDefaultTxSudo:N,chainSS58:f,fork:n,hasInjectedAccounts:0!==o.length,isApiReady:!0,isDevelopment:y,isEthereum:w,specName:e.runtimeVersion.specName.toString(),specVersion:e.runtimeVersion.specVersion.toString(),systemChain:c,systemName:u,systemVersion:g}})(z.statics.api,ee,e,a,A,n,s).then(k).catch(t)})),_&&(l().set("localFork",""),z.statics.api.connect().catch(t)),G(!0)})).catch(t)}),[ee,e,v,w,A,_]),le.isApiInitialized?(0,a.jsx)(E.E.Provider,{value:le,children:t}):null}},94356:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var a=n(52322),s=n(2784),i=n(87206),r=n(48731);function o(e,t={}){class n extends s.PureComponent{component=s.createRef();render(){return(0,a.jsx)(i.E.Consumer,{children:n=>((0,r.hu)(n?.api,"Application root must be wrapped inside 'react-api/Api' to provide API context"),(0,a.jsx)(e,{...t,...n,...this.props,ref:this.component}))})}}return n}},98727:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var a=n(52322),s=n(2784),i=n(17965),r=n(1346),o=n(17751),l=n(48731),c=n(80522),d=n(41186),u=n(94356);const m=()=>{},h=()=>!1,p={};function g(e,{at:t,atProp:n,callOnResult:g,fallbacks:f,isMulti:b=!1,paramName:x,paramPick:A,paramValid:v=!1,params:w=[],propName:y,skipIf:j=h,transform:k=c.default,withIndicator:C=!1}={}){return c=>{class h extends s.Component{state={callResult:void 0,callUpdated:!1,callUpdatedAt:0};destroy;isActive=!1;propName;timerId=-1;constructor(t){super(t);const[,n,a]=e.split(".");this.propName=`${n}_${a}`}componentDidUpdate(e){const t=this.getParams(e),n=this.getParams(this.props);this.isActive&&!(0,d.isEqual)(n,t)&&this.subscribe(n).then(m).catch(m)}componentDidMount(){this.isActive=!0,C&&(this.timerId=window.setInterval((()=>{const e=Date.now()-(this.state.callUpdatedAt||0)<=1500;e!==this.state.callUpdated&&this.nextState({callUpdated:e})}),500)),(0,i.Y)((()=>{this.subscribe(this.getParams(this.props)).then(m).catch(m)}))}componentWillUnmount(){this.isActive=!1,this.unsubscribe().then(m).catch(m),-1!==this.timerId&&clearInterval(this.timerId)}nextState(e){this.isActive&&this.setState(e)}getParams(e){const a=A?A(e):x?e[x]:void 0;return n&&(t=e[n]),!v&&x&&((0,r.o)(a)||(0,o.F)(a))?[!1,[]]:[!0,(0,r.o)(a)?w:w.concat(Array.isArray(a)&&!a.toU8a?a:[a])]}constructApiSection=e=>{const{api:n}=this.props,[a,s,i,...r]=e.split(".");return(0,l.hu)(a.length&&s.length&&i.length&&0===r.length,`Invalid API format, expected .
., found ${e}`),(0,l.hu)(["consts","rpc","query","derive"].includes(a),`Unknown api.${a}, expected consts, rpc, query or derive`),(0,l.hu)(!t||"query"===a,"Only able to do an 'at' query on the api.query interface"),[n[a][s],a,s,i]};getApiMethod(t){if("subscribe"===e){const[e,...n]=t;return[e,n,"subscribe"]}const n=[e].concat(f||[]).map(this.constructApiSection),[a,s,i,c]=n.find((([e])=>!!e))||[{},n[0][1],n[0][2],n[0][3]];(0,l.hu)(a?.[c],`Unable to find api.${s}.${i}.${c}`);const d=a[c].meta;if("query"===s&&d?.type.isMap){const e=t[0];(0,l.hu)(!(0,r.o)(e)&&!(0,o.F)(e)||d.type.asMap.kind.isLinkedMap,`${d.name} expects one argument`)}return[a[c],t,c.startsWith("subscribe")?"subscribe":s]}async subscribe([a,s]){if(!a||j(this.props))return;const{api:i}=this.props;let r;await i.isReady;try{(0,l.hu)(t||!n,"Unable to perform query on non-existent at hash"),r=this.getApiMethod(s)}catch(t){p[t.message]||(console.warn(e,"::",t),p[t.message]=!0)}if(!r)return;const[o,c,d]=r,u=e=>this.triggerUpdate(this.props,e);await this.unsubscribe();try{["derive","subscribe"].includes(d)||"query"===d&&!t&&!n?this.destroy=b?await o.multi(c,u):await o(...c,u):u("consts"===d?o:t?await o.at(t,...c):await o(...c))}catch{}}async unsubscribe(){this.destroy&&(this.destroy(),this.destroy=void 0)}triggerUpdate(e,t){try{const n=(e.transform||k)(t);if(!this.isActive||(0,d.isEqual)(n,this.state.callResult))return;(0,d.triggerChange)(n,g,e.callOnResult),this.nextState({callResult:n,callUpdated:!0,callUpdatedAt:Date.now()})}catch{}}render(){const{callResult:e,callUpdated:t,callUpdatedAt:n}=this.state,s={...this.props,callUpdated:t,callUpdatedAt:n};return(0,r.o)(e)||(s[y||this.propName]=e),(0,a.jsx)(c,{...s})}}return(0,u.default)(h)}}},3364:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(52322),s=(n(2784),n(98727));function i(e,t={}){return(n,i={})=>(0,s.default)(e,{...t,propName:"callResult"})((function({callResult:e,callUpdated:t,children:s,className:r=i.className,label:o=""}){return(0,a.jsxs)("div",{...i,className:[r||"",t?"rx--updated":void 0].join(" "),children:[o,n(e),s]})}))}},5246:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var a=n(98727);function s(...e){return t=>e.reverse().reduce(((e,t)=>Array.isArray(t)?(0,a.default)(...t)(e):(0,a.default)(t)(e)),t)}},69356:(e,t,n)=>{n.r(t),n.d(t,{onlyOnApp:()=>c.onlyOnApp,onlyOnWeb:()=>c.onlyOnWeb,withApi:()=>a.default,withCall:()=>s.default,withCallDiv:()=>i.default,withCalls:()=>r.default,withMulti:()=>o.default,withObservable:()=>l.default});var a=n(94356),s=n(98727),i=n(3364),r=n(5246),o=n(60028),l=n(33989),c=n(35475)},60028:(e,t,n)=>{function a(e,...t){return t.reverse().reduce(((e,t)=>t(e)),e)}n.r(t),n.d(t,{default:()=>a})},33989:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var a=n(52322),s=n(2784),i=n(77984),r=n(47009),o=n(35120),l=n(80522),c=n(41186);function d(e,{callOnResult:t,propName:n="value",transform:d=l.default}={}){return(l,u={},m)=>{class h extends s.Component{isActive=!0;state={callResult:void 0,callUpdated:!1,callUpdatedAt:0,subscriptions:[]};componentDidMount(){this.setState({subscriptions:[e.pipe((0,i.U)(d),(0,r.K)((()=>(0,o.of)(void 0)))).subscribe((e=>this.triggerUpdate(this.props,e))),(0,c.intervalObservable)(this)]})}componentWillUnmount(){this.isActive=!1,this.state.subscriptions.forEach((e=>e.unsubscribe()))}triggerUpdate=(e,n)=>{try{if(!this.isActive||(0,c.isEqual)(n,this.state.callResult))return;(0,c.triggerChange)(n,t,e.callOnResult||u.callOnResult),this.setState({callResult:n,callUpdated:!0,callUpdatedAt:Date.now()})}catch(e){console.error(this.props,e)}};render(){const{children:e}=this.props,{callResult:t,callUpdated:s,callUpdatedAt:i}=this.state,r={...u,...this.props,callUpdated:s,callUpdatedAt:i,[n]:t};return(0,a.jsxs)(l,{...r,children:[m?.(t),e]})}}return h}}},35475:(e,t,n)=>{n.r(t),n.d(t,{onlyOnApp:()=>r,onlyOnWeb:()=>i});var a=n(41186);const s=e=>t=>(0,a.getEnvironment)()===e?t:()=>null,i=s("web"),r=s("app")},57139:(e,t,n)=>{n.r(t),n.d(t,{ApiCtxRoot:()=>a.ApiCtxRoot,DEFAULT_DECIMALS:()=>a.DEFAULT_DECIMALS,DEFAULT_SS58:()=>a.DEFAULT_SS58,statics:()=>i.statics,withApi:()=>s.withApi,withCallDiv:()=>s.withCallDiv,withCalls:()=>s.withCalls,withMulti:()=>s.withMulti,withObservable:()=>s.withObservable});var a=n(53484),s=n(69356),i=n(95267)},36956:(e,t,n)=>{n.r(t),n.d(t,{lightSpecs:()=>r,relaySpecs:()=>o});var a=n(59039),s=n(37178),i=n(15299);const r=Object.entries({kusama:s.specs,polkadot:i.specs}).reduce(((e,[t,n])=>(e[t]=n.reduce(((e,n)=>(e[n]=`./light/${t}/${n}.json`,e)),{}),e)),{}),o={kusama:a.WellKnownChain.ksmcc3,polkadot:a.WellKnownChain.polkadot,rococo:a.WellKnownChain.rococo_v2_2,westend:a.WellKnownChain.westend2}},37178:(e,t,n)=>{n.r(t),n.d(t,{specs:()=>a});const a=["gm","shiden","tinkernet"]},15299:(e,t,n)=>{n.r(t),n.d(t,{specs:()=>a});const a=["astar"]},95267:(e,t,n)=>{n.r(t),n.d(t,{statics:()=>a});const a={api:void 0,registry:new(n(35562).P)}},80522:(e,t,n)=>{function a(e,t){return e}n.r(t),n.d(t,{default:()=>a})},81369:(e,t,n)=>{n.r(t),n.d(t,{decodeUrlTypes:()=>d,encodeUrlTypes:()=>u});var a=n(13824),s=n(85168),i=n(16039),r=n(48731),o=n(56623),l=n(64021),c=n(41444);function d(){const e=s.Z.parse(location.href.split("?")[1]);if(e.types)try{(0,r.hu)(!Array.isArray(e.types),"Expected a single type specification");const t=e.types.split("#"),n=(0,c.tV)(decodeURIComponent(t[0])),s=(0,a.HT)(n);return JSON.parse((0,o.z)(s))}catch(e){console.error(e)}return null}function u(e){const t=(0,l.d)(JSON.stringify(e)),n=(0,a.iZ)(t,{level:9}),s=(0,c.h$)(n);return`${window.location.origin}${window.location.pathname}?rpc=${encodeURIComponent(i.X.apiUrl)}&types=${encodeURIComponent(s)}`}},68372:(e,t,n)=>{n.r(t),n.d(t,{getEnvironment:()=>s});var a=n(34406);function s(){return a?.versions?.electron||"renderer"===window?.process?.type||navigator?.userAgent?.indexOf("Electron")>=0?"app":"web"}},77809:(e,t,n)=>{async function a(e,t,n){return Promise.all(n.map((n=>e(n,...t)))).then((e=>e.map(((e,t)=>[n[t],e]))))}n.r(t),n.d(t,{getHistoric:()=>a})},41186:(e,t,n)=>{n.r(t),n.d(t,{getEnvironment:()=>a.getEnvironment,getHistoric:()=>s.getHistoric,intervalObservable:()=>i.intervalObservable,isEqual:()=>r.isEqual,triggerChange:()=>o.triggerChange});var a=n(68372),s=n(77809),i=n(71951),r=n(65345),o=n(74733)},71951:(e,t,n)=>{n.r(t),n.d(t,{intervalObservable:()=>s});const a=(0,n(487).F)(500);function s(e){return a.subscribe((()=>{const t=Date.now()-(e.state.callUpdatedAt||0)<=1500;t!==e.state.callUpdated&&e.setState({callUpdated:t})}))}},65345:(e,t,n)=>{function a(e,t){return t?t.$$typeof?"":Array.isArray(t)?t.map((e=>a(0,e))):t:t}function s(e,t){return JSON.stringify({test:e},a)===JSON.stringify({test:t},a)}n.r(t),n.d(t,{isEqual:()=>s})},74733:(e,t,n)=>{n.r(t),n.d(t,{triggerChange:()=>i});var a=n(4757),s=n(33661);function i(e,...t){t?.length&&t.forEach((t=>{(0,a.b)(t)?t.next(e):(0,s.m)(t)&&t(e)}))}},13731:(e,t,n)=>{n.d(t,{Z:()=>h,d:()=>m});var a=n(52322),s=n(2784),i=n(56360),r=n(97794),o=n(48801),l=n.n(o),c=n(95292),d=n(25294),u=n(43151);const m=[1,2,4,8,16,32].map(((e,t)=>[t+1,e,new(l())(e)])),h=s.memo((function({className:e="",label:t,onChange:n,value:o,voteLockingPeriod:l}){const{t:h}=(0,u.$)(),p=(0,i.n)(),g=(0,s.useRef)(function(e,t,n){return[{text:n("0.1x voting balance, no lockup period"),value:0},...m.map((([a,s,i])=>({text:n("{{value}}x voting balance, locked for {{duration}}x duration{{period}}",{replace:{duration:s,period:t&&t.gt(c.nw)?` (${(0,r.A)(e,i.mul(t),n)[1]})`:"",value:a}}),value:a})))]}(p,l,h));return(0,a.jsx)(d.Z,{className:e,label:t,onChange:n,options:g.current,value:o})}))},25294:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(52322),s=n(2784),i=n(25650),r=n(31076),o=n(1346),l=n(12493);const c=(0,n(21779).z)(l.Z)` .ui--Dropdown-item { position: relative; white-space: nowrap; diff --git a/index.html b/index.html index 3cd3543514cf..322ebaf20895 100644 --- a/index.html +++ b/index.html @@ -124,7 +124,7 @@ opacity: 0.15; } - +
diff --git a/main.af52ef8a8116b410.js b/main.416d34215091cc70.js similarity index 99% rename from main.af52ef8a8116b410.js rename to main.416d34215091cc70.js index b4972adbd75d..7552caff44e5 100644 --- a/main.af52ef8a8116b410.js +++ b/main.416d34215091cc70.js @@ -308,7 +308,7 @@ } } } -`,At=g.memo((function({className:e="",isActive:n,name:t,routes:i}){return 1===i.length&&"settings"===i[0].group?(0,r.jsx)(kt,{className:n?"isActive":"",classNameText:"smallHide",isToplevel:!0,route:i[0]}):(0,r.jsxs)(jt,{className:`${e} ${n?"isActive":""}`,children:[(0,r.jsxs)("div",{className:"groupHdr "+(n?"":"highlight--color-contrast"),children:[(0,r.jsx)("span",{className:"smallHide",children:t}),(0,r.jsx)(A.JO,{className:"smallShow",icon:i[0].icon}),(0,r.jsx)(A.JO,{icon:"caret-down"})]}),(0,r.jsx)("ul",{className:"groupMenu",children:i.map((e=>(0,r.jsx)(kt,{route:e},e.name)))})]})}));var Nt=t(39082),It=t(52727);const St=`apps v${"0.141.2-4-x".replace("-x","")}`,Zt=A.zo.div` +`,At=g.memo((function({className:e="",isActive:n,name:t,routes:i}){return 1===i.length&&"settings"===i[0].group?(0,r.jsx)(kt,{className:n?"isActive":"",classNameText:"smallHide",isToplevel:!0,route:i[0]}):(0,r.jsxs)(jt,{className:`${e} ${n?"isActive":""}`,children:[(0,r.jsxs)("div",{className:"groupHdr "+(n?"":"highlight--color-contrast"),children:[(0,r.jsx)("span",{className:"smallHide",children:t}),(0,r.jsx)(A.JO,{className:"smallShow",icon:i[0].icon}),(0,r.jsx)(A.JO,{icon:"caret-down"})]}),(0,r.jsx)("ul",{className:"groupMenu",children:i.map((e=>(0,r.jsx)(kt,{route:e},e.name)))})]})}));var Nt=t(39082),It=t(52727);const St=`apps v${"0.141.2-5-x".replace("-x","")}`,Zt=A.zo.div` background: transparent; font-size: var(--font-size-tiny); line-height: 1.2;