@polkadot-api/substrate-bindings
Advanced tools
Comparing version 0.0.1-8bd149cc88adc8f432e18d66898591418bb29fa0.1.0 to 0.0.1-929b980de37b4215e40f967dc0b03498d4d28563.1.0
@@ -698,3 +698,7 @@ import * as scale_ts from 'scale-ts'; | ||
}>; | ||
type StorageType<T extends StorageDescriptor<any, ArgsWithPayloadCodec<any, any>>> = T extends StorageDescriptor<any, ArgsWithPayloadCodec<infer Args, infer Payload>> ? { | ||
keyArgs: Args; | ||
value: Payload; | ||
} : unknown; | ||
export { AccountId, ArgsWithPayloadCodec, ArgsWithoutPayloadCodec, BitSequence, Blake2128, Blake2128Concat, Blake2256, ConstantDescriptor, Descriptor, DescriptorCommon, EncoderWithHash, ErrorDescriptor, EventDescriptor, EventToObject, Hex, HexString, Identity, OpaqueCodec, OpaqueValue, SS58String, Self, Storage, StorageDescriptor, Twox128, Twox256, Twox64Concat, TxDescriptor, TxDescriptorArgs, TxDescriptorErrors, TxDescriptorEvents, TxFunction, UnionizeTupleEvents, V14, V14Extrinsic, V14Lookup, V14Pallets, bitSequence, char, compactBn, compactNumber, createCommonDescriptor, fixedStr, getDescriptorCreator, getPalletCreator, h64, metadata, selfDecoder, selfEncoder, v14 }; | ||
export { AccountId, ArgsWithPayloadCodec, ArgsWithoutPayloadCodec, BitSequence, Blake2128, Blake2128Concat, Blake2256, ConstantDescriptor, Descriptor, DescriptorCommon, EncoderWithHash, ErrorDescriptor, EventDescriptor, EventToObject, Hex, HexString, Identity, OpaqueCodec, OpaqueValue, SS58String, Self, Storage, StorageDescriptor, StorageType, Twox128, Twox256, Twox64Concat, TxDescriptor, TxDescriptorArgs, TxDescriptorErrors, TxDescriptorEvents, TxFunction, UnionizeTupleEvents, V14, V14Extrinsic, V14Lookup, V14Pallets, bitSequence, char, compactBn, compactNumber, createCommonDescriptor, fixedStr, getDescriptorCreator, getPalletCreator, h64, metadata, selfDecoder, selfEncoder, v14 }; |
@@ -698,3 +698,7 @@ import * as scale_ts from 'scale-ts'; | ||
}>; | ||
type StorageType<T extends StorageDescriptor<any, ArgsWithPayloadCodec<any, any>>> = T extends StorageDescriptor<any, ArgsWithPayloadCodec<infer Args, infer Payload>> ? { | ||
keyArgs: Args; | ||
value: Payload; | ||
} : unknown; | ||
export { AccountId, ArgsWithPayloadCodec, ArgsWithoutPayloadCodec, BitSequence, Blake2128, Blake2128Concat, Blake2256, ConstantDescriptor, Descriptor, DescriptorCommon, EncoderWithHash, ErrorDescriptor, EventDescriptor, EventToObject, Hex, HexString, Identity, OpaqueCodec, OpaqueValue, SS58String, Self, Storage, StorageDescriptor, Twox128, Twox256, Twox64Concat, TxDescriptor, TxDescriptorArgs, TxDescriptorErrors, TxDescriptorEvents, TxFunction, UnionizeTupleEvents, V14, V14Extrinsic, V14Lookup, V14Pallets, bitSequence, char, compactBn, compactNumber, createCommonDescriptor, fixedStr, getDescriptorCreator, getPalletCreator, h64, metadata, selfDecoder, selfEncoder, v14 }; | ||
export { AccountId, ArgsWithPayloadCodec, ArgsWithoutPayloadCodec, BitSequence, Blake2128, Blake2128Concat, Blake2256, ConstantDescriptor, Descriptor, DescriptorCommon, EncoderWithHash, ErrorDescriptor, EventDescriptor, EventToObject, Hex, HexString, Identity, OpaqueCodec, OpaqueValue, SS58String, Self, Storage, StorageDescriptor, StorageType, Twox128, Twox256, Twox64Concat, TxDescriptor, TxDescriptorArgs, TxDescriptorErrors, TxDescriptorEvents, TxFunction, UnionizeTupleEvents, V14, V14Extrinsic, V14Lookup, V14Pallets, bitSequence, char, compactBn, compactNumber, createCommonDescriptor, fixedStr, getDescriptorCreator, getPalletCreator, h64, metadata, selfDecoder, selfEncoder, v14 }; |
@@ -1,2 +0,2 @@ | ||
"use strict";var J=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var ae=(e,r)=>{for(var t in r)J(e,t,{get:r[t],enumerable:!0})},X=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ne(r))!Ve.call(e,a)&&a!==t&&J(e,a,{get:()=>r[a],enumerable:!(i=Be(r,a))||i.enumerable});return e},m=(e,r,t)=>(X(e,r,"default"),t&&X(t,r,"default"));var _e=e=>X(J({},"__esModule",{value:!0}),e);var T={};ae(T,{AccountId:()=>pe,Blake2128:()=>we,Blake2128Concat:()=>oe,Blake2256:()=>or,Hex:()=>_,Identity:()=>ne,OpaqueCodec:()=>W,Self:()=>me,Storage:()=>cr,Twox128:()=>G,Twox256:()=>sr,Twox64Concat:()=>ce,bitSequence:()=>be,char:()=>he,compactBn:()=>de,compactNumber:()=>p,createCommonDescriptor:()=>ar,fixedStr:()=>ve,getDescriptorCreator:()=>ir,getPalletCreator:()=>pr,h64:()=>k,metadata:()=>Te,selfDecoder:()=>re,selfEncoder:()=>ee,v14:()=>$});module.exports=_e(T);m(T,require("scale-ts"),module.exports);var l={};ae(l,{AccountId:()=>pe,Hex:()=>_,OpaqueCodec:()=>W,Self:()=>me,bitSequence:()=>be,char:()=>he,compactBn:()=>de,compactNumber:()=>p,fixedStr:()=>ve,metadata:()=>Te,selfDecoder:()=>re,selfEncoder:()=>ee,v14:()=>$});m(l,require("scale-ts"));var O=require("scale-ts"),Y=require("@noble/hashes/blake2b"),Z=require("@scure/base"),ie=new TextEncoder().encode("SS58PRE"),Q=2,He=e=>{let r=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return t=>{let i=(0,Y.blake2b)(Uint8Array.of(...ie,...r,...t),{dkLen:64}).subarray(0,Q);return Z.base58.encode(Uint8Array.of(...r,...t,...i))}};function Ie(e,r){return t=>{let i=Z.base58.decode(t),a=i.subarray(0,i[0]&64?2:1),y=i.subarray(a.length,i.length-Q);if(y.length!==e)throw new Error("Invalid public key length");let x=i.subarray(a.length+y.length),g=(0,Y.blake2b)(Uint8Array.of(...ie,...a,...y),{dkLen:64}).subarray(0,Q);if(x[0]!==g[0]||x[1]!==g[1])throw new Error("Invalid checksum");if(Le(a)!=r)throw new Error("Invalid SS58 prefix");return y.slice()}}var pe=(e=42,r=32)=>(0,O.enhanceCodec)((0,O.Bytes)(r),Ie(r,e),He(e)),Le=e=>{let r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.byteLength===1?r.getUint8(0):r.getUint16(0)};var F=require("scale-ts"),p=F.compact,de=F.compact;var L=require("scale-ts"),ee=e=>{let r=t=>{let i=L.Struct.enc({self:e()});return r=i,i(t)};return t=>r(t)},re=e=>{let r=t=>{let i=L.Struct.dec({self:e()}),a=i;return r=i,a(t)};return t=>r(t)},me=e=>(0,L.createCodec)(ee(()=>e().enc),re(()=>e().dec));var V=require("scale-ts");var ye=(e,r=p.dec)=>(0,V.createDecoder)(t=>{let i=r(t),a=(0,V.Bytes)(i).dec(t),y;return{length:i,inner:()=>y=y||e(a)}}),le=(e,r=p.enc)=>t=>{let i=r(t.length),a=new Uint8Array(i.length+t.length);return a.set(i,0),a.set(e(t.inner()),i.length),a},W=(e,r=p)=>(0,V.createCodec)(le(e.enc,r.enc),ye(e.dec,r.dec));W.enc=le;W.dec=ye;var S=require("scale-ts");var n=require("scale-ts"),xe=(0,n.Option)(n.str),M=(0,n.Vector)(n.str),qe=(0,n.Enum)({bool:n._void,char:n._void,str:n._void,u8:n._void,u16:n._void,u32:n._void,u64:n._void,u128:n._void,u256:n._void,i8:n._void,i16:n._void,i32:n._void,i64:n._void,i128:n._void,i256:n._void}),fe=(0,n.Vector)((0,n.Struct)({name:xe,type:p,typeName:xe,docs:M})),Ke=(0,n.Struct)({len:n.u32,type:p}),Oe=(0,n.Struct)({bitStoreType:p,bitOrderType:p}),We=(0,n.Vector)((0,n.Struct)({name:n.str,fields:fe,index:n.u8,docs:M})),Me=(0,n.Enum)({composite:fe,variant:We,sequence:p,array:Ke,tuple:(0,n.Vector)(p),primitive:qe,compact:p,bitSequence:Oe,historicMetaCompat:n.str}),Re=(0,n.Struct)({name:n.str,type:(0,n.Option)(p)}),$e=(0,n.Vector)(Re),ze=(0,n.Struct)({id:p,path:M,params:$e,def:Me,docs:M}),ge=(0,n.Vector)(ze);var R=require("@polkadot-api/utils"),q=require("scale-ts"),ue=e=>{let r=q.Bytes.enc(e);return t=>r((0,R.fromHex)(t))},Ce=e=>{let r=q.Bytes.dec(e);return t=>(0,R.toHex)(r(t))},_=e=>(0,q.createCodec)(ue(e),Ce(e));_.enc=ue;_.dec=Ce;var c=require("scale-ts"),je=(0,c.Enum)({Blake2128:c._void,Blake2256:c._void,Blake2128Concat:c._void,Twox128:c._void,Twox256:c._void,Twox64Concat:c._void,Identity:c._void}),Ge=(0,c.Vector)(je),Xe=(0,c.Struct)({hashers:Ge,key:p,value:p}),Je=(0,c.Struct)({name:c.str,modifier:c.u8,type:(0,c.Enum)({plain:p,map:Xe}),fallback:(0,c.Vector)(c.u8),docs:(0,c.Vector)(c.str)}),Qe=(0,c.Option)((0,c.Struct)({prefix:c.str,items:(0,c.Vector)(Je)})),De=(0,c.Vector)((0,c.Struct)({name:c.str,storage:Qe,calls:(0,c.Option)(p),events:(0,c.Option)(p),constants:(0,c.Vector)((0,c.Struct)({name:c.str,type:p,value:_(),docs:(0,c.Vector)(c.str)})),errors:(0,c.Option)(p),index:c.u8}));var Ye=(0,S.Struct)({type:p,version:S.u8,signedExtensions:(0,S.Vector)((0,S.Struct)({identifier:S.str,type:p,additionalSigned:p}))}),$=(0,S.Struct)({lookup:ge,pallets:De,extrinsic:Ye,type:p});var B=require("scale-ts");var Ee=()=>{throw new Error("Unsupported metadata version!")},h=(0,B.createCodec)(Ee,Ee),Te=(0,B.Struct)({magicNumber:B.u32,metadata:(0,B.Enum)({v0:h,v1:h,v2:h,v3:h,v4:h,v5:h,v6:h,v7:h,v8:h,v9:h,v10:h,v11:h,v12:h,v13:h,v14:$})});var H=require("scale-ts");var Ze=(0,H.createDecoder)(e=>{let r=p.dec(e),t=Math.ceil(r/8);return{bytes:(0,H.Bytes)(t).dec(e),bitsLen:r}}),Fe=e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);let r=p.enc(e.bitsLen),t=new Uint8Array(e.bytes.length+r.length);return t.set(r,0),t.set(e.bytes,r.length),t},be=(0,H.createCodec)(Fe,Ze);var z=require("scale-ts"),he=(0,z.enhanceCodec)(z.u8,e=>e.charCodeAt(0),String.fromCharCode);var j=require("scale-ts"),er=new TextEncoder,rr=new TextDecoder,ve=e=>(0,j.enhanceCodec)((0,j.Bytes)(e),r=>er.encode(r),r=>rr.decode(r));m(T,l,module.exports);var Ae=require("@polkadot-api/utils"),te=require("@noble/hashes/blake2b"),tr={dkLen:32},or=e=>(0,te.blake2b)(e,tr),nr={dkLen:16},we=e=>(0,te.blake2b)(e,nr),oe=e=>(0,Ae.mergeUint8)(we(e),e);var ne=e=>e;var Ue=require("@polkadot-api/utils"),Pe=require("scale-ts");var N=(e,r,t,i)=>new DataView(new Uint16Array([e,r,t,i]).buffer).getBigUint64(0,!0),se=2n**64n-1n,E=(e,r)=>e<<r&se|e>>64n-r,d=(e,r)=>e*r&se,C=(e,r)=>e+r&se,D=11400714785074694791n,v=14029467366897019727n,Se=1609587929392839161n,K=9650029242287828579n,ke=2870177450012600261n;function k(e,r=0n){let t=C(C(r,D),v),i=C(r,v),a=r,y=r-D,x=e.length,g=0,P=null;(function(){let o=0,A=o+x;if(x){if(P=new Uint8Array(32),x<32){P.set(e.subarray(0,x),g),g+=x;return}if(o<=A-32){let I=A-32;do{let w;w=N(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]),t=d(E(C(t,d(w,v)),31n),D),o+=8,w=N(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]),i=d(E(C(i,d(w,v)),31n),D),o+=8,w=N(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]),a=d(E(C(a,d(w,v)),31n),D),o+=8,w=N(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]),y=d(E(C(y,d(w,v)),31n),D),o+=8}while(o<=I)}o<A&&(P.set(e.subarray(o,A),g),g=A-o)}})(),e=P||e;let s,f=0;for(x>=32?(s=E(t,1n),s=C(s,E(i,7n)),s=C(s,E(a,12n)),s=C(s,E(y,18n)),t=d(E(d(t,v),31n),D),s=s^t,s=C(d(s,D),K),i=d(E(d(i,v),31n),D),s=s^i,s=C(d(s,D),K),a=d(E(d(a,v),31n),D),s=s^a,s=C(d(s,D),K),y=d(E(d(y,v),31n),D),s=s^y,s=C(d(s,D),K)):s=C(r,ke),s=C(s,BigInt(x));f<=g-8;){let b=N(e[f+1]<<8|e[f],e[f+3]<<8|e[f+2],e[f+5]<<8|e[f+4],e[f+7]<<8|e[f+6]);b=d(E(d(b,v),31n),D),s=C(d(E(s^b,27n),D),K),f+=8}if(f+4<=g){let b=d(N(e[f+1]<<8|e[f],e[f+3]<<8|e[f+2],0,0),D);s=C(d(E(s^b,23n),v),Se),f+=4}for(;f<g;){let b=d(N(e[f++],0,0,0),ke);s=d(E(s^b,11n),D)}let u=s>>33n;return s=d(s^u,v),u=s>>29n,s=d(s^u,Se),u=s>>32n,s^=u,s}var G=e=>{let r=new Uint8Array(16),t=new DataView(r.buffer);return t.setBigUint64(0,k(e),!0),t.setBigUint64(8,k(e,1n),!0),r},sr=e=>{let r=new Uint8Array(32),t=new DataView(r.buffer);return t.setBigUint64(0,k(e),!0),t.setBigUint64(8,k(e,1n),!0),t.setBigUint64(16,k(e,2n),!0),t.setBigUint64(24,k(e,3n),!0),r},ce=e=>(0,Ue.mergeUint8)(Pe.u64.enc(k(e)),e);var U=require("@polkadot-api/utils");var cr=e=>{let r=G((0,U.utf16StrToUtf8Bytes)(e));return(t,i,...a)=>{let y=(0,U.mergeUint8)(r,G((0,U.utf16StrToUtf8Bytes)(t))),x=(0,U.toHex)(y),g=a.map(u=>u[1]).map(u=>u===ne?0:u===ce?8:u===oe?16:null).filter(Boolean),P=u=>{if(!u.startsWith(x))throw new Error(`key does not match this storage (${e}.${t})`);if(g.length!==a.length)throw new Error("Impossible to decode this key");if(a.length===0)return[];let b=u.slice(x.length),o=new Array(a.length);for(let A=0,I=0;A<g.length;A++){let w=a[A][0];I+=g[A],o[A]=w.dec(b.slice(I*2)),I+=w.enc(o[A]).length}return o},s=a.map(([{enc:u},b])=>o=>b(u(o)));return{enc:(...u)=>(0,U.toHex)((0,U.mergeUint8)(y,...u.map((b,o)=>s[o](b)))),dec:i,keyDecoder:P}}};var ar=(e,r,t)=>({checksum:e,pallet:r,name:t}),ir=(e,r,t,i,a)=>({type:e,props:{checksum:r,pallet:t,name:i},codecs:a}),pr=e=>({getPayloadDescriptor:(a,y,x,g)=>({type:a,props:{checksum:y,pallet:e,name:x},codecs:g}),getStorageDescriptor:(a,y,x)=>({type:"storage",props:{checksum:a,pallet:e,name:y},codecs:x}),getTxDescriptor:(a,y,x,g,P)=>({type:"tx",props:{checksum:a,pallet:e,name:y},codecs:P,events:x,errors:g})}); | ||
"use strict";var J=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var ae=(e,r)=>{for(var t in r)J(e,t,{get:r[t],enumerable:!0})},X=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ne(r))!Ve.call(e,a)&&a!==t&&J(e,a,{get:()=>r[a],enumerable:!(i=Be(r,a))||i.enumerable});return e},m=(e,r,t)=>(X(e,r,"default"),t&&X(t,r,"default"));var _e=e=>X(J({},"__esModule",{value:!0}),e);var T={};ae(T,{AccountId:()=>de,Blake2128:()=>Se,Blake2128Concat:()=>oe,Blake2256:()=>or,Hex:()=>_,Identity:()=>ne,OpaqueCodec:()=>O,Self:()=>me,Storage:()=>cr,Twox128:()=>G,Twox256:()=>sr,Twox64Concat:()=>ce,bitSequence:()=>be,char:()=>he,compactBn:()=>pe,compactNumber:()=>d,createCommonDescriptor:()=>ar,fixedStr:()=>ve,getDescriptorCreator:()=>ir,getPalletCreator:()=>dr,h64:()=>k,metadata:()=>Te,selfDecoder:()=>re,selfEncoder:()=>ee,v14:()=>$});module.exports=_e(T);m(T,require("scale-ts"),module.exports);var l={};ae(l,{AccountId:()=>de,Hex:()=>_,OpaqueCodec:()=>O,Self:()=>me,bitSequence:()=>be,char:()=>he,compactBn:()=>pe,compactNumber:()=>d,fixedStr:()=>ve,metadata:()=>Te,selfDecoder:()=>re,selfEncoder:()=>ee,v14:()=>$});m(l,require("scale-ts"));var K=require("scale-ts"),Y=require("@noble/hashes/blake2b"),Z=require("@scure/base"),ie=new TextEncoder().encode("SS58PRE"),Q=2,He=e=>{let r=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return t=>{let i=(0,Y.blake2b)(Uint8Array.of(...ie,...r,...t),{dkLen:64}).subarray(0,Q);return Z.base58.encode(Uint8Array.of(...r,...t,...i))}};function Ie(e,r){return t=>{let i=Z.base58.decode(t),a=i.subarray(0,i[0]&64?2:1),y=i.subarray(a.length,i.length-Q);if(y.length!==e)throw new Error("Invalid public key length");let x=i.subarray(a.length+y.length),g=(0,Y.blake2b)(Uint8Array.of(...ie,...a,...y),{dkLen:64}).subarray(0,Q);if(x[0]!==g[0]||x[1]!==g[1])throw new Error("Invalid checksum");if(Le(a)!=r)throw new Error("Invalid SS58 prefix");return y.slice()}}var de=(e=42,r=32)=>(0,K.enhanceCodec)((0,K.Bytes)(r),Ie(r,e),He(e)),Le=e=>{let r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.byteLength===1?r.getUint8(0):r.getUint16(0)};var F=require("scale-ts"),d=F.compact,pe=F.compact;var L=require("scale-ts"),ee=e=>{let r=t=>{let i=L.Struct.enc({self:e()});return r=i,i(t)};return t=>r(t)},re=e=>{let r=t=>{let i=L.Struct.dec({self:e()}),a=i;return r=i,a(t)};return t=>r(t)},me=e=>(0,L.createCodec)(ee(()=>e().enc),re(()=>e().dec));var V=require("scale-ts");var ye=(e,r=d.dec)=>(0,V.createDecoder)(t=>{let i=r(t),a=(0,V.Bytes)(i).dec(t),y;return{length:i,inner:()=>y=y||e(a)}}),le=(e,r=d.enc)=>t=>{let i=r(t.length),a=new Uint8Array(i.length+t.length);return a.set(i,0),a.set(e(t.inner()),i.length),a},O=(e,r=d)=>(0,V.createCodec)(le(e.enc,r.enc),ye(e.dec,r.dec));O.enc=le;O.dec=ye;var w=require("scale-ts");var n=require("scale-ts"),xe=(0,n.Option)(n.str),M=(0,n.Vector)(n.str),We=(0,n.Enum)({bool:n._void,char:n._void,str:n._void,u8:n._void,u16:n._void,u32:n._void,u64:n._void,u128:n._void,u256:n._void,i8:n._void,i16:n._void,i32:n._void,i64:n._void,i128:n._void,i256:n._void}),fe=(0,n.Vector)((0,n.Struct)({name:xe,type:d,typeName:xe,docs:M})),qe=(0,n.Struct)({len:n.u32,type:d}),Ke=(0,n.Struct)({bitStoreType:d,bitOrderType:d}),Oe=(0,n.Vector)((0,n.Struct)({name:n.str,fields:fe,index:n.u8,docs:M})),Me=(0,n.Enum)({composite:fe,variant:Oe,sequence:d,array:qe,tuple:(0,n.Vector)(d),primitive:We,compact:d,bitSequence:Ke,historicMetaCompat:n.str}),Re=(0,n.Struct)({name:n.str,type:(0,n.Option)(d)}),$e=(0,n.Vector)(Re),ze=(0,n.Struct)({id:d,path:M,params:$e,def:Me,docs:M}),ge=(0,n.Vector)(ze);var R=require("@polkadot-api/utils"),W=require("scale-ts"),ue=e=>{let r=W.Bytes.enc(e);return t=>r((0,R.fromHex)(t))},Ce=e=>{let r=W.Bytes.dec(e);return t=>(0,R.toHex)(r(t))},_=e=>(0,W.createCodec)(ue(e),Ce(e));_.enc=ue;_.dec=Ce;var c=require("scale-ts"),je=(0,c.Enum)({Blake2128:c._void,Blake2256:c._void,Blake2128Concat:c._void,Twox128:c._void,Twox256:c._void,Twox64Concat:c._void,Identity:c._void}),Ge=(0,c.Vector)(je),Xe=(0,c.Struct)({hashers:Ge,key:d,value:d}),Je=(0,c.Struct)({name:c.str,modifier:c.u8,type:(0,c.Enum)({plain:d,map:Xe}),fallback:(0,c.Vector)(c.u8),docs:(0,c.Vector)(c.str)}),Qe=(0,c.Option)((0,c.Struct)({prefix:c.str,items:(0,c.Vector)(Je)})),De=(0,c.Vector)((0,c.Struct)({name:c.str,storage:Qe,calls:(0,c.Option)(d),events:(0,c.Option)(d),constants:(0,c.Vector)((0,c.Struct)({name:c.str,type:d,value:_(),docs:(0,c.Vector)(c.str)})),errors:(0,c.Option)(d),index:c.u8}));var Ye=(0,w.Struct)({type:d,version:w.u8,signedExtensions:(0,w.Vector)((0,w.Struct)({identifier:w.str,type:d,additionalSigned:d}))}),$=(0,w.Struct)({lookup:ge,pallets:De,extrinsic:Ye,type:d});var B=require("scale-ts");var Ee=()=>{throw new Error("Unsupported metadata version!")},h=(0,B.createCodec)(Ee,Ee),Te=(0,B.Struct)({magicNumber:B.u32,metadata:(0,B.Enum)({v0:h,v1:h,v2:h,v3:h,v4:h,v5:h,v6:h,v7:h,v8:h,v9:h,v10:h,v11:h,v12:h,v13:h,v14:$})});var H=require("scale-ts");var Ze=(0,H.createDecoder)(e=>{let r=d.dec(e),t=Math.ceil(r/8);return{bytes:(0,H.Bytes)(t).dec(e),bitsLen:r}}),Fe=e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);let r=d.enc(e.bitsLen),t=new Uint8Array(e.bytes.length+r.length);return t.set(r,0),t.set(e.bytes,r.length),t},be=(0,H.createCodec)(Fe,Ze);var z=require("scale-ts"),he=(0,z.enhanceCodec)(z.u8,e=>e.charCodeAt(0),String.fromCharCode);var j=require("scale-ts"),er=new TextEncoder,rr=new TextDecoder,ve=e=>(0,j.enhanceCodec)((0,j.Bytes)(e),r=>er.encode(r),r=>rr.decode(r));m(T,l,module.exports);var Ae=require("@polkadot-api/utils"),te=require("@noble/hashes/blake2b"),tr={dkLen:32},or=e=>(0,te.blake2b)(e,tr),nr={dkLen:16},Se=e=>(0,te.blake2b)(e,nr),oe=e=>(0,Ae.mergeUint8)(Se(e),e);var ne=e=>e;var Ue=require("@polkadot-api/utils"),Pe=require("scale-ts");var N=(e,r,t,i)=>new DataView(new Uint16Array([e,r,t,i]).buffer).getBigUint64(0,!0),se=2n**64n-1n,E=(e,r)=>e<<r&se|e>>64n-r,p=(e,r)=>e*r&se,C=(e,r)=>e+r&se,D=11400714785074694791n,v=14029467366897019727n,we=1609587929392839161n,q=9650029242287828579n,ke=2870177450012600261n;function k(e,r=0n){let t=C(C(r,D),v),i=C(r,v),a=r,y=r-D,x=e.length,g=0,P=null;(function(){let o=0,A=o+x;if(x){if(P=new Uint8Array(32),x<32){P.set(e.subarray(0,x),g),g+=x;return}if(o<=A-32){let I=A-32;do{let S;S=N(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]),t=p(E(C(t,p(S,v)),31n),D),o+=8,S=N(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]),i=p(E(C(i,p(S,v)),31n),D),o+=8,S=N(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]),a=p(E(C(a,p(S,v)),31n),D),o+=8,S=N(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]),y=p(E(C(y,p(S,v)),31n),D),o+=8}while(o<=I)}o<A&&(P.set(e.subarray(o,A),g),g=A-o)}})(),e=P||e;let s,f=0;for(x>=32?(s=E(t,1n),s=C(s,E(i,7n)),s=C(s,E(a,12n)),s=C(s,E(y,18n)),t=p(E(p(t,v),31n),D),s=s^t,s=C(p(s,D),q),i=p(E(p(i,v),31n),D),s=s^i,s=C(p(s,D),q),a=p(E(p(a,v),31n),D),s=s^a,s=C(p(s,D),q),y=p(E(p(y,v),31n),D),s=s^y,s=C(p(s,D),q)):s=C(r,ke),s=C(s,BigInt(x));f<=g-8;){let b=N(e[f+1]<<8|e[f],e[f+3]<<8|e[f+2],e[f+5]<<8|e[f+4],e[f+7]<<8|e[f+6]);b=p(E(p(b,v),31n),D),s=C(p(E(s^b,27n),D),q),f+=8}if(f+4<=g){let b=p(N(e[f+1]<<8|e[f],e[f+3]<<8|e[f+2],0,0),D);s=C(p(E(s^b,23n),v),we),f+=4}for(;f<g;){let b=p(N(e[f++],0,0,0),ke);s=p(E(s^b,11n),D)}let u=s>>33n;return s=p(s^u,v),u=s>>29n,s=p(s^u,we),u=s>>32n,s^=u,s}var G=e=>{let r=new Uint8Array(16),t=new DataView(r.buffer);return t.setBigUint64(0,k(e),!0),t.setBigUint64(8,k(e,1n),!0),r},sr=e=>{let r=new Uint8Array(32),t=new DataView(r.buffer);return t.setBigUint64(0,k(e),!0),t.setBigUint64(8,k(e,1n),!0),t.setBigUint64(16,k(e,2n),!0),t.setBigUint64(24,k(e,3n),!0),r},ce=e=>(0,Ue.mergeUint8)(Pe.u64.enc(k(e)),e);var U=require("@polkadot-api/utils");var cr=e=>{let r=G((0,U.utf16StrToUtf8Bytes)(e));return(t,i,...a)=>{let y=(0,U.mergeUint8)(r,G((0,U.utf16StrToUtf8Bytes)(t))),x=(0,U.toHex)(y),g=a.map(u=>u[1]).map(u=>u===ne?0:u===ce?8:u===oe?16:null).filter(Boolean),P=u=>{if(!u.startsWith(x))throw new Error(`key does not match this storage (${e}.${t})`);if(g.length!==a.length)throw new Error("Impossible to decode this key");if(a.length===0)return[];let b=u.slice(x.length),o=new Array(a.length);for(let A=0,I=0;A<g.length;A++){let S=a[A][0];I+=g[A],o[A]=S.dec(b.slice(I*2)),I+=S.enc(o[A]).length}return o},s=a.map(([{enc:u},b])=>o=>b(u(o)));return{enc:(...u)=>(0,U.toHex)((0,U.mergeUint8)(y,...u.map((b,o)=>s[o](b)))),dec:i,keyDecoder:P}}};var ar=(e,r,t)=>({checksum:e,pallet:r,name:t}),ir=(e,r,t,i,a)=>({type:e,props:{checksum:r,pallet:t,name:i},codecs:a}),dr=e=>({getPayloadDescriptor:(a,y,x,g)=>({type:a,props:{checksum:y,pallet:e,name:x},codecs:g}),getStorageDescriptor:(a,y,x)=>({type:"storage",props:{checksum:a,pallet:e,name:y},codecs:x}),getTxDescriptor:(a,y,x,g,P)=>({type:"tx",props:{checksum:a,pallet:e,name:y},codecs:P,events:x,errors:g})}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@polkadot-api/substrate-bindings", | ||
"version": "0.0.1-8bd149cc88adc8f432e18d66898591418bb29fa0.1.0", | ||
"version": "0.0.1-929b980de37b4215e40f967dc0b03498d4d28563.1.0", | ||
"author": "Josep M Sobrepere (https://github.com/josepot)", | ||
@@ -15,4 +15,9 @@ "repository": { | ||
"production": { | ||
"require": "./dist/min/index.js" | ||
} | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/min/index.js", | ||
"default": "./dist/index.js" | ||
}, | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
}, | ||
@@ -42,3 +47,3 @@ "module": "./dist/index.mjs", | ||
"scale-ts": "^1.4.0", | ||
"@polkadot-api/utils": "0.0.1-8bd149cc88adc8f432e18d66898591418bb29fa0.1.0" | ||
"@polkadot-api/utils": "0.0.1-929b980de37b4215e40f967dc0b03498d4d28563.1.0" | ||
}, | ||
@@ -45,0 +50,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
292118
4081
3
4
200