@polkadot-api/substrate-bindings
Advanced tools
Comparing version 0.0.1-81d5a1339ac709636f6bd916981aea58a4c031f9.1.0 to 0.0.1-8207d417c57431583f97269921a425bc169b85c3.1.0
@@ -84,5 +84,7 @@ import * as scale_ts from 'scale-ts'; | ||
value: any; | ||
}> | Uint8Array ? T : T extends (...args: infer Args) => infer R ? (...args: Anonymize<Args>) => Anonymize<R> : T extends MyTuple<any> ? { | ||
}> | Uint8Array ? T : T extends (...args: infer Args) => infer R ? (...args: { | ||
[K in keyof Args]: Anonymize<Args[K]>; | ||
}) => Anonymize<R> : T extends MyTuple<any> ? { | ||
[K in keyof T]: Anonymize<T[K]>; | ||
} : T extends Array<infer A> ? List<Anonymize<A>> : { | ||
} : T extends [] ? [] : T extends Array<infer A> ? List<Anonymize<A>> : { | ||
[K in keyof T]: Anonymize<T[K]>; | ||
@@ -761,2 +763,3 @@ }>; | ||
apis: Record<string, Record<string, RuntimeDescriptor<any, any>>>; | ||
asset: PlainDescriptor<any>; | ||
}; | ||
@@ -763,0 +766,0 @@ type PickDescriptors<Idx extends 0 | 1 | 2 | 3 | 4, T extends Descriptors["pallets"]> = { |
@@ -84,5 +84,7 @@ import * as scale_ts from 'scale-ts'; | ||
value: any; | ||
}> | Uint8Array ? T : T extends (...args: infer Args) => infer R ? (...args: Anonymize<Args>) => Anonymize<R> : T extends MyTuple<any> ? { | ||
}> | Uint8Array ? T : T extends (...args: infer Args) => infer R ? (...args: { | ||
[K in keyof Args]: Anonymize<Args[K]>; | ||
}) => Anonymize<R> : T extends MyTuple<any> ? { | ||
[K in keyof T]: Anonymize<T[K]>; | ||
} : T extends Array<infer A> ? List<Anonymize<A>> : { | ||
} : T extends [] ? [] : T extends Array<infer A> ? List<Anonymize<A>> : { | ||
[K in keyof T]: Anonymize<T[K]>; | ||
@@ -761,2 +763,3 @@ }>; | ||
apis: Record<string, Record<string, RuntimeDescriptor<any, any>>>; | ||
asset: PlainDescriptor<any>; | ||
}; | ||
@@ -763,0 +766,0 @@ type PickDescriptors<Idx extends 0 | 1 | 2 | 3 | 4, T extends Descriptors["pallets"]> = { |
@@ -1,2 +0,2 @@ | ||
"use strict";var W=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var $e=Object.prototype.hasOwnProperty;var Ge=(e,t,n)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t)=>{for(var n in t)W(e,n,{get:t[n],enumerable:!0})},Xe=(e,t,n,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of We(t))!$e.call(e,m)&&m!==n&&W(e,m,{get:()=>t[m],enumerable:!(d=qe(t,m))||d.enumerable});return e};var Je=e=>Xe(W({},"__esModule",{value:!0}),e);var $=(e,t,n)=>(Ge(e,typeof t!="symbol"?t+"":t,n),n),Te=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var U=(e,t,n)=>(Te(e,t,"read from private field"),n?n.call(e):t.get(e)),G=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},j=(e,t,n,d)=>(Te(e,t,"write to private field"),d?d.call(e,n):t.set(e,n),n);var Lt={};je(Lt,{AccountId:()=>Ze,Bin:()=>ce,Binary:()=>J,Blake2128:()=>_e,Blake2128Concat:()=>pe,Blake2256:()=>Dt,Bytes:()=>r.Bytes,Enum:()=>ae,Hex:()=>S,Identity:()=>le,Option:()=>r.Option,Result:()=>r.Result,Self:()=>yt,Storage:()=>Rt,Struct:()=>r.Struct,Tuple:()=>r.Tuple,Twox128:()=>te,Twox256:()=>Ht,Twox64Concat:()=>fe,Variant:()=>z,Vector:()=>r.Vector,_Enum:()=>mt,_void:()=>r._void,bitSequence:()=>ct,blockHeader:()=>lt,bool:()=>r.bool,char:()=>st,compact:()=>r.compact,compactBn:()=>nt,compactNumber:()=>a,createCodec:()=>r.createCodec,createDecoder:()=>r.createDecoder,enhanceCodec:()=>r.enhanceCodec,enhanceDecoder:()=>r.enhanceDecoder,enhanceEncoder:()=>r.enhanceEncoder,fixedStr:()=>dt,h64:()=>C,i128:()=>r.i128,i16:()=>r.i16,i256:()=>r.i256,i32:()=>r.i32,i64:()=>r.i64,i8:()=>r.i8,metadata:()=>Bt,selfDecoder:()=>we,selfEncoder:()=>ke,str:()=>r.str,u128:()=>r.u128,u16:()=>r.u16,u256:()=>r.u256,u32:()=>r.u32,u64:()=>r.u64,u8:()=>r.u8,v15:()=>me});module.exports=Je(Lt);var X=require("scale-ts"),re=require("@noble/hashes/blake2b"),oe=require("@scure/base"),ge=new TextEncoder().encode("SS58PRE"),ne=2,Qe=e=>{let t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{let d=(0,re.blake2b)(Uint8Array.of(...ge,...t,...n),{dkLen:64}).subarray(0,ne);return oe.base58.encode(Uint8Array.of(...t,...n,...d))}};function Ye(e,t){return n=>{let d=oe.base58.decode(n),m=d.subarray(0,d[0]&64?2:1),b=d.subarray(m.length,d.length-ne);if(b.length!==e)throw new Error("Invalid public key length");let v=d.subarray(m.length+b.length),h=(0,re.blake2b)(Uint8Array.of(...ge,...m,...b),{dkLen:64}).subarray(0,ne);if(v[0]!==h[0]||v[1]!==h[1])throw new Error("Invalid checksum");if(Fe(m)!=t)throw new Error("Invalid SS58 prefix");return b.slice()}}var Ze=(e=42,t=32)=>(0,X.enhanceCodec)((0,X.Bytes)(t),Ye(t,e),Qe(e)),Fe=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)};var N=require("scale-ts"),Q=require("@polkadot-api/utils");var et=new TextEncoder,tt=new TextDecoder,B,O,H,I=class I{constructor(t){G(this,B,void 0);G(this,O,null);G(this,H,null);$(this,"asText",()=>U(this,H)===null?j(this,H,tt.decode(U(this,B))):U(this,H));$(this,"asHex",()=>U(this,O)===null?j(this,O,(0,Q.toHex)(U(this,B))):U(this,O));$(this,"asBytes",()=>U(this,B));j(this,B,t)}static fromText(t){return new I(et.encode(t))}static fromHex(t){return new I((0,Q.fromHex)(t))}static fromBytes(t){return new I(t)}};B=new WeakMap,O=new WeakMap,H=new WeakMap;var J=I,be=e=>{let t=N.Bytes.enc(e);return n=>t(n.asBytes())},he=e=>{let t=N.Bytes.dec(e);return n=>J.fromBytes(t(n))},ce=e=>(0,N.createCodec)(be(e),he(e));ce.enc=be;ce.dec=he;var R=require("scale-ts");var se=require("scale-ts"),a=se.compact,nt=se.compact;var rt=(0,R.createDecoder)(e=>{let t=a.dec(e),n=Math.ceil(t/8);return{bytes:(0,R.Bytes)(n).dec(e),bitsLen:t}}),ot=e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);let t=a.enc(e.bitsLen),n=new Uint8Array(e.bytes.length+t.length);return n.set(t,0),n.set(e.bytes,t.length),n},ct=(0,R.createCodec)(ot,rt);var Y=require("scale-ts"),st=(0,Y.enhanceCodec)(Y.u8,e=>e.charCodeAt(0),String.fromCharCode);var Z=require("@polkadot-api/utils"),M=require("scale-ts"),Ee=e=>{let t=M.Bytes.enc(e);return n=>t((0,Z.fromHex)(n))},ve=e=>{let t=M.Bytes.dec(e);return n=>(0,Z.toHex)(t(n))},S=e=>(0,M.createCodec)(Ee(e),ve(e));S.enc=Ee;S.dec=ve;var F=require("scale-ts"),it=new TextEncoder,at=new TextDecoder,dt=e=>(0,F.enhanceCodec)((0,F.Bytes)(e),t=>it.encode(t),t=>at.decode(t));var r=require("scale-ts");var Ae=require("scale-ts"),ke=e=>{let t=n=>{let d=e();return t=d,d(n)};return n=>t(n)},we=e=>{let t=n=>{let d=e(),m=d;return t=d,m(n)};return n=>t(n)},yt=e=>(0,Ae.createCodec)(ke(()=>e().enc),we(()=>e().dec));var P=require("scale-ts"),ie=require("@polkadot-api/utils"),mt=new Proxy({},{get(e,t){return n=>ae(t,n)}}),ae=(e,t)=>({as:n=>{if(n!==e)throw new Error(`Enum.as(${n}) used with actual type ${e}`);return t},is:n=>n===e,type:e,value:t}),Se=(...e)=>{let t=P.Enum.enc(...e);return n=>t({tag:n.type,value:n.value})},Ce=(...e)=>{let t=P.Enum.dec(...e);return n=>{let{tag:d,value:m}=t(n);return ae(d,m)}},z=(e,...t)=>(0,P.createCodec)(Se((0,ie.mapObject)(e,([n])=>n),...t),Ce((0,ie.mapObject)(e,([,n])=>n),...t));z.enc=Se;z.dec=Ce;var Ue=new TextEncoder,Ke=new TextDecoder,ut=(0,r.enhanceCodec)((0,r.Bytes)(4),Ue.encode.bind(Ue),Ke.decode.bind(Ke)),de=(0,r.Struct)({engine:ut,payload:S()}),pt=z({consensus:de,seal:de,preRuntime:de,runtimeUpdated:r._void},[4,5,6,8]),ye=S(32),lt=(0,r.Struct)({parentHash:ye,number:a,stateRoot:ye,extrinsicRoot:ye,digests:(0,r.Vector)(pt)});var u=require("scale-ts");var c=require("scale-ts"),Be=(0,c.Option)(c.str),ee=(0,c.Vector)(c.str),xt=(0,c.Enum)({bool:c._void,char:c._void,str:c._void,u8:c._void,u16:c._void,u32:c._void,u64:c._void,u128:c._void,u256:c._void,i8:c._void,i16:c._void,i32:c._void,i64:c._void,i128:c._void,i256:c._void}),Ve=(0,c.Vector)((0,c.Struct)({name:Be,type:a,typeName:Be,docs:ee})),ft=(0,c.Struct)({len:c.u32,type:a}),Tt=(0,c.Struct)({bitStoreType:a,bitOrderType:a}),gt=(0,c.Vector)((0,c.Struct)({name:c.str,fields:Ve,index:c.u8,docs:ee})),bt=(0,c.Enum)({composite:Ve,variant:gt,sequence:a,array:ft,tuple:(0,c.Vector)(a),primitive:xt,compact:a,bitSequence:Tt,historicMetaCompat:c.str}),ht=(0,c.Struct)({name:c.str,type:(0,c.Option)(a)}),Et=(0,c.Vector)(ht),vt=(0,c.Struct)({id:a,path:ee,params:Et,def:bt,docs:ee}),De=(0,c.Vector)(vt);var i=require("scale-ts"),At=(0,i.Enum)({Blake2128:i._void,Blake2256:i._void,Blake2128Concat:i._void,Twox128:i._void,Twox256:i._void,Twox64Concat:i._void,Identity:i._void}),kt=(0,i.Vector)(At),wt=(0,i.Struct)({hashers:kt,key:a,value:a}),St=(0,i.Struct)({name:i.str,modifier:i.u8,type:(0,i.Enum)({plain:a,map:wt}),fallback:S(),docs:(0,i.Vector)(i.str)}),Ct=(0,i.Option)((0,i.Struct)({prefix:i.str,items:(0,i.Vector)(St)})),Oe=(0,i.Vector)((0,i.Struct)({name:i.str,storage:Ct,calls:(0,i.Option)(a),events:(0,i.Option)(a),constants:(0,i.Vector)((0,i.Struct)({name:i.str,type:a,value:S(),docs:(0,i.Vector)(i.str)})),errors:(0,i.Option)(a),index:i.u8,docs:(0,i.Vector)(i.str)}));var He=(0,u.Vector)(u.str),Ut=(0,u.Struct)({name:u.str,methods:(0,u.Vector)((0,u.Struct)({name:u.str,inputs:(0,u.Vector)((0,u.Struct)({name:u.str,type:a})),output:a,docs:He})),docs:He}),Kt=(0,u.Struct)({version:u.u8,address:a,call:a,signature:a,extra:a,signedExtensions:(0,u.Vector)((0,u.Struct)({identifier:u.str,type:a,additionalSigned:a}))}),me=(0,u.Struct)({lookup:De,pallets:Oe,extrinsic:Kt,type:a,apis:(0,u.Vector)(Ut),outerEnums:(0,u.Struct)({call:a,event:a,error:a}),custom:(0,u.Vector)((0,u.Tuple)(u.str,(0,u.Struct)({type:a,value:S()})))});var K=require("scale-ts");var Re=()=>{throw new Error("Unsupported metadata version!")},g=(0,K.createCodec)(Re,Re),Bt=(0,K.Struct)({magicNumber:K.u32,metadata:(0,K.Enum)({v0:g,v1:g,v2:g,v3:g,v4:g,v5:g,v6:g,v7:g,v8:g,v9:g,v10:g,v11:g,v12:g,v13:g,v14:g,v15:me})});var Le=require("@polkadot-api/utils"),ue=require("@noble/hashes/blake2b"),Vt={dkLen:32},Dt=e=>(0,ue.blake2b)(e,Vt),Ot={dkLen:16},_e=e=>(0,ue.blake2b)(e,Ot),pe=e=>(0,Le.mergeUint8)(_e(e),e);var le=e=>e;var Me=require("@polkadot-api/utils"),Pe=require("scale-ts");var V=(e,t,n,d)=>new DataView(new Uint16Array([e,t,n,d]).buffer).getBigUint64(0,!0),xe=2n**64n-1n,T=(e,t)=>e<<t&xe|e>>64n-t,y=(e,t)=>e*t&xe,x=(e,t)=>e+t&xe,f=11400714785074694791n,A=14029467366897019727n,Ie=1609587929392839161n,q=9650029242287828579n,Ne=2870177450012600261n;function C(e,t=0n){let n=x(x(t,f),A),d=x(t,A),m=t,b=t-f,v=e.length,h=0,D=null;(function(){let o=0,k=o+v;if(v){if(D=new Uint8Array(32),v<32){D.set(e.subarray(0,v),h),h+=v;return}if(o<=k-32){let _=k-32;do{let w;w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),n=y(T(x(n,y(w,A)),31n),f),o+=8,w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),d=y(T(x(d,y(w,A)),31n),f),o+=8,w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),m=y(T(x(m,y(w,A)),31n),f),o+=8,w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),b=y(T(x(b,y(w,A)),31n),f),o+=8}while(o<=_)}o<k&&(D.set(e.subarray(o,k),h),h=k-o)}})(),e=D||e;let s,p=0;for(v>=32?(s=T(n,1n),s=x(s,T(d,7n)),s=x(s,T(m,12n)),s=x(s,T(b,18n)),n=y(T(y(n,A),31n),f),s=s^n,s=x(y(s,f),q),d=y(T(y(d,A),31n),f),s=s^d,s=x(y(s,f),q),m=y(T(y(m,A),31n),f),s=s^m,s=x(y(s,f),q),b=y(T(y(b,A),31n),f),s=s^b,s=x(y(s,f),q)):s=x(t,Ne),s=x(s,BigInt(v));p<=h-8;){let E=V(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]);E=y(T(y(E,A),31n),f),s=x(y(T(s^E,27n),f),q),p+=8}if(p+4<=h){let E=y(V(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],0,0),f);s=x(y(T(s^E,23n),A),Ie),p+=4}for(;p<h;){let E=y(V(e[p++],0,0,0),Ne);s=y(T(s^E,11n),f)}let l=s>>33n;return s=y(s^l,A),l=s>>29n,s=y(s^l,Ie),l=s>>32n,s^=l,s}var te=e=>{let t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigUint64(0,C(e),!0),n.setBigUint64(8,C(e,1n),!0),t},Ht=e=>{let t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigUint64(0,C(e),!0),n.setBigUint64(8,C(e,1n),!0),n.setBigUint64(16,C(e,2n),!0),n.setBigUint64(24,C(e,3n),!0),t},fe=e=>(0,Me.mergeUint8)(Pe.u64.enc(C(e)),e);var L=require("@polkadot-api/utils");var ze=new TextEncoder,Rt=e=>{let t=te(ze.encode(e));return(n,d,...m)=>{let b=(0,L.mergeUint8)(t,te(ze.encode(n))),v=(0,L.toHex)(b),h=m.map(l=>l[1]).map(l=>l===le?0:l===fe?8:l===pe?16:null).filter(Boolean),D=l=>{if(!l.startsWith(v))throw new Error(`key does not match this storage (${e}.${n})`);if(h.length!==m.length)throw new Error("Impossible to decode this key");if(m.length===0)return[];let E=l.slice(v.length),o=new Array(m.length);for(let k=0,_=0;k<h.length;k++){let w=m[k][0];_+=h[k],o[k]=w.dec(E.slice(_*2)),_+=w.enc(o[k]).length}return o},s=m.map(([{enc:l},E])=>o=>E(l(o)));return{enc:(...l)=>(0,L.toHex)((0,L.mergeUint8)(b,...l.map((E,o)=>s[o](E)))),dec:d,keyDecoder:D}}}; | ||
"use strict";var W=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var $e=Object.prototype.hasOwnProperty;var Ge=(e,t,n)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t)=>{for(var n in t)W(e,n,{get:t[n],enumerable:!0})},Xe=(e,t,n,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of We(t))!$e.call(e,m)&&m!==n&&W(e,m,{get:()=>t[m],enumerable:!(d=qe(t,m))||d.enumerable});return e};var Je=e=>Xe(W({},"__esModule",{value:!0}),e);var $=(e,t,n)=>(Ge(e,typeof t!="symbol"?t+"":t,n),n),Te=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var C=(e,t,n)=>(Te(e,t,"read from private field"),n?n.call(e):t.get(e)),G=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},j=(e,t,n,d)=>(Te(e,t,"write to private field"),d?d.call(e,n):t.set(e,n),n);var Lt={};je(Lt,{AccountId:()=>Ze,Bin:()=>ce,Binary:()=>J,Blake2128:()=>_e,Blake2128Concat:()=>pe,Blake2256:()=>Dt,Bytes:()=>r.Bytes,Enum:()=>ae,Hex:()=>S,Identity:()=>le,Option:()=>r.Option,Result:()=>r.Result,Self:()=>yt,Storage:()=>Rt,Struct:()=>r.Struct,Tuple:()=>r.Tuple,Twox128:()=>te,Twox256:()=>Ht,Twox64Concat:()=>fe,Variant:()=>z,Vector:()=>r.Vector,_Enum:()=>mt,_void:()=>r._void,bitSequence:()=>ct,blockHeader:()=>lt,bool:()=>r.bool,char:()=>st,compact:()=>r.compact,compactBn:()=>nt,compactNumber:()=>a,createCodec:()=>r.createCodec,createDecoder:()=>r.createDecoder,enhanceCodec:()=>r.enhanceCodec,enhanceDecoder:()=>r.enhanceDecoder,enhanceEncoder:()=>r.enhanceEncoder,fixedStr:()=>dt,h64:()=>K,i128:()=>r.i128,i16:()=>r.i16,i256:()=>r.i256,i32:()=>r.i32,i64:()=>r.i64,i8:()=>r.i8,metadata:()=>Bt,selfDecoder:()=>we,selfEncoder:()=>ke,str:()=>r.str,u128:()=>r.u128,u16:()=>r.u16,u256:()=>r.u256,u32:()=>r.u32,u64:()=>r.u64,u8:()=>r.u8,v15:()=>me});module.exports=Je(Lt);var X=require("scale-ts"),re=require("@noble/hashes/blake2b"),oe=require("@scure/base"),ge=new TextEncoder().encode("SS58PRE"),ne=2,Qe=e=>{let t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{let d=(0,re.blake2b)(Uint8Array.of(...ge,...t,...n),{dkLen:64}).subarray(0,ne);return oe.base58.encode(Uint8Array.of(...t,...n,...d))}};function Ye(e,t){return n=>{let d=oe.base58.decode(n),m=d.subarray(0,d[0]&64?2:1),b=d.subarray(m.length,d.length-ne);if(b.length!==e)throw new Error("Invalid public key length");let v=d.subarray(m.length+b.length),h=(0,re.blake2b)(Uint8Array.of(...ge,...m,...b),{dkLen:64}).subarray(0,ne);if(v[0]!==h[0]||v[1]!==h[1])throw new Error("Invalid checksum");if(Fe(m)!=t)throw new Error("Invalid SS58 prefix");return b.slice()}}var Ze=(e=42,t=32)=>(0,X.enhanceCodec)((0,X.Bytes)(t),Ye(t,e),Qe(e)),Fe=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)};var N=require("scale-ts"),Q=require("@polkadot-api/utils");var et=new TextEncoder,tt=new TextDecoder,B,O,H,I=class I{constructor(t){G(this,B,void 0);G(this,O,null);G(this,H,null);$(this,"asText",()=>C(this,H)===null?j(this,H,tt.decode(C(this,B))):C(this,H));$(this,"asHex",()=>C(this,O)===null?j(this,O,(0,Q.toHex)(C(this,B))):C(this,O));$(this,"asBytes",()=>C(this,B));j(this,B,t)}static fromText(t){return new I(et.encode(t))}static fromHex(t){return new I((0,Q.fromHex)(t))}static fromBytes(t){return new I(t)}};B=new WeakMap,O=new WeakMap,H=new WeakMap;var J=I,be=e=>{let t=N.Bytes.enc(e);return n=>t(n.asBytes())},he=e=>{let t=N.Bytes.dec(e);return n=>J.fromBytes(t(n))},ce=e=>(0,N.createCodec)(be(e),he(e));ce.enc=be;ce.dec=he;var R=require("scale-ts");var se=require("scale-ts"),a=se.compact,nt=se.compact;var rt=(0,R.createDecoder)(e=>{let t=a.dec(e),n=Math.ceil(t/8);return{bytes:(0,R.Bytes)(n).dec(e),bitsLen:t}}),ot=e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);let t=a.enc(e.bitsLen),n=new Uint8Array(e.bytes.length+t.length);return n.set(t,0),n.set(e.bytes,t.length),n},ct=(0,R.createCodec)(ot,rt);var Y=require("scale-ts"),st=(0,Y.enhanceCodec)(Y.u8,e=>e.charCodeAt(0),String.fromCharCode);var Z=require("@polkadot-api/utils"),M=require("scale-ts"),Ee=e=>{let t=M.Bytes.enc(e);return n=>t((0,Z.fromHex)(n))},ve=e=>{let t=M.Bytes.dec(e);return n=>(0,Z.toHex)(t(n))},S=e=>(0,M.createCodec)(Ee(e),ve(e));S.enc=Ee;S.dec=ve;var F=require("scale-ts"),it=new TextEncoder,at=new TextDecoder,dt=e=>(0,F.enhanceCodec)((0,F.Bytes)(e),t=>it.encode(t),t=>at.decode(t));var r=require("scale-ts");var Ae=require("scale-ts"),ke=e=>{let t=n=>{let d=e();return t=d,d(n)};return n=>t(n)},we=e=>{let t=n=>{let d=e(),m=d;return t=d,m(n)};return n=>t(n)},yt=e=>(0,Ae.createCodec)(ke(()=>e().enc),we(()=>e().dec));var P=require("scale-ts"),ie=require("@polkadot-api/utils"),mt=new Proxy({},{get(e,t){return n=>ae(t,n)}}),ae=(e,t)=>({as:n=>{if(n!==e)throw new Error(`Enum.as(${n}) used with actual type ${e}`);return t},is:n=>n===e,type:e,value:t}),Se=(...e)=>{let t=P.Enum.enc(...e);return n=>t({tag:n.type,value:n.value})},Ke=(...e)=>{let t=P.Enum.dec(...e);return n=>{let{tag:d,value:m}=t(n);return ae(d,m)}},z=(e,...t)=>(0,P.createCodec)(Se((0,ie.mapObject)(e,([n])=>n),...t),Ke((0,ie.mapObject)(e,([,n])=>n),...t));z.enc=Se;z.dec=Ke;var Ce=new TextEncoder,Ue=new TextDecoder,ut=(0,r.enhanceCodec)((0,r.Bytes)(4),Ce.encode.bind(Ce),Ue.decode.bind(Ue)),de=(0,r.Struct)({engine:ut,payload:S()}),pt=z({consensus:de,seal:de,preRuntime:de,runtimeUpdated:r._void},[4,5,6,8]),ye=S(32),lt=(0,r.Struct)({parentHash:ye,number:a,stateRoot:ye,extrinsicRoot:ye,digests:(0,r.Vector)(pt)});var u=require("scale-ts");var c=require("scale-ts"),Be=(0,c.Option)(c.str),ee=(0,c.Vector)(c.str),xt=(0,c.Enum)({bool:c._void,char:c._void,str:c._void,u8:c._void,u16:c._void,u32:c._void,u64:c._void,u128:c._void,u256:c._void,i8:c._void,i16:c._void,i32:c._void,i64:c._void,i128:c._void,i256:c._void}),Ve=(0,c.Vector)((0,c.Struct)({name:Be,type:a,typeName:Be,docs:ee})),ft=(0,c.Struct)({len:c.u32,type:a}),Tt=(0,c.Struct)({bitStoreType:a,bitOrderType:a}),gt=(0,c.Vector)((0,c.Struct)({name:c.str,fields:Ve,index:c.u8,docs:ee})),bt=(0,c.Enum)({composite:Ve,variant:gt,sequence:a,array:ft,tuple:(0,c.Vector)(a),primitive:xt,compact:a,bitSequence:Tt,historicMetaCompat:c.str}),ht=(0,c.Struct)({name:c.str,type:(0,c.Option)(a)}),Et=(0,c.Vector)(ht),vt=(0,c.Struct)({id:a,path:ee,params:Et,def:bt,docs:ee}),De=(0,c.Vector)(vt);var i=require("scale-ts"),At=(0,i.Enum)({Blake2128:i._void,Blake2256:i._void,Blake2128Concat:i._void,Twox128:i._void,Twox256:i._void,Twox64Concat:i._void,Identity:i._void}),kt=(0,i.Vector)(At),wt=(0,i.Struct)({hashers:kt,key:a,value:a}),St=(0,i.Struct)({name:i.str,modifier:i.u8,type:(0,i.Enum)({plain:a,map:wt}),fallback:S(),docs:(0,i.Vector)(i.str)}),Kt=(0,i.Option)((0,i.Struct)({prefix:i.str,items:(0,i.Vector)(St)})),Oe=(0,i.Vector)((0,i.Struct)({name:i.str,storage:Kt,calls:(0,i.Option)(a),events:(0,i.Option)(a),constants:(0,i.Vector)((0,i.Struct)({name:i.str,type:a,value:S(),docs:(0,i.Vector)(i.str)})),errors:(0,i.Option)(a),index:i.u8,docs:(0,i.Vector)(i.str)}));var He=(0,u.Vector)(u.str),Ct=(0,u.Struct)({name:u.str,methods:(0,u.Vector)((0,u.Struct)({name:u.str,inputs:(0,u.Vector)((0,u.Struct)({name:u.str,type:a})),output:a,docs:He})),docs:He}),Ut=(0,u.Struct)({version:u.u8,address:a,call:a,signature:a,extra:a,signedExtensions:(0,u.Vector)((0,u.Struct)({identifier:u.str,type:a,additionalSigned:a}))}),me=(0,u.Struct)({lookup:De,pallets:Oe,extrinsic:Ut,type:a,apis:(0,u.Vector)(Ct),outerEnums:(0,u.Struct)({call:a,event:a,error:a}),custom:(0,u.Vector)((0,u.Tuple)(u.str,(0,u.Struct)({type:a,value:S()})))});var U=require("scale-ts");var Re=()=>{throw new Error("Unsupported metadata version!")},g=(0,U.createCodec)(Re,Re),Bt=(0,U.Struct)({magicNumber:U.u32,metadata:(0,U.Enum)({v0:g,v1:g,v2:g,v3:g,v4:g,v5:g,v6:g,v7:g,v8:g,v9:g,v10:g,v11:g,v12:g,v13:g,v14:g,v15:me})});var Le=require("@polkadot-api/utils"),ue=require("@noble/hashes/blake2b"),Vt={dkLen:32},Dt=e=>(0,ue.blake2b)(e,Vt),Ot={dkLen:16},_e=e=>(0,ue.blake2b)(e,Ot),pe=e=>(0,Le.mergeUint8)(_e(e),e);var le=e=>e;var Me=require("@polkadot-api/utils"),Pe=require("scale-ts");var V=(e,t,n,d)=>new DataView(new Uint16Array([e,t,n,d]).buffer).getBigUint64(0,!0),xe=2n**64n-1n,T=(e,t)=>e<<t&xe|e>>64n-t,y=(e,t)=>e*t&xe,x=(e,t)=>e+t&xe,f=11400714785074694791n,A=14029467366897019727n,Ie=1609587929392839161n,q=9650029242287828579n,Ne=2870177450012600261n;function K(e,t=0n){let n=x(x(t,f),A),d=x(t,A),m=t,b=t-f,v=e.length,h=0,D=null;(function(){let o=0,k=o+v;if(v){if(D=new Uint8Array(32),v<32){D.set(e.subarray(0,v),h),h+=v;return}if(o<=k-32){let _=k-32;do{let w;w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),n=y(T(x(n,y(w,A)),31n),f),o+=8,w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),d=y(T(x(d,y(w,A)),31n),f),o+=8,w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),m=y(T(x(m,y(w,A)),31n),f),o+=8,w=V(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),b=y(T(x(b,y(w,A)),31n),f),o+=8}while(o<=_)}o<k&&(D.set(e.subarray(o,k),h),h=k-o)}})(),e=D||e;let s,p=0;for(v>=32?(s=T(n,1n),s=x(s,T(d,7n)),s=x(s,T(m,12n)),s=x(s,T(b,18n)),n=y(T(y(n,A),31n),f),s=s^n,s=x(y(s,f),q),d=y(T(y(d,A),31n),f),s=s^d,s=x(y(s,f),q),m=y(T(y(m,A),31n),f),s=s^m,s=x(y(s,f),q),b=y(T(y(b,A),31n),f),s=s^b,s=x(y(s,f),q)):s=x(t,Ne),s=x(s,BigInt(v));p<=h-8;){let E=V(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]);E=y(T(y(E,A),31n),f),s=x(y(T(s^E,27n),f),q),p+=8}if(p+4<=h){let E=y(V(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],0,0),f);s=x(y(T(s^E,23n),A),Ie),p+=4}for(;p<h;){let E=y(V(e[p++],0,0,0),Ne);s=y(T(s^E,11n),f)}let l=s>>33n;return s=y(s^l,A),l=s>>29n,s=y(s^l,Ie),l=s>>32n,s^=l,s}var te=e=>{let t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigUint64(0,K(e),!0),n.setBigUint64(8,K(e,1n),!0),t},Ht=e=>{let t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigUint64(0,K(e),!0),n.setBigUint64(8,K(e,1n),!0),n.setBigUint64(16,K(e,2n),!0),n.setBigUint64(24,K(e,3n),!0),t},fe=e=>(0,Me.mergeUint8)(Pe.u64.enc(K(e)),e);var L=require("@polkadot-api/utils");var ze=new TextEncoder,Rt=e=>{let t=te(ze.encode(e));return(n,d,...m)=>{let b=(0,L.mergeUint8)(t,te(ze.encode(n))),v=(0,L.toHex)(b),h=m.map(l=>l[1]).map(l=>l===le?0:l===fe?8:l===pe?16:null).filter(Boolean),D=l=>{if(!l.startsWith(v))throw new Error(`key does not match this storage (${e}.${n})`);if(h.length!==m.length)throw new Error("Impossible to decode this key");if(m.length===0)return[];let E=l.slice(v.length),o=new Array(m.length);for(let k=0,_=0;k<h.length;k++){let w=m[k][0];_+=h[k],o[k]=w.dec(E.slice(_*2)),_+=w.enc(o[k]).length}return o},s=m.map(([{enc:l},E])=>o=>E(l(o)));return{enc:(...l)=>(0,L.toHex)((0,L.mergeUint8)(b,...l.map((E,o)=>s[o](E)))),dec:d,keyDecoder:D}}}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@polkadot-api/substrate-bindings", | ||
"version": "0.0.1-81d5a1339ac709636f6bd916981aea58a4c031f9.1.0", | ||
"version": "0.0.1-8207d417c57431583f97269921a425bc169b85c3.1.0", | ||
"author": "Josep M Sobrepere (https://github.com/josepot)", | ||
@@ -46,3 +46,3 @@ "repository": { | ||
"scale-ts": "^1.6.0", | ||
"@polkadot-api/utils": "0.0.1-81d5a1339ac709636f6bd916981aea58a4c031f9.1.0" | ||
"@polkadot-api/utils": "0.0.1-8207d417c57431583f97269921a425bc169b85c3.1.0" | ||
}, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267840
3146