polkadot-api 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.mjs +3 -2
- package/bin/cli.mjs.map +1 -1
- package/dist/esm/reexports/ink.mjs +2 -0
- package/dist/esm/reexports/ink.mjs.map +1 -0
- package/dist/esm/tx/create-tx.mjs +37 -24
- package/dist/esm/tx/create-tx.mjs.map +1 -1
- package/dist/esm/tx/tx.mjs +8 -1
- package/dist/esm/tx/tx.mjs.map +1 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +44 -24
- package/dist/index.js.map +1 -1
- package/dist/reexports/chains.d.ts +1 -0
- package/dist/reexports/ink.d.ts +1 -0
- package/dist/reexports/ink.js +11 -0
- package/dist/reexports/ink.js.map +1 -0
- package/dist/umd/index.min.js +2 -2
- package/dist/umd/ink.min.js +1 -0
- package/dist/umd/pjs-signer.min.js +1 -1
- package/dist/umd/signer.min.js +1 -1
- package/dist/umd/ws-provider_web.min.js +1 -1
- package/ink/package.json +9 -0
- package/package.json +34 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(we,ge){typeof exports=="object"&&typeof module<"u"?ge(exports):typeof define=="function"&&define.amd?define(["exports"],ge):(we=typeof globalThis<"u"?globalThis:we||self,ge(we.papiInk={}))})(this,function(we){"use strict";const ge=(e,t)=>e.type==="array"&&e.len===t&&e.value.type==="primitive"&&e.value.value==="u8",ae={type:"void"},Cn=(e,t=()=>null)=>{const n=new Map,r=new Set,s=u=>d=>{let h=n.get(d);if(h)return h;if(r.has(d)){const p={id:d};return n.set(d,p),p}r.add(d);const l=u(d);return h=n.get(d),h?Object.assign(h,l):(h={id:d,...l},n.set(d,h)),r.delete(d),h};let o=!0,c=!0;const a=s(u=>{const d=t(e[u]);if(d)return d;const{def:h,path:l,params:p}=e[u];if(h.tag==="composite"){if(h.value.length===0)return ae;if(h.value.length===1){const g=a(h.value[0].type);return o&&l.at(-1)==="AccountId32"&&ge(g,32)?(o=!1,{type:"AccountId32"}):c&&l.at(-1)==="AccountId20"&&ge(g,20)?(c=!1,{type:"AccountId20"}):g}return f(h.value)}if(h.tag==="variant"){if(l.length===1&&l[0]==="Option"&&p.length===1&&p[0].name==="T"){const k=a(p[0].type);return k.type==="void"?{type:"primitive",value:"bool"}:{type:"option",value:k}}if(l.length===1&&l[0]==="Result"&&p.length===2&&p[0].name==="T"&&p[1].name==="E")return{type:"result",value:{ok:a(p[0].type),ko:a(p[1].type)}};if(h.value.length===0)return ae;const g={},b={};return h.value.forEach(k=>{const _=k.name;if(b[_]=k.docs,k.fields.length===0){g[_]={...ae,idx:k.index};return}if(k.fields.length===1&&!k.fields[0].name){g[_]={type:"lookupEntry",value:a(k.fields[0].type),idx:k.index};return}g[_]={...f(k.fields),idx:k.index}}),{type:"enum",value:g,innerDocs:b}}if(h.tag==="sequence")return{type:"sequence",value:a(h.value)};if(h.tag==="array"){const{len:g}=h.value,b=a(h.value.type);return!g||b.type==="void"?ae:g>1?{type:"array",value:b,len:h.value.len}:b}if(h.tag==="tuple")return h.value.length===0?ae:h.value.length>1?i(h.value.map(g=>a(g)),h.value.map(g=>e[g].docs)):a(h.value[0]);if(h.tag==="primitive")return{type:"primitive",value:h.value.tag};if(h.tag==="compact"){const g=a(h.value);return g.type==="void"?ae:{type:"compact",isBig:Number(g.value.slice(1))>32}}return{type:h.tag}}),f=u=>{let d=!0;const h={},l={};return u.forEach((p,g)=>{d=d&&!!p.name;const b=p.name||g,k=a(p.type);k.type!=="void"&&(h[b]=k,l[b]=p.docs)}),d?{type:"struct",value:h,innerDocs:l}:i(Object.values(h),Object.values(l))},i=(u,d)=>{if(u.every(h=>h.id===u[0].id)&&d.every(h=>!h.length)){const[h]=u;return h.type==="void"?ae:{type:"array",value:u[0],len:u.length}}return{type:"tuple",value:u,innerDocs:d}};return a},Hn=e=>Cn(e);var Mn=Object.defineProperty,Vn=(e,t,n)=>t in e?Mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t,n)=>(Vn(e,typeof t!="symbol"?t+"":t,n),n),Ke={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function jn(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|Ke[e[2]]);for(let o=0;o<r;){const c=n+o*2,a=Ke[e[c]],f=Ke[e[c+1]];s[t+o++]=a<<4|f}return s}var ut=class extends Uint8Array{constructor(e){super(e),lt(this,"i",0),lt(this,"v"),this.v=new DataView(e)}},N=e=>t=>e(t instanceof ut?t:new ut(t instanceof Uint8Array?t.buffer:typeof t=="string"?jn(t).buffer:t)),X=e=>{const t=e.length;let n=0;for(let s=0;s<t;s++)n+=e[s].byteLength;const r=new Uint8Array(n);for(let s=0,o=0;s<t;s++){const c=e[s];r.set(c,o),o+=c.byteLength}return r};function Le(e,t){const n=Object.keys(e),r=n.length,s={};for(let o=0;o<r;o++){const c=n[o];s[c]=t(e[c],c)}return s}var We=N,x=(e,t)=>{const n=[e,t];return n.enc=e,n.dec=t,n},ze=(e,t)=>n=>e(t(n)),Ue=(e,t)=>n=>t(e(n)),K=([e,t],n,r)=>x(ze(e,n),Ue(t,r));function Rn(e,t){return N(n=>{const r=n.v[t](n.i,!0);return n.i+=e,r})}function Pn(e,t){return n=>{const r=new Uint8Array(e);return new DataView(r.buffer)[t](0,n,!0),r}}function Z(e,t,n){return x(Pn(e,n),Rn(e,t))}var L=Z(1,"getUint8","setUint8"),me=Z(2,"getUint16","setUint16"),ee=Z(4,"getUint32","setUint32"),Se=Z(8,"getBigUint64","setBigUint64"),Nn=Z(1,"getInt8","setInt8"),qn=Z(2,"getInt16","setInt16"),Fn=Z(4,"getInt32","setInt32"),Xn=Z(8,"getBigInt64","setBigInt64"),ht=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),t},dt=e=>N(t=>{const{v:n,i:r}=t,s=n.getBigUint64(r,!0),o=n[e](r+8,!0);return t.i+=16,o<<64n|s}),Kn=x(ht,dt("getBigUint64")),Wn=x(ht,dt("getBigInt64")),ft=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),n.setBigInt64(16,e>>128n,!0),n.setBigInt64(24,e>>192n,!0),t},yt=e=>N(t=>{let n=t.v.getBigUint64(t.i,!0);return t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<64n,t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<128n,t.i+=8,n|=t.v[e](t.i,!0)<<192n,t.i+=8,n}),zn=x(ft,yt("getBigUint64")),Gn=x(ft,yt("getBigInt64")),Ge=K(L,e=>e?1:0,Boolean),Yn=[L[1],me[1],ee[1]],Jn=N(e=>{const t=e[e.i],n=t&3;if(n<3)return Yn[n](e)>>>2;const r=(t>>>2)+4;e.i++;let s=0n;const o=r/8|0;let c=0n;for(let f=0;f<o;f++)s=Se[1](e)<<c|s,c+=64n;let a=r%8;return a>3&&(s=BigInt(ee[1](e))<<c|s,c+=32n,a-=4),a>1&&(s=BigInt(me[1](e))<<c|s,c+=16n,a-=2),a&&(s=BigInt(L[1](e))<<c|s),s}),Qn=1n<<56n,Zn=1<<24,er=256,tr=4294967295n,nr=64,rr=16384,sr=1<<30,or=e=>{if(e<0)throw new Error(`Wrong compact input (${e})`);const t=Number(e)<<2;if(e<nr)return L[0](t);if(e<rr)return me[0](t|1);if(e<sr)return ee[0](t|2);let n=[new Uint8Array(1)],r=BigInt(e);for(;r>=Qn;)n.push(Se[0](r)),r>>=64n;r>=Zn&&(n.push(ee[0](Number(r&tr))),r>>=32n);let s=Number(r);s>=er&&(n.push(me[0](s)),s>>=16),s&&n.push(L[0](s));const o=X(n);return o[0]=o.length-5<<2|3,o},T=x(or,Jn),cr=new TextEncoder,ir=e=>{const t=cr.encode(e);return X([T.enc(t.length),t])},ar=new TextDecoder,lr=N(e=>{let t=T.dec(e);const n=new DataView(e.buffer,e.i,t);return e.i+=t,ar.decode(n)}),A=x(ir,lr),ur=()=>{},hr=new Uint8Array(0),v=x(()=>hr,ur),pt=e=>e===void 0?t=>X([T.enc(t.length),t]):t=>t.length===e?t:t.slice(0,e),gt=e=>N(t=>{const n=e===void 0?T.dec(t):e!==1/0?e:t.byteLength-t.i,r=new Uint8Array(t.buffer.slice(t.i,t.i+n));return t.i+=n,r}),D=e=>x(pt(e),gt(e));D.enc=pt,D.dec=gt;var bt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((o,c)=>[n[c],o])??n.map((o,c)=>[o,c])),s=o=>r.get(o);return({tag:o,value:c})=>X([L.enc(s(o)),e[o](c)])},wt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((s,o)=>[s,n[o]])??n.map((s,o)=>[o,s]));return N(s=>{const o=L.dec(s),c=r.get(o),a=e[c];return{tag:c,value:a(s)}})},q=(e,...t)=>x(bt(Le(e,([n])=>n),...t),wt(Le(e,([,n])=>n),...t));q.enc=bt,q.dec=wt;var mt=e=>N(t=>{const n=L.dec(t);if(n!==0)return e===Ge[1]?n===1:e(t)}),vt=e=>t=>{const n=new Uint8Array(1);return t===void 0?(n[0]=0,n):(n[0]=1,e===Ge[0]?(n[0]=t?1:2,n):X([n,e(t)]))},V=e=>x(vt(e[0]),mt(e[1]));V.enc=vt,V.dec=mt;var kt=(e,t)=>N(n=>{const r=L[1](n)===0,o=(r?e:t)(n);return{success:r,value:o}}),Et=(e,t)=>({success:n,value:r})=>X([L[0](n?0:1),(n?e:t)(r)]),De=(e,t)=>x(Et(e[0],t[0]),kt(e[1],t[1]));De.dec=kt,De.enc=Et;var xt=(...e)=>N(t=>e.map(n=>n(t))),Bt=(...e)=>t=>X(e.map((n,r)=>n(t[r]))),F=(...e)=>x(Bt(...e.map(([t])=>t)),xt(...e.map(([,t])=>t)));F.enc=Bt,F.dec=xt;var It=e=>{const t=Object.keys(e);return ze(F.enc(...Object.values(e)),n=>t.map(r=>n[r]))},At=e=>{const t=Object.keys(e);return Ue(F.dec(...Object.values(e)),n=>Object.fromEntries(n.map((r,s)=>[t[s],r])))},m=e=>x(It(Le(e,t=>t[0])),At(Le(e,t=>t[1])));m.enc=It,m.dec=At;var Ot=(e,t)=>t>=0?n=>X(n.map(e)):n=>X([T.enc(n.length),X(n.map(e))]),_t=(e,t)=>N(n=>{const r=t>=0?t:T.dec(n),s=new Array(r);for(let o=0;o<r;o++)s[o]=e(n);return s}),B=(e,t)=>x(Ot(e[0],t),_t(e[1],t));B.enc=Ot,B.dec=_t;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function dr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function fr(...e){const t=o=>o,n=(o,c)=>a=>o(c(a)),r=e.map(o=>o.encode).reduceRight(n,t),s=e.map(o=>o.decode).reduce(n,t);return{encode:r,decode:s}}function yr(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function pr(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function Lt(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const s=[],o=Array.from(e);for(o.forEach(c=>{if(c<0||c>=t)throw new Error(`Wrong integer: ${c}`)});;){let c=0,a=!0;for(let f=r;f<o.length;f++){const i=o[f],u=t*c+i;if(!Number.isSafeInteger(u)||t*c/t!==c||u-i!==t*c)throw new Error("convertRadix: carry overflow");c=u%n;const d=Math.floor(u/n);if(o[f]=d,!Number.isSafeInteger(d)||d*n+c!==u)throw new Error("convertRadix: carry overflow");if(a)d?a=!1:r=f;else continue}if(s.push(c),a)break}for(let c=0;c<e.length-1&&e[c]===0;c++)s.push(0);return s.reverse()}function gr(e){return{encode:t=>{if(!dr(t))throw new Error("radix.encode input should be Uint8Array");return Lt(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(Lt(t,e,2**8))}}}const Ut=(e=>fr(gr(58),yr(e),pr("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function le(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function br(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function $e(e,...t){if(!br(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function ve(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ye(e,t){$e(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wr=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ue=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Te=(e,t)=>e<<32-t|e>>>t,C=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,St=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,W=C?e=>e:e=>St(e);function H(e){for(let t=0;t<e.length;t++)e[t]=St(e[t])}function mr(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function z(e){return typeof e=="string"&&(e=mr(e)),$e(e),e}class Dt{clone(){return this._cloneInto()}}function vr(e){const t=r=>e().update(z(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function kr(e){const t=(r,s)=>e(s).update(z(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function Er(e){const t=(r,s)=>e(s).update(z(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const xr=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class $t extends Dt{constructor(t,n,r={},s,o,c){if(super(),this.blockLen=t,this.outputLen=n,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,le(t),le(n),le(s),n<0||n>s)throw new Error("outputLen bigger than keyLen");if(r.key!==void 0&&(r.key.length<1||r.key.length>s))throw new Error(`key must be up 1..${s} byte long or undefined`);if(r.salt!==void 0&&r.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(r.personalization!==void 0&&r.personalization.length!==c)throw new Error(`personalization must be ${c} byte long or undefined`);this.buffer32=ue(this.buffer=new Uint8Array(t))}update(t){ve(this);const{blockLen:n,buffer:r,buffer32:s}=this;t=z(t);const o=t.length,c=t.byteOffset,a=t.buffer;for(let f=0;f<o;){this.pos===n&&(C||H(s),this.compress(s,0,!1),C||H(s),this.pos=0);const i=Math.min(n-this.pos,o-f),u=c+f;if(i===n&&!(u%4)&&f+i<o){const d=new Uint32Array(a,u,Math.floor((o-f)/4));C||H(d);for(let h=0;f+n<o;h+=s.length,f+=n)this.length+=n,this.compress(d,h,!1);C||H(d);continue}r.set(t.subarray(f,f+i),this.pos),this.pos+=i,this.length+=i,f+=i}return this}digestInto(t){ve(this),Ye(t,this);const{pos:n,buffer32:r}=this;this.finished=!0,this.buffer.subarray(n).fill(0),C||H(r),this.compress(r,0,!0),C||H(r);const s=ue(t);this.get().forEach((o,c)=>s[c]=W(o))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:c,pos:a}=this;return t||(t=new this.constructor({dkLen:c})),t.set(...this.get()),t.length=r,t.finished=s,t.destroyed=o,t.outputLen=c,t.buffer.set(n),t.pos=a,t}}const Ce=BigInt(2**32-1),Je=BigInt(32);function He(e,t=!1){return t?{h:Number(e&Ce),l:Number(e>>Je&Ce)}:{h:Number(e>>Je&Ce)|0,l:Number(e&Ce)|0}}function Tt(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:c}=He(e[s],t);[n[s],r[s]]=[o,c]}return[n,r]}const Br=(e,t)=>BigInt(e>>>0)<<Je|BigInt(t>>>0),Ir=(e,t,n)=>e>>>n,Ar=(e,t,n)=>e<<32-n|t>>>n,Or=(e,t,n)=>e>>>n|t<<32-n,_r=(e,t,n)=>e<<32-n|t>>>n,Lr=(e,t,n)=>e<<64-n|t>>>n-32,Ur=(e,t,n)=>e>>>n-32|t<<64-n,Sr=(e,t)=>t,Dr=(e,t)=>e,Ct=(e,t,n)=>e<<n|t>>>32-n,Ht=(e,t,n)=>t<<n|e>>>32-n,Mt=(e,t,n)=>t<<n-32|e>>>64-n,Vt=(e,t,n)=>e<<n-32|t>>>64-n;function $r(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const M={fromBig:He,split:Tt,toBig:Br,shrSH:Ir,shrSL:Ar,rotrSH:Or,rotrSL:_r,rotrBH:Lr,rotrBL:Ur,rotr32H:Sr,rotr32L:Dr,rotlSH:Ct,rotlSL:Ht,rotlBH:Mt,rotlBL:Vt,add:$r,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,add5H:(e,t,n,r,s,o)=>t+n+r+s+o+(e/2**32|0)|0,add5L:(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},O=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),y=new Uint32Array(32);function te(e,t,n,r,s,o){const c=s[o],a=s[o+1];let f=y[2*e],i=y[2*e+1],u=y[2*t],d=y[2*t+1],h=y[2*n],l=y[2*n+1],p=y[2*r],g=y[2*r+1],b=M.add3L(f,u,c);i=M.add3H(b,i,d,a),f=b|0,{Dh:g,Dl:p}={Dh:g^i,Dl:p^f},{Dh:g,Dl:p}={Dh:M.rotr32H(g,p),Dl:M.rotr32L(g,p)},{h:l,l:h}=M.add(l,h,g,p),{Bh:d,Bl:u}={Bh:d^l,Bl:u^h},{Bh:d,Bl:u}={Bh:M.rotrSH(d,u,24),Bl:M.rotrSL(d,u,24)},y[2*e]=f,y[2*e+1]=i,y[2*t]=u,y[2*t+1]=d,y[2*n]=h,y[2*n+1]=l,y[2*r]=p,y[2*r+1]=g}function ne(e,t,n,r,s,o){const c=s[o],a=s[o+1];let f=y[2*e],i=y[2*e+1],u=y[2*t],d=y[2*t+1],h=y[2*n],l=y[2*n+1],p=y[2*r],g=y[2*r+1],b=M.add3L(f,u,c);i=M.add3H(b,i,d,a),f=b|0,{Dh:g,Dl:p}={Dh:g^i,Dl:p^f},{Dh:g,Dl:p}={Dh:M.rotrSH(g,p,16),Dl:M.rotrSL(g,p,16)},{h:l,l:h}=M.add(l,h,g,p),{Bh:d,Bl:u}={Bh:d^l,Bl:u^h},{Bh:d,Bl:u}={Bh:M.rotrBH(d,u,63),Bl:M.rotrBL(d,u,63)},y[2*e]=f,y[2*e+1]=i,y[2*t]=u,y[2*t+1]=d,y[2*n]=h,y[2*n+1]=l,y[2*r]=p,y[2*r+1]=g}class Tr extends $t{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=O[0]|0,this.v0h=O[1]|0,this.v1l=O[2]|0,this.v1h=O[3]|0,this.v2l=O[4]|0,this.v2h=O[5]|0,this.v3l=O[6]|0,this.v3h=O[7]|0,this.v4l=O[8]|0,this.v4h=O[9]|0,this.v5l=O[10]|0,this.v5h=O[11]|0,this.v6l=O[12]|0,this.v6h=O[13]|0,this.v7l=O[14]|0,this.v7h=O[15]|0;const n=t.key?t.key.length:0;if(this.v0l^=this.outputLen|n<<8|65536|1<<24,t.salt){const r=ue(z(t.salt));this.v4l^=W(r[0]),this.v4h^=W(r[1]),this.v5l^=W(r[2]),this.v5h^=W(r[3])}if(t.personalization){const r=ue(z(t.personalization));this.v6l^=W(r[0]),this.v6h^=W(r[1]),this.v7l^=W(r[2]),this.v7h^=W(r[3])}if(t.key){const r=new Uint8Array(this.blockLen);r.set(z(t.key)),this.update(r)}}get(){let{v0l:t,v0h:n,v1l:r,v1h:s,v2l:o,v2h:c,v3l:a,v3h:f,v4l:i,v4h:u,v5l:d,v5h:h,v6l:l,v6h:p,v7l:g,v7h:b}=this;return[t,n,r,s,o,c,a,f,i,u,d,h,l,p,g,b]}set(t,n,r,s,o,c,a,f,i,u,d,h,l,p,g,b){this.v0l=t|0,this.v0h=n|0,this.v1l=r|0,this.v1h=s|0,this.v2l=o|0,this.v2h=c|0,this.v3l=a|0,this.v3h=f|0,this.v4l=i|0,this.v4h=u|0,this.v5l=d|0,this.v5h=h|0,this.v6l=l|0,this.v6h=p|0,this.v7l=g|0,this.v7h=b|0}compress(t,n,r){this.get().forEach((f,i)=>y[i]=f),y.set(O,16);let{h:s,l:o}=M.fromBig(BigInt(this.length));y[24]=O[8]^o,y[25]=O[9]^s,r&&(y[28]=~y[28],y[29]=~y[29]);let c=0;const a=xr;for(let f=0;f<12;f++)te(0,4,8,12,t,n+2*a[c++]),ne(0,4,8,12,t,n+2*a[c++]),te(1,5,9,13,t,n+2*a[c++]),ne(1,5,9,13,t,n+2*a[c++]),te(2,6,10,14,t,n+2*a[c++]),ne(2,6,10,14,t,n+2*a[c++]),te(3,7,11,15,t,n+2*a[c++]),ne(3,7,11,15,t,n+2*a[c++]),te(0,5,10,15,t,n+2*a[c++]),ne(0,5,10,15,t,n+2*a[c++]),te(1,6,11,12,t,n+2*a[c++]),ne(1,6,11,12,t,n+2*a[c++]),te(2,7,8,13,t,n+2*a[c++]),ne(2,7,8,13,t,n+2*a[c++]),te(3,4,9,14,t,n+2*a[c++]),ne(3,4,9,14,t,n+2*a[c++]);this.v0l^=y[0]^y[16],this.v0h^=y[1]^y[17],this.v1l^=y[2]^y[18],this.v1h^=y[3]^y[19],this.v2l^=y[4]^y[20],this.v2h^=y[5]^y[21],this.v3l^=y[6]^y[22],this.v3h^=y[7]^y[23],this.v4l^=y[8]^y[24],this.v4h^=y[9]^y[25],this.v5l^=y[10]^y[26],this.v5h^=y[11]^y[27],this.v6l^=y[12]^y[28],this.v6h^=y[13]^y[29],this.v7l^=y[14]^y[30],this.v7h^=y[15]^y[31],y.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Me=kr(e=>new Tr(e)),jt=new TextEncoder().encode("SS58PRE"),Qe=2,Rt=e=>{try{const t=Ut.decode(e),n=t.subarray(0,t[0]&64?2:1),r=t.subarray(n.length,t.length-Qe),s=t.subarray(n.length+r.length),o=Me(Uint8Array.of(...jt,...n,...r),{dkLen:64}).subarray(0,Qe);return s[0]===o[0]&&s[1]===o[1]?{isValid:!0,ss58Format:Cr(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},Cr=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)},Pt=e=>{const t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{const r=Me(Uint8Array.of(...jt,...t,...n),{dkLen:64}).subarray(0,Qe);return Ut.encode(Uint8Array.of(...t,...n,...r))}};function Hr(e,t){return n=>{const r=Rt(n);if(!r.isValid)throw new Error("Invalid checksum");const{publicKey:s}=r;if(s.length!==e)throw new Error("Invalid public key length");return s}}const Ze=(e=42,t=32)=>K(D(t),Hr(t),Pt(e)),Nt="0123456789abcdef";function re(e){const t=new Array(e.length+1);t[0]="0x";for(let n=0;n<e.length;){const r=e[n++];t[n]=Nt[r>>4]+Nt[r&15]}return t.join("")}const et={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function Ve(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|et[e[2]]);for(let o=0;o<r;){const c=n+o*2,a=et[e[c]],f=et[e[c+1]];s[t+o++]=a<<4|f}return s}function qt(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r,n)]))}const be=(...e)=>{const t=e.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.byteLength}return n};var Mr=Object.defineProperty,Ft=e=>{throw TypeError(e)},Vr=(e,t,n)=>t in e?Mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ke=(e,t,n)=>Vr(e,typeof t!="symbol"?t+"":t,n),Xt=(e,t,n)=>t.has(e)||Ft("Cannot "+n),G=(e,t,n)=>(Xt(e,t,"read from private field"),n?n.call(e):t.get(e)),Ee=(e,t,n)=>t.has(e)?Ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Xt(e,t,"write to private field"),t.set(e,n),n),Y,xe,je,Re,Pe;const jr=new TextEncoder,Rr=new TextDecoder,Pr=F(T,D(1/0))[1];class de{constructor(t,n=!1){if(Ee(this,Y),Ee(this,xe,null),Ee(this,je,null),Ee(this,Re,null),Ee(this,Pe,null),ke(this,"asText",()=>G(this,Pe)??he(this,Pe,Rr.decode(G(this,Y)))),ke(this,"asHex",()=>G(this,je)||he(this,je,re(G(this,Y)))),ke(this,"asOpaqueHex",()=>G(this,Re)||he(this,Re,re(this.asBytes()))),ke(this,"asBytes",()=>G(this,Y)),ke(this,"asOpaqueBytes",()=>G(this,xe)||he(this,xe,be(T[0](G(this,Y).length),G(this,Y)))),n){try{const[r,s]=Pr(t);if(r===s.length){he(this,Y,s),he(this,xe,t);return}}catch{}throw new Error("Invalid opaque bytes")}else he(this,Y,t)}static fromText(t){return new this(jr.encode(t))}static fromHex(t){return new this(Ve(t))}static fromOpaqueHex(t){return new this(Ve(t),!0)}static fromBytes(t){return new this(t)}static fromOpaqueBytes(t){return new this(t,!0)}}Y=new WeakMap,xe=new WeakMap,je=new WeakMap,Re=new WeakMap,Pe=new WeakMap;const[Nr]=Ze();class Kt extends de{constructor(t){super(t)}static fromArray(t){return new this(new Uint8Array(t))}static fromAccountId32(t){return new this(Nr(t))}}const Wt=e=>{const t=D.enc(e);return n=>t(n.asBytes())},zt=e=>{const t=D.dec(e),n=e==null?de:Kt;return r=>n.fromBytes(t(r))},Be=e=>x(Wt(e),zt(e));Be.enc=Wt,Be.dec=zt;const w=T,qr=T,Fr=We(e=>{const t=w.dec(e),n=Math.ceil(t/8);return{bytes:D(n).dec(e),bitsLen:t}}),Gt=x(e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);const t=w.enc(e.bitsLen),n=new Uint8Array(e.bytes.length+t.length);return n.set(t,0),n.set(e.bytes,t.length),n},Fr),Xr=K(L,e=>e.charCodeAt(0),String.fromCharCode),Yt=e=>{const t=D.enc(e);return n=>t(Ve(n))},Jt=e=>{const t=D.dec(e);return n=>re(t(n))},se=e=>x(Yt(e),Jt(e));se.enc=Yt,se.dec=Jt;const Kr=new TextEncoder,Wr=new TextDecoder,zr=e=>K(D(e),t=>Kr.encode(t),t=>Wr.decode(t)),Qt=e=>{let t=n=>{const r=e();return t=r,r(n)};return n=>t(n)},Zt=e=>{let t=n=>{const r=e(),s=r;return t=r,s(n)};return n=>t(n)},en=e=>x(Qt(()=>e().enc),Zt(()=>e().dec)),tt=Object.assign((e,t)=>({type:e,value:t}),{is(e,t){return e.type===t},as(e,t){if(t!==e.type)throw new Error(`Enum.as(enum, ${t}) used with actual type ${e.type}`);return e}}),Gr=new Proxy({},{get(e,t){return n=>tt(t,n)}}),tn=(...e)=>{const t=q.enc(...e);return n=>t({tag:n.type,value:n.value})},nn=(...e)=>{const t=q.dec(...e);return n=>{const{tag:r,value:s}=t(n);return tt(r,s)}},fe=(e,...t)=>x(tn(qt(e,([n])=>n),...t),nn(qt(e,([,n])=>n),...t));fe.enc=tn,fe.dec=nn;const rn=[],sn=[],on=[],Yr=BigInt(0),Ie=BigInt(1),Jr=BigInt(2),Qr=BigInt(7),Zr=BigInt(256),es=BigInt(113);for(let e=0,t=Ie,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],rn.push(2*(5*r+n)),sn.push((e+1)*(e+2)/2%64);let s=Yr;for(let o=0;o<7;o++)t=(t<<Ie^(t>>Qr)*es)%Zr,t&Jr&&(s^=Ie<<(Ie<<BigInt(o))-Ie);on.push(s)}const[ts,ns]=Tt(on,!0),cn=(e,t,n)=>n>32?Mt(e,t,n):Ct(e,t,n),an=(e,t,n)=>n>32?Vt(e,t,n):Ht(e,t,n);function rs(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let c=0;c<10;c++)n[c]=e[c]^e[c+10]^e[c+20]^e[c+30]^e[c+40];for(let c=0;c<10;c+=2){const a=(c+8)%10,f=(c+2)%10,i=n[f],u=n[f+1],d=cn(i,u,1)^n[a],h=an(i,u,1)^n[a+1];for(let l=0;l<50;l+=10)e[c+l]^=d,e[c+l+1]^=h}let s=e[2],o=e[3];for(let c=0;c<24;c++){const a=sn[c],f=cn(s,o,a),i=an(s,o,a),u=rn[c];s=e[u],o=e[u+1],e[u]=f,e[u+1]=i}for(let c=0;c<50;c+=10){for(let a=0;a<10;a++)n[a]=e[c+a];for(let a=0;a<10;a++)e[c+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=ts[r],e[1]^=ns[r]}n.fill(0)}class nt extends Dt{constructor(t,n,r,s=!1,o=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,le(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ue(this.state)}keccak(){C||H(this.state32),rs(this.state32,this.rounds),C||H(this.state32),this.posOut=0,this.pos=0}update(t){ve(this);const{blockLen:n,state:r}=this;t=z(t);const s=t.length;for(let o=0;o<s;){const c=Math.min(n-this.pos,s-o);for(let a=0;a<c;a++)r[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){ve(this,!1),$e(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=r&&this.keccak();const c=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+c),s),this.posOut+=c,s+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return le(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Ye(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:c}=this;return t||(t=new nt(n,r,s,c,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=c,t.destroyed=this.destroyed,t}}const ss=((e,t,n)=>vr(()=>new nt(t,e,n)))(1,136,256/8),ln=e=>{const t=e.slice(2),n=re(ss(t)).slice(2),r=new Array(40);for(let s=0;s<40;s++){const o=parseInt(n[s],16),c=t[s];r[s]=o>7?c.toUpperCase():c}return`0x${r.join("")}`},os=D(20)[1],un=x(e=>{const t=Ve(e);if(t.length!==20)throw new Error(`Invalid length found on EthAddress(${e})`);const n=re(t);if(e===n||e===n.toUpperCase())return t;if(ln(n)!==e)throw new Error(`Invalid checksum found on EthAddress(${e})`);return t},We(e=>ln(re(os(e))))),hn=new TextEncoder,dn=new TextDecoder,cs=K(D(4),hn.encode.bind(hn),dn.decode.bind(dn)),rt=m({engine:cs,payload:se()}),is=fe({consensus:rt,seal:rt,preRuntime:rt,runtimeUpdated:v},[4,5,6,8]),st=se(32),as=m({parentHash:st,number:w,stateRoot:st,extrinsicRoot:st,digests:B(is)}),J=B(A),fn=V(A),ls=q({bool:v,char:v,str:v,u8:v,u16:v,u32:v,u64:v,u128:v,u256:v,i8:v,i16:v,i32:v,i64:v,i128:v,i256:v}),yn=B(m({name:fn,type:w,typeName:fn,docs:J})),us=m({len:ee,type:w}),hs=m({bitStoreType:w,bitOrderType:w}),ds=B(m({name:A,fields:yn,index:L,docs:J})),fs=q({composite:yn,variant:ds,sequence:w,array:us,tuple:B(w),primitive:ls,compact:w,bitSequence:hs}),ys=m({name:A,type:V(w)}),ps=B(ys),gs=m({id:w,path:J,params:ps,def:fs,docs:J}),Ne=B(gs),bs=q({Blake2128:v,Blake2256:v,Blake2128Concat:v,Twox128:v,Twox256:v,Twox64Concat:v,Identity:v}),ws=B(bs),ms=m({hashers:ws,key:w,value:w}),vs=m({name:A,modifier:L,type:q({plain:w,map:ms}),fallback:se(),docs:J}),ks=V(m({prefix:A,items:B(vs)})),pn={name:A,storage:ks,calls:V(w),events:V(w),constants:B(m({name:A,type:w,value:se(),docs:J})),errors:V(w),index:L},Es={...pn,docs:J},xs=new Uint8Array,gn=e=>x(()=>xs,()=>e),Bs=m({type:w,version:L,signedExtensions:B(m({identifier:A,type:w,additionalSigned:w}))}),bn=m({lookup:Ne,pallets:B(m({...pn,docs:gn([])})),extrinsic:Bs,type:w,apis:gn([])}),Is=m({name:A,methods:B(m({name:A,inputs:B(m({name:A,type:w})),output:w,docs:J})),docs:J}),As=m({version:L,address:w,call:w,signature:w,extra:w,signedExtensions:B(m({identifier:A,type:w,additionalSigned:w}))}),wn=m({lookup:Ne,pallets:B(m(Es)),extrinsic:As,type:w,apis:B(Is),outerEnums:m({call:w,event:w,error:w}),custom:B(F(A,m({type:w,value:se()})))}),mn=()=>{throw new Error("Unsupported metadata version!")},j=x(mn,mn),Ae=m({magicNumber:ee,metadata:q({v0:j,v1:j,v2:j,v3:j,v4:j,v5:j,v6:j,v7:j,v8:j,v9:j,v10:j,v11:j,v12:j,v13:j,v14:bn,v15:wn})}),ot=D(),Os=V(ot),_s=F(T,ot),Ls=e=>{try{return Ae.dec(e)}catch{}try{return Ae.dec(Os.dec(e))}catch{}try{return Ae.dec(ot.dec(e))}catch{}try{return Ae.dec(_s.dec(e)[1])}catch{}throw null},Us={dkLen:32},Ss=e=>Me(e,Us),Ds={dkLen:16},vn=e=>Me(e,Ds),kn=e=>be(vn(e),e),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function oe(e,t,n,r,s){return e=e+t+s|0,r=Te(r^e,16),n=n+r|0,t=Te(t^n,12),{a:e,b:t,c:n,d:r}}function ce(e,t,n,r,s){return e=e+t+s|0,r=Te(r^e,8),n=n+r|0,t=Te(t^n,7),{a:e,b:t,c:n,d:r}}function En(e,t,n,r,s,o,c,a,f,i,u,d,h,l,p,g,b,k,_,R){let I=0;for(let pe=0;pe<r;pe++)({a:s,b:f,c:h,d:b}=oe(s,f,h,b,n[t+e[I++]])),{a:s,b:f,c:h,d:b}=ce(s,f,h,b,n[t+e[I++]]),{a:o,b:i,c:l,d:k}=oe(o,i,l,k,n[t+e[I++]]),{a:o,b:i,c:l,d:k}=ce(o,i,l,k,n[t+e[I++]]),{a:c,b:u,c:p,d:_}=oe(c,u,p,_,n[t+e[I++]]),{a:c,b:u,c:p,d:_}=ce(c,u,p,_,n[t+e[I++]]),{a,b:d,c:g,d:R}=oe(a,d,g,R,n[t+e[I++]]),{a,b:d,c:g,d:R}=ce(a,d,g,R,n[t+e[I++]]),{a:s,b:i,c:p,d:R}=oe(s,i,p,R,n[t+e[I++]]),{a:s,b:i,c:p,d:R}=ce(s,i,p,R,n[t+e[I++]]),{a:o,b:u,c:g,d:b}=oe(o,u,g,b,n[t+e[I++]]),{a:o,b:u,c:g,d:b}=ce(o,u,g,b,n[t+e[I++]]),{a:c,b:d,c:h,d:k}=oe(c,d,h,k,n[t+e[I++]]),{a:c,b:d,c:h,d:k}=ce(c,d,h,k,n[t+e[I++]]),{a,b:f,c:l,d:_}=oe(a,f,l,_,n[t+e[I++]]),{a,b:f,c:l,d:_}=ce(a,f,l,_,n[t+e[I++]]);return{v0:s,v1:o,v2:c,v3:a,v4:f,v5:i,v6:u,v7:d,v8:h,v9:l,v10:p,v11:g,v12:b,v13:k,v14:_,v15:R}}const xn=(()=>{const e=Array.from({length:16},(r,s)=>s),t=r=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(s=>r[s]),n=[];for(let r=0,s=e;r<7;r++,s=t(s))n.push(...s);return Uint8Array.from(n)})();class ct extends $t{constructor(t={},n=0){if(super(64,t.dkLen===void 0?32:t.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=t.dkLen===void 0?32:t.dkLen,le(this.outputLen),t.key!==void 0&&t.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(t.key!==void 0){const r=z(t.key).slice();if(r.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=ue(r),C||H(this.IV),this.flags=n|16}else if(t.context!==void 0){const r=new ct({dkLen:32},32).update(t.context).digest();this.IV=ue(r),C||H(this.IV),this.flags=n|64}else this.IV=Q.slice(),this.flags=n;this.state=this.IV.slice(),this.bufferOut=wr(this.bufferOut32)}get(){return[]}set(){}b2Compress(t,n,r,s=0){const{state:o,pos:c}=this,{h:a,l:f}=He(BigInt(t),!0),{v0:i,v1:u,v2:d,v3:h,v4:l,v5:p,v6:g,v7:b,v8:k,v9:_,v10:R,v11:I,v12:pe,v13:Fe,v14:Xe,v15:so}=En(xn,s,r,7,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],Q[0],Q[1],Q[2],Q[3],a,f,c,n);o[0]=i^k,o[1]=u^_,o[2]=d^R,o[3]=h^I,o[4]=l^pe,o[5]=p^Fe,o[6]=g^Xe,o[7]=b^so}compress(t,n=0,r=!1){let s=this.flags;if(this.chunkPos||(s|=1),(this.chunkPos===15||r)&&(s|=2),r||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,s,t,n),this.chunkPos+=1,this.chunkPos===16||r){let o=this.state;this.state=this.IV.slice();for(let c,a=this.chunksDone+1;(r||!(a&1))&&(c=this.stack.pop());a>>=1)this.buffer32.set(c,0),this.buffer32.set(o,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|4,this.buffer32,0),o=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(o)}this.pos=0}_cloneInto(t){t=super._cloneInto(t);const{IV:n,flags:r,state:s,chunkPos:o,posOut:c,chunkOut:a,stack:f,chunksDone:i}=this;return t.state.set(s.slice()),t.stack=f.map(u=>Uint32Array.from(u)),t.IV.set(n),t.flags=r,t.chunkPos=o,t.chunksDone=i,t.posOut=c,t.chunkOut=a,t.enableXOF=this.enableXOF,t.bufferOut32.set(this.bufferOut32),t}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let t of this.stack)t.fill(0)}b2CompressOut(){const{state:t,pos:n,flags:r,buffer32:s,bufferOut32:o}=this,{h:c,l:a}=He(BigInt(this.chunkOut++));C||H(s);const{v0:f,v1:i,v2:u,v3:d,v4:h,v5:l,v6:p,v7:g,v8:b,v9:k,v10:_,v11:R,v12:I,v13:pe,v14:Fe,v15:Xe}=En(xn,0,s,7,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],Q[0],Q[1],Q[2],Q[3],a,c,n,r);o[0]=f^b,o[1]=i^k,o[2]=u^_,o[3]=d^R,o[4]=h^I,o[5]=l^pe,o[6]=p^Fe,o[7]=g^Xe,o[8]=t[0]^b,o[9]=t[1]^k,o[10]=t[2]^_,o[11]=t[3]^R,o[12]=t[4]^I,o[13]=t[5]^pe,o[14]=t[6]^Fe,o[15]=t[7]^Xe,C||(H(s),H(o)),this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let t=this.flags|8;this.stack.length?(t|=4,C||H(this.buffer32),this.compress(this.buffer32,0,!0),C||H(this.buffer32),this.chunksDone=0,this.pos=this.blockLen):t|=(this.chunkPos?0:1)|2,this.flags=t,this.b2CompressOut()}writeInto(t){ve(this,!1),$e(t),this.finish();const{blockLen:n,bufferOut:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=n&&this.b2CompressOut();const c=Math.min(n-this.posOut,o-s);t.set(r.subarray(this.posOut,this.posOut+c),s),this.posOut+=c,s+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible after digest call");return this.writeInto(t)}xof(t){return le(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Ye(t,this),this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}}const $s=Er(e=>new ct(e)),Ts={dkLen:32},Bn=e=>$s(e,Ts),Cs=e=>be(Bn(e),e),In=e=>e,ye=(e,t,n,r)=>new DataView(new Uint16Array([e,t,n,r]).buffer).getBigUint64(0,!0),it=2n**64n-1n,$=(e,t)=>e<<t&it|e>>64n-t,E=(e,t)=>e*t&it,U=(e,t)=>e+t&it,S=11400714785074694791n,P=14029467366897019727n,An=1609587929392839161n,Oe=9650029242287828579n,On=2870177450012600261n;function ie(e,t=0n){let n=U(U(t,S),P),r=U(t,P),s=t,o=t-S,c=e.length,a=0,f=null;(function(){let l=0,p=l+c;if(c){if(f=new Uint8Array(32),c<32){f.set(e.subarray(0,c),a),a+=c;return}if(l<=p-32){const g=p-32;do{let b;b=ye(e[l+1]<<8|e[l],e[l+3]<<8|e[l+2],e[l+5]<<8|e[l+4],e[l+7]<<8|e[l+6]),n=E($(U(n,E(b,P)),31n),S),l+=8,b=ye(e[l+1]<<8|e[l],e[l+3]<<8|e[l+2],e[l+5]<<8|e[l+4],e[l+7]<<8|e[l+6]),r=E($(U(r,E(b,P)),31n),S),l+=8,b=ye(e[l+1]<<8|e[l],e[l+3]<<8|e[l+2],e[l+5]<<8|e[l+4],e[l+7]<<8|e[l+6]),s=E($(U(s,E(b,P)),31n),S),l+=8,b=ye(e[l+1]<<8|e[l],e[l+3]<<8|e[l+2],e[l+5]<<8|e[l+4],e[l+7]<<8|e[l+6]),o=E($(U(o,E(b,P)),31n),S),l+=8}while(l<=g)}l<p&&(f.set(e.subarray(l,p),a),a=p-l)}})(),e=f||e;let i,u=0;for(c>=32?(i=$(n,1n),i=U(i,$(r,7n)),i=U(i,$(s,12n)),i=U(i,$(o,18n)),n=E($(E(n,P),31n),S),i=i^n,i=U(E(i,S),Oe),r=E($(E(r,P),31n),S),i=i^r,i=U(E(i,S),Oe),s=E($(E(s,P),31n),S),i=i^s,i=U(E(i,S),Oe),o=E($(E(o,P),31n),S),i=i^o,i=U(E(i,S),Oe)):i=U(t,On),i=U(i,BigInt(c));u<=a-8;){let h=ye(e[u+1]<<8|e[u],e[u+3]<<8|e[u+2],e[u+5]<<8|e[u+4],e[u+7]<<8|e[u+6]);h=E($(E(h,P),31n),S),i=U(E($(i^h,27n),S),Oe),u+=8}if(u+4<=a){let h=E(ye(e[u+1]<<8|e[u],e[u+3]<<8|e[u+2],0,0),S);i=U(E($(i^h,23n),P),An),u+=4}for(;u<a;){const h=E(ye(e[u++],0,0,0),On);i=E($(i^h,11n),S)}let d=i>>33n;return i=E(i^d,P),d=i>>29n,i=E(i^d,An),d=i>>32n,i^=d,i}const at=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigUint64(0,ie(e),!0),n.setBigUint64(8,ie(e,1n),!0),t},Hs=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigUint64(0,ie(e),!0),n.setBigUint64(8,ie(e,1n),!0),n.setBigUint64(16,ie(e,2n),!0),n.setBigUint64(24,ie(e,3n),!0),t},_n=e=>be(Se.enc(ie(e)),e),Ln=new TextEncoder;var Ms=Object.freeze({__proto__:null,AccountId:Ze,Bin:Be,Binary:de,Blake2128:vn,Blake2128Concat:kn,Blake2256:Ss,Blake3256:Bn,Blake3256Concat:Cs,Bytes:D,Enum:tt,FixedSizeBinary:Kt,Hex:se,Identity:In,Option:V,Result:De,ScaleEnum:q,Self:en,Storage:e=>{const t=at(Ln.encode(e));return(n,r,...s)=>{const o=be(t,at(Ln.encode(n))),c=re(o),a=s.map(d=>d[1]).map(d=>{switch(d){case In:return 0;case _n:return 8;case kn:return 16;default:return null}}).filter(d=>d!==null),f=d=>{if(!d.startsWith(c))throw new Error(`key does not match this storage (${e}.${n})`);if(a.length!==s.length)throw new Error("Impossible to decode this key");if(s.length===0)return[];const h=d.slice(c.length),l=new Array(s.length);for(let p=0,g=0;p<a.length;p++){const b=s[p][0];g+=a[p],l[p]=b.dec(h.slice(g*2)),g+=b.enc(l[p]).length}return l},i=s.map(([{enc:d},h])=>l=>h(d(l)));return{enc:(...d)=>re(be(o,...d.map((h,l)=>i[l](h)))),dec:r,keyDecoder:f}}},Struct:m,Tuple:F,Twox128:at,Twox256:Hs,Twox64Concat:_n,Variant:fe,Vector:B,_Enum:Gr,_void:v,bitSequence:Gt,blockHeader:as,bool:Ge,char:Xr,compact:T,compactBn:qr,compactNumber:w,createCodec:x,createDecoder:We,decAnyMetadata:Ls,enhanceCodec:K,enhanceDecoder:Ue,enhanceEncoder:ze,ethAccount:un,fixedStr:zr,fromBufferToBase58:Pt,getSs58AddressInfo:Rt,h64:ie,i128:Wn,i16:qn,i256:Gn,i32:Fn,i64:Xn,i8:Nn,metadata:Ae,selfDecoder:Zt,selfEncoder:Qt,str:A,u128:Kn,u16:me,u256:zn,u32:ee,u64:Se,u8:L,v14:bn,v14Lookup:Ne,v15:wn});const Vs=(e,t,n)=>(r,s,o,...c)=>{const{id:a}=r;if(s.has(a))return s.get(a);if(o.has(a)){const i=t(()=>s.get(a),r,...c);return s.set(a,i),i}o.add(a);let f=e(r,s,o,...c);return o.delete(a),s.has(a)&&(f=n(f,s.get(a),r,...c)),s.set(a,f),f},js=Be(),Rs=x(T[0],Ue(T[1],BigInt)),Un=Vs((e,t,n,r)=>{if(e.type==="primitive")return Ms[e.value];if(e.type==="void")return v;if(e.type==="AccountId32")return r;if(e.type==="AccountId20")return un;if(e.type==="compact")return e.isBig?Rs:T;if(e.type==="bitSequence")return Gt;const s=l=>Un(l,t,n,r),o=(l,p)=>{const g=s(l);return p?B(g,p):B(g)},c=l=>F(...l.map(s)),a=l=>{const p=Object.fromEntries(Object.entries(l).map(([g,b])=>[g,s(b)]));return m(p)};if(e.type==="sequence"&&e.value.type==="primitive"&&e.value.value==="u8")return js;if(e.type==="array")return e.value.type==="primitive"&&e.value.value==="u8"?Be(e.len):o(e.value,e.len);if(e.type==="sequence")return o(e.value);if(e.type==="tuple")return c(e.value);if(e.type==="struct")return a(e.value);if(e.type==="option")return V(s(e.value));if(e.type==="result")return De(s(e.value.ok),s(e.value.ko));const f=Object.values(e.value).map(l=>{switch(l.type){case"void":return v;case"lookupEntry":return s(l.value);case"tuple":return c(l.value);case"struct":return a(l.value);case"array":return o(l.value,l.len)}}),i=Object.fromEntries(Object.keys(e.value).map((l,p)=>[l,f[p]])),u=Object.values(e.value).map(l=>l.idx),h=u.every((l,p)=>l===p)?fe(i):fe(i,u);return e.byteLength?Ns(h,e.byteLength):h},en,e=>e),Ps=(e,t=Ze())=>{const n=new Map,r=s=>Un(e(s),n,new Set,t);return s=>r(s)},Ns=(e,t)=>{const n=D(t);return x(r=>n.enc(e.enc(r)),r=>e.dec(n.dec(r)))},qs=e=>{const{metadata:t}=e,n=Ps(e),r=i=>{if("root"in i)return r(i.root.layout);if("leaf"in i)return n(i.leaf.ty);if("hash"in i)throw new Error("HashLayout not implemented");if("array"in i)return B(r(i.array.layout),i.array.len);if("struct"in i)return m(Object.fromEntries(i.struct.fields.map(d=>[d.name,r(d.layout)])));const u=Object.values(i.enum.variants);if(i.enum.name==="Option"&&u.length===2&&u[0].name==="None"&&u[1].name==="Some"){const d=u[1].fields.length===1?r(u[1].fields[0].layout):F(...u[1].fields.map(h=>r(h.layout)));return V(d)}return q(Object.fromEntries(Object.values(i.enum.variants).map(d=>[d.name,m(Object.fromEntries(d.fields.map(h=>[h.name,r(h.layout)])))])))},s=()=>r(t.storage),o=i=>{const u=de.fromHex(i.selector).asBytes(),d=m(Object.fromEntries(i.args.map(l=>[l.label,n(l.type.type)]))),h=F(D(4),d);return{call:K(h,l=>[u,l],([,l])=>l),value:n(i.returnType.type)}};return{buildConstructor:i=>{const u=t.spec.constructors.find(d=>d.label===i);if(!u)throw new Error(`Constructor ${i} not found`);return o(u)},buildMessage:i=>{const u=t.spec.messages.find(d=>d.label===i);if(!u)throw new Error(`Message ${i} not found`);return o(u)},buildStorageRoot:s,buildEvent:()=>fe(Object.fromEntries(t.spec.events.map(i=>[i.label,m(Object.fromEntries(i.args.map(u=>[u.label,n(u.type.type)])))])))}},Sn=e=>K(q(e),t=>{if(typeof t=="string")return{tag:t,value:void 0};const[n,r]=Object.entries(t)[0];return{tag:n,value:r}},t=>({[t.tag]:t.value})),_e=(e,t)=>K(B(e,t),n=>n??[],n=>n),Dn=V(A),qe=_e(A),Fs=Sn({bool:v,char:v,str:v,u8:v,u16:v,u32:v,u64:v,u128:v,u256:v,i8:v,i16:v,i32:v,i64:v,i128:v,i256:v}),$n=_e(m({name:Dn,type:w,typeName:Dn,docs:qe})),Xs=m({len:ee,type:w}),Ks=m({bitStoreType:w,bitOrderType:w}),Ws=_e(m({name:A,fields:$n,index:L,docs:qe})),zs=Sn({composite:m({fields:$n}),variant:m({variants:Ws}),sequence:m({type:w}),array:Xs,tuple:B(w),primitive:Fs,compact:w,bitSequence:Ks}),Gs=m({name:A,type:V(w)}),Ys=_e(Gs),Js=m({id:w,path:qe,params:Ys,def:zs,docs:qe}),Qs=K(Js,e=>({id:e.id,path:e.type.path,params:e.type.params??[],def:e.type.def,docs:[]}),e=>({id:e.id,type:{def:e.def,path:e.path,params:e.params}})),Zs=_e(Qs),eo=e=>{const t=Zs.enc(e.types),n=Ne.dec(t),r=e.spec.environment.accountId.type,s=n.find(c=>c.id===r);s&&(s.path=["AccountId32"]);const o=Hn(n);return Object.assign(o,{metadata:e})},to=e=>{const t=eo(e.metadata),n=qs(t);return{constructor:Tn(n.buildConstructor),message:Tn(n.buildMessage),storage:no(t,n.buildStorageRoot),event:ro(n.buildEvent)}},Tn=e=>t=>{const n=e(t);return{encode:r=>de.fromBytes(n.call.enc(r||{})),decode:r=>n.value.dec(r.data.asBytes())}},no=(e,t)=>{const{metadata:n}=e,r=de.fromHex(n.storage.root.root_key);return{rootKey:Number(n.version)===4?de.fromBytes(r.asBytes().reverse()):r,decodeRoot:o=>t().dec(o.asBytes())}},ro=e=>{const t=n=>e().dec(n.data.asBytes());return{decode:t,filter:(n,r=[])=>r.map(s=>"event"in s?s.event:s).filter(s=>s.type==="Contracts"&&s.value.type==="ContractEmitted"&&s.value.value.contract===n).map(s=>{try{return t(s.value.value)}catch(o){throw console.error(`Contract ${n} emitted an incompatible event`,s.value.value),o}})}};we.getInkClient=to});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(be,ke){typeof exports=="object"&&typeof module<"u"?ke(exports):typeof define=="function"&&define.amd?define(["exports"],ke):(be=typeof globalThis<"u"?globalThis:be||self,ke(be.papiPjsSigner={}))})(this,function(be){"use strict";var ke=Object.defineProperty,Vn=(e,t,n)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ut=(e,t,n)=>(Vn(e,typeof t!="symbol"?t+"":t,n),n),Ke={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function jn(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|Ke[e[2]]);for(let o=0;o<r;){const i=n+o*2,c=Ke[e[i]],y=Ke[e[i+1]];s[t+o++]=c<<4|y}return s}var ht=class extends Uint8Array{constructor(e){super(e),ut(this,"i",0),ut(this,"v"),this.v=new DataView(e)}},F=e=>t=>e(t instanceof ht?t:new ht(t instanceof Uint8Array?t.buffer:typeof t=="string"?jn(t).buffer:t)),K=e=>{const t=e.length;let n=0;for(let s=0;s<t;s++)n+=e[s].byteLength;const r=new Uint8Array(n);for(let s=0,o=0;s<t;s++){const i=e[s];r.set(i,o),o+=i.byteLength}return r};function Te(e,t){const n=Object.keys(e),r=n.length,s={};for(let o=0;o<r;o++){const i=n[o];s[i]=t(e[i],i)}return s}var We=F,k=(e,t)=>{const n=[e,t];return n.enc=e,n.dec=t,n},De=(e,t)=>n=>e(t(n)),$e=(e,t)=>n=>t(e(n)),we=([e,t],n,r)=>k(De(e,n),$e(t,r));function Rn(e,t){return F(n=>{const r=n.v[t](n.i,!0);return n.i+=e,r})}function Nn(e,t){return n=>{const r=new Uint8Array(e);return new DataView(r.buffer)[t](0,n,!0),r}}function re(e,t,n){return k(Nn(e,n),Rn(e,t))}var _=re(1,"getUint8","setUint8"),Ee=re(2,"getUint16","setUint16"),z=re(4,"getUint32","setUint32"),Me=re(8,"getBigUint64","setBigUint64"),Fn=re(1,"getInt8","setInt8"),qn=re(2,"getInt16","setInt16"),Xn=re(4,"getInt32","setInt32"),Kn=re(8,"getBigInt64","setBigInt64"),dt=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),t},ft=e=>F(t=>{const{v:n,i:r}=t,s=n.getBigUint64(r,!0),o=n[e](r+8,!0);return t.i+=16,o<<64n|s}),Wn=k(dt,ft("getBigUint64")),Gn=k(dt,ft("getBigInt64")),yt=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),n.setBigInt64(16,e>>128n,!0),n.setBigInt64(24,e>>192n,!0),t},pt=e=>F(t=>{let n=t.v.getBigUint64(t.i,!0);return t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<64n,t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<128n,t.i+=8,n|=t.v[e](t.i,!0)<<192n,t.i+=8,n}),zn=k(yt,pt("getBigUint64")),Yn=k(yt,pt("getBigInt64")),Ge=we(_,e=>e?1:0,Boolean),Jn=[_[1],Ee[1],z[1]],Qn=F(e=>{const t=e[e.i],n=t&3;if(n<3)return Jn[n](e)>>>2;const r=(t>>>2)+4;e.i++;let s=0n;const o=r/8|0;let i=0n;for(let y=0;y<o;y++)s=Me[1](e)<<i|s,i+=64n;let c=r%8;return c>3&&(s=BigInt(z[1](e))<<i|s,i+=32n,c-=4),c>1&&(s=BigInt(Ee[1](e))<<i|s,i+=16n,c-=2),c&&(s=BigInt(_[1](e))<<i|s),s}),Zn=1n<<56n,er=1<<24,tr=256,nr=4294967295n,rr=64,sr=16384,or=1<<30,ir=e=>{if(e<0)throw new Error(`Wrong compact input (${e})`);const t=Number(e)<<2;if(e<rr)return _[0](t);if(e<sr)return Ee[0](t|1);if(e<or)return z[0](t|2);let n=[new Uint8Array(1)],r=BigInt(e);for(;r>=Zn;)n.push(Me[0](r)),r>>=64n;r>=er&&(n.push(z[0](Number(r&nr))),r>>=32n);let s=Number(r);s>=tr&&(n.push(Ee[0](s)),s>>=16),s&&n.push(_[0](s));const o=K(n);return o[0]=o.length-5<<2|3,o},U=k(ir,Qn),cr=new TextEncoder,ar=e=>{const t=cr.encode(e);return K([U.enc(t.length),t])},lr=new TextDecoder,ur=F(e=>{let t=U.dec(e);const n=new DataView(e.buffer,e.i,t);return e.i+=t,lr.decode(n)}),M=k(ar,ur),hr=()=>{},dr=new Uint8Array(0),E=k(()=>dr,hr),gt=e=>e===void 0?t=>K([U.enc(t.length),t]):t=>t.length===e?t:t.slice(0,e),bt=e=>F(t=>{const n=e===void 0?U.dec(t):e!==1/0?e:t.byteLength-t.i,r=new Uint8Array(t.buffer.slice(t.i,t.i+n));return t.i+=n,r}),C=e=>k(gt(e),bt(e));C.enc=gt,C.dec=bt;var wt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((o,i)=>[n[i],o])??n.map((o,i)=>[o,i])),s=o=>r.get(o);return({tag:o,value:i})=>K([_.enc(s(o)),e[o](i)])},vt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((s,o)=>[s,n[o]])??n.map((s,o)=>[o,s]));return F(s=>{const o=_.dec(s),i=r.get(o),c=e[i];return{tag:i,value:c(s)}})},W=(e,...t)=>k(wt(Te(e,([n])=>n),...t),vt(Te(e,([,n])=>n),...t));W.enc=wt,W.dec=vt;var mt=e=>F(t=>{const n=_.dec(t);if(n!==0)return e===Ge[1]?n===1:e(t)}),xt=e=>t=>{const n=new Uint8Array(1);return t===void 0?(n[0]=0,n):(n[0]=1,e===Ge[0]?(n[0]=t?1:2,n):K([n,e(t)]))},q=e=>k(xt(e[0]),mt(e[1]));q.enc=xt,q.dec=mt;var kt=(e,t)=>F(n=>{const r=_[1](n)===0,o=(r?e:t)(n);return{success:r,value:o}}),Et=(e,t)=>({success:n,value:r})=>K([_[0](n?0:1),(n?e:t)(r)]),He=(e,t)=>k(Et(e[0],t[0]),kt(e[1],t[1]));He.dec=kt,He.enc=Et;var Bt=(...e)=>F(t=>e.map(n=>n(t))),It=(...e)=>t=>K(e.map((n,r)=>n(t[r]))),X=(...e)=>k(It(...e.map(([t])=>t)),Bt(...e.map(([,t])=>t)));X.enc=It,X.dec=Bt;var At=e=>{const t=Object.keys(e);return De(X.enc(...Object.values(e)),n=>t.map(r=>n[r]))},Ot=e=>{const t=Object.keys(e);return $e(X.dec(...Object.values(e)),n=>Object.fromEntries(n.map((r,s)=>[t[s],r])))},m=e=>k(At(Te(e,t=>t[0])),Ot(Te(e,t=>t[1])));m.enc=At,m.dec=Ot;var _t=(e,t)=>t>=0?n=>K(n.map(e)):n=>K([U.enc(n.length),K(n.map(e))]),Ut=(e,t)=>F(n=>{const r=t>=0?t:U.dec(n),s=new Array(r);for(let o=0;o<r;o++)s[o]=e(n);return s}),I=(e,t)=>k(_t(e[0],t),Ut(e[1],t));I.enc=_t,I.dec=Ut;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function fr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function yr(...e){const t=o=>o,n=(o,i)=>c=>o(i(c)),r=e.map(o=>o.encode).reduceRight(n,t),s=e.map(o=>o.decode).reduce(n,t);return{encode:r,decode:s}}function pr(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function gr(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function Lt(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const s=[],o=Array.from(e);for(o.forEach(i=>{if(i<0||i>=t)throw new Error(`Wrong integer: ${i}`)});;){let i=0,c=!0;for(let y=r;y<o.length;y++){const h=o[y],d=t*i+h;if(!Number.isSafeInteger(d)||t*i/t!==i||d-h!==t*i)throw new Error("convertRadix: carry overflow");i=d%n;const l=Math.floor(d/n);if(o[y]=l,!Number.isSafeInteger(l)||l*n+i!==d)throw new Error("convertRadix: carry overflow");if(c)l?c=!1:r=y;else continue}if(s.push(i),c)break}for(let i=0;i<e.length-1&&e[i]===0;i++)s.push(0);return s.reverse()}function br(e){return{encode:t=>{if(!fr(t))throw new Error("radix.encode input should be Uint8Array");return Lt(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(Lt(t,e,2**8))}}}const St=(e=>yr(br(58),pr(e),gr("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function he(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function wr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Pe(e,...t){if(!wr(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Be(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ze(e,t){Pe(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vr=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),de=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ve=(e,t)=>e<<32-t|e>>>t,H=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Ct=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,Y=H?e=>e:e=>Ct(e);function P(e){for(let t=0;t<e.length;t++)e[t]=Ct(e[t])}function mr(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function J(e){return typeof e=="string"&&(e=mr(e)),Pe(e),e}class Tt{clone(){return this._cloneInto()}}function xr(e){const t=r=>e().update(J(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function kr(e){const t=(r,s)=>e(s).update(J(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function Er(e){const t=(r,s)=>e(s).update(J(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const Br=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class Dt extends Tt{constructor(t,n,r={},s,o,i){if(super(),this.blockLen=t,this.outputLen=n,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,he(t),he(n),he(s),n<0||n>s)throw new Error("outputLen bigger than keyLen");if(r.key!==void 0&&(r.key.length<1||r.key.length>s))throw new Error(`key must be up 1..${s} byte long or undefined`);if(r.salt!==void 0&&r.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(r.personalization!==void 0&&r.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=de(this.buffer=new Uint8Array(t))}update(t){Be(this);const{blockLen:n,buffer:r,buffer32:s}=this;t=J(t);const o=t.length,i=t.byteOffset,c=t.buffer;for(let y=0;y<o;){this.pos===n&&(H||P(s),this.compress(s,0,!1),H||P(s),this.pos=0);const h=Math.min(n-this.pos,o-y),d=i+y;if(h===n&&!(d%4)&&y+h<o){const l=new Uint32Array(c,d,Math.floor((o-y)/4));H||P(l);for(let u=0;y+n<o;u+=s.length,y+=n)this.length+=n,this.compress(l,u,!1);H||P(l);continue}r.set(t.subarray(y,y+h),this.pos),this.pos+=h,this.length+=h,y+=h}return this}digestInto(t){Be(this),ze(t,this);const{pos:n,buffer32:r}=this;this.finished=!0,this.buffer.subarray(n).fill(0),H||P(r),this.compress(r,0,!0),H||P(r);const s=de(t);this.get().forEach((o,i)=>s[i]=Y(o))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:i,pos:c}=this;return t||(t=new this.constructor({dkLen:i})),t.set(...this.get()),t.length=r,t.finished=s,t.destroyed=o,t.outputLen=i,t.buffer.set(n),t.pos=c,t}}const je=BigInt(2**32-1),Ye=BigInt(32);function Re(e,t=!1){return t?{h:Number(e&je),l:Number(e>>Ye&je)}:{h:Number(e>>Ye&je)|0,l:Number(e&je)|0}}function $t(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:i}=Re(e[s],t);[n[s],r[s]]=[o,i]}return[n,r]}const Ir=(e,t)=>BigInt(e>>>0)<<Ye|BigInt(t>>>0),Ar=(e,t,n)=>e>>>n,Or=(e,t,n)=>e<<32-n|t>>>n,_r=(e,t,n)=>e>>>n|t<<32-n,Ur=(e,t,n)=>e<<32-n|t>>>n,Lr=(e,t,n)=>e<<64-n|t>>>n-32,Sr=(e,t,n)=>e>>>n-32|t<<64-n,Cr=(e,t)=>t,Tr=(e,t)=>e,Mt=(e,t,n)=>e<<n|t>>>32-n,Ht=(e,t,n)=>t<<n|e>>>32-n,Pt=(e,t,n)=>t<<n-32|e>>>64-n,Vt=(e,t,n)=>e<<n-32|t>>>64-n;function Dr(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const V={fromBig:Re,split:$t,toBig:Ir,shrSH:Ar,shrSL:Or,rotrSH:_r,rotrSL:Ur,rotrBH:Lr,rotrBL:Sr,rotr32H:Cr,rotr32L:Tr,rotlSH:Mt,rotlSL:Ht,rotlBH:Pt,rotlBL:Vt,add:Dr,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,add5H:(e,t,n,r,s,o)=>t+n+r+s+o+(e/2**32|0)|0,add5L:(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},O=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),g=new Uint32Array(32);function se(e,t,n,r,s,o){const i=s[o],c=s[o+1];let y=g[2*e],h=g[2*e+1],d=g[2*t],l=g[2*t+1],u=g[2*n],a=g[2*n+1],f=g[2*r],p=g[2*r+1],b=V.add3L(y,d,i);h=V.add3H(b,h,l,c),y=b|0,{Dh:p,Dl:f}={Dh:p^h,Dl:f^y},{Dh:p,Dl:f}={Dh:V.rotr32H(p,f),Dl:V.rotr32L(p,f)},{h:a,l:u}=V.add(a,u,p,f),{Bh:l,Bl:d}={Bh:l^a,Bl:d^u},{Bh:l,Bl:d}={Bh:V.rotrSH(l,d,24),Bl:V.rotrSL(l,d,24)},g[2*e]=y,g[2*e+1]=h,g[2*t]=d,g[2*t+1]=l,g[2*n]=u,g[2*n+1]=a,g[2*r]=f,g[2*r+1]=p}function oe(e,t,n,r,s,o){const i=s[o],c=s[o+1];let y=g[2*e],h=g[2*e+1],d=g[2*t],l=g[2*t+1],u=g[2*n],a=g[2*n+1],f=g[2*r],p=g[2*r+1],b=V.add3L(y,d,i);h=V.add3H(b,h,l,c),y=b|0,{Dh:p,Dl:f}={Dh:p^h,Dl:f^y},{Dh:p,Dl:f}={Dh:V.rotrSH(p,f,16),Dl:V.rotrSL(p,f,16)},{h:a,l:u}=V.add(a,u,p,f),{Bh:l,Bl:d}={Bh:l^a,Bl:d^u},{Bh:l,Bl:d}={Bh:V.rotrBH(l,d,63),Bl:V.rotrBL(l,d,63)},g[2*e]=y,g[2*e+1]=h,g[2*t]=d,g[2*t+1]=l,g[2*n]=u,g[2*n+1]=a,g[2*r]=f,g[2*r+1]=p}class $r extends Dt{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=O[0]|0,this.v0h=O[1]|0,this.v1l=O[2]|0,this.v1h=O[3]|0,this.v2l=O[4]|0,this.v2h=O[5]|0,this.v3l=O[6]|0,this.v3h=O[7]|0,this.v4l=O[8]|0,this.v4h=O[9]|0,this.v5l=O[10]|0,this.v5h=O[11]|0,this.v6l=O[12]|0,this.v6h=O[13]|0,this.v7l=O[14]|0,this.v7h=O[15]|0;const n=t.key?t.key.length:0;if(this.v0l^=this.outputLen|n<<8|65536|1<<24,t.salt){const r=de(J(t.salt));this.v4l^=Y(r[0]),this.v4h^=Y(r[1]),this.v5l^=Y(r[2]),this.v5h^=Y(r[3])}if(t.personalization){const r=de(J(t.personalization));this.v6l^=Y(r[0]),this.v6h^=Y(r[1]),this.v7l^=Y(r[2]),this.v7h^=Y(r[3])}if(t.key){const r=new Uint8Array(this.blockLen);r.set(J(t.key)),this.update(r)}}get(){let{v0l:t,v0h:n,v1l:r,v1h:s,v2l:o,v2h:i,v3l:c,v3h:y,v4l:h,v4h:d,v5l:l,v5h:u,v6l:a,v6h:f,v7l:p,v7h:b}=this;return[t,n,r,s,o,i,c,y,h,d,l,u,a,f,p,b]}set(t,n,r,s,o,i,c,y,h,d,l,u,a,f,p,b){this.v0l=t|0,this.v0h=n|0,this.v1l=r|0,this.v1h=s|0,this.v2l=o|0,this.v2h=i|0,this.v3l=c|0,this.v3h=y|0,this.v4l=h|0,this.v4h=d|0,this.v5l=l|0,this.v5h=u|0,this.v6l=a|0,this.v6h=f|0,this.v7l=p|0,this.v7h=b|0}compress(t,n,r){this.get().forEach((y,h)=>g[h]=y),g.set(O,16);let{h:s,l:o}=V.fromBig(BigInt(this.length));g[24]=O[8]^o,g[25]=O[9]^s,r&&(g[28]=~g[28],g[29]=~g[29]);let i=0;const c=Br;for(let y=0;y<12;y++)se(0,4,8,12,t,n+2*c[i++]),oe(0,4,8,12,t,n+2*c[i++]),se(1,5,9,13,t,n+2*c[i++]),oe(1,5,9,13,t,n+2*c[i++]),se(2,6,10,14,t,n+2*c[i++]),oe(2,6,10,14,t,n+2*c[i++]),se(3,7,11,15,t,n+2*c[i++]),oe(3,7,11,15,t,n+2*c[i++]),se(0,5,10,15,t,n+2*c[i++]),oe(0,5,10,15,t,n+2*c[i++]),se(1,6,11,12,t,n+2*c[i++]),oe(1,6,11,12,t,n+2*c[i++]),se(2,7,8,13,t,n+2*c[i++]),oe(2,7,8,13,t,n+2*c[i++]),se(3,4,9,14,t,n+2*c[i++]),oe(3,4,9,14,t,n+2*c[i++]);this.v0l^=g[0]^g[16],this.v0h^=g[1]^g[17],this.v1l^=g[2]^g[18],this.v1h^=g[3]^g[19],this.v2l^=g[4]^g[20],this.v2h^=g[5]^g[21],this.v3l^=g[6]^g[22],this.v3h^=g[7]^g[23],this.v4l^=g[8]^g[24],this.v4h^=g[9]^g[25],this.v5l^=g[10]^g[26],this.v5h^=g[11]^g[27],this.v6l^=g[12]^g[28],this.v6h^=g[13]^g[29],this.v7l^=g[14]^g[30],this.v7h^=g[15]^g[31],g.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Ne=kr(e=>new $r(e)),jt=new TextEncoder().encode("SS58PRE"),Je=2,Rt=e=>{try{const t=St.decode(e),n=t.subarray(0,t[0]&64?2:1),r=t.subarray(n.length,t.length-Je),s=t.subarray(n.length+r.length),o=Ne(Uint8Array.of(...jt,...n,...r),{dkLen:64}).subarray(0,Je);return s[0]===o[0]&&s[1]===o[1]?{isValid:!0,ss58Format:Mr(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},Mr=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)},Nt=e=>{const t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{const r=Ne(Uint8Array.of(...jt,...t,...n),{dkLen:64}).subarray(0,Je);return St.encode(Uint8Array.of(...t,...n,...r))}};function Hr(e,t){return n=>{const r=Rt(n);if(!r.isValid)throw new Error("Invalid checksum");const{publicKey:s}=r;if(s.length!==e)throw new Error("Invalid public key length");return s}}const Ie=(e=42,t=32)=>we(C(t),Hr(t),Nt(e)),Ft="0123456789abcdef";function j(e){const t=new Array(e.length+1);t[0]="0x";for(let n=0;n<e.length;){const r=e[n++];t[n]=Ft[r>>4]+Ft[r&15]}return t.join("")}const Qe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function fe(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|Qe[e[2]]);for(let o=0;o<r;){const i=n+o*2,c=Qe[e[i]],y=Qe[e[i+1]];s[t+o++]=c<<4|y}return s}function Ze(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r,n)]))}const ie=(...e)=>{const t=e.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.byteLength}return n};var Pr=Object.defineProperty,qt=e=>{throw TypeError(e)},Vr=(e,t,n)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ae=(e,t,n)=>Vr(e,typeof t!="symbol"?t+"":t,n),Xt=(e,t,n)=>t.has(e)||qt("Cannot "+n),Q=(e,t,n)=>(Xt(e,t,"read from private field"),n?n.call(e):t.get(e)),Oe=(e,t,n)=>t.has(e)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,r)=>(Xt(e,t,"write to private field"),t.set(e,n),n),Z,_e,Fe,qe,Xe;const jr=new TextEncoder,Rr=new TextDecoder,Nr=X(U,C(1/0))[1];class et{constructor(t,n=!1){if(Oe(this,Z),Oe(this,_e,null),Oe(this,Fe,null),Oe(this,qe,null),Oe(this,Xe,null),Ae(this,"asText",()=>Q(this,Xe)??ye(this,Xe,Rr.decode(Q(this,Z)))),Ae(this,"asHex",()=>Q(this,Fe)||ye(this,Fe,j(Q(this,Z)))),Ae(this,"asOpaqueHex",()=>Q(this,qe)||ye(this,qe,j(this.asBytes()))),Ae(this,"asBytes",()=>Q(this,Z)),Ae(this,"asOpaqueBytes",()=>Q(this,_e)||ye(this,_e,ie(U[0](Q(this,Z).length),Q(this,Z)))),n){try{const[r,s]=Nr(t);if(r===s.length){ye(this,Z,s),ye(this,_e,t);return}}catch{}throw new Error("Invalid opaque bytes")}else ye(this,Z,t)}static fromText(t){return new this(jr.encode(t))}static fromHex(t){return new this(fe(t))}static fromOpaqueHex(t){return new this(fe(t),!0)}static fromBytes(t){return new this(t)}static fromOpaqueBytes(t){return new this(t,!0)}}Z=new WeakMap,_e=new WeakMap,Fe=new WeakMap,qe=new WeakMap,Xe=new WeakMap;class Kt extends et{constructor(t){super(t)}static fromArray(t){return new this(new Uint8Array(t))}}const Wt=e=>{const t=C.enc(e);return n=>t(n.asBytes())},Gt=e=>{const t=C.dec(e),n=e==null?et:Kt;return r=>n.fromBytes(t(r))},Ue=e=>k(Wt(e),Gt(e));Ue.enc=Wt,Ue.dec=Gt;const v=U,zt=U,Fr=We(e=>{const t=v.dec(e),n=Math.ceil(t/8);return{bytes:C(n).dec(e),bitsLen:t}}),Yt=k(e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);const t=v.enc(e.bitsLen),n=new Uint8Array(e.bytes.length+t.length);return n.set(t,0),n.set(e.bytes,t.length),n},Fr),qr=we(_,e=>e.charCodeAt(0),String.fromCharCode),Jt=e=>{const t=C.enc(e);return n=>t(fe(n))},Qt=e=>{const t=C.dec(e);return n=>j(t(n))},ce=e=>k(Jt(e),Qt(e));ce.enc=Jt,ce.dec=Qt;const Xr=new TextEncoder,Kr=new TextDecoder,Wr=e=>we(C(e),t=>Xr.encode(t),t=>Kr.decode(t)),Zt=e=>{let t=n=>{const r=e();return t=r,r(n)};return n=>t(n)},en=e=>{let t=n=>{const r=e(),s=r;return t=r,s(n)};return n=>t(n)},tn=e=>k(Zt(()=>e().enc),en(()=>e().dec)),tt=Object.assign((e,t)=>({type:e,value:t}),{is(e,t){return e.type===t},as(e,t){if(t!==e.type)throw new Error(`Enum.as(enum, ${t}) used with actual type ${e.type}`);return e}}),Gr=new Proxy({},{get(e,t){return n=>tt(t,n)}}),nn=(...e)=>{const t=W.enc(...e);return n=>t({tag:n.type,value:n.value})},rn=(...e)=>{const t=W.dec(...e);return n=>{const{tag:r,value:s}=t(n);return tt(r,s)}},ve=(e,...t)=>k(nn(Ze(e,([n])=>n),...t),rn(Ze(e,([,n])=>n),...t));ve.enc=nn,ve.dec=rn;const sn=[],on=[],cn=[],zr=BigInt(0),Le=BigInt(1),Yr=BigInt(2),Jr=BigInt(7),Qr=BigInt(256),Zr=BigInt(113);for(let e=0,t=Le,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],sn.push(2*(5*r+n)),on.push((e+1)*(e+2)/2%64);let s=zr;for(let o=0;o<7;o++)t=(t<<Le^(t>>Jr)*Zr)%Qr,t&Yr&&(s^=Le<<(Le<<BigInt(o))-Le);cn.push(s)}const[es,ts]=$t(cn,!0),an=(e,t,n)=>n>32?Pt(e,t,n):Mt(e,t,n),ln=(e,t,n)=>n>32?Vt(e,t,n):Ht(e,t,n);function ns(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const c=(i+8)%10,y=(i+2)%10,h=n[y],d=n[y+1],l=an(h,d,1)^n[c],u=ln(h,d,1)^n[c+1];for(let a=0;a<50;a+=10)e[i+a]^=l,e[i+a+1]^=u}let s=e[2],o=e[3];for(let i=0;i<24;i++){const c=on[i],y=an(s,o,c),h=ln(s,o,c),d=sn[i];s=e[d],o=e[d+1],e[d]=y,e[d+1]=h}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=e[i+c];for(let c=0;c<10;c++)e[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=es[r],e[1]^=ts[r]}n.fill(0)}class nt extends Tt{constructor(t,n,r,s=!1,o=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,he(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=de(this.state)}keccak(){H||P(this.state32),ns(this.state32,this.rounds),H||P(this.state32),this.posOut=0,this.pos=0}update(t){Be(this);const{blockLen:n,state:r}=this;t=J(t);const s=t.length;for(let o=0;o<s;){const i=Math.min(n-this.pos,s-o);for(let c=0;c<i;c++)r[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Be(this,!1),Pe(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return he(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ze(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new nt(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}}const rs=((e,t,n)=>xr(()=>new nt(t,e,n)))(1,136,256/8),un=e=>{const t=e.slice(2),n=j(rs(t)).slice(2),r=new Array(40);for(let s=0;s<40;s++){const o=parseInt(n[s],16),i=t[s];r[s]=o>7?i.toUpperCase():i}return`0x${r.join("")}`},ss=C(20)[1],hn=k(e=>{const t=fe(e);if(t.length!==20)throw new Error(`Invalid length found on EthAddress(${e})`);const n=j(t);if(e===n||e===n.toUpperCase())return t;if(un(n)!==e)throw new Error(`Invalid checksum found on EthAddress(${e})`);return t},We(e=>un(j(ss(e))))),dn=new TextEncoder,fn=new TextDecoder,os=we(C(4),dn.encode.bind(dn),fn.decode.bind(fn)),rt=m({engine:os,payload:ce()}),is=ve({consensus:rt,seal:rt,preRuntime:rt,runtimeUpdated:E},[4,5,6,8]),st=ce(32),cs=m({parentHash:st,number:v,stateRoot:st,extrinsicRoot:st,digests:I(is)}),ee=I(M),yn=q(M),as=W({bool:E,char:E,str:E,u8:E,u16:E,u32:E,u64:E,u128:E,u256:E,i8:E,i16:E,i32:E,i64:E,i128:E,i256:E}),pn=I(m({name:yn,type:v,typeName:yn,docs:ee})),ls=m({len:z,type:v}),us=m({bitStoreType:v,bitOrderType:v}),hs=I(m({name:M,fields:pn,index:_,docs:ee})),ds=W({composite:pn,variant:hs,sequence:v,array:ls,tuple:I(v),primitive:as,compact:v,bitSequence:us}),fs=m({name:M,type:q(v)}),ys=I(fs),ps=m({id:v,path:ee,params:ys,def:ds,docs:ee}),ot=I(ps),gs=W({Blake2128:E,Blake2256:E,Blake2128Concat:E,Twox128:E,Twox256:E,Twox64Concat:E,Identity:E}),bs=I(gs),ws=m({hashers:bs,key:v,value:v}),vs=m({name:M,modifier:_,type:W({plain:v,map:ws}),fallback:ce(),docs:ee}),ms=q(m({prefix:M,items:I(vs)})),gn={name:M,storage:ms,calls:q(v),events:q(v),constants:I(m({name:M,type:v,value:ce(),docs:ee})),errors:q(v),index:_},xs={...gn,docs:ee},ks=new Uint8Array,bn=e=>k(()=>ks,()=>e),Es=m({type:v,version:_,signedExtensions:I(m({identifier:M,type:v,additionalSigned:v}))}),wn=m({lookup:ot,pallets:I(m({...gn,docs:bn([])})),extrinsic:Es,type:v,apis:bn([])}),Bs=m({name:M,methods:I(m({name:M,inputs:I(m({name:M,type:v})),output:v,docs:ee})),docs:ee}),Is=m({version:_,address:v,call:v,signature:v,extra:v,signedExtensions:I(m({identifier:M,type:v,additionalSigned:v}))}),vn=m({lookup:ot,pallets:I(m(xs)),extrinsic:Is,type:v,apis:I(Bs),outerEnums:m({call:v,event:v,error:v}),custom:I(X(M,m({type:v,value:ce()})))}),mn=()=>{throw new Error("Unsupported metadata version!")},R=k(mn,mn),Se=m({magicNumber:z,metadata:W({v0:R,v1:R,v2:R,v3:R,v4:R,v5:R,v6:R,v7:R,v8:R,v9:R,v10:R,v11:R,v12:R,v13:R,v14:wn,v15:vn})}),it=C(),As=q(it),Os=X(U,it),xn=e=>{try{return Se.dec(e)}catch{}try{return Se.dec(As.dec(e))}catch{}try{return Se.dec(it.dec(e))}catch{}try{return Se.dec(Os.dec(e)[1])}catch{}throw null},_s={dkLen:32},kn=e=>Ne(e,_s),Us={dkLen:16},En=e=>Ne(e,Us),Bn=e=>ie(En(e),e),te=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function ae(e,t,n,r,s){return e=e+t+s|0,r=Ve(r^e,16),n=n+r|0,t=Ve(t^n,12),{a:e,b:t,c:n,d:r}}function le(e,t,n,r,s){return e=e+t+s|0,r=Ve(r^e,8),n=n+r|0,t=Ve(t^n,7),{a:e,b:t,c:n,d:r}}function In(e,t,n,r,s,o,i,c,y,h,d,l,u,a,f,p,b,w,A,D){let B=0;for(let ne=0;ne<r;ne++)({a:s,b:y,c:u,d:b}=ae(s,y,u,b,n[t+e[B++]])),{a:s,b:y,c:u,d:b}=le(s,y,u,b,n[t+e[B++]]),{a:o,b:h,c:a,d:w}=ae(o,h,a,w,n[t+e[B++]]),{a:o,b:h,c:a,d:w}=le(o,h,a,w,n[t+e[B++]]),{a:i,b:d,c:f,d:A}=ae(i,d,f,A,n[t+e[B++]]),{a:i,b:d,c:f,d:A}=le(i,d,f,A,n[t+e[B++]]),{a:c,b:l,c:p,d:D}=ae(c,l,p,D,n[t+e[B++]]),{a:c,b:l,c:p,d:D}=le(c,l,p,D,n[t+e[B++]]),{a:s,b:h,c:f,d:D}=ae(s,h,f,D,n[t+e[B++]]),{a:s,b:h,c:f,d:D}=le(s,h,f,D,n[t+e[B++]]),{a:o,b:d,c:p,d:b}=ae(o,d,p,b,n[t+e[B++]]),{a:o,b:d,c:p,d:b}=le(o,d,p,b,n[t+e[B++]]),{a:i,b:l,c:u,d:w}=ae(i,l,u,w,n[t+e[B++]]),{a:i,b:l,c:u,d:w}=le(i,l,u,w,n[t+e[B++]]),{a:c,b:y,c:a,d:A}=ae(c,y,a,A,n[t+e[B++]]),{a:c,b:y,c:a,d:A}=le(c,y,a,A,n[t+e[B++]]);return{v0:s,v1:o,v2:i,v3:c,v4:y,v5:h,v6:d,v7:l,v8:u,v9:a,v10:f,v11:p,v12:b,v13:w,v14:A,v15:D}}const An=(()=>{const e=Array.from({length:16},(r,s)=>s),t=r=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(s=>r[s]),n=[];for(let r=0,s=e;r<7;r++,s=t(s))n.push(...s);return Uint8Array.from(n)})();class ct extends Dt{constructor(t={},n=0){if(super(64,t.dkLen===void 0?32:t.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=t.dkLen===void 0?32:t.dkLen,he(this.outputLen),t.key!==void 0&&t.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(t.key!==void 0){const r=J(t.key).slice();if(r.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=de(r),H||P(this.IV),this.flags=n|16}else if(t.context!==void 0){const r=new ct({dkLen:32},32).update(t.context).digest();this.IV=de(r),H||P(this.IV),this.flags=n|64}else this.IV=te.slice(),this.flags=n;this.state=this.IV.slice(),this.bufferOut=vr(this.bufferOut32)}get(){return[]}set(){}b2Compress(t,n,r,s=0){const{state:o,pos:i}=this,{h:c,l:y}=Re(BigInt(t),!0),{v0:h,v1:d,v2:l,v3:u,v4:a,v5:f,v6:p,v7:b,v8:w,v9:A,v10:D,v11:B,v12:ne,v13:$,v14:G,v15:xe}=In(An,s,r,7,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],te[0],te[1],te[2],te[3],c,y,i,n);o[0]=h^w,o[1]=d^A,o[2]=l^D,o[3]=u^B,o[4]=a^ne,o[5]=f^$,o[6]=p^G,o[7]=b^xe}compress(t,n=0,r=!1){let s=this.flags;if(this.chunkPos||(s|=1),(this.chunkPos===15||r)&&(s|=2),r||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,s,t,n),this.chunkPos+=1,this.chunkPos===16||r){let o=this.state;this.state=this.IV.slice();for(let i,c=this.chunksDone+1;(r||!(c&1))&&(i=this.stack.pop());c>>=1)this.buffer32.set(i,0),this.buffer32.set(o,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|4,this.buffer32,0),o=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(o)}this.pos=0}_cloneInto(t){t=super._cloneInto(t);const{IV:n,flags:r,state:s,chunkPos:o,posOut:i,chunkOut:c,stack:y,chunksDone:h}=this;return t.state.set(s.slice()),t.stack=y.map(d=>Uint32Array.from(d)),t.IV.set(n),t.flags=r,t.chunkPos=o,t.chunksDone=h,t.posOut=i,t.chunkOut=c,t.enableXOF=this.enableXOF,t.bufferOut32.set(this.bufferOut32),t}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let t of this.stack)t.fill(0)}b2CompressOut(){const{state:t,pos:n,flags:r,buffer32:s,bufferOut32:o}=this,{h:i,l:c}=Re(BigInt(this.chunkOut++));H||P(s);const{v0:y,v1:h,v2:d,v3:l,v4:u,v5:a,v6:f,v7:p,v8:b,v9:w,v10:A,v11:D,v12:B,v13:ne,v14:$,v15:G}=In(An,0,s,7,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],te[0],te[1],te[2],te[3],c,i,n,r);o[0]=y^b,o[1]=h^w,o[2]=d^A,o[3]=l^D,o[4]=u^B,o[5]=a^ne,o[6]=f^$,o[7]=p^G,o[8]=t[0]^b,o[9]=t[1]^w,o[10]=t[2]^A,o[11]=t[3]^D,o[12]=t[4]^B,o[13]=t[5]^ne,o[14]=t[6]^$,o[15]=t[7]^G,H||(P(s),P(o)),this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let t=this.flags|8;this.stack.length?(t|=4,H||P(this.buffer32),this.compress(this.buffer32,0,!0),H||P(this.buffer32),this.chunksDone=0,this.pos=this.blockLen):t|=(this.chunkPos?0:1)|2,this.flags=t,this.b2CompressOut()}writeInto(t){Be(this,!1),Pe(t),this.finish();const{blockLen:n,bufferOut:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=n&&this.b2CompressOut();const i=Math.min(n-this.posOut,o-s);t.set(r.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible after digest call");return this.writeInto(t)}xof(t){return he(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ze(t,this),this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}}const Ls=Er(e=>new ct(e)),Ss={dkLen:32},On=e=>Ls(e,Ss),Cs=e=>ie(On(e),e),_n=e=>e,pe=(e,t,n,r)=>new DataView(new Uint16Array([e,t,n,r]).buffer).getBigUint64(0,!0),at=2n**64n-1n,T=(e,t)=>e<<t&at|e>>64n-t,x=(e,t)=>e*t&at,L=(e,t)=>e+t&at,S=11400714785074694791n,N=14029467366897019727n,Un=1609587929392839161n,Ce=9650029242287828579n,Ln=2870177450012600261n;function ue(e,t=0n){let n=L(L(t,S),N),r=L(t,N),s=t,o=t-S,i=e.length,c=0,y=null;(function(){let a=0,f=a+i;if(i){if(y=new Uint8Array(32),i<32){y.set(e.subarray(0,i),c),c+=i;return}if(a<=f-32){const p=f-32;do{let b;b=pe(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),n=x(T(L(n,x(b,N)),31n),S),a+=8,b=pe(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),r=x(T(L(r,x(b,N)),31n),S),a+=8,b=pe(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),s=x(T(L(s,x(b,N)),31n),S),a+=8,b=pe(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),o=x(T(L(o,x(b,N)),31n),S),a+=8}while(a<=p)}a<f&&(y.set(e.subarray(a,f),c),c=f-a)}})(),e=y||e;let h,d=0;for(i>=32?(h=T(n,1n),h=L(h,T(r,7n)),h=L(h,T(s,12n)),h=L(h,T(o,18n)),n=x(T(x(n,N),31n),S),h=h^n,h=L(x(h,S),Ce),r=x(T(x(r,N),31n),S),h=h^r,h=L(x(h,S),Ce),s=x(T(x(s,N),31n),S),h=h^s,h=L(x(h,S),Ce),o=x(T(x(o,N),31n),S),h=h^o,h=L(x(h,S),Ce)):h=L(t,Ln),h=L(h,BigInt(i));d<=c-8;){let u=pe(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],e[d+5]<<8|e[d+4],e[d+7]<<8|e[d+6]);u=x(T(x(u,N),31n),S),h=L(x(T(h^u,27n),S),Ce),d+=8}if(d+4<=c){let u=x(pe(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],0,0),S);h=L(x(T(h^u,23n),N),Un),d+=4}for(;d<c;){const u=x(pe(e[d++],0,0,0),Ln);h=x(T(h^u,11n),S)}let l=h>>33n;return h=x(h^l,N),l=h>>29n,h=x(h^l,Un),l=h>>32n,h^=l,h}const lt=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigUint64(0,ue(e),!0),n.setBigUint64(8,ue(e,1n),!0),t},Ts=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigUint64(0,ue(e),!0),n.setBigUint64(8,ue(e,1n),!0),n.setBigUint64(16,ue(e,2n),!0),n.setBigUint64(24,ue(e,3n),!0),t},Sn=e=>ie(Me.enc(ue(e)),e),Cn=new TextEncoder,Tn=e=>{const t=lt(Cn.encode(e));return(n,r,...s)=>{const o=ie(t,lt(Cn.encode(n))),i=j(o),c=s.map(l=>l[1]).map(l=>{switch(l){case _n:return 0;case Sn:return 8;case Bn:return 16;default:return null}}).filter(l=>l!==null),y=l=>{if(!l.startsWith(i))throw new Error(`key does not match this storage (${e}.${n})`);if(c.length!==s.length)throw new Error("Impossible to decode this key");if(s.length===0)return[];const u=l.slice(i.length),a=new Array(s.length);for(let f=0,p=0;f<c.length;f++){const b=s[f][0];p+=c[f],a[f]=b.dec(u.slice(p*2)),p+=b.enc(a[f]).length}return a},h=s.map(([{enc:l},u])=>a=>u(l(a)));return{enc:(...l)=>j(ie(o,...l.map((u,a)=>h[a](u)))),dec:r,keyDecoder:y}}};var Dn=Object.freeze({__proto__:null,AccountId:Ie,Bin:Ue,Binary:et,Blake2128:En,Blake2128Concat:Bn,Blake2256:kn,Blake3256:On,Blake3256Concat:Cs,Bytes:C,Enum:tt,FixedSizeBinary:Kt,Hex:ce,Identity:_n,Option:q,Result:He,ScaleEnum:W,Self:tn,Storage:Tn,Struct:m,Tuple:X,Twox128:lt,Twox256:Ts,Twox64Concat:Sn,Variant:ve,Vector:I,_Enum:Gr,_void:E,bitSequence:Yt,blockHeader:cs,bool:Ge,char:qr,compact:U,compactBn:zt,compactNumber:v,createCodec:k,createDecoder:We,decAnyMetadata:xn,enhanceCodec:we,enhanceDecoder:$e,enhanceEncoder:De,ethAccount:hn,fixedStr:Wr,fromBufferToBase58:Nt,getSs58AddressInfo:Rt,h64:ue,i128:Gn,i16:qn,i256:Yn,i32:Xn,i64:Kn,i8:Fn,metadata:Se,selfDecoder:en,selfEncoder:Zt,str:M,u128:Wn,u16:Ee,u256:zn,u32:z,u64:Me,u8:_,v14:wn,v14Lookup:ot,v15:vn});const $n=(e,t)=>e.type==="array"&&e.len===t&&e.value.type==="primitive"&&e.value.value==="u8",ge={type:"void"},Ds=(e,t=()=>null)=>{const n=new Map,r=new Set,s=d=>l=>{let u=n.get(l);if(u)return u;if(r.has(l)){const f={id:l};return n.set(l,f),f}r.add(l);const a=d(l);return u=n.get(l),u?Object.assign(u,a):(u={id:l,...a},n.set(l,u)),r.delete(l),u};let o=!0,i=!0;const c=s(d=>{const l=t(e[d]);if(l)return l;const{def:u,path:a,params:f}=e[d];if(u.tag==="composite"){if(u.value.length===0)return ge;if(u.value.length===1){const p=c(u.value[0].type);return o&&a.at(-1)==="AccountId32"&&$n(p,32)?(o=!1,{type:"AccountId32"}):i&&a.at(-1)==="AccountId20"&&$n(p,20)?(i=!1,{type:"AccountId20"}):p}return y(u.value)}if(u.tag==="variant"){if(a.length===1&&a[0]==="Option"&&f.length===1&&f[0].name==="T"){const w=c(f[0].type);return w.type==="void"?{type:"primitive",value:"bool"}:{type:"option",value:w}}if(a.length===1&&a[0]==="Result"&&f.length===2&&f[0].name==="T"&&f[1].name==="E")return{type:"result",value:{ok:c(f[0].type),ko:c(f[1].type)}};if(u.value.length===0)return ge;const p={},b={};return u.value.forEach(w=>{const A=w.name;if(b[A]=w.docs,w.fields.length===0){p[A]={...ge,idx:w.index};return}if(w.fields.length===1&&!w.fields[0].name){p[A]={type:"lookupEntry",value:c(w.fields[0].type),idx:w.index};return}p[A]={...y(w.fields),idx:w.index}}),{type:"enum",value:p,innerDocs:b}}if(u.tag==="sequence")return{type:"sequence",value:c(u.value)};if(u.tag==="array"){const{len:p}=u.value,b=c(u.value.type);return!p||b.type==="void"?ge:p>1?{type:"array",value:b,len:u.value.len}:b}if(u.tag==="tuple")return u.value.length===0?ge:u.value.length>1?h(u.value.map(p=>c(p)),u.value.map(p=>e[p].docs)):c(u.value[0]);if(u.tag==="primitive")return{type:"primitive",value:u.value.tag};if(u.tag==="compact"){const p=c(u.value);return p.type==="void"?{type:"compact",isBig:null}:{type:"compact",isBig:Number(p.value.slice(1))>32}}return{type:u.tag}}),y=d=>{let l=!0;const u={},a={};return d.forEach((f,p)=>{l=l&&!!f.name;const b=f.name||p,w=c(f.type);w.type!=="void"&&(u[b]=w,a[b]=f.docs)}),l?{type:"struct",value:u,innerDocs:a}:h(Object.values(u),Object.values(a))},h=(d,l)=>{if(d.every(u=>u.id===d[0].id)&&l.every(u=>!u.length)){const[u]=d;return u.type==="void"?ge:{type:"array",value:d[0],len:d.length}}return{type:"tuple",value:d,innerDocs:l}};return c},$s=e=>{const t=Ds(e.lookup,({def:s})=>{if(s.tag==="composite"){const o=n(s);if(o)return{type:"enum",innerDocs:{},value:Object.fromEntries(e.pallets.map(i=>[i.name,i.errors==null?{...ge,idx:i.index}:{type:"lookupEntry",value:t(i.errors),idx:i.index}])),byteLength:o}}return null});function n(s){if(!(s.value.length===2&&s.value[0].name==="index"&&s.value[1].name==="error"))return null;const i=t(s.value[0].type),c=t(s.value[1].type);return i.type==="primitive"&&i.value==="u8"&&c.type==="array"&&c.value.type==="primitive"&&c.value.value==="u8"?1+c.len:null}return Object.assign(t,{metadata:e,call:"outerEnums"in e?e.outerEnums.call:e.lookup[e.extrinsic?.type]?.params.find(i=>i.name==="Call")?.type??null})},Ms=(e,t,n)=>(r,s,o,...i)=>{const{id:c}=r;if(s.has(c))return s.get(c);if(o.has(c)){const h=t(()=>s.get(c),r,...i);return s.set(c,h),h}o.add(c);let y=e(r,s,o,...i);return o.delete(c),s.has(c)&&(y=n(y,s.get(c),r,...i)),s.set(c,y),y},Hs=Ue(),Ps=k(U[0],$e(U[1],BigInt)),Mn=Ms((e,t,n,r)=>{if(e.type==="primitive")return Dn[e.value];if(e.type==="void")return E;if(e.type==="AccountId32")return r;if(e.type==="AccountId20")return hn;if(e.type==="compact")return e.isBig?Ps:U;if(e.type==="bitSequence")return Yt;const s=a=>Mn(a,t,n,r),o=(a,f)=>{const p=s(a);return f?I(p,f):I(p)},i=a=>X(...a.map(s)),c=a=>{const f=Object.fromEntries(Object.entries(a).map(([p,b])=>[p,s(b)]));return m(f)};if(e.type==="sequence"&&e.value.type==="primitive"&&e.value.value==="u8")return Hs;if(e.type==="array")return e.value.type==="primitive"&&e.value.value==="u8"?Ue(e.len):o(e.value,e.len);if(e.type==="sequence")return o(e.value);if(e.type==="tuple")return i(e.value);if(e.type==="struct")return c(e.value);if(e.type==="option")return q(s(e.value));if(e.type==="result")return He(s(e.value.ok),s(e.value.ko));const y=Object.values(e.value).map(a=>{switch(a.type){case"void":return E;case"lookupEntry":return s(a.value);case"tuple":return i(a.value);case"struct":return c(a.value);case"array":return o(a.value,a.len)}}),h=Object.fromEntries(Object.keys(e.value).map((a,f)=>[a,y[f]])),d=Object.values(e.value).map(a=>a.idx),u=d.every((a,f)=>a===f)?ve(h):ve(h,d);return e.byteLength?Vs(u,e.byteLength):u},tn,e=>e),Hn=(e,t=Ie())=>{const n=new Map,r=s=>Mn(e(s),n,new Set,t);return s=>r(s)},Vs=(e,t)=>{const n=C(t);return k(r=>n.enc(e.enc(r)),r=>e.dec(n.dec(r)))},js=e=>{const{metadata:t}=e;let n=Hn(e);const r=t.pallets.find(l=>l.name==="System")?.constants.find(l=>l.name==="SS58Prefix");let s;if(r)try{const l=n(r.type).dec(r.value);typeof l=="number"&&(s=l,n=Hn(e,Ie(l)))}catch{}const o=new Map,i=(l,u)=>{let a=o.get(l);a||o.set(l,a=Tn(l));const f=t.pallets.find($=>$.name===l).storage.items.find($=>$.name===u),p=($,...G)=>{const xe=a(...G);return{...xe,len:$,fallback:f.modifier===1?xe.dec(f.fallback):void 0}};if(f.type.tag==="plain")return p(0,u,n(f.type.value).dec);const{key:b,value:w,hashers:A}=f.type.value,D=n(w),B=A.map($=>Dn[$.tag]),ne=(()=>{if(B.length===1)return[[n(b),B[0]]];const $=e(b);switch($.type){case"array":return B.map(G=>[n($.value.id),G]);case"tuple":return $.value.map((G,xe)=>[n(G.id),B[xe]]);default:throw new Error("Invalid key type")}})();return p(B.length,u,D.dec,...ne)},c=l=>{switch(l.type){case"void":return E;case"lookupEntry":return n(l.value.id);case"tuple":return X(...Object.values(l.value).map(u=>n(u.id)));case"struct":return m(Ze(l.value,u=>n(u.id)));case"array":return I(n(l.value.id),l.len)}},y=(l,u)=>{const a=t.pallets.find(f=>f.name===l).constants.find(f=>f.name===u);return n(a.type)},h=l=>(u,a)=>{const f=t.pallets.find(w=>w.name===u),p=e(f[l]);if(p.type!=="enum")throw null;const b=p.value[a];return{location:[f.index,b.idx],codec:c(p.value[a])}},d=(l,u)=>{const a=t.apis.find(f=>f.name===l)?.methods.find(f=>f.name===u);if(!a)throw null;return{args:X(...a.inputs.map(f=>n(f.type))),value:n(a.output)}};return{buildDefinition:n,buildStorage:i,buildEvent:h("events"),buildError:h("errors"),buildRuntimeCall:d,buildCall:h("calls"),buildConstant:y,ss58Prefix:s}},me=(e,t)=>{let n=e.toString(16);n=(n.length%2?"0":"")+n;const r=Math.max(0,(t||0)-n.length/2);return"0x"+"00".repeat(r)+n},Rs=({additionalSigned:e})=>({genesisHash:j(e)}),Ns=({value:e})=>({nonce:me(U.dec(e),4)}),Fs=({additionalSigned:e})=>({transactionVersion:me(z.dec(e),4)}),qs=m({tip:U,asset:q(C(1/0))}).dec;var Pn=Object.freeze({__proto__:null,ChargeAssetTxPayment:({value:e})=>{const{tip:t,asset:n}=qs(e);return{...n?{assetId:j(n)}:{},tip:me(t,16)}},ChargeTransactionPayment:({value:e})=>({tip:me(zt.dec(e),16)}),CheckGenesis:Rs,CheckMetadataHash:({value:e,additionalSigned:t})=>e.length&&e[0]?{mode:1,metadataHash:j(t.length?t.slice(1):t)}:{},CheckMortality:({value:e,additionalSigned:t},n)=>({era:j(e),blockHash:j(t),blockNumber:me(n,4)}),CheckNonce:Ns,CheckSpecVersion:({additionalSigned:e})=>({specVersion:me(z.dec(e),4)}),CheckTxVersion:Fs});const Xs=e=>{const t=js($s(e)),n=e.pallets.find(r=>r.name==="System").constants.find(r=>r.name==="SS58Prefix");return t.buildDefinition(n.type).dec(n.value)},Ks=De(_.enc,e=>+!!e.signed<<7|e.version),Ws=Ie().enc;function Gs(e,t,n){const r=i=>n({address:e,data:j(i),type:"bytes"}).then(({signature:c})=>fe(c)),s=Ws(e);return{publicKey:s,signTx:async(i,c,y,h,d=kn)=>{let l;try{const b=xn(y);if(b.metadata.tag!=="v14"&&b.metadata.tag!=="v15")throw null;l=b.metadata.value}catch{throw new Error("Unsupported metadata version")}const u={};u.signedExtensions=[];const{version:a}=l.extrinsic,f=[];l.extrinsic.signedExtensions.map(({identifier:b})=>{const w=c[b];if(!w)throw new Error(`Missing ${b} signed-extension`);if(f.push(w.value),u.signedExtensions.push(b),!Pn[b]){if(w.value.length===0&&w.additionalSigned.length===0)return;throw new Error(`PJS does not support this signed-extension: ${b}`)}Object.assign(u,Pn[b](w,h))}),u.address=Ie(Xs(l)).dec(s),u.method=j(i),u.version=a,u.withSignedTransaction=!0;const p=await t(u);if(!p.signedTransaction){const b=ie(Ks({signed:!0,version:a}),new Uint8Array([0,...s]),fe(p.signature),...f,i);return ie(U.enc(b.length),b)}return typeof p.signedTransaction=="string"?fe(p.signedTransaction):p.signedTransaction},signBytes:r}}const zs=new Set(["ed25519","sr25519","ecdsa"]),Ys=async e=>{let t=window.injectedWeb3?.[e];if(!t)throw new Error(`Unavailable extension: "${e}"`);const n=await t.enable(),r=n.signer.signPayload.bind(n.signer),s=n.signer.signRaw.bind(n.signer),o=h=>h.filter(({type:d})=>zs.has(d)).map(d=>{const l=Gs(d.address,r,s);return{...d,polkadotSigner:l}});let i=o(await n.accounts.get());const c=new Set,y=n.accounts.subscribe(h=>{i=o(h),c.forEach(d=>{d(i)})});return{name:e,getAccounts:()=>i,subscribe:h=>(c.add(h),()=>{c.delete(h)}),disconnect:()=>{y()}}},Js=()=>{const{injectedWeb3:e}=window;return e?Object.keys(e):[]};be.connectInjectedExtension=Ys,be.getInjectedExtensions=Js});
|
|
1
|
+
(function(be,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(be=typeof globalThis<"u"?globalThis:be||self,Ee(be.papiPjsSigner={}))})(this,function(be){"use strict";var Ee=Object.defineProperty,Vn=(e,t,n)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ut=(e,t,n)=>(Vn(e,typeof t!="symbol"?t+"":t,n),n),Ke={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function jn(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|Ke[e[2]]);for(let o=0;o<r;){const i=n+o*2,c=Ke[e[i]],y=Ke[e[i+1]];s[t+o++]=c<<4|y}return s}var ht=class extends Uint8Array{constructor(e){super(e),ut(this,"i",0),ut(this,"v"),this.v=new DataView(e)}},F=e=>t=>e(t instanceof ht?t:new ht(t instanceof Uint8Array?t.buffer:typeof t=="string"?jn(t).buffer:t)),K=e=>{const t=e.length;let n=0;for(let s=0;s<t;s++)n+=e[s].byteLength;const r=new Uint8Array(n);for(let s=0,o=0;s<t;s++){const i=e[s];r.set(i,o),o+=i.byteLength}return r};function Te(e,t){const n=Object.keys(e),r=n.length,s={};for(let o=0;o<r;o++){const i=n[o];s[i]=t(e[i],i)}return s}var We=F,k=(e,t)=>{const n=[e,t];return n.enc=e,n.dec=t,n},De=(e,t)=>n=>e(t(n)),$e=(e,t)=>n=>t(e(n)),we=([e,t],n,r)=>k(De(e,n),$e(t,r));function Rn(e,t){return F(n=>{const r=n.v[t](n.i,!0);return n.i+=e,r})}function Nn(e,t){return n=>{const r=new Uint8Array(e);return new DataView(r.buffer)[t](0,n,!0),r}}function re(e,t,n){return k(Nn(e,n),Rn(e,t))}var _=re(1,"getUint8","setUint8"),Be=re(2,"getUint16","setUint16"),z=re(4,"getUint32","setUint32"),Me=re(8,"getBigUint64","setBigUint64"),Fn=re(1,"getInt8","setInt8"),qn=re(2,"getInt16","setInt16"),Xn=re(4,"getInt32","setInt32"),Kn=re(8,"getBigInt64","setBigInt64"),dt=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),t},ft=e=>F(t=>{const{v:n,i:r}=t,s=n.getBigUint64(r,!0),o=n[e](r+8,!0);return t.i+=16,o<<64n|s}),Wn=k(dt,ft("getBigUint64")),Gn=k(dt,ft("getBigInt64")),yt=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),n.setBigInt64(16,e>>128n,!0),n.setBigInt64(24,e>>192n,!0),t},pt=e=>F(t=>{let n=t.v.getBigUint64(t.i,!0);return t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<64n,t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<128n,t.i+=8,n|=t.v[e](t.i,!0)<<192n,t.i+=8,n}),zn=k(yt,pt("getBigUint64")),Yn=k(yt,pt("getBigInt64")),Ge=we(_,e=>e?1:0,Boolean),Jn=[_[1],Be[1],z[1]],Qn=F(e=>{const t=e[e.i],n=t&3;if(n<3)return Jn[n](e)>>>2;const r=(t>>>2)+4;e.i++;let s=0n;const o=r/8|0;let i=0n;for(let y=0;y<o;y++)s=Me[1](e)<<i|s,i+=64n;let c=r%8;return c>3&&(s=BigInt(z[1](e))<<i|s,i+=32n,c-=4),c>1&&(s=BigInt(Be[1](e))<<i|s,i+=16n,c-=2),c&&(s=BigInt(_[1](e))<<i|s),s}),Zn=1n<<56n,er=1<<24,tr=256,nr=4294967295n,rr=64,sr=16384,or=1<<30,ir=e=>{if(e<0)throw new Error(`Wrong compact input (${e})`);const t=Number(e)<<2;if(e<rr)return _[0](t);if(e<sr)return Be[0](t|1);if(e<or)return z[0](t|2);let n=[new Uint8Array(1)],r=BigInt(e);for(;r>=Zn;)n.push(Me[0](r)),r>>=64n;r>=er&&(n.push(z[0](Number(r&nr))),r>>=32n);let s=Number(r);s>=tr&&(n.push(Be[0](s)),s>>=16),s&&n.push(_[0](s));const o=K(n);return o[0]=o.length-5<<2|3,o},U=k(ir,Qn),cr=new TextEncoder,ar=e=>{const t=cr.encode(e);return K([U.enc(t.length),t])},lr=new TextDecoder,ur=F(e=>{let t=U.dec(e);const n=new DataView(e.buffer,e.i,t);return e.i+=t,lr.decode(n)}),M=k(ar,ur),hr=()=>{},dr=new Uint8Array(0),E=k(()=>dr,hr),gt=e=>e===void 0?t=>K([U.enc(t.length),t]):t=>t.length===e?t:t.slice(0,e),bt=e=>F(t=>{const n=e===void 0?U.dec(t):e!==1/0?e:t.byteLength-t.i,r=new Uint8Array(t.buffer.slice(t.i,t.i+n));return t.i+=n,r}),C=e=>k(gt(e),bt(e));C.enc=gt,C.dec=bt;var wt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((o,i)=>[n[i],o])??n.map((o,i)=>[o,i])),s=o=>r.get(o);return({tag:o,value:i})=>K([_.enc(s(o)),e[o](i)])},vt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((s,o)=>[s,n[o]])??n.map((s,o)=>[o,s]));return F(s=>{const o=_.dec(s),i=r.get(o),c=e[i];return{tag:i,value:c(s)}})},W=(e,...t)=>k(wt(Te(e,([n])=>n),...t),vt(Te(e,([,n])=>n),...t));W.enc=wt,W.dec=vt;var mt=e=>F(t=>{const n=_.dec(t);if(n!==0)return e===Ge[1]?n===1:e(t)}),xt=e=>t=>{const n=new Uint8Array(1);return t===void 0?(n[0]=0,n):(n[0]=1,e===Ge[0]?(n[0]=t?1:2,n):K([n,e(t)]))},q=e=>k(xt(e[0]),mt(e[1]));q.enc=xt,q.dec=mt;var kt=(e,t)=>F(n=>{const r=_[1](n)===0,o=(r?e:t)(n);return{success:r,value:o}}),Et=(e,t)=>({success:n,value:r})=>K([_[0](n?0:1),(n?e:t)(r)]),He=(e,t)=>k(Et(e[0],t[0]),kt(e[1],t[1]));He.dec=kt,He.enc=Et;var Bt=(...e)=>F(t=>e.map(n=>n(t))),It=(...e)=>t=>K(e.map((n,r)=>n(t[r]))),X=(...e)=>k(It(...e.map(([t])=>t)),Bt(...e.map(([,t])=>t)));X.enc=It,X.dec=Bt;var At=e=>{const t=Object.keys(e);return De(X.enc(...Object.values(e)),n=>t.map(r=>n[r]))},Ot=e=>{const t=Object.keys(e);return $e(X.dec(...Object.values(e)),n=>Object.fromEntries(n.map((r,s)=>[t[s],r])))},m=e=>k(At(Te(e,t=>t[0])),Ot(Te(e,t=>t[1])));m.enc=At,m.dec=Ot;var _t=(e,t)=>t>=0?n=>K(n.map(e)):n=>K([U.enc(n.length),K(n.map(e))]),Ut=(e,t)=>F(n=>{const r=t>=0?t:U.dec(n),s=new Array(r);for(let o=0;o<r;o++)s[o]=e(n);return s}),I=(e,t)=>k(_t(e[0],t),Ut(e[1],t));I.enc=_t,I.dec=Ut;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function fr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function yr(...e){const t=o=>o,n=(o,i)=>c=>o(i(c)),r=e.map(o=>o.encode).reduceRight(n,t),s=e.map(o=>o.decode).reduce(n,t);return{encode:r,decode:s}}function pr(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function gr(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function Lt(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const s=[],o=Array.from(e);for(o.forEach(i=>{if(i<0||i>=t)throw new Error(`Wrong integer: ${i}`)});;){let i=0,c=!0;for(let y=r;y<o.length;y++){const h=o[y],d=t*i+h;if(!Number.isSafeInteger(d)||t*i/t!==i||d-h!==t*i)throw new Error("convertRadix: carry overflow");i=d%n;const l=Math.floor(d/n);if(o[y]=l,!Number.isSafeInteger(l)||l*n+i!==d)throw new Error("convertRadix: carry overflow");if(c)l?c=!1:r=y;else continue}if(s.push(i),c)break}for(let i=0;i<e.length-1&&e[i]===0;i++)s.push(0);return s.reverse()}function br(e){return{encode:t=>{if(!fr(t))throw new Error("radix.encode input should be Uint8Array");return Lt(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(Lt(t,e,2**8))}}}const St=(e=>yr(br(58),pr(e),gr("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function de(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function wr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Pe(e,...t){if(!wr(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Ie(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ze(e,t){Pe(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vr=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),fe=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ve=(e,t)=>e<<32-t|e>>>t,H=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Ct=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,Y=H?e=>e:e=>Ct(e);function P(e){for(let t=0;t<e.length;t++)e[t]=Ct(e[t])}function mr(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function J(e){return typeof e=="string"&&(e=mr(e)),Pe(e),e}class Tt{clone(){return this._cloneInto()}}function xr(e){const t=r=>e().update(J(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function kr(e){const t=(r,s)=>e(s).update(J(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function Er(e){const t=(r,s)=>e(s).update(J(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const Br=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class Dt extends Tt{constructor(t,n,r={},s,o,i){if(super(),this.blockLen=t,this.outputLen=n,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,de(t),de(n),de(s),n<0||n>s)throw new Error("outputLen bigger than keyLen");if(r.key!==void 0&&(r.key.length<1||r.key.length>s))throw new Error(`key must be up 1..${s} byte long or undefined`);if(r.salt!==void 0&&r.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(r.personalization!==void 0&&r.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=fe(this.buffer=new Uint8Array(t))}update(t){Ie(this);const{blockLen:n,buffer:r,buffer32:s}=this;t=J(t);const o=t.length,i=t.byteOffset,c=t.buffer;for(let y=0;y<o;){this.pos===n&&(H||P(s),this.compress(s,0,!1),H||P(s),this.pos=0);const h=Math.min(n-this.pos,o-y),d=i+y;if(h===n&&!(d%4)&&y+h<o){const l=new Uint32Array(c,d,Math.floor((o-y)/4));H||P(l);for(let u=0;y+n<o;u+=s.length,y+=n)this.length+=n,this.compress(l,u,!1);H||P(l);continue}r.set(t.subarray(y,y+h),this.pos),this.pos+=h,this.length+=h,y+=h}return this}digestInto(t){Ie(this),ze(t,this);const{pos:n,buffer32:r}=this;this.finished=!0,this.buffer.subarray(n).fill(0),H||P(r),this.compress(r,0,!0),H||P(r);const s=fe(t);this.get().forEach((o,i)=>s[i]=Y(o))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:i,pos:c}=this;return t||(t=new this.constructor({dkLen:i})),t.set(...this.get()),t.length=r,t.finished=s,t.destroyed=o,t.outputLen=i,t.buffer.set(n),t.pos=c,t}}const je=BigInt(2**32-1),Ye=BigInt(32);function Re(e,t=!1){return t?{h:Number(e&je),l:Number(e>>Ye&je)}:{h:Number(e>>Ye&je)|0,l:Number(e&je)|0}}function $t(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:i}=Re(e[s],t);[n[s],r[s]]=[o,i]}return[n,r]}const Ir=(e,t)=>BigInt(e>>>0)<<Ye|BigInt(t>>>0),Ar=(e,t,n)=>e>>>n,Or=(e,t,n)=>e<<32-n|t>>>n,_r=(e,t,n)=>e>>>n|t<<32-n,Ur=(e,t,n)=>e<<32-n|t>>>n,Lr=(e,t,n)=>e<<64-n|t>>>n-32,Sr=(e,t,n)=>e>>>n-32|t<<64-n,Cr=(e,t)=>t,Tr=(e,t)=>e,Mt=(e,t,n)=>e<<n|t>>>32-n,Ht=(e,t,n)=>t<<n|e>>>32-n,Pt=(e,t,n)=>t<<n-32|e>>>64-n,Vt=(e,t,n)=>e<<n-32|t>>>64-n;function Dr(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const V={fromBig:Re,split:$t,toBig:Ir,shrSH:Ar,shrSL:Or,rotrSH:_r,rotrSL:Ur,rotrBH:Lr,rotrBL:Sr,rotr32H:Cr,rotr32L:Tr,rotlSH:Mt,rotlSL:Ht,rotlBH:Pt,rotlBL:Vt,add:Dr,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,add5H:(e,t,n,r,s,o)=>t+n+r+s+o+(e/2**32|0)|0,add5L:(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},O=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),g=new Uint32Array(32);function se(e,t,n,r,s,o){const i=s[o],c=s[o+1];let y=g[2*e],h=g[2*e+1],d=g[2*t],l=g[2*t+1],u=g[2*n],a=g[2*n+1],f=g[2*r],p=g[2*r+1],b=V.add3L(y,d,i);h=V.add3H(b,h,l,c),y=b|0,{Dh:p,Dl:f}={Dh:p^h,Dl:f^y},{Dh:p,Dl:f}={Dh:V.rotr32H(p,f),Dl:V.rotr32L(p,f)},{h:a,l:u}=V.add(a,u,p,f),{Bh:l,Bl:d}={Bh:l^a,Bl:d^u},{Bh:l,Bl:d}={Bh:V.rotrSH(l,d,24),Bl:V.rotrSL(l,d,24)},g[2*e]=y,g[2*e+1]=h,g[2*t]=d,g[2*t+1]=l,g[2*n]=u,g[2*n+1]=a,g[2*r]=f,g[2*r+1]=p}function oe(e,t,n,r,s,o){const i=s[o],c=s[o+1];let y=g[2*e],h=g[2*e+1],d=g[2*t],l=g[2*t+1],u=g[2*n],a=g[2*n+1],f=g[2*r],p=g[2*r+1],b=V.add3L(y,d,i);h=V.add3H(b,h,l,c),y=b|0,{Dh:p,Dl:f}={Dh:p^h,Dl:f^y},{Dh:p,Dl:f}={Dh:V.rotrSH(p,f,16),Dl:V.rotrSL(p,f,16)},{h:a,l:u}=V.add(a,u,p,f),{Bh:l,Bl:d}={Bh:l^a,Bl:d^u},{Bh:l,Bl:d}={Bh:V.rotrBH(l,d,63),Bl:V.rotrBL(l,d,63)},g[2*e]=y,g[2*e+1]=h,g[2*t]=d,g[2*t+1]=l,g[2*n]=u,g[2*n+1]=a,g[2*r]=f,g[2*r+1]=p}class $r extends Dt{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=O[0]|0,this.v0h=O[1]|0,this.v1l=O[2]|0,this.v1h=O[3]|0,this.v2l=O[4]|0,this.v2h=O[5]|0,this.v3l=O[6]|0,this.v3h=O[7]|0,this.v4l=O[8]|0,this.v4h=O[9]|0,this.v5l=O[10]|0,this.v5h=O[11]|0,this.v6l=O[12]|0,this.v6h=O[13]|0,this.v7l=O[14]|0,this.v7h=O[15]|0;const n=t.key?t.key.length:0;if(this.v0l^=this.outputLen|n<<8|65536|1<<24,t.salt){const r=fe(J(t.salt));this.v4l^=Y(r[0]),this.v4h^=Y(r[1]),this.v5l^=Y(r[2]),this.v5h^=Y(r[3])}if(t.personalization){const r=fe(J(t.personalization));this.v6l^=Y(r[0]),this.v6h^=Y(r[1]),this.v7l^=Y(r[2]),this.v7h^=Y(r[3])}if(t.key){const r=new Uint8Array(this.blockLen);r.set(J(t.key)),this.update(r)}}get(){let{v0l:t,v0h:n,v1l:r,v1h:s,v2l:o,v2h:i,v3l:c,v3h:y,v4l:h,v4h:d,v5l:l,v5h:u,v6l:a,v6h:f,v7l:p,v7h:b}=this;return[t,n,r,s,o,i,c,y,h,d,l,u,a,f,p,b]}set(t,n,r,s,o,i,c,y,h,d,l,u,a,f,p,b){this.v0l=t|0,this.v0h=n|0,this.v1l=r|0,this.v1h=s|0,this.v2l=o|0,this.v2h=i|0,this.v3l=c|0,this.v3h=y|0,this.v4l=h|0,this.v4h=d|0,this.v5l=l|0,this.v5h=u|0,this.v6l=a|0,this.v6h=f|0,this.v7l=p|0,this.v7h=b|0}compress(t,n,r){this.get().forEach((y,h)=>g[h]=y),g.set(O,16);let{h:s,l:o}=V.fromBig(BigInt(this.length));g[24]=O[8]^o,g[25]=O[9]^s,r&&(g[28]=~g[28],g[29]=~g[29]);let i=0;const c=Br;for(let y=0;y<12;y++)se(0,4,8,12,t,n+2*c[i++]),oe(0,4,8,12,t,n+2*c[i++]),se(1,5,9,13,t,n+2*c[i++]),oe(1,5,9,13,t,n+2*c[i++]),se(2,6,10,14,t,n+2*c[i++]),oe(2,6,10,14,t,n+2*c[i++]),se(3,7,11,15,t,n+2*c[i++]),oe(3,7,11,15,t,n+2*c[i++]),se(0,5,10,15,t,n+2*c[i++]),oe(0,5,10,15,t,n+2*c[i++]),se(1,6,11,12,t,n+2*c[i++]),oe(1,6,11,12,t,n+2*c[i++]),se(2,7,8,13,t,n+2*c[i++]),oe(2,7,8,13,t,n+2*c[i++]),se(3,4,9,14,t,n+2*c[i++]),oe(3,4,9,14,t,n+2*c[i++]);this.v0l^=g[0]^g[16],this.v0h^=g[1]^g[17],this.v1l^=g[2]^g[18],this.v1h^=g[3]^g[19],this.v2l^=g[4]^g[20],this.v2h^=g[5]^g[21],this.v3l^=g[6]^g[22],this.v3h^=g[7]^g[23],this.v4l^=g[8]^g[24],this.v4h^=g[9]^g[25],this.v5l^=g[10]^g[26],this.v5h^=g[11]^g[27],this.v6l^=g[12]^g[28],this.v6h^=g[13]^g[29],this.v7l^=g[14]^g[30],this.v7h^=g[15]^g[31],g.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Ne=kr(e=>new $r(e)),jt=new TextEncoder().encode("SS58PRE"),Je=2,Rt=e=>{try{const t=St.decode(e),n=t.subarray(0,t[0]&64?2:1),r=t.subarray(n.length,t.length-Je),s=t.subarray(n.length+r.length),o=Ne(Uint8Array.of(...jt,...n,...r),{dkLen:64}).subarray(0,Je);return s[0]===o[0]&&s[1]===o[1]?{isValid:!0,ss58Format:Mr(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},Mr=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)},Nt=e=>{const t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{const r=Ne(Uint8Array.of(...jt,...t,...n),{dkLen:64}).subarray(0,Je);return St.encode(Uint8Array.of(...t,...n,...r))}};function Hr(e,t){return n=>{const r=Rt(n);if(!r.isValid)throw new Error("Invalid checksum");const{publicKey:s}=r;if(s.length!==e)throw new Error("Invalid public key length");return s}}const ve=(e=42,t=32)=>we(C(t),Hr(t),Nt(e)),Ft="0123456789abcdef";function j(e){const t=new Array(e.length+1);t[0]="0x";for(let n=0;n<e.length;){const r=e[n++];t[n]=Ft[r>>4]+Ft[r&15]}return t.join("")}const Qe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function ye(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|Qe[e[2]]);for(let o=0;o<r;){const i=n+o*2,c=Qe[e[i]],y=Qe[e[i+1]];s[t+o++]=c<<4|y}return s}function Ze(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r,n)]))}const ie=(...e)=>{const t=e.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.byteLength}return n};var Pr=Object.defineProperty,qt=e=>{throw TypeError(e)},Vr=(e,t,n)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ae=(e,t,n)=>Vr(e,typeof t!="symbol"?t+"":t,n),Xt=(e,t,n)=>t.has(e)||qt("Cannot "+n),Q=(e,t,n)=>(Xt(e,t,"read from private field"),n?n.call(e):t.get(e)),Oe=(e,t,n)=>t.has(e)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,r)=>(Xt(e,t,"write to private field"),t.set(e,n),n),Z,_e,Fe,qe,Xe;const jr=new TextEncoder,Rr=new TextDecoder,Nr=X(U,C(1/0))[1];class et{constructor(t,n=!1){if(Oe(this,Z),Oe(this,_e,null),Oe(this,Fe,null),Oe(this,qe,null),Oe(this,Xe,null),Ae(this,"asText",()=>Q(this,Xe)??pe(this,Xe,Rr.decode(Q(this,Z)))),Ae(this,"asHex",()=>Q(this,Fe)||pe(this,Fe,j(Q(this,Z)))),Ae(this,"asOpaqueHex",()=>Q(this,qe)||pe(this,qe,j(this.asBytes()))),Ae(this,"asBytes",()=>Q(this,Z)),Ae(this,"asOpaqueBytes",()=>Q(this,_e)||pe(this,_e,ie(U[0](Q(this,Z).length),Q(this,Z)))),n){try{const[r,s]=Nr(t);if(r===s.length){pe(this,Z,s),pe(this,_e,t);return}}catch{}throw new Error("Invalid opaque bytes")}else pe(this,Z,t)}static fromText(t){return new this(jr.encode(t))}static fromHex(t){return new this(ye(t))}static fromOpaqueHex(t){return new this(ye(t),!0)}static fromBytes(t){return new this(t)}static fromOpaqueBytes(t){return new this(t,!0)}}Z=new WeakMap,_e=new WeakMap,Fe=new WeakMap,qe=new WeakMap,Xe=new WeakMap;const[Fr]=ve();class Kt extends et{constructor(t){super(t)}static fromArray(t){return new this(new Uint8Array(t))}static fromAccountId32(t){return new this(Fr(t))}}const Wt=e=>{const t=C.enc(e);return n=>t(n.asBytes())},Gt=e=>{const t=C.dec(e),n=e==null?et:Kt;return r=>n.fromBytes(t(r))},Ue=e=>k(Wt(e),Gt(e));Ue.enc=Wt,Ue.dec=Gt;const v=U,zt=U,qr=We(e=>{const t=v.dec(e),n=Math.ceil(t/8);return{bytes:C(n).dec(e),bitsLen:t}}),Yt=k(e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);const t=v.enc(e.bitsLen),n=new Uint8Array(e.bytes.length+t.length);return n.set(t,0),n.set(e.bytes,t.length),n},qr),Xr=we(_,e=>e.charCodeAt(0),String.fromCharCode),Jt=e=>{const t=C.enc(e);return n=>t(ye(n))},Qt=e=>{const t=C.dec(e);return n=>j(t(n))},ce=e=>k(Jt(e),Qt(e));ce.enc=Jt,ce.dec=Qt;const Kr=new TextEncoder,Wr=new TextDecoder,Gr=e=>we(C(e),t=>Kr.encode(t),t=>Wr.decode(t)),Zt=e=>{let t=n=>{const r=e();return t=r,r(n)};return n=>t(n)},en=e=>{let t=n=>{const r=e(),s=r;return t=r,s(n)};return n=>t(n)},tn=e=>k(Zt(()=>e().enc),en(()=>e().dec)),tt=Object.assign((e,t)=>({type:e,value:t}),{is(e,t){return e.type===t},as(e,t){if(t!==e.type)throw new Error(`Enum.as(enum, ${t}) used with actual type ${e.type}`);return e}}),zr=new Proxy({},{get(e,t){return n=>tt(t,n)}}),nn=(...e)=>{const t=W.enc(...e);return n=>t({tag:n.type,value:n.value})},rn=(...e)=>{const t=W.dec(...e);return n=>{const{tag:r,value:s}=t(n);return tt(r,s)}},me=(e,...t)=>k(nn(Ze(e,([n])=>n),...t),rn(Ze(e,([,n])=>n),...t));me.enc=nn,me.dec=rn;const sn=[],on=[],cn=[],Yr=BigInt(0),Le=BigInt(1),Jr=BigInt(2),Qr=BigInt(7),Zr=BigInt(256),es=BigInt(113);for(let e=0,t=Le,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],sn.push(2*(5*r+n)),on.push((e+1)*(e+2)/2%64);let s=Yr;for(let o=0;o<7;o++)t=(t<<Le^(t>>Qr)*es)%Zr,t&Jr&&(s^=Le<<(Le<<BigInt(o))-Le);cn.push(s)}const[ts,ns]=$t(cn,!0),an=(e,t,n)=>n>32?Pt(e,t,n):Mt(e,t,n),ln=(e,t,n)=>n>32?Vt(e,t,n):Ht(e,t,n);function rs(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const c=(i+8)%10,y=(i+2)%10,h=n[y],d=n[y+1],l=an(h,d,1)^n[c],u=ln(h,d,1)^n[c+1];for(let a=0;a<50;a+=10)e[i+a]^=l,e[i+a+1]^=u}let s=e[2],o=e[3];for(let i=0;i<24;i++){const c=on[i],y=an(s,o,c),h=ln(s,o,c),d=sn[i];s=e[d],o=e[d+1],e[d]=y,e[d+1]=h}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=e[i+c];for(let c=0;c<10;c++)e[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=ts[r],e[1]^=ns[r]}n.fill(0)}class nt extends Tt{constructor(t,n,r,s=!1,o=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,de(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=fe(this.state)}keccak(){H||P(this.state32),rs(this.state32,this.rounds),H||P(this.state32),this.posOut=0,this.pos=0}update(t){Ie(this);const{blockLen:n,state:r}=this;t=J(t);const s=t.length;for(let o=0;o<s;){const i=Math.min(n-this.pos,s-o);for(let c=0;c<i;c++)r[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Ie(this,!1),Pe(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,o-s);t.set(n.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return de(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ze(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:i}=this;return t||(t=new nt(n,r,s,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=s,t.enableXOF=i,t.destroyed=this.destroyed,t}}const ss=((e,t,n)=>xr(()=>new nt(t,e,n)))(1,136,256/8),un=e=>{const t=e.slice(2),n=j(ss(t)).slice(2),r=new Array(40);for(let s=0;s<40;s++){const o=parseInt(n[s],16),i=t[s];r[s]=o>7?i.toUpperCase():i}return`0x${r.join("")}`},os=C(20)[1],hn=k(e=>{const t=ye(e);if(t.length!==20)throw new Error(`Invalid length found on EthAddress(${e})`);const n=j(t);if(e===n||e===n.toUpperCase())return t;if(un(n)!==e)throw new Error(`Invalid checksum found on EthAddress(${e})`);return t},We(e=>un(j(os(e))))),dn=new TextEncoder,fn=new TextDecoder,is=we(C(4),dn.encode.bind(dn),fn.decode.bind(fn)),rt=m({engine:is,payload:ce()}),cs=me({consensus:rt,seal:rt,preRuntime:rt,runtimeUpdated:E},[4,5,6,8]),st=ce(32),as=m({parentHash:st,number:v,stateRoot:st,extrinsicRoot:st,digests:I(cs)}),ee=I(M),yn=q(M),ls=W({bool:E,char:E,str:E,u8:E,u16:E,u32:E,u64:E,u128:E,u256:E,i8:E,i16:E,i32:E,i64:E,i128:E,i256:E}),pn=I(m({name:yn,type:v,typeName:yn,docs:ee})),us=m({len:z,type:v}),hs=m({bitStoreType:v,bitOrderType:v}),ds=I(m({name:M,fields:pn,index:_,docs:ee})),fs=W({composite:pn,variant:ds,sequence:v,array:us,tuple:I(v),primitive:ls,compact:v,bitSequence:hs}),ys=m({name:M,type:q(v)}),ps=I(ys),gs=m({id:v,path:ee,params:ps,def:fs,docs:ee}),ot=I(gs),bs=W({Blake2128:E,Blake2256:E,Blake2128Concat:E,Twox128:E,Twox256:E,Twox64Concat:E,Identity:E}),ws=I(bs),vs=m({hashers:ws,key:v,value:v}),ms=m({name:M,modifier:_,type:W({plain:v,map:vs}),fallback:ce(),docs:ee}),xs=q(m({prefix:M,items:I(ms)})),gn={name:M,storage:xs,calls:q(v),events:q(v),constants:I(m({name:M,type:v,value:ce(),docs:ee})),errors:q(v),index:_},ks={...gn,docs:ee},Es=new Uint8Array,bn=e=>k(()=>Es,()=>e),Bs=m({type:v,version:_,signedExtensions:I(m({identifier:M,type:v,additionalSigned:v}))}),wn=m({lookup:ot,pallets:I(m({...gn,docs:bn([])})),extrinsic:Bs,type:v,apis:bn([])}),Is=m({name:M,methods:I(m({name:M,inputs:I(m({name:M,type:v})),output:v,docs:ee})),docs:ee}),As=m({version:_,address:v,call:v,signature:v,extra:v,signedExtensions:I(m({identifier:M,type:v,additionalSigned:v}))}),vn=m({lookup:ot,pallets:I(m(ks)),extrinsic:As,type:v,apis:I(Is),outerEnums:m({call:v,event:v,error:v}),custom:I(X(M,m({type:v,value:ce()})))}),mn=()=>{throw new Error("Unsupported metadata version!")},R=k(mn,mn),Se=m({magicNumber:z,metadata:W({v0:R,v1:R,v2:R,v3:R,v4:R,v5:R,v6:R,v7:R,v8:R,v9:R,v10:R,v11:R,v12:R,v13:R,v14:wn,v15:vn})}),it=C(),Os=q(it),_s=X(U,it),xn=e=>{try{return Se.dec(e)}catch{}try{return Se.dec(Os.dec(e))}catch{}try{return Se.dec(it.dec(e))}catch{}try{return Se.dec(_s.dec(e)[1])}catch{}throw null},Us={dkLen:32},kn=e=>Ne(e,Us),Ls={dkLen:16},En=e=>Ne(e,Ls),Bn=e=>ie(En(e),e),te=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function ae(e,t,n,r,s){return e=e+t+s|0,r=Ve(r^e,16),n=n+r|0,t=Ve(t^n,12),{a:e,b:t,c:n,d:r}}function le(e,t,n,r,s){return e=e+t+s|0,r=Ve(r^e,8),n=n+r|0,t=Ve(t^n,7),{a:e,b:t,c:n,d:r}}function In(e,t,n,r,s,o,i,c,y,h,d,l,u,a,f,p,b,w,A,D){let B=0;for(let ne=0;ne<r;ne++)({a:s,b:y,c:u,d:b}=ae(s,y,u,b,n[t+e[B++]])),{a:s,b:y,c:u,d:b}=le(s,y,u,b,n[t+e[B++]]),{a:o,b:h,c:a,d:w}=ae(o,h,a,w,n[t+e[B++]]),{a:o,b:h,c:a,d:w}=le(o,h,a,w,n[t+e[B++]]),{a:i,b:d,c:f,d:A}=ae(i,d,f,A,n[t+e[B++]]),{a:i,b:d,c:f,d:A}=le(i,d,f,A,n[t+e[B++]]),{a:c,b:l,c:p,d:D}=ae(c,l,p,D,n[t+e[B++]]),{a:c,b:l,c:p,d:D}=le(c,l,p,D,n[t+e[B++]]),{a:s,b:h,c:f,d:D}=ae(s,h,f,D,n[t+e[B++]]),{a:s,b:h,c:f,d:D}=le(s,h,f,D,n[t+e[B++]]),{a:o,b:d,c:p,d:b}=ae(o,d,p,b,n[t+e[B++]]),{a:o,b:d,c:p,d:b}=le(o,d,p,b,n[t+e[B++]]),{a:i,b:l,c:u,d:w}=ae(i,l,u,w,n[t+e[B++]]),{a:i,b:l,c:u,d:w}=le(i,l,u,w,n[t+e[B++]]),{a:c,b:y,c:a,d:A}=ae(c,y,a,A,n[t+e[B++]]),{a:c,b:y,c:a,d:A}=le(c,y,a,A,n[t+e[B++]]);return{v0:s,v1:o,v2:i,v3:c,v4:y,v5:h,v6:d,v7:l,v8:u,v9:a,v10:f,v11:p,v12:b,v13:w,v14:A,v15:D}}const An=(()=>{const e=Array.from({length:16},(r,s)=>s),t=r=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(s=>r[s]),n=[];for(let r=0,s=e;r<7;r++,s=t(s))n.push(...s);return Uint8Array.from(n)})();class ct extends Dt{constructor(t={},n=0){if(super(64,t.dkLen===void 0?32:t.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=t.dkLen===void 0?32:t.dkLen,de(this.outputLen),t.key!==void 0&&t.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(t.key!==void 0){const r=J(t.key).slice();if(r.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=fe(r),H||P(this.IV),this.flags=n|16}else if(t.context!==void 0){const r=new ct({dkLen:32},32).update(t.context).digest();this.IV=fe(r),H||P(this.IV),this.flags=n|64}else this.IV=te.slice(),this.flags=n;this.state=this.IV.slice(),this.bufferOut=vr(this.bufferOut32)}get(){return[]}set(){}b2Compress(t,n,r,s=0){const{state:o,pos:i}=this,{h:c,l:y}=Re(BigInt(t),!0),{v0:h,v1:d,v2:l,v3:u,v4:a,v5:f,v6:p,v7:b,v8:w,v9:A,v10:D,v11:B,v12:ne,v13:$,v14:G,v15:ke}=In(An,s,r,7,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],te[0],te[1],te[2],te[3],c,y,i,n);o[0]=h^w,o[1]=d^A,o[2]=l^D,o[3]=u^B,o[4]=a^ne,o[5]=f^$,o[6]=p^G,o[7]=b^ke}compress(t,n=0,r=!1){let s=this.flags;if(this.chunkPos||(s|=1),(this.chunkPos===15||r)&&(s|=2),r||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,s,t,n),this.chunkPos+=1,this.chunkPos===16||r){let o=this.state;this.state=this.IV.slice();for(let i,c=this.chunksDone+1;(r||!(c&1))&&(i=this.stack.pop());c>>=1)this.buffer32.set(i,0),this.buffer32.set(o,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|4,this.buffer32,0),o=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(o)}this.pos=0}_cloneInto(t){t=super._cloneInto(t);const{IV:n,flags:r,state:s,chunkPos:o,posOut:i,chunkOut:c,stack:y,chunksDone:h}=this;return t.state.set(s.slice()),t.stack=y.map(d=>Uint32Array.from(d)),t.IV.set(n),t.flags=r,t.chunkPos=o,t.chunksDone=h,t.posOut=i,t.chunkOut=c,t.enableXOF=this.enableXOF,t.bufferOut32.set(this.bufferOut32),t}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let t of this.stack)t.fill(0)}b2CompressOut(){const{state:t,pos:n,flags:r,buffer32:s,bufferOut32:o}=this,{h:i,l:c}=Re(BigInt(this.chunkOut++));H||P(s);const{v0:y,v1:h,v2:d,v3:l,v4:u,v5:a,v6:f,v7:p,v8:b,v9:w,v10:A,v11:D,v12:B,v13:ne,v14:$,v15:G}=In(An,0,s,7,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],te[0],te[1],te[2],te[3],c,i,n,r);o[0]=y^b,o[1]=h^w,o[2]=d^A,o[3]=l^D,o[4]=u^B,o[5]=a^ne,o[6]=f^$,o[7]=p^G,o[8]=t[0]^b,o[9]=t[1]^w,o[10]=t[2]^A,o[11]=t[3]^D,o[12]=t[4]^B,o[13]=t[5]^ne,o[14]=t[6]^$,o[15]=t[7]^G,H||(P(s),P(o)),this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let t=this.flags|8;this.stack.length?(t|=4,H||P(this.buffer32),this.compress(this.buffer32,0,!0),H||P(this.buffer32),this.chunksDone=0,this.pos=this.blockLen):t|=(this.chunkPos?0:1)|2,this.flags=t,this.b2CompressOut()}writeInto(t){Ie(this,!1),Pe(t),this.finish();const{blockLen:n,bufferOut:r}=this;for(let s=0,o=t.length;s<o;){this.posOut>=n&&this.b2CompressOut();const i=Math.min(n-this.posOut,o-s);t.set(r.subarray(this.posOut,this.posOut+i),s),this.posOut+=i,s+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible after digest call");return this.writeInto(t)}xof(t){return de(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ze(t,this),this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}}const Ss=Er(e=>new ct(e)),Cs={dkLen:32},On=e=>Ss(e,Cs),Ts=e=>ie(On(e),e),_n=e=>e,ge=(e,t,n,r)=>new DataView(new Uint16Array([e,t,n,r]).buffer).getBigUint64(0,!0),at=2n**64n-1n,T=(e,t)=>e<<t&at|e>>64n-t,x=(e,t)=>e*t&at,L=(e,t)=>e+t&at,S=11400714785074694791n,N=14029467366897019727n,Un=1609587929392839161n,Ce=9650029242287828579n,Ln=2870177450012600261n;function ue(e,t=0n){let n=L(L(t,S),N),r=L(t,N),s=t,o=t-S,i=e.length,c=0,y=null;(function(){let a=0,f=a+i;if(i){if(y=new Uint8Array(32),i<32){y.set(e.subarray(0,i),c),c+=i;return}if(a<=f-32){const p=f-32;do{let b;b=ge(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),n=x(T(L(n,x(b,N)),31n),S),a+=8,b=ge(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),r=x(T(L(r,x(b,N)),31n),S),a+=8,b=ge(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),s=x(T(L(s,x(b,N)),31n),S),a+=8,b=ge(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),o=x(T(L(o,x(b,N)),31n),S),a+=8}while(a<=p)}a<f&&(y.set(e.subarray(a,f),c),c=f-a)}})(),e=y||e;let h,d=0;for(i>=32?(h=T(n,1n),h=L(h,T(r,7n)),h=L(h,T(s,12n)),h=L(h,T(o,18n)),n=x(T(x(n,N),31n),S),h=h^n,h=L(x(h,S),Ce),r=x(T(x(r,N),31n),S),h=h^r,h=L(x(h,S),Ce),s=x(T(x(s,N),31n),S),h=h^s,h=L(x(h,S),Ce),o=x(T(x(o,N),31n),S),h=h^o,h=L(x(h,S),Ce)):h=L(t,Ln),h=L(h,BigInt(i));d<=c-8;){let u=ge(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],e[d+5]<<8|e[d+4],e[d+7]<<8|e[d+6]);u=x(T(x(u,N),31n),S),h=L(x(T(h^u,27n),S),Ce),d+=8}if(d+4<=c){let u=x(ge(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],0,0),S);h=L(x(T(h^u,23n),N),Un),d+=4}for(;d<c;){const u=x(ge(e[d++],0,0,0),Ln);h=x(T(h^u,11n),S)}let l=h>>33n;return h=x(h^l,N),l=h>>29n,h=x(h^l,Un),l=h>>32n,h^=l,h}const lt=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigUint64(0,ue(e),!0),n.setBigUint64(8,ue(e,1n),!0),t},Ds=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigUint64(0,ue(e),!0),n.setBigUint64(8,ue(e,1n),!0),n.setBigUint64(16,ue(e,2n),!0),n.setBigUint64(24,ue(e,3n),!0),t},Sn=e=>ie(Me.enc(ue(e)),e),Cn=new TextEncoder,Tn=e=>{const t=lt(Cn.encode(e));return(n,r,...s)=>{const o=ie(t,lt(Cn.encode(n))),i=j(o),c=s.map(l=>l[1]).map(l=>{switch(l){case _n:return 0;case Sn:return 8;case Bn:return 16;default:return null}}).filter(l=>l!==null),y=l=>{if(!l.startsWith(i))throw new Error(`key does not match this storage (${e}.${n})`);if(c.length!==s.length)throw new Error("Impossible to decode this key");if(s.length===0)return[];const u=l.slice(i.length),a=new Array(s.length);for(let f=0,p=0;f<c.length;f++){const b=s[f][0];p+=c[f],a[f]=b.dec(u.slice(p*2)),p+=b.enc(a[f]).length}return a},h=s.map(([{enc:l},u])=>a=>u(l(a)));return{enc:(...l)=>j(ie(o,...l.map((u,a)=>h[a](u)))),dec:r,keyDecoder:y}}};var Dn=Object.freeze({__proto__:null,AccountId:ve,Bin:Ue,Binary:et,Blake2128:En,Blake2128Concat:Bn,Blake2256:kn,Blake3256:On,Blake3256Concat:Ts,Bytes:C,Enum:tt,FixedSizeBinary:Kt,Hex:ce,Identity:_n,Option:q,Result:He,ScaleEnum:W,Self:tn,Storage:Tn,Struct:m,Tuple:X,Twox128:lt,Twox256:Ds,Twox64Concat:Sn,Variant:me,Vector:I,_Enum:zr,_void:E,bitSequence:Yt,blockHeader:as,bool:Ge,char:Xr,compact:U,compactBn:zt,compactNumber:v,createCodec:k,createDecoder:We,decAnyMetadata:xn,enhanceCodec:we,enhanceDecoder:$e,enhanceEncoder:De,ethAccount:hn,fixedStr:Gr,fromBufferToBase58:Nt,getSs58AddressInfo:Rt,h64:ue,i128:Gn,i16:qn,i256:Yn,i32:Xn,i64:Kn,i8:Fn,metadata:Se,selfDecoder:en,selfEncoder:Zt,str:M,u128:Wn,u16:Be,u256:zn,u32:z,u64:Me,u8:_,v14:wn,v14Lookup:ot,v15:vn});const $n=(e,t)=>e.type==="array"&&e.len===t&&e.value.type==="primitive"&&e.value.value==="u8",he={type:"void"},$s=(e,t=()=>null)=>{const n=new Map,r=new Set,s=d=>l=>{let u=n.get(l);if(u)return u;if(r.has(l)){const f={id:l};return n.set(l,f),f}r.add(l);const a=d(l);return u=n.get(l),u?Object.assign(u,a):(u={id:l,...a},n.set(l,u)),r.delete(l),u};let o=!0,i=!0;const c=s(d=>{const l=t(e[d]);if(l)return l;const{def:u,path:a,params:f}=e[d];if(u.tag==="composite"){if(u.value.length===0)return he;if(u.value.length===1){const p=c(u.value[0].type);return o&&a.at(-1)==="AccountId32"&&$n(p,32)?(o=!1,{type:"AccountId32"}):i&&a.at(-1)==="AccountId20"&&$n(p,20)?(i=!1,{type:"AccountId20"}):p}return y(u.value)}if(u.tag==="variant"){if(a.length===1&&a[0]==="Option"&&f.length===1&&f[0].name==="T"){const w=c(f[0].type);return w.type==="void"?{type:"primitive",value:"bool"}:{type:"option",value:w}}if(a.length===1&&a[0]==="Result"&&f.length===2&&f[0].name==="T"&&f[1].name==="E")return{type:"result",value:{ok:c(f[0].type),ko:c(f[1].type)}};if(u.value.length===0)return he;const p={},b={};return u.value.forEach(w=>{const A=w.name;if(b[A]=w.docs,w.fields.length===0){p[A]={...he,idx:w.index};return}if(w.fields.length===1&&!w.fields[0].name){p[A]={type:"lookupEntry",value:c(w.fields[0].type),idx:w.index};return}p[A]={...y(w.fields),idx:w.index}}),{type:"enum",value:p,innerDocs:b}}if(u.tag==="sequence")return{type:"sequence",value:c(u.value)};if(u.tag==="array"){const{len:p}=u.value,b=c(u.value.type);return!p||b.type==="void"?he:p>1?{type:"array",value:b,len:u.value.len}:b}if(u.tag==="tuple")return u.value.length===0?he:u.value.length>1?h(u.value.map(p=>c(p)),u.value.map(p=>e[p].docs)):c(u.value[0]);if(u.tag==="primitive")return{type:"primitive",value:u.value.tag};if(u.tag==="compact"){const p=c(u.value);return p.type==="void"?he:{type:"compact",isBig:Number(p.value.slice(1))>32}}return{type:u.tag}}),y=d=>{let l=!0;const u={},a={};return d.forEach((f,p)=>{l=l&&!!f.name;const b=f.name||p,w=c(f.type);w.type!=="void"&&(u[b]=w,a[b]=f.docs)}),l?{type:"struct",value:u,innerDocs:a}:h(Object.values(u),Object.values(a))},h=(d,l)=>{if(d.every(u=>u.id===d[0].id)&&l.every(u=>!u.length)){const[u]=d;return u.type==="void"?he:{type:"array",value:d[0],len:d.length}}return{type:"tuple",value:d,innerDocs:l}};return c},Ms=e=>{const t=$s(e.lookup,({def:s})=>{if(s.tag==="composite"){const o=n(s);if(o)return{type:"enum",innerDocs:{},value:Object.fromEntries(e.pallets.map(i=>[i.name,i.errors==null?{...he,idx:i.index}:{type:"lookupEntry",value:t(i.errors),idx:i.index}])),byteLength:o}}return null});function n(s){if(!(s.value.length===2&&s.value[0].name==="index"&&s.value[1].name==="error"))return null;const i=t(s.value[0].type),c=t(s.value[1].type);return i.type==="primitive"&&i.value==="u8"&&c.type==="array"&&c.value.type==="primitive"&&c.value.value==="u8"?1+c.len:null}return Object.assign(t,{metadata:e,call:"outerEnums"in e?e.outerEnums.call:e.lookup[e.extrinsic?.type]?.params.find(i=>i.name==="Call")?.type??null})},Hs=(e,t,n)=>(r,s,o,...i)=>{const{id:c}=r;if(s.has(c))return s.get(c);if(o.has(c)){const h=t(()=>s.get(c),r,...i);return s.set(c,h),h}o.add(c);let y=e(r,s,o,...i);return o.delete(c),s.has(c)&&(y=n(y,s.get(c),r,...i)),s.set(c,y),y},Ps=Ue(),Vs=k(U[0],$e(U[1],BigInt)),Mn=Hs((e,t,n,r)=>{if(e.type==="primitive")return Dn[e.value];if(e.type==="void")return E;if(e.type==="AccountId32")return r;if(e.type==="AccountId20")return hn;if(e.type==="compact")return e.isBig?Vs:U;if(e.type==="bitSequence")return Yt;const s=a=>Mn(a,t,n,r),o=(a,f)=>{const p=s(a);return f?I(p,f):I(p)},i=a=>X(...a.map(s)),c=a=>{const f=Object.fromEntries(Object.entries(a).map(([p,b])=>[p,s(b)]));return m(f)};if(e.type==="sequence"&&e.value.type==="primitive"&&e.value.value==="u8")return Ps;if(e.type==="array")return e.value.type==="primitive"&&e.value.value==="u8"?Ue(e.len):o(e.value,e.len);if(e.type==="sequence")return o(e.value);if(e.type==="tuple")return i(e.value);if(e.type==="struct")return c(e.value);if(e.type==="option")return q(s(e.value));if(e.type==="result")return He(s(e.value.ok),s(e.value.ko));const y=Object.values(e.value).map(a=>{switch(a.type){case"void":return E;case"lookupEntry":return s(a.value);case"tuple":return i(a.value);case"struct":return c(a.value);case"array":return o(a.value,a.len)}}),h=Object.fromEntries(Object.keys(e.value).map((a,f)=>[a,y[f]])),d=Object.values(e.value).map(a=>a.idx),u=d.every((a,f)=>a===f)?me(h):me(h,d);return e.byteLength?js(u,e.byteLength):u},tn,e=>e),Hn=(e,t=ve())=>{const n=new Map,r=s=>Mn(e(s),n,new Set,t);return s=>r(s)},js=(e,t)=>{const n=C(t);return k(r=>n.enc(e.enc(r)),r=>e.dec(n.dec(r)))},Rs=e=>{const{metadata:t}=e;let n=Hn(e);const r=t.pallets.find(l=>l.name==="System")?.constants.find(l=>l.name==="SS58Prefix");let s;if(r)try{const l=n(r.type).dec(r.value);typeof l=="number"&&(s=l,n=Hn(e,ve(l)))}catch{}const o=new Map,i=(l,u)=>{let a=o.get(l);a||o.set(l,a=Tn(l));const f=t.pallets.find($=>$.name===l).storage.items.find($=>$.name===u),p=($,...G)=>{const ke=a(...G);return{...ke,len:$,fallback:f.modifier===1?ke.dec(f.fallback):void 0}};if(f.type.tag==="plain")return p(0,u,n(f.type.value).dec);const{key:b,value:w,hashers:A}=f.type.value,D=n(w),B=A.map($=>Dn[$.tag]),ne=(()=>{if(B.length===1)return[[n(b),B[0]]];const $=e(b);switch($.type){case"array":return B.map(G=>[n($.value.id),G]);case"tuple":return $.value.map((G,ke)=>[n(G.id),B[ke]]);default:throw new Error("Invalid key type")}})();return p(B.length,u,D.dec,...ne)},c=l=>{switch(l.type){case"void":return E;case"lookupEntry":return n(l.value.id);case"tuple":return X(...Object.values(l.value).map(u=>n(u.id)));case"struct":return m(Ze(l.value,u=>n(u.id)));case"array":return I(n(l.value.id),l.len)}},y=(l,u)=>{const a=t.pallets.find(f=>f.name===l).constants.find(f=>f.name===u);return n(a.type)},h=l=>(u,a)=>{const f=t.pallets.find(w=>w.name===u),p=e(f[l]);if(p.type!=="enum")throw null;const b=p.value[a];return{location:[f.index,b.idx],codec:c(p.value[a])}},d=(l,u)=>{const a=t.apis.find(f=>f.name===l)?.methods.find(f=>f.name===u);if(!a)throw null;return{args:X(...a.inputs.map(f=>n(f.type))),value:n(a.output)}};return{buildDefinition:n,buildStorage:i,buildEvent:h("events"),buildError:h("errors"),buildRuntimeCall:d,buildCall:h("calls"),buildConstant:y,ss58Prefix:s}},xe=(e,t)=>{let n=e.toString(16);n=(n.length%2?"0":"")+n;const r=Math.max(0,(t||0)-n.length/2);return"0x"+"00".repeat(r)+n},Ns=({additionalSigned:e})=>({genesisHash:j(e)}),Fs=({value:e})=>({nonce:xe(U.dec(e),4)}),qs=({additionalSigned:e})=>({transactionVersion:xe(z.dec(e),4)}),Xs=m({tip:U,asset:q(C(1/0))}).dec;var Pn=Object.freeze({__proto__:null,ChargeAssetTxPayment:({value:e})=>{const{tip:t,asset:n}=Xs(e);return{...n?{assetId:j(n)}:{},tip:xe(t,16)}},ChargeTransactionPayment:({value:e})=>({tip:xe(zt.dec(e),16)}),CheckGenesis:Ns,CheckMetadataHash:({value:e,additionalSigned:t})=>e.length&&e[0]?{mode:1,metadataHash:j(t.length?t.slice(1):t)}:{},CheckMortality:({value:e,additionalSigned:t},n)=>({era:j(e),blockHash:j(t),blockNumber:xe(n,4)}),CheckNonce:Fs,CheckSpecVersion:({additionalSigned:e})=>({specVersion:xe(z.dec(e),4)}),CheckTxVersion:qs});const Ks=e=>{const t=Rs(Ms(e)),n=e.pallets.find(r=>r.name==="System").constants.find(r=>r.name==="SS58Prefix");return t.buildDefinition(n.type).dec(n.value)},Ws=De(_.enc,e=>+!!e.signed<<7|e.version),Gs=ve().enc;function zs(e,t,n){const r=i=>n({address:e,data:j(i),type:"bytes"}).then(({signature:c})=>ye(c)),s=Gs(e);return{publicKey:s,signTx:async(i,c,y,h,d=kn)=>{let l;try{const b=xn(y);if(b.metadata.tag!=="v14"&&b.metadata.tag!=="v15")throw null;l=b.metadata.value}catch{throw new Error("Unsupported metadata version")}const u={};u.signedExtensions=[];const{version:a}=l.extrinsic,f=[];l.extrinsic.signedExtensions.map(({identifier:b})=>{const w=c[b];if(!w)throw new Error(`Missing ${b} signed-extension`);if(f.push(w.value),u.signedExtensions.push(b),!Pn[b]){if(w.value.length===0&&w.additionalSigned.length===0)return;throw new Error(`PJS does not support this signed-extension: ${b}`)}Object.assign(u,Pn[b](w,h))}),u.address=ve(Ks(l)).dec(s),u.method=j(i),u.version=a,u.withSignedTransaction=!0;const p=await t(u);if(!p.signedTransaction){const b=ie(Ws({signed:!0,version:a}),new Uint8Array([0,...s]),ye(p.signature),...f,i);return ie(U.enc(b.length),b)}return typeof p.signedTransaction=="string"?ye(p.signedTransaction):p.signedTransaction},signBytes:r}}const Ys=new Set(["ed25519","sr25519","ecdsa"]),Js=async e=>{let t=window.injectedWeb3?.[e];if(!t)throw new Error(`Unavailable extension: "${e}"`);const n=await t.enable(),r=n.signer.signPayload.bind(n.signer),s=n.signer.signRaw.bind(n.signer),o=h=>h.filter(({type:d})=>Ys.has(d)).map(d=>{const l=zs(d.address,r,s);return{...d,polkadotSigner:l}});let i=o(await n.accounts.get());const c=new Set,y=n.accounts.subscribe(h=>{i=o(h),c.forEach(d=>{d(i)})});return{name:e,getAccounts:()=>i,subscribe:h=>(c.add(h),()=>{c.delete(h)}),disconnect:()=>{y()}}},Qs=()=>{const{injectedWeb3:e}=window;return e?Object.keys(e):[]};be.connectInjectedExtension=Js,be.getInjectedExtensions=Qs});
|
package/dist/umd/signer.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(G,R){typeof exports=="object"&&typeof module<"u"?R(exports):typeof define=="function"&&define.amd?define(["exports"],R):(G=typeof globalThis<"u"?globalThis:G||self,R(G.papiSigner={}))})(this,function(G){"use strict";var R=Object.defineProperty,ne=(e,t,n)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t,n)=>(ne(e,typeof t!="symbol"?t+"":t,n),n),ut={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function re(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|ut[e[2]]);for(let i=0;i<r;){const o=n+i*2,a=ut[e[o]],h=ut[e[o+1]];s[t+i++]=a<<4|h}return s}var xt=class extends Uint8Array{constructor(e){super(e),mt(this,"i",0),mt(this,"v"),this.v=new DataView(e)}},D=e=>t=>e(t instanceof xt?t:new xt(t instanceof Uint8Array?t.buffer:typeof t=="string"?re(t).buffer:t)),k=e=>{const t=e.length;let n=0;for(let s=0;s<t;s++)n+=e[s].byteLength;const r=new Uint8Array(n);for(let s=0,i=0;s<t;s++){const o=e[s];r.set(o,i),i+=o.byteLength}return r};function nt(e,t){const n=Object.keys(e),r=n.length,s={};for(let i=0;i<r;i++){const o=n[i];s[o]=t(e[o],o)}return s}var x=(e,t)=>{const n=[e,t];return n.enc=e,n.dec=t,n},dt=(e,t)=>n=>e(t(n)),bt=(e,t)=>n=>t(e(n)),se=([e,t],n,r)=>x(dt(e,n),bt(t,r));function ie(e,t){return D(n=>{const r=n.v[t](n.i,!0);return n.i+=e,r})}function oe(e,t){return n=>{const r=new Uint8Array(e);return new DataView(r.buffer)[t](0,n,!0),r}}function $(e,t,n){return x(oe(e,n),ie(e,t))}var _=$(1,"getUint8","setUint8"),rt=$(2,"getUint16","setUint16"),X=$(4,"getUint32","setUint32"),Et=$(8,"getBigUint64","setBigUint64");$(1,"getInt8","setInt8"),$(2,"getInt16","setInt16"),$(4,"getInt32","setInt32"),$(8,"getBigInt64","setBigInt64");var _t=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),t},Ut=e=>D(t=>{const{v:n,i:r}=t,s=n.getBigUint64(r,!0),i=n[e](r+8,!0);return t.i+=16,i<<64n|s});x(_t,Ut("getBigUint64")),x(_t,Ut("getBigInt64"));var At=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),n.setBigInt64(16,e>>128n,!0),n.setBigInt64(24,e>>192n,!0),t},It=e=>D(t=>{let n=t.v.getBigUint64(t.i,!0);return t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<64n,t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<128n,t.i+=8,n|=t.v[e](t.i,!0)<<192n,t.i+=8,n});x(At,It("getBigUint64")),x(At,It("getBigInt64"));var Lt=se(_,e=>e?1:0,Boolean),ce=[_[1],rt[1],X[1]],ae=D(e=>{const t=e[e.i],n=t&3;if(n<3)return ce[n](e)>>>2;const r=(t>>>2)+4;e.i++;let s=0n;const i=r/8|0;let o=0n;for(let h=0;h<i;h++)s=Et[1](e)<<o|s,o+=64n;let a=r%8;return a>3&&(s=BigInt(X[1](e))<<o|s,o+=32n,a-=4),a>1&&(s=BigInt(rt[1](e))<<o|s,o+=16n,a-=2),a&&(s=BigInt(_[1](e))<<o|s),s}),he=1n<<56n,le=1<<24,ue=256,de=4294967295n,fe=64,ve=16384,pe=1<<30,ge=e=>{if(e<0)throw new Error(`Wrong compact input (${e})`);const t=Number(e)<<2;if(e<fe)return _[0](t);if(e<ve)return rt[0](t|1);if(e<pe)return X[0](t|2);let n=[new Uint8Array(1)],r=BigInt(e);for(;r>=he;)n.push(Et[0](r)),r>>=64n;r>=le&&(n.push(X[0](Number(r&de))),r>>=32n);let s=Number(r);s>=ue&&(n.push(rt[0](s)),s>>=16),s&&n.push(_[0](s));const i=k(n);return i[0]=i.length-5<<2|3,i},L=x(ge,ae),ye=new TextEncoder,we=e=>{const t=ye.encode(e);return k([L.enc(t.length),t])},Be=new TextDecoder,me=D(e=>{let t=L.dec(e);const n=new DataView(e.buffer,e.i,t);return e.i+=t,Be.decode(n)}),U=x(we,me),xe=()=>{},be=new Uint8Array(0),g=x(()=>be,xe),Dt=e=>e===void 0?t=>k([L.enc(t.length),t]):t=>t.length===e?t:t.slice(0,e),kt=e=>D(t=>{const n=e===void 0?L.dec(t):e!==1/0?e:t.byteLength-t.i,r=new Uint8Array(t.buffer.slice(t.i,t.i+n));return t.i+=n,r}),j=e=>x(Dt(e),kt(e));j.enc=Dt,j.dec=kt;var Ht=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((i,o)=>[n[o],i])??n.map((i,o)=>[i,o])),s=i=>r.get(i);return({tag:i,value:o})=>k([_.enc(s(i)),e[i](o)])},Tt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((s,i)=>[s,n[i]])??n.map((s,i)=>[i,s]));return D(s=>{const i=_.dec(s),o=r.get(i),a=e[o];return{tag:o,value:a(s)}})},q=(e,...t)=>x(Ht(nt(e,([n])=>n),...t),Tt(nt(e,([,n])=>n),...t));q.enc=Ht,q.dec=Tt;var Ot=e=>D(t=>{const n=_.dec(t);if(n!==0)return e===Lt[1]?n===1:e(t)}),Mt=e=>t=>{const n=new Uint8Array(1);return t===void 0?(n[0]=0,n):(n[0]=1,e===Lt[0]?(n[0]=t?1:2,n):k([n,e(t)]))},H=e=>x(Mt(e[0]),Ot(e[1]));H.enc=Mt,H.dec=Ot;var St=(...e)=>D(t=>e.map(n=>n(t))),$t=(...e)=>t=>k(e.map((n,r)=>n(t[r]))),P=(...e)=>x($t(...e.map(([t])=>t)),St(...e.map(([,t])=>t)));P.enc=$t,P.dec=St;var Nt=e=>{const t=Object.keys(e);return dt(P.enc(...Object.values(e)),n=>t.map(r=>n[r]))},Ct=e=>{const t=Object.keys(e);return bt(P.dec(...Object.values(e)),n=>Object.fromEntries(n.map((r,s)=>[t[s],r])))},u=e=>x(Nt(nt(e,t=>t[0])),Ct(nt(e,t=>t[1])));u.enc=Nt,u.dec=Ct;var qt=(e,t)=>t>=0?n=>k(n.map(e)):n=>k([L.enc(n.length),k(n.map(e))]),Pt=(e,t)=>D(n=>{const r=t>=0?t:L.dec(n),s=new Array(r);for(let i=0;i<r;i++)s[i]=e(n);return s}),B=(e,t)=>x(qt(e[0],t),Pt(e[1],t));B.enc=qt,B.dec=Pt;function ft(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Ee(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Vt(e,...t){if(!Ee(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Wt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _e(e,t){Vt(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const st=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),V=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Ft=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,T=V?e=>e:e=>Ft(e);function K(e){for(let t=0;t<e.length;t++)e[t]=Ft(e[t])}function Ue(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function z(e){return typeof e=="string"&&(e=Ue(e)),Vt(e),e}class Ae{clone(){return this._cloneInto()}}function Ie(e){const t=(r,s)=>e(s).update(z(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const Le=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class De extends Ae{constructor(t,n,r={},s,i,o){if(super(),this.blockLen=t,this.outputLen=n,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,ft(t),ft(n),ft(s),n<0||n>s)throw new Error("outputLen bigger than keyLen");if(r.key!==void 0&&(r.key.length<1||r.key.length>s))throw new Error(`key must be up 1..${s} byte long or undefined`);if(r.salt!==void 0&&r.salt.length!==i)throw new Error(`salt must be ${i} byte long or undefined`);if(r.personalization!==void 0&&r.personalization.length!==o)throw new Error(`personalization must be ${o} byte long or undefined`);this.buffer32=st(this.buffer=new Uint8Array(t))}update(t){Wt(this);const{blockLen:n,buffer:r,buffer32:s}=this;t=z(t);const i=t.length,o=t.byteOffset,a=t.buffer;for(let h=0;h<i;){this.pos===n&&(V||K(s),this.compress(s,0,!1),V||K(s),this.pos=0);const v=Math.min(n-this.pos,i-h),d=o+h;if(v===n&&!(d%4)&&h+v<i){const f=new Uint32Array(a,d,Math.floor((i-h)/4));V||K(f);for(let w=0;h+n<i;w+=s.length,h+=n)this.length+=n,this.compress(f,w,!1);V||K(f);continue}r.set(t.subarray(h,h+v),this.pos),this.pos+=v,this.length+=v,h+=v}return this}digestInto(t){Wt(this),_e(t,this);const{pos:n,buffer32:r}=this;this.finished=!0,this.buffer.subarray(n).fill(0),V||K(r),this.compress(r,0,!0),V||K(r);const s=st(t);this.get().forEach((i,o)=>s[o]=T(i))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:i,outputLen:o,pos:a}=this;return t||(t=new this.constructor({dkLen:o})),t.set(...this.get()),t.length=r,t.finished=s,t.destroyed=i,t.outputLen=o,t.buffer.set(n),t.pos=a,t}}const it=BigInt(2**32-1),vt=BigInt(32);function Xt(e,t=!1){return t?{h:Number(e&it),l:Number(e>>vt&it)}:{h:Number(e>>vt&it)|0,l:Number(e&it)|0}}function ke(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:i,l:o}=Xt(e[s],t);[n[s],r[s]]=[i,o]}return[n,r]}const He=(e,t)=>BigInt(e>>>0)<<vt|BigInt(t>>>0),Te=(e,t,n)=>e>>>n,Oe=(e,t,n)=>e<<32-n|t>>>n,Me=(e,t,n)=>e>>>n|t<<32-n,Se=(e,t,n)=>e<<32-n|t>>>n,$e=(e,t,n)=>e<<64-n|t>>>n-32,Ne=(e,t,n)=>e>>>n-32|t<<64-n,Ce=(e,t)=>t,qe=(e,t)=>e,Pe=(e,t,n)=>e<<n|t>>>32-n,Ve=(e,t,n)=>t<<n|e>>>32-n,We=(e,t,n)=>t<<n-32|e>>>64-n,Fe=(e,t,n)=>e<<n-32|t>>>64-n;function Xe(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const E={fromBig:Xt,split:ke,toBig:He,shrSH:Te,shrSL:Oe,rotrSH:Me,rotrSL:Se,rotrBH:$e,rotrBL:Ne,rotr32H:Ce,rotr32L:qe,rotlSH:Pe,rotlSL:Ve,rotlBH:We,rotlBL:Fe,add:Xe,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,add5H:(e,t,n,r,s,i)=>t+n+r+s+i+(e/2**32|0)|0,add5L:(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},m=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),c=new Uint32Array(32);function N(e,t,n,r,s,i){const o=s[i],a=s[i+1];let h=c[2*e],v=c[2*e+1],d=c[2*t],f=c[2*t+1],w=c[2*n],b=c[2*n+1],p=c[2*r],y=c[2*r+1],I=E.add3L(h,d,o);v=E.add3H(I,v,f,a),h=I|0,{Dh:y,Dl:p}={Dh:y^v,Dl:p^h},{Dh:y,Dl:p}={Dh:E.rotr32H(y,p),Dl:E.rotr32L(y,p)},{h:b,l:w}=E.add(b,w,y,p),{Bh:f,Bl:d}={Bh:f^b,Bl:d^w},{Bh:f,Bl:d}={Bh:E.rotrSH(f,d,24),Bl:E.rotrSL(f,d,24)},c[2*e]=h,c[2*e+1]=v,c[2*t]=d,c[2*t+1]=f,c[2*n]=w,c[2*n+1]=b,c[2*r]=p,c[2*r+1]=y}function C(e,t,n,r,s,i){const o=s[i],a=s[i+1];let h=c[2*e],v=c[2*e+1],d=c[2*t],f=c[2*t+1],w=c[2*n],b=c[2*n+1],p=c[2*r],y=c[2*r+1],I=E.add3L(h,d,o);v=E.add3H(I,v,f,a),h=I|0,{Dh:y,Dl:p}={Dh:y^v,Dl:p^h},{Dh:y,Dl:p}={Dh:E.rotrSH(y,p,16),Dl:E.rotrSL(y,p,16)},{h:b,l:w}=E.add(b,w,y,p),{Bh:f,Bl:d}={Bh:f^b,Bl:d^w},{Bh:f,Bl:d}={Bh:E.rotrBH(f,d,63),Bl:E.rotrBL(f,d,63)},c[2*e]=h,c[2*e+1]=v,c[2*t]=d,c[2*t+1]=f,c[2*n]=w,c[2*n+1]=b,c[2*r]=p,c[2*r+1]=y}class je extends De{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=m[0]|0,this.v0h=m[1]|0,this.v1l=m[2]|0,this.v1h=m[3]|0,this.v2l=m[4]|0,this.v2h=m[5]|0,this.v3l=m[6]|0,this.v3h=m[7]|0,this.v4l=m[8]|0,this.v4h=m[9]|0,this.v5l=m[10]|0,this.v5h=m[11]|0,this.v6l=m[12]|0,this.v6h=m[13]|0,this.v7l=m[14]|0,this.v7h=m[15]|0;const n=t.key?t.key.length:0;if(this.v0l^=this.outputLen|n<<8|65536|1<<24,t.salt){const r=st(z(t.salt));this.v4l^=T(r[0]),this.v4h^=T(r[1]),this.v5l^=T(r[2]),this.v5h^=T(r[3])}if(t.personalization){const r=st(z(t.personalization));this.v6l^=T(r[0]),this.v6h^=T(r[1]),this.v7l^=T(r[2]),this.v7h^=T(r[3])}if(t.key){const r=new Uint8Array(this.blockLen);r.set(z(t.key)),this.update(r)}}get(){let{v0l:t,v0h:n,v1l:r,v1h:s,v2l:i,v2h:o,v3l:a,v3h:h,v4l:v,v4h:d,v5l:f,v5h:w,v6l:b,v6h:p,v7l:y,v7h:I}=this;return[t,n,r,s,i,o,a,h,v,d,f,w,b,p,y,I]}set(t,n,r,s,i,o,a,h,v,d,f,w,b,p,y,I){this.v0l=t|0,this.v0h=n|0,this.v1l=r|0,this.v1h=s|0,this.v2l=i|0,this.v2h=o|0,this.v3l=a|0,this.v3h=h|0,this.v4l=v|0,this.v4h=d|0,this.v5l=f|0,this.v5h=w|0,this.v6l=b|0,this.v6h=p|0,this.v7l=y|0,this.v7h=I|0}compress(t,n,r){this.get().forEach((h,v)=>c[v]=h),c.set(m,16);let{h:s,l:i}=E.fromBig(BigInt(this.length));c[24]=m[8]^i,c[25]=m[9]^s,r&&(c[28]=~c[28],c[29]=~c[29]);let o=0;const a=Le;for(let h=0;h<12;h++)N(0,4,8,12,t,n+2*a[o++]),C(0,4,8,12,t,n+2*a[o++]),N(1,5,9,13,t,n+2*a[o++]),C(1,5,9,13,t,n+2*a[o++]),N(2,6,10,14,t,n+2*a[o++]),C(2,6,10,14,t,n+2*a[o++]),N(3,7,11,15,t,n+2*a[o++]),C(3,7,11,15,t,n+2*a[o++]),N(0,5,10,15,t,n+2*a[o++]),C(0,5,10,15,t,n+2*a[o++]),N(1,6,11,12,t,n+2*a[o++]),C(1,6,11,12,t,n+2*a[o++]),N(2,7,8,13,t,n+2*a[o++]),C(2,7,8,13,t,n+2*a[o++]),N(3,4,9,14,t,n+2*a[o++]),C(3,4,9,14,t,n+2*a[o++]);this.v0l^=c[0]^c[16],this.v0h^=c[1]^c[17],this.v1l^=c[2]^c[18],this.v1h^=c[3]^c[19],this.v2l^=c[4]^c[20],this.v2h^=c[5]^c[21],this.v3l^=c[6]^c[22],this.v3h^=c[7]^c[23],this.v4l^=c[8]^c[24],this.v4h^=c[9]^c[25],this.v5l^=c[10]^c[26],this.v5h^=c[11]^c[27],this.v6l^=c[12]^c[28],this.v6h^=c[13]^c[29],this.v7l^=c[14]^c[30],this.v7h^=c[15]^c[31],c.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Ke=Ie(e=>new je(e)),jt="0123456789abcdef";function pt(e){const t=new Array(e.length+1);t[0]="0x";for(let n=0;n<e.length;){const r=e[n++];t[n]=jt[r>>4]+jt[r&15]}return t.join("")}const gt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function yt(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|gt[e[2]]);for(let i=0;i<r;){const o=n+i*2,a=gt[e[o]],h=gt[e[o+1]];s[t+i++]=a<<4|h}return s}const Y=(...e)=>{const t=e.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.byteLength}return n};var Ge=Object.defineProperty,Kt=e=>{throw TypeError(e)},Re=(e,t,n)=>t in e?Ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t,n)=>Re(e,typeof t!="symbol"?t+"":t,n),Gt=(e,t,n)=>t.has(e)||Kt("Cannot "+n),O=(e,t,n)=>(Gt(e,t,"read from private field"),n?n.call(e):t.get(e)),Q=(e,t,n)=>t.has(e)?Kt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(Gt(e,t,"write to private field"),t.set(e,n),n),M,Z,ot,ct,at;const ze=new TextEncoder,Ye=new TextDecoder,Je=P(L,j(1/0))[1];class Qe{constructor(t,n=!1){if(Q(this,M),Q(this,Z,null),Q(this,ot,null),Q(this,ct,null),Q(this,at,null),J(this,"asText",()=>O(this,at)??W(this,at,Ye.decode(O(this,M)))),J(this,"asHex",()=>O(this,ot)||W(this,ot,pt(O(this,M)))),J(this,"asOpaqueHex",()=>O(this,ct)||W(this,ct,pt(this.asBytes()))),J(this,"asBytes",()=>O(this,M)),J(this,"asOpaqueBytes",()=>O(this,Z)||W(this,Z,Y(L[0](O(this,M).length),O(this,M)))),n){try{const[r,s]=Je(t);if(r===s.length){W(this,M,s),W(this,Z,t);return}}catch{}throw new Error("Invalid opaque bytes")}else W(this,M,t)}static fromText(t){return new this(ze.encode(t))}static fromHex(t){return new this(yt(t))}static fromOpaqueHex(t){return new this(yt(t),!0)}static fromBytes(t){return new this(t)}static fromOpaqueBytes(t){return new this(t,!0)}}M=new WeakMap,Z=new WeakMap,ot=new WeakMap,ct=new WeakMap,at=new WeakMap;const l=L,Rt=e=>{const t=j.enc(e);return n=>t(yt(n))},zt=e=>{const t=j.dec(e);return n=>pt(t(n))},tt=e=>x(Rt(e),zt(e));tt.enc=Rt,tt.dec=zt;const S=B(U),Yt=H(U),Ze=q({bool:g,char:g,str:g,u8:g,u16:g,u32:g,u64:g,u128:g,u256:g,i8:g,i16:g,i32:g,i64:g,i128:g,i256:g}),Jt=B(u({name:Yt,type:l,typeName:Yt,docs:S})),tn=u({len:X,type:l}),en=u({bitStoreType:l,bitOrderType:l}),nn=B(u({name:U,fields:Jt,index:_,docs:S})),rn=q({composite:Jt,variant:nn,sequence:l,array:tn,tuple:B(l),primitive:Ze,compact:l,bitSequence:en}),sn=u({name:U,type:H(l)}),on=B(sn),cn=u({id:l,path:S,params:on,def:rn,docs:S}),Qt=B(cn),an=q({Blake2128:g,Blake2256:g,Blake2128Concat:g,Twox128:g,Twox256:g,Twox64Concat:g,Identity:g}),hn=B(an),ln=u({hashers:hn,key:l,value:l}),un=u({name:U,modifier:_,type:q({plain:l,map:ln}),fallback:tt(),docs:S}),dn=H(u({prefix:U,items:B(un)})),Zt={name:U,storage:dn,calls:H(l),events:H(l),constants:B(u({name:U,type:l,value:tt(),docs:S})),errors:H(l),index:_},fn={...Zt,docs:S},vn=new Uint8Array,te=e=>x(()=>vn,()=>e),pn=u({type:l,version:_,signedExtensions:B(u({identifier:U,type:l,additionalSigned:l}))}),gn=u({lookup:Qt,pallets:B(u({...Zt,docs:te([])})),extrinsic:pn,type:l,apis:te([])}),yn=u({name:U,methods:B(u({name:U,inputs:B(u({name:U,type:l})),output:l,docs:S})),docs:S}),wn=u({version:_,address:l,call:l,signature:l,extra:l,signedExtensions:B(u({identifier:U,type:l,additionalSigned:l}))}),Bn=u({lookup:Qt,pallets:B(u(fn)),extrinsic:wn,type:l,apis:B(yn),outerEnums:u({call:l,event:l,error:l}),custom:B(P(U,u({type:l,value:tt()})))}),ee=()=>{throw new Error("Unsupported metadata version!")},A=x(ee,ee),ht=u({magicNumber:X,metadata:q({v0:A,v1:A,v2:A,v3:A,v4:A,v5:A,v6:A,v7:A,v8:A,v9:A,v10:A,v11:A,v12:A,v13:A,v14:gn,v15:Bn})}),wt=j(),mn=H(wt),xn=P(L,wt),bn=e=>{try{return ht.dec(e)}catch{}try{return ht.dec(mn.dec(e))}catch{}try{return ht.dec(wt.dec(e))}catch{}try{return ht.dec(xn.dec(e)[1])}catch{}throw null},En={dkLen:32},_n=e=>Ke(e,En),Un=dt(_.enc,e=>+!!e.signed<<7|e.version),An={Ed25519:0,Sr25519:1,Ecdsa:2},[lt,et]=["<Bytes>","</Bytes>"].map(e=>Qe.fromText(e).asBytes());function In(e,t,n){return{publicKey:e,signTx:async(i,o,a,h,v=_n)=>{let d;try{const F=bn(a);if(F.metadata.tag!=="v14"&&F.metadata.tag!=="v15")throw null;d=F.metadata.value}catch{throw new Error("Unsupported metadata version")}const{version:f}=d.extrinsic,w=[],b=[];d.extrinsic.signedExtensions.map(({identifier:F})=>{const Bt=o[F];if(!Bt)throw new Error(`Missing ${F} signed extension`);w.push(Bt.value),b.push(Bt.additionalSigned)});const p=Y(i,...w,...b),y=await n(p.length>256?v(p):p),I=Y(Un({signed:!0,version:f}),new Uint8Array([0,...e]),new Uint8Array([An[t],...y]),...w,i);return Y(L.enc(I.length),I)},signBytes:async i=>{let o=!0,a;for(a=0;o&&a<lt.length;a++)o=lt[a]===i[a];o=o&&a===lt.length;const h=i.length-et.length;for(a=0;o&&a<et.length;a++)o=et[a]===i[h+a];return o=o&&a===et.length,n(o?i:Y(lt,i,et))}}}G.getPolkadotSigner=In});
|
|
1
|
+
(function(F,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):(F=typeof globalThis<"u"?globalThis:F||self,G(F.papiSigner={}))})(this,function(F){"use strict";var G=Object.defineProperty,ae=(e,t,n)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xt=(e,t,n)=>(ae(e,typeof t!="symbol"?t+"":t,n),n),ut={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function he(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|ut[e[2]]);for(let o=0;o<r;){const i=n+o*2,a=ut[e[i]],h=ut[e[i+1]];s[t+o++]=a<<4|h}return s}var Et=class extends Uint8Array{constructor(e){super(e),xt(this,"i",0),xt(this,"v"),this.v=new DataView(e)}},k=e=>t=>e(t instanceof Et?t:new Et(t instanceof Uint8Array?t.buffer:typeof t=="string"?he(t).buffer:t)),D=e=>{const t=e.length;let n=0;for(let s=0;s<t;s++)n+=e[s].byteLength;const r=new Uint8Array(n);for(let s=0,o=0;s<t;s++){const i=e[s];r.set(i,o),o+=i.byteLength}return r};function nt(e,t){const n=Object.keys(e),r=n.length,s={};for(let o=0;o<r;o++){const i=n[o];s[i]=t(e[i],i)}return s}var B=(e,t)=>{const n=[e,t];return n.enc=e,n.dec=t,n},dt=(e,t)=>n=>e(t(n)),At=(e,t)=>n=>t(e(n)),Ut=([e,t],n,r)=>B(dt(e,n),At(t,r));function le(e,t){return k(n=>{const r=n.v[t](n.i,!0);return n.i+=e,r})}function ue(e,t){return n=>{const r=new Uint8Array(e);return new DataView(r.buffer)[t](0,n,!0),r}}function $(e,t,n){return B(ue(e,n),le(e,t))}var A=$(1,"getUint8","setUint8"),rt=$(2,"getUint16","setUint16"),K=$(4,"getUint32","setUint32"),_t=$(8,"getBigUint64","setBigUint64");$(1,"getInt8","setInt8"),$(2,"getInt16","setInt16"),$(4,"getInt32","setInt32"),$(8,"getBigInt64","setBigInt64");var It=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),t},Lt=e=>k(t=>{const{v:n,i:r}=t,s=n.getBigUint64(r,!0),o=n[e](r+8,!0);return t.i+=16,o<<64n|s});B(It,Lt("getBigUint64")),B(It,Lt("getBigInt64"));var kt=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),n.setBigInt64(16,e>>128n,!0),n.setBigInt64(24,e>>192n,!0),t},Dt=e=>k(t=>{let n=t.v.getBigUint64(t.i,!0);return t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<64n,t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<128n,t.i+=8,n|=t.v[e](t.i,!0)<<192n,t.i+=8,n});B(kt,Dt("getBigUint64")),B(kt,Dt("getBigInt64"));var Tt=Ut(A,e=>e?1:0,Boolean),de=[A[1],rt[1],K[1]],fe=k(e=>{const t=e[e.i],n=t&3;if(n<3)return de[n](e)>>>2;const r=(t>>>2)+4;e.i++;let s=0n;const o=r/8|0;let i=0n;for(let h=0;h<o;h++)s=_t[1](e)<<i|s,i+=64n;let a=r%8;return a>3&&(s=BigInt(K[1](e))<<i|s,i+=32n,a-=4),a>1&&(s=BigInt(rt[1](e))<<i|s,i+=16n,a-=2),a&&(s=BigInt(A[1](e))<<i|s),s}),ve=1n<<56n,pe=1<<24,ye=256,ge=4294967295n,we=64,be=16384,me=1<<30,Be=e=>{if(e<0)throw new Error(`Wrong compact input (${e})`);const t=Number(e)<<2;if(e<we)return A[0](t);if(e<be)return rt[0](t|1);if(e<me)return K[0](t|2);let n=[new Uint8Array(1)],r=BigInt(e);for(;r>=ve;)n.push(_t[0](r)),r>>=64n;r>=pe&&(n.push(K[0](Number(r&ge))),r>>=32n);let s=Number(r);s>=ye&&(n.push(rt[0](s)),s>>=16),s&&n.push(A[0](s));const o=D(n);return o[0]=o.length-5<<2|3,o},L=B(Be,fe),xe=new TextEncoder,Ee=e=>{const t=xe.encode(e);return D([L.enc(t.length),t])},Ae=new TextDecoder,Ue=k(e=>{let t=L.dec(e);const n=new DataView(e.buffer,e.i,t);return e.i+=t,Ae.decode(n)}),U=B(Ee,Ue),_e=()=>{},Ie=new Uint8Array(0),y=B(()=>Ie,_e),Ht=e=>e===void 0?t=>D([L.enc(t.length),t]):t=>t.length===e?t:t.slice(0,e),St=e=>k(t=>{const n=e===void 0?L.dec(t):e!==1/0?e:t.byteLength-t.i,r=new Uint8Array(t.buffer.slice(t.i,t.i+n));return t.i+=n,r}),V=e=>B(Ht(e),St(e));V.enc=Ht,V.dec=St;var Ot=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((o,i)=>[n[i],o])??n.map((o,i)=>[o,i])),s=o=>r.get(o);return({tag:o,value:i})=>D([A.enc(s(o)),e[o](i)])},Mt=(e,t)=>{const n=Object.keys(e),r=new Map(t?.map((s,o)=>[s,n[o]])??n.map((s,o)=>[o,s]));return k(s=>{const o=A.dec(s),i=r.get(o),a=e[i];return{tag:i,value:a(s)}})},P=(e,...t)=>B(Ot(nt(e,([n])=>n),...t),Mt(nt(e,([,n])=>n),...t));P.enc=Ot,P.dec=Mt;var $t=e=>k(t=>{const n=A.dec(t);if(n!==0)return e===Tt[1]?n===1:e(t)}),Nt=e=>t=>{const n=new Uint8Array(1);return t===void 0?(n[0]=0,n):(n[0]=1,e===Tt[0]?(n[0]=t?1:2,n):D([n,e(t)]))},T=e=>B(Nt(e[0]),$t(e[1]));T.enc=Nt,T.dec=$t;var Ct=(...e)=>k(t=>e.map(n=>n(t))),Vt=(...e)=>t=>D(e.map((n,r)=>n(t[r]))),q=(...e)=>B(Vt(...e.map(([t])=>t)),Ct(...e.map(([,t])=>t)));q.enc=Vt,q.dec=Ct;var Pt=e=>{const t=Object.keys(e);return dt(q.enc(...Object.values(e)),n=>t.map(r=>n[r]))},qt=e=>{const t=Object.keys(e);return At(q.dec(...Object.values(e)),n=>Object.fromEntries(n.map((r,s)=>[t[s],r])))},v=e=>B(Pt(nt(e,t=>t[0])),qt(nt(e,t=>t[1])));v.enc=Pt,v.dec=qt;var jt=(e,t)=>t>=0?n=>D(n.map(e)):n=>D([L.enc(n.length),D(n.map(e))]),Rt=(e,t)=>k(n=>{const r=t>=0?t:L.dec(n),s=new Array(r);for(let o=0;o<r;o++)s[o]=e(n);return s}),b=(e,t)=>B(jt(e[0],t),Rt(e[1],t));b.enc=jt,b.dec=Rt;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Le(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function ke(...e){const t=o=>o,n=(o,i)=>a=>o(i(a)),r=e.map(o=>o.encode).reduceRight(n,t),s=e.map(o=>o.decode).reduce(n,t);return{encode:r,decode:s}}function De(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function Te(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function Wt(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const s=[],o=Array.from(e);for(o.forEach(i=>{if(i<0||i>=t)throw new Error(`Wrong integer: ${i}`)});;){let i=0,a=!0;for(let h=r;h<o.length;h++){const f=o[h],u=t*i+f;if(!Number.isSafeInteger(u)||t*i/t!==i||u-f!==t*i)throw new Error("convertRadix: carry overflow");i=u%n;const d=Math.floor(u/n);if(o[h]=d,!Number.isSafeInteger(d)||d*n+i!==u)throw new Error("convertRadix: carry overflow");if(a)d?a=!1:r=h;else continue}if(s.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)s.push(0);return s.reverse()}function He(e){return{encode:t=>{if(!Le(t))throw new Error("radix.encode input should be Uint8Array");return Wt(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(Wt(t,e,2**8))}}}const Kt=(e=>ke(He(58),De(e),Te("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function ft(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Se(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Xt(e,...t){if(!Se(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Ft(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Oe(e,t){Xt(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const st=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),j=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Gt=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,H=j?e=>e:e=>Gt(e);function X(e){for(let t=0;t<e.length;t++)e[t]=Gt(e[t])}function Me(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function z(e){return typeof e=="string"&&(e=Me(e)),Xt(e),e}class $e{clone(){return this._cloneInto()}}function Ne(e){const t=(r,s)=>e(s).update(z(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const Ce=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class Ve extends $e{constructor(t,n,r={},s,o,i){if(super(),this.blockLen=t,this.outputLen=n,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,ft(t),ft(n),ft(s),n<0||n>s)throw new Error("outputLen bigger than keyLen");if(r.key!==void 0&&(r.key.length<1||r.key.length>s))throw new Error(`key must be up 1..${s} byte long or undefined`);if(r.salt!==void 0&&r.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(r.personalization!==void 0&&r.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=st(this.buffer=new Uint8Array(t))}update(t){Ft(this);const{blockLen:n,buffer:r,buffer32:s}=this;t=z(t);const o=t.length,i=t.byteOffset,a=t.buffer;for(let h=0;h<o;){this.pos===n&&(j||X(s),this.compress(s,0,!1),j||X(s),this.pos=0);const f=Math.min(n-this.pos,o-h),u=i+h;if(f===n&&!(u%4)&&h+f<o){const d=new Uint32Array(a,u,Math.floor((o-h)/4));j||X(d);for(let w=0;h+n<o;w+=s.length,h+=n)this.length+=n,this.compress(d,w,!1);j||X(d);continue}r.set(t.subarray(h,h+f),this.pos),this.pos+=f,this.length+=f,h+=f}return this}digestInto(t){Ft(this),Oe(t,this);const{pos:n,buffer32:r}=this;this.finished=!0,this.buffer.subarray(n).fill(0),j||X(r),this.compress(r,0,!0),j||X(r);const s=st(t);this.get().forEach((o,i)=>s[i]=H(o))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:i,pos:a}=this;return t||(t=new this.constructor({dkLen:i})),t.set(...this.get()),t.length=r,t.finished=s,t.destroyed=o,t.outputLen=i,t.buffer.set(n),t.pos=a,t}}const ot=BigInt(2**32-1),vt=BigInt(32);function zt(e,t=!1){return t?{h:Number(e&ot),l:Number(e>>vt&ot)}:{h:Number(e>>vt&ot)|0,l:Number(e&ot)|0}}function Pe(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:i}=zt(e[s],t);[n[s],r[s]]=[o,i]}return[n,r]}const qe=(e,t)=>BigInt(e>>>0)<<vt|BigInt(t>>>0),je=(e,t,n)=>e>>>n,Re=(e,t,n)=>e<<32-n|t>>>n,We=(e,t,n)=>e>>>n|t<<32-n,Ke=(e,t,n)=>e<<32-n|t>>>n,Xe=(e,t,n)=>e<<64-n|t>>>n-32,Fe=(e,t,n)=>e>>>n-32|t<<64-n,Ge=(e,t)=>t,ze=(e,t)=>e,Ye=(e,t,n)=>e<<n|t>>>32-n,Je=(e,t,n)=>t<<n|e>>>32-n,Qe=(e,t,n)=>t<<n-32|e>>>64-n,Ze=(e,t,n)=>e<<n-32|t>>>64-n;function tn(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const E={fromBig:zt,split:Pe,toBig:qe,shrSH:je,shrSL:Re,rotrSH:We,rotrSL:Ke,rotrBH:Xe,rotrBL:Fe,rotr32H:Ge,rotr32L:ze,rotlSH:Ye,rotlSL:Je,rotlBH:Qe,rotlBL:Ze,add:tn,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,add5H:(e,t,n,r,s,o)=>t+n+r+s+o+(e/2**32|0)|0,add5L:(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0)},m=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),c=new Uint32Array(32);function N(e,t,n,r,s,o){const i=s[o],a=s[o+1];let h=c[2*e],f=c[2*e+1],u=c[2*t],d=c[2*t+1],w=c[2*n],x=c[2*n+1],p=c[2*r],g=c[2*r+1],I=E.add3L(h,u,i);f=E.add3H(I,f,d,a),h=I|0,{Dh:g,Dl:p}={Dh:g^f,Dl:p^h},{Dh:g,Dl:p}={Dh:E.rotr32H(g,p),Dl:E.rotr32L(g,p)},{h:x,l:w}=E.add(x,w,g,p),{Bh:d,Bl:u}={Bh:d^x,Bl:u^w},{Bh:d,Bl:u}={Bh:E.rotrSH(d,u,24),Bl:E.rotrSL(d,u,24)},c[2*e]=h,c[2*e+1]=f,c[2*t]=u,c[2*t+1]=d,c[2*n]=w,c[2*n+1]=x,c[2*r]=p,c[2*r+1]=g}function C(e,t,n,r,s,o){const i=s[o],a=s[o+1];let h=c[2*e],f=c[2*e+1],u=c[2*t],d=c[2*t+1],w=c[2*n],x=c[2*n+1],p=c[2*r],g=c[2*r+1],I=E.add3L(h,u,i);f=E.add3H(I,f,d,a),h=I|0,{Dh:g,Dl:p}={Dh:g^f,Dl:p^h},{Dh:g,Dl:p}={Dh:E.rotrSH(g,p,16),Dl:E.rotrSL(g,p,16)},{h:x,l:w}=E.add(x,w,g,p),{Bh:d,Bl:u}={Bh:d^x,Bl:u^w},{Bh:d,Bl:u}={Bh:E.rotrBH(d,u,63),Bl:E.rotrBL(d,u,63)},c[2*e]=h,c[2*e+1]=f,c[2*t]=u,c[2*t+1]=d,c[2*n]=w,c[2*n+1]=x,c[2*r]=p,c[2*r+1]=g}class en extends Ve{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=m[0]|0,this.v0h=m[1]|0,this.v1l=m[2]|0,this.v1h=m[3]|0,this.v2l=m[4]|0,this.v2h=m[5]|0,this.v3l=m[6]|0,this.v3h=m[7]|0,this.v4l=m[8]|0,this.v4h=m[9]|0,this.v5l=m[10]|0,this.v5h=m[11]|0,this.v6l=m[12]|0,this.v6h=m[13]|0,this.v7l=m[14]|0,this.v7h=m[15]|0;const n=t.key?t.key.length:0;if(this.v0l^=this.outputLen|n<<8|65536|1<<24,t.salt){const r=st(z(t.salt));this.v4l^=H(r[0]),this.v4h^=H(r[1]),this.v5l^=H(r[2]),this.v5h^=H(r[3])}if(t.personalization){const r=st(z(t.personalization));this.v6l^=H(r[0]),this.v6h^=H(r[1]),this.v7l^=H(r[2]),this.v7h^=H(r[3])}if(t.key){const r=new Uint8Array(this.blockLen);r.set(z(t.key)),this.update(r)}}get(){let{v0l:t,v0h:n,v1l:r,v1h:s,v2l:o,v2h:i,v3l:a,v3h:h,v4l:f,v4h:u,v5l:d,v5h:w,v6l:x,v6h:p,v7l:g,v7h:I}=this;return[t,n,r,s,o,i,a,h,f,u,d,w,x,p,g,I]}set(t,n,r,s,o,i,a,h,f,u,d,w,x,p,g,I){this.v0l=t|0,this.v0h=n|0,this.v1l=r|0,this.v1h=s|0,this.v2l=o|0,this.v2h=i|0,this.v3l=a|0,this.v3h=h|0,this.v4l=f|0,this.v4h=u|0,this.v5l=d|0,this.v5h=w|0,this.v6l=x|0,this.v6h=p|0,this.v7l=g|0,this.v7h=I|0}compress(t,n,r){this.get().forEach((h,f)=>c[f]=h),c.set(m,16);let{h:s,l:o}=E.fromBig(BigInt(this.length));c[24]=m[8]^o,c[25]=m[9]^s,r&&(c[28]=~c[28],c[29]=~c[29]);let i=0;const a=Ce;for(let h=0;h<12;h++)N(0,4,8,12,t,n+2*a[i++]),C(0,4,8,12,t,n+2*a[i++]),N(1,5,9,13,t,n+2*a[i++]),C(1,5,9,13,t,n+2*a[i++]),N(2,6,10,14,t,n+2*a[i++]),C(2,6,10,14,t,n+2*a[i++]),N(3,7,11,15,t,n+2*a[i++]),C(3,7,11,15,t,n+2*a[i++]),N(0,5,10,15,t,n+2*a[i++]),C(0,5,10,15,t,n+2*a[i++]),N(1,6,11,12,t,n+2*a[i++]),C(1,6,11,12,t,n+2*a[i++]),N(2,7,8,13,t,n+2*a[i++]),C(2,7,8,13,t,n+2*a[i++]),N(3,4,9,14,t,n+2*a[i++]),C(3,4,9,14,t,n+2*a[i++]);this.v0l^=c[0]^c[16],this.v0h^=c[1]^c[17],this.v1l^=c[2]^c[18],this.v1h^=c[3]^c[19],this.v2l^=c[4]^c[20],this.v2h^=c[5]^c[21],this.v3l^=c[6]^c[22],this.v3h^=c[7]^c[23],this.v4l^=c[8]^c[24],this.v4h^=c[9]^c[25],this.v5l^=c[10]^c[26],this.v5h^=c[11]^c[27],this.v6l^=c[12]^c[28],this.v6h^=c[13]^c[29],this.v7l^=c[14]^c[30],this.v7h^=c[15]^c[31],c.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const pt=Ne(e=>new en(e)),Yt=new TextEncoder().encode("SS58PRE"),yt=2,nn=e=>{try{const t=Kt.decode(e),n=t.subarray(0,t[0]&64?2:1),r=t.subarray(n.length,t.length-yt),s=t.subarray(n.length+r.length),o=pt(Uint8Array.of(...Yt,...n,...r),{dkLen:64}).subarray(0,yt);return s[0]===o[0]&&s[1]===o[1]?{isValid:!0,ss58Format:rn(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},rn=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)},sn=e=>{const t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{const r=pt(Uint8Array.of(...Yt,...t,...n),{dkLen:64}).subarray(0,yt);return Kt.encode(Uint8Array.of(...t,...n,...r))}};function on(e,t){return n=>{const r=nn(n);if(!r.isValid)throw new Error("Invalid checksum");const{publicKey:s}=r;if(s.length!==e)throw new Error("Invalid public key length");return s}}const cn=(e=42,t=32)=>Ut(V(t),on(t),sn(e)),Jt="0123456789abcdef";function gt(e){const t=new Array(e.length+1);t[0]="0x";for(let n=0;n<e.length;){const r=e[n++];t[n]=Jt[r>>4]+Jt[r&15]}return t.join("")}const wt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function bt(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,s=new Uint8Array(r);t&&(s[0]=0|wt[e[2]]);for(let o=0;o<r;){const i=n+o*2,a=wt[e[i]],h=wt[e[i+1]];s[t+o++]=a<<4|h}return s}const Y=(...e)=>{const t=e.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const o=e[r];n.set(o,s),s+=o.byteLength}return n};var an=Object.defineProperty,Qt=e=>{throw TypeError(e)},hn=(e,t,n)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t,n)=>hn(e,typeof t!="symbol"?t+"":t,n),Zt=(e,t,n)=>t.has(e)||Qt("Cannot "+n),S=(e,t,n)=>(Zt(e,t,"read from private field"),n?n.call(e):t.get(e)),Q=(e,t,n)=>t.has(e)?Qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),R=(e,t,n,r)=>(Zt(e,t,"write to private field"),t.set(e,n),n),O,Z,it,ct,at;const ln=new TextEncoder,un=new TextDecoder,dn=q(L,V(1/0))[1];class fn{constructor(t,n=!1){if(Q(this,O),Q(this,Z,null),Q(this,it,null),Q(this,ct,null),Q(this,at,null),J(this,"asText",()=>S(this,at)??R(this,at,un.decode(S(this,O)))),J(this,"asHex",()=>S(this,it)||R(this,it,gt(S(this,O)))),J(this,"asOpaqueHex",()=>S(this,ct)||R(this,ct,gt(this.asBytes()))),J(this,"asBytes",()=>S(this,O)),J(this,"asOpaqueBytes",()=>S(this,Z)||R(this,Z,Y(L[0](S(this,O).length),S(this,O)))),n){try{const[r,s]=dn(t);if(r===s.length){R(this,O,s),R(this,Z,t);return}}catch{}throw new Error("Invalid opaque bytes")}else R(this,O,t)}static fromText(t){return new this(ln.encode(t))}static fromHex(t){return new this(bt(t))}static fromOpaqueHex(t){return new this(bt(t),!0)}static fromBytes(t){return new this(t)}static fromOpaqueBytes(t){return new this(t,!0)}}O=new WeakMap,Z=new WeakMap,it=new WeakMap,ct=new WeakMap,at=new WeakMap,cn();const l=L,te=e=>{const t=V.enc(e);return n=>t(bt(n))},ee=e=>{const t=V.dec(e);return n=>gt(t(n))},tt=e=>B(te(e),ee(e));tt.enc=te,tt.dec=ee;const M=b(U),ne=T(U),vn=P({bool:y,char:y,str:y,u8:y,u16:y,u32:y,u64:y,u128:y,u256:y,i8:y,i16:y,i32:y,i64:y,i128:y,i256:y}),re=b(v({name:ne,type:l,typeName:ne,docs:M})),pn=v({len:K,type:l}),yn=v({bitStoreType:l,bitOrderType:l}),gn=b(v({name:U,fields:re,index:A,docs:M})),wn=P({composite:re,variant:gn,sequence:l,array:pn,tuple:b(l),primitive:vn,compact:l,bitSequence:yn}),bn=v({name:U,type:T(l)}),mn=b(bn),Bn=v({id:l,path:M,params:mn,def:wn,docs:M}),se=b(Bn),xn=P({Blake2128:y,Blake2256:y,Blake2128Concat:y,Twox128:y,Twox256:y,Twox64Concat:y,Identity:y}),En=b(xn),An=v({hashers:En,key:l,value:l}),Un=v({name:U,modifier:A,type:P({plain:l,map:An}),fallback:tt(),docs:M}),_n=T(v({prefix:U,items:b(Un)})),oe={name:U,storage:_n,calls:T(l),events:T(l),constants:b(v({name:U,type:l,value:tt(),docs:M})),errors:T(l),index:A},In={...oe,docs:M},Ln=new Uint8Array,ie=e=>B(()=>Ln,()=>e),kn=v({type:l,version:A,signedExtensions:b(v({identifier:U,type:l,additionalSigned:l}))}),Dn=v({lookup:se,pallets:b(v({...oe,docs:ie([])})),extrinsic:kn,type:l,apis:ie([])}),Tn=v({name:U,methods:b(v({name:U,inputs:b(v({name:U,type:l})),output:l,docs:M})),docs:M}),Hn=v({version:A,address:l,call:l,signature:l,extra:l,signedExtensions:b(v({identifier:U,type:l,additionalSigned:l}))}),Sn=v({lookup:se,pallets:b(v(In)),extrinsic:Hn,type:l,apis:b(Tn),outerEnums:v({call:l,event:l,error:l}),custom:b(q(U,v({type:l,value:tt()})))}),ce=()=>{throw new Error("Unsupported metadata version!")},_=B(ce,ce),ht=v({magicNumber:K,metadata:P({v0:_,v1:_,v2:_,v3:_,v4:_,v5:_,v6:_,v7:_,v8:_,v9:_,v10:_,v11:_,v12:_,v13:_,v14:Dn,v15:Sn})}),mt=V(),On=T(mt),Mn=q(L,mt),$n=e=>{try{return ht.dec(e)}catch{}try{return ht.dec(On.dec(e))}catch{}try{return ht.dec(mt.dec(e))}catch{}try{return ht.dec(Mn.dec(e)[1])}catch{}throw null},Nn={dkLen:32},Cn=e=>pt(e,Nn),Vn=dt(A.enc,e=>+!!e.signed<<7|e.version),Pn={Ed25519:0,Sr25519:1,Ecdsa:2},[lt,et]=["<Bytes>","</Bytes>"].map(e=>fn.fromText(e).asBytes());function qn(e,t,n){return{publicKey:e,signTx:async(o,i,a,h,f=Cn)=>{let u;try{const W=$n(a);if(W.metadata.tag!=="v14"&&W.metadata.tag!=="v15")throw null;u=W.metadata.value}catch{throw new Error("Unsupported metadata version")}const{version:d}=u.extrinsic,w=[],x=[];u.extrinsic.signedExtensions.map(({identifier:W})=>{const Bt=i[W];if(!Bt)throw new Error(`Missing ${W} signed extension`);w.push(Bt.value),x.push(Bt.additionalSigned)});const p=Y(o,...w,...x),g=await n(p.length>256?f(p):p),I=Y(Vn({signed:!0,version:d}),new Uint8Array([0,...e]),new Uint8Array([Pn[t],...g]),...w,o);return Y(L.enc(I.length),I)},signBytes:async o=>{let i=!0,a;for(a=0;i&&a<lt.length;a++)i=lt[a]===o[a];i=i&&a===lt.length;const h=o.length-et.length;for(a=0;i&&a<et.length;a++)i=et[a]===o[h+a];return i=i&&a===et.length,n(i?o:Y(lt,o,et))}}}F.getPolkadotSigner=qn});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(f,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(f=typeof globalThis<"u"?globalThis:f||self,y(f.papiWsProviderWeb={}))})(this,function(f){"use strict";const y=n=>JSON.stringify({jsonrpc:"2.0",...n}),L=new Set(["v1","unstable"].map(n=>`chainHead_${n}_unfollow`)),S=n=>{let e={type:1,pending:[]};const r=s=>{if(e.type===0){const t=JSON.parse(s);if("id"in t)e.onGoingRequests.get(t.id)?.type===0&&e.activeChainHeads.add(t.result),e.onGoingRequests.delete(t.id);else{const{subscription:c,result:d}=t.params;d?.event==="stop"&&e.activeChainHeads.delete(c)}}e.type!==2&&n(s)},i=s=>{if(e.type===2)return;if(e.type===1){e.pending.push(s);return}const t=JSON.parse(s);if(L.has(t.method)&&e.activeChainHeads.delete(t.params[0]),"id"in t){const{method:c,id:d}=t,E=c.startsWith("chainHead")?c.endsWith("follow")?{type:0,msg:s}:{type:1,id:d}:{type:2,msg:s};e.onGoingRequests.set(d,E)}e.connection.send(s)};return{send:i,disconnect:()=>{e.type!==2&&(e.type===0&&e.connection.disconnect(),e={type:2})},connect:s=>{if(e.type!==1)throw new Error("Nonesense");const{pending:t}=e,c=new Map,d=new Set;e={type:0,connection:s(r,()=>{e={type:1,pending:[]},d.forEach(o=>{r(y({params:{subscription:o,result:{event:"stop",internal:!0}}}))}),d.clear();for(const o of c.values())o.type===1?r(y({id:o.id,error:{code:-32603,message:"Internal error"},internal:!0})):i(o.msg);c.clear()}),onGoingRequests:c,activeChainHeads:d},t.forEach(i)}}},w=n=>e=>{let r=S(e);const i=()=>{n().then(s=>{if(r)r.connect((t,c)=>s(t,()=>{c(),i()}));else try{s(()=>{},()=>{}).disconnect()}catch{}},()=>{r&&setTimeout(i,0)})};return i(),{send:s=>{r?.send(s)},disconnect:()=>{r?.disconnect(),r=null}}};var l=(n=>(n[n.CONNECTING=0]="CONNECTING",n[n.CONNECTED=1]="CONNECTED",n[n.ERROR=2]="ERROR",n[n.CLOSE=3]="CLOSE",n))(l||{});const g={type:l.ERROR,event:{type:"timeout"}},O=()=>{},T=(n=>(...e)=>{let r=[],i=O;typeof e[1]=="function"&&(i=e[1]),Array.isArray(e[0])?r=e[0].map(o=>typeof o=="string"?[o]:[o.uri,o.protocol]):(r=[[e[0]]],e[1]&&e[1]!==i&&(r[0][1]=e[1]),e[2]&&(i=e[2]));let s=0,t,c=null,d=O;const E=w(async()=>{const[o,h]=c||r[s++%r.length];c=null;const p=new n(o,h);return i(t={type:l.CONNECTING,uri:o,protocols:h}),await new Promise((N,R)=>{const C=()=>{u(),N()},v=a=>{u(),console.error(`Unable to connect to ${o}${h?", protocols: "+h:""}`),i(t={type:a?l.ERROR:l.CLOSE,event:a}),setTimeout(R,a?300:0,a)},m=setTimeout(()=>{u(),i(t=g),R(g.event)},3500),u=()=>{clearTimeout(m),p.removeEventListener("error",v),p.removeEventListener("open",C)};p.addEventListener("open",C),p.addEventListener("error",v),d=()=>{v(null)}}),i(t={type:l.CONNECTED,uri:o,protocols:h}),(N,R)=>{const C=a=>{typeof a.data=="string"&&N(a.data)},v=a=>H=>{console.warn(`WS halt (${a})`),i(t={type:a,event:H}),R()},m=v(l.ERROR),u=v(l.CLOSE);return p.addEventListener("message",C),p.addEventListener("error",m),p.addEventListener("close",u),d=a=>{d=O,p.removeEventListener("message",C),p.removeEventListener("error",m),p.removeEventListener("close",u),p.close(),a&&u({})},{send:a=>{p.send(a)},disconnect:d}}});return E.getStatus=()=>t,E.switch=(...o)=>{t.type!==l.CLOSE&&(o.length&&(c=o),t.type!==l.ERROR&&d(!0))},E})(WebSocket);f.WsEvent=l,f.getWsProvider=T});
|
package/ink/package.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "polkadot-api_ink",
|
|
3
|
+
"types": "../dist/reexports/ink.d.ts",
|
|
4
|
+
"module": "../dist/esm/reexports/ink.mjs",
|
|
5
|
+
"import": "../dist/esm/reexports/ink.mjs",
|
|
6
|
+
"browser": "../dist/esm/reexports/ink.mjs",
|
|
7
|
+
"require": "../dist/reexports/ink.js",
|
|
8
|
+
"default": "../dist/reexports/ink.js"
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polkadot-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"author": "Josep M Sobrepere (https://github.com/josepot)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -155,6 +155,18 @@
|
|
|
155
155
|
"import": "./dist/esm/reexports/utils.mjs",
|
|
156
156
|
"require": "./dist/reexports/utils.js",
|
|
157
157
|
"default": "./dist/reexports/utils.js"
|
|
158
|
+
},
|
|
159
|
+
"./ink": {
|
|
160
|
+
"types": "./dist/reexports/ink.d.ts",
|
|
161
|
+
"node": {
|
|
162
|
+
"import": "./dist/esm/reexports/ink.mjs",
|
|
163
|
+
"require": "./dist/reexports/ink.js",
|
|
164
|
+
"default": "./dist/reexports/ink.js"
|
|
165
|
+
},
|
|
166
|
+
"module": "./dist/esm/reexports/ink.mjs",
|
|
167
|
+
"import": "./dist/esm/reexports/ink.mjs",
|
|
168
|
+
"require": "./dist/reexports/ink.js",
|
|
169
|
+
"default": "./dist/reexports/ink.js"
|
|
158
170
|
}
|
|
159
171
|
},
|
|
160
172
|
"main": "./dist/index.js",
|
|
@@ -172,33 +184,35 @@
|
|
|
172
184
|
"ws-provider",
|
|
173
185
|
"chains",
|
|
174
186
|
"smoldot",
|
|
175
|
-
"utils"
|
|
187
|
+
"utils",
|
|
188
|
+
"ink"
|
|
176
189
|
],
|
|
177
190
|
"peerDependencies": {
|
|
178
191
|
"rxjs": ">=7.8.0"
|
|
179
192
|
},
|
|
180
193
|
"dependencies": {
|
|
181
|
-
"@polkadot-api/cli": "0.9.
|
|
182
|
-
"@polkadot-api/
|
|
183
|
-
"@polkadot-api/json-rpc-provider": "0.0.
|
|
184
|
-
"@polkadot-api/polkadot-sdk-compat": "2.2.
|
|
185
|
-
"@polkadot-api/metadata-builders": "0.8.
|
|
186
|
-
"@polkadot-api/
|
|
187
|
-
"@polkadot-api/
|
|
188
|
-
"@polkadot-api/
|
|
189
|
-
"@polkadot-api/
|
|
190
|
-
"@polkadot-api/signer": "0.1.
|
|
191
|
-
"@polkadot-api/
|
|
192
|
-
"@polkadot-api/substrate-
|
|
193
|
-
"@polkadot-api/substrate-
|
|
194
|
-
"@polkadot-api/
|
|
195
|
-
"@polkadot-api/
|
|
196
|
-
"@polkadot-api/
|
|
197
|
-
"@polkadot-api/smoldot": "0.3.
|
|
194
|
+
"@polkadot-api/cli": "0.9.6",
|
|
195
|
+
"@polkadot-api/ink-contracts": "0.0.1",
|
|
196
|
+
"@polkadot-api/json-rpc-provider": "0.0.4",
|
|
197
|
+
"@polkadot-api/polkadot-sdk-compat": "2.2.2",
|
|
198
|
+
"@polkadot-api/metadata-builders": "0.8.2",
|
|
199
|
+
"@polkadot-api/logs-provider": "0.0.6",
|
|
200
|
+
"@polkadot-api/metadata-compatibility": "0.1.9",
|
|
201
|
+
"@polkadot-api/observable-client": "0.5.9",
|
|
202
|
+
"@polkadot-api/pjs-signer": "0.4.5",
|
|
203
|
+
"@polkadot-api/signer": "0.1.8",
|
|
204
|
+
"@polkadot-api/polkadot-signer": "0.1.6",
|
|
205
|
+
"@polkadot-api/substrate-bindings": "0.9.2",
|
|
206
|
+
"@polkadot-api/substrate-client": "0.2.2",
|
|
207
|
+
"@polkadot-api/utils": "0.1.2",
|
|
208
|
+
"@polkadot-api/known-chains": "0.5.4",
|
|
209
|
+
"@polkadot-api/ws-provider": "0.3.2",
|
|
210
|
+
"@polkadot-api/smoldot": "0.3.3",
|
|
211
|
+
"@polkadot-api/sm-provider": "0.1.3"
|
|
198
212
|
},
|
|
199
213
|
"devDependencies": {
|
|
200
214
|
"rxjs": "^7.8.1",
|
|
201
|
-
"@polkadot-api/codegen": "0.12.
|
|
215
|
+
"@polkadot-api/codegen": "0.12.4"
|
|
202
216
|
},
|
|
203
217
|
"scripts": {
|
|
204
218
|
"build-core": "tsc --noEmit && rollup -c",
|