1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[578],{578:function(e,n,t){t.d(n,{connectInjectedExtension:function(){return H},getInjectedExtensions:function(){return S}});var s={};t.r(s),t.d(s,{ChargeAssetTxPayment:function(){return x},ChargeTransactionPayment:function(){return k},CheckGenesis:function(){return f},CheckMetadataHash:function(){return m},CheckMortality:function(){return y},CheckNonce:function(){return p},CheckSpecVersion:function(){return E},CheckTxVersion:function(){return b}});var r=t(6727),i=t(7692),a=t(1275),c=t(5543),o=t(8494),u=t(195),d=t(797),l=t(83),h=t(8153);let g=(e,n)=>{let t=e.toString(16),s=Math.max(0,(n||0)-(t=(t.length%2?"0":"")+t).length/2);return"0x"+"00".repeat(s)+t},f=({additionalSigned:e})=>({genesisHash:(0,u.N)(e)}),p=({value:e})=>({nonce:g(d.oA.dec(e),4)}),b=({additionalSigned:e})=>({transactionVersion:g(d.Jq.dec(e),4)}),w=(0,l.AU)({tip:d.oA,asset:(0,l.Wx)((0,d.Jj)(1/0))}).dec,x=({value:e})=>{let{tip:n,asset:t}=w(e);return{...t?{assetId:(0,u.N)(t)}:{},tip:g(n,16)}},k=({value:e})=>({tip:g(h.v.dec(e),16)}),y=({value:e,additionalSigned:n},t)=>({era:(0,u.N)(e),blockHash:(0,u.N)(n),blockNumber:g(t,4)}),E=({additionalSigned:e})=>({specVersion:g(d.Jq.dec(e),4)}),m=({value:e,additionalSigned:n})=>e.length&&e[0]?{mode:1,metadataHash:(0,u.N)(n.length?n.slice(1):n)}:{},N=(0,i.h)().enc,C=e=>e.startsWith("0x")?(0,u.H)(e):N(e),v=new Set(["ed25519","sr25519","ecdsa","ethereum"]),H=async(e,n)=>{let t=window.injectedWeb3?.[e];if(!t)throw Error(`Unavailable extension: "${e}"`);let i=await t.enable(n),d=i.signer.signPayload.bind(i.signer),l=i.signer.signRaw.bind(i.signer),h=e=>e.filter(({type:e})=>v.has(e)).map(e=>{let n=function(e,n,t){let i=C(e),d=async(t,d,l,h,g=a.vT)=>{let f=(0,c.h)((0,o.q)(l)),p={};p.signedExtensions=[];let{version:b}=f.extrinsic,w=[];f.extrinsic.signedExtensions[0].map(({identifier:e})=>{let n=d[e];if(!n)throw Error(`Missing ${e} signed-extension`);if(w.push(n.value),p.signedExtensions.push(e),!s[e]){if(0===n.value.length&&0===n.additionalSigned.length)return;throw Error(`PJS does not support this signed-extension: ${e}`)}Object.assign(p,s[e](n,h))});let x=b.includes(4)?4:null;if(null==x)throw Error("Only extrinsic v4 is supported");p.address=e,p.method=(0,u.N)(t),p.version=x,p.withSignedTransaction=!0;let k=await n(p),y=k.signedTransaction;return y?"string"==typeof y?(0,u.H)(y):y:(0,r.m)(f,i,(0,u.H)(k.signature),w,t)};return{publicKey:i,signTx:d,signBytes:n=>t({address:e,data:(0,u.N)(n),type:"bytes"}).then(({signature:e})=>(0,u.H)(e))}}(e.address,d,l);return{...e,polkadotSigner:n}}),g=h(await i.accounts.get()),f=new Set,p=i.accounts.subscribe(e=>{g=h(e),f.forEach(e=>{e(g)})});return{name:e,getAccounts:()=>g,subscribe:e=>(f.add(e),()=>{f.delete(e)}),disconnect:()=>{p()}}},S=()=>{let{injectedWeb3:e}=window;return e?Object.keys(e):[]}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.