@polkadot-api/substrate-bindings
Advanced tools
Comparing version 0.0.1-b90f9f566f52c20be81648b575b91e8a49f70890.1.0 to 0.0.1-bba5c3894709259dfac43265c0a6efd6d9f12ddf.1.0
@@ -612,6 +612,3 @@ import * as scale_ts from 'scale-ts'; | ||
digests: ({ | ||
tag: "other"; | ||
value: HexString; | ||
} | { | ||
tag: "postRuntime"; | ||
tag: "consensus"; | ||
value: { | ||
@@ -638,2 +635,3 @@ engine: string; | ||
}>; | ||
type BlockHeader = CodecType<typeof blockHeader>; | ||
@@ -708,2 +706,2 @@ declare const Blake2256: (encoded: Uint8Array) => Uint8Array; | ||
export { AccountId, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type ConstFromDescriptors, type Descriptors, type EncoderWithHash, type ErrorsFromDescriptors, type EventsFromDescriptors, Hex, type HexString, Identity, OpaqueCodec, type OpaqueValue, type PlainDescriptor, type QueryFromDescriptors, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14, type V14Extrinsic, type V14Lookup, type V14Pallets, bitSequence, blockHeader, char, compactBn, compactNumber, fixedStr, h64, metadata, selfDecoder, selfEncoder, v14 }; | ||
export { AccountId, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type EncoderWithHash, type ErrorsFromDescriptors, type EventsFromDescriptors, Hex, type HexString, Identity, OpaqueCodec, type OpaqueValue, type PlainDescriptor, type QueryFromDescriptors, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14, type V14Extrinsic, type V14Lookup, type V14Pallets, bitSequence, blockHeader, char, compactBn, compactNumber, fixedStr, h64, metadata, selfDecoder, selfEncoder, v14 }; |
@@ -123,4 +123,4 @@ "use strict"; | ||
); | ||
var prefixBytesToNumber = (bytes2) => { | ||
const dv = new DataView(bytes2.buffer, bytes2.byteOffset, bytes2.byteLength); | ||
var prefixBytesToNumber = (bytes) => { | ||
const dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); | ||
return dv.byteLength === 1 ? dv.getUint8(0) : dv.getUint16(0); | ||
@@ -160,5 +160,5 @@ }; | ||
var import_scale_ts4 = require("scale-ts"); | ||
var OpaqueDecoder = (inner, len = compactNumber.dec) => (0, import_scale_ts4.createDecoder)((bytes2) => { | ||
const length = len(bytes2); | ||
const innerBytes = (0, import_scale_ts4.Bytes)(length).dec(bytes2); | ||
var OpaqueDecoder = (inner, len = compactNumber.dec) => (0, import_scale_ts4.createDecoder)((bytes) => { | ||
const length = len(bytes); | ||
const innerBytes = (0, import_scale_ts4.Bytes)(length).dec(bytes); | ||
let _cachedValue; | ||
@@ -378,4 +378,4 @@ return { | ||
const bytesLen = Math.ceil(bitsLen / 8); | ||
const bytes2 = (0, import_scale_ts10.Bytes)(bytesLen).dec(data); | ||
return { bytes: bytes2, bitsLen }; | ||
const bytes = (0, import_scale_ts10.Bytes)(bytesLen).dec(data); | ||
return { bytes, bitsLen }; | ||
}); | ||
@@ -410,3 +410,3 @@ var bitSequenceEncoder = (input) => { | ||
(str4) => textEncoder.encode(str4), | ||
(bytes2) => textDecoder.decode(bytes2) | ||
(bytes) => textDecoder.decode(bytes) | ||
); | ||
@@ -418,3 +418,2 @@ | ||
var textDecoder2 = new TextDecoder(); | ||
var hex32 = Hex(32); | ||
var fourChars = (0, import_scale_ts13.enhanceCodec)( | ||
@@ -425,11 +424,9 @@ (0, import_scale_ts13.Bytes)(4), | ||
); | ||
var bytes = Hex(); | ||
var diggestVal = (0, import_scale_ts13.Struct)({ | ||
engine: fourChars, | ||
payload: bytes | ||
payload: Hex() | ||
}); | ||
var diggest = (0, import_scale_ts13.Enum)( | ||
{ | ||
other: bytes, | ||
postRuntime: diggestVal, | ||
consensus: diggestVal, | ||
seal: diggestVal, | ||
@@ -439,4 +436,5 @@ preRuntime: diggestVal, | ||
}, | ||
[0, 4, 5, 6, 8] | ||
[4, 5, 6, 8] | ||
); | ||
var hex32 = Hex(32); | ||
var blockHeader = (0, import_scale_ts13.Struct)({ | ||
@@ -443,0 +441,0 @@ parentHash: hex32, |
@@ -612,6 +612,3 @@ import * as scale_ts from 'scale-ts'; | ||
digests: ({ | ||
tag: "other"; | ||
value: HexString; | ||
} | { | ||
tag: "postRuntime"; | ||
tag: "consensus"; | ||
value: { | ||
@@ -638,2 +635,3 @@ engine: string; | ||
}>; | ||
type BlockHeader = CodecType<typeof blockHeader>; | ||
@@ -708,2 +706,2 @@ declare const Blake2256: (encoded: Uint8Array) => Uint8Array; | ||
export { AccountId, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type ConstFromDescriptors, type Descriptors, type EncoderWithHash, type ErrorsFromDescriptors, type EventsFromDescriptors, Hex, type HexString, Identity, OpaqueCodec, type OpaqueValue, type PlainDescriptor, type QueryFromDescriptors, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14, type V14Extrinsic, type V14Lookup, type V14Pallets, bitSequence, blockHeader, char, compactBn, compactNumber, fixedStr, h64, metadata, selfDecoder, selfEncoder, v14 }; | ||
export { AccountId, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type EncoderWithHash, type ErrorsFromDescriptors, type EventsFromDescriptors, Hex, type HexString, Identity, OpaqueCodec, type OpaqueValue, type PlainDescriptor, type QueryFromDescriptors, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14, type V14Extrinsic, type V14Lookup, type V14Pallets, bitSequence, blockHeader, char, compactBn, compactNumber, fixedStr, h64, metadata, selfDecoder, selfEncoder, v14 }; |
@@ -1,2 +0,2 @@ | ||
"use strict";var J=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Me=Object.prototype.hasOwnProperty;var de=(e,t)=>{for(var r in t)J(e,r,{get:t[r],enumerable:!0})},j=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Re(t))!Me.call(e,d)&&d!==r&&J(e,d,{get:()=>t[d],enumerable:!(i=Oe(t,d))||i.enumerable});return e},l=(e,t,r)=>(j(e,t,"default"),r&&j(r,t,"default"));var Pe=e=>j(J({},"__esModule",{value:!0}),e);var h={};de(h,{AccountId:()=>le,Blake2128:()=>He,Blake2128Concat:()=>ce,Blake2256:()=>ft,Hex:()=>v,Identity:()=>se,OpaqueCodec:()=>M,Self:()=>ye,Storage:()=>xt,Twox128:()=>X,Twox256:()=>ut,Twox64Concat:()=>ae,bitSequence:()=>Ae,blockHeader:()=>Ve,char:()=>Ue,compactBn:()=>pe,compactNumber:()=>a,fixedStr:()=>ke,h64:()=>D,metadata:()=>Se,selfDecoder:()=>te,selfEncoder:()=>ee,v14:()=>$});module.exports=Pe(h);l(h,require("scale-ts"),module.exports);var p={};de(p,{AccountId:()=>le,Hex:()=>v,OpaqueCodec:()=>M,Self:()=>ye,bitSequence:()=>Ae,blockHeader:()=>Ve,char:()=>Ue,compactBn:()=>pe,compactNumber:()=>a,fixedStr:()=>ke,metadata:()=>Se,selfDecoder:()=>te,selfEncoder:()=>ee,v14:()=>$});l(p,require("scale-ts"));var R=require("scale-ts"),Y=require("@noble/hashes/blake2b"),Z=require("@scure/base"),me=new TextEncoder().encode("SS58PRE"),Q=2,We=e=>{let t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return r=>{let i=(0,Y.blake2b)(Uint8Array.of(...me,...t,...r),{dkLen:64}).subarray(0,Q);return Z.base58.encode(Uint8Array.of(...t,...r,...i))}};function $e(e,t){return r=>{let i=Z.base58.decode(r),d=i.subarray(0,i[0]&64?2:1),b=i.subarray(d.length,i.length-Q);if(b.length!==e)throw new Error("Invalid public key length");let C=i.subarray(d.length+b.length),T=(0,Y.blake2b)(Uint8Array.of(...me,...d,...b),{dkLen:64}).subarray(0,Q);if(C[0]!==T[0]||C[1]!==T[1])throw new Error("Invalid checksum");if(ze(d)!=t)throw new Error("Invalid SS58 prefix");return b.slice()}}var le=(e=42,t=32)=>(0,R.enhanceCodec)((0,R.Bytes)(t),$e(t,e),We(e)),ze=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)};var F=require("scale-ts"),a=F.compact,pe=F.compact;var fe=require("scale-ts"),ee=e=>{let t=r=>{let i=e();return t=i,i(r)};return r=>t(r)},te=e=>{let t=r=>{let i=e(),d=i;return t=i,d(r)};return r=>t(r)},ye=e=>(0,fe.createCodec)(ee(()=>e().enc),te(()=>e().dec));var I=require("scale-ts");var ue=(e,t=a.dec)=>(0,I.createDecoder)(r=>{let i=t(r),d=(0,I.Bytes)(i).dec(r),b;return{length:i,inner:()=>b=b||e(d)}}),xe=(e,t=a.enc)=>r=>{let i=t(r.length),d=new Uint8Array(i.length+r.length);return d.set(i,0),d.set(e(r.inner()),i.length),d},M=(e,t=a)=>(0,I.createCodec)(xe(e.enc,t.enc),ue(e.dec,t.dec));M.enc=xe;M.dec=ue;var B=require("scale-ts");var n=require("scale-ts"),be=(0,n.Option)(n.str),P=(0,n.Vector)(n.str),Ge=(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}),ge=(0,n.Vector)((0,n.Struct)({name:be,type:a,typeName:be,docs:P})),Xe=(0,n.Struct)({len:n.u32,type:a}),je=(0,n.Struct)({bitStoreType:a,bitOrderType:a}),Je=(0,n.Vector)((0,n.Struct)({name:n.str,fields:ge,index:n.u8,docs:P})),Qe=(0,n.Enum)({composite:ge,variant:Je,sequence:a,array:Xe,tuple:(0,n.Vector)(a),primitive:Ge,compact:a,bitSequence:je,historicMetaCompat:n.str}),Ye=(0,n.Struct)({name:n.str,type:(0,n.Option)(a)}),Ze=(0,n.Vector)(Ye),Fe=(0,n.Struct)({id:a,path:P,params:Ze,def:Qe,docs:P}),he=(0,n.Vector)(Fe);var W=require("@polkadot-api/utils"),K=require("scale-ts"),Te=e=>{let t=K.Bytes.enc(e);return r=>t((0,W.fromHex)(r))},Ee=e=>{let t=K.Bytes.dec(e);return r=>(0,W.toHex)(t(r))},v=e=>(0,K.createCodec)(Te(e),Ee(e));v.enc=Te;v.dec=Ee;var s=require("scale-ts"),et=(0,s.Enum)({Blake2128:s._void,Blake2256:s._void,Blake2128Concat:s._void,Twox128:s._void,Twox256:s._void,Twox64Concat:s._void,Identity:s._void}),tt=(0,s.Vector)(et),rt=(0,s.Struct)({hashers:tt,key:a,value:a}),ot=(0,s.Struct)({name:s.str,modifier:s.u8,type:(0,s.Enum)({plain:a,map:rt}),fallback:v(),docs:(0,s.Vector)(s.str)}),nt=(0,s.Option)((0,s.Struct)({prefix:s.str,items:(0,s.Vector)(ot)})),we=(0,s.Vector)((0,s.Struct)({name:s.str,storage:nt,calls:(0,s.Option)(a),events:(0,s.Option)(a),constants:(0,s.Vector)((0,s.Struct)({name:s.str,type:a,value:v(),docs:(0,s.Vector)(s.str)})),errors:(0,s.Option)(a),index:s.u8}));var ct=(0,B.Struct)({type:a,version:B.u8,signedExtensions:(0,B.Vector)((0,B.Struct)({identifier:B.str,type:a,additionalSigned:a}))}),$=(0,B.Struct)({lookup:he,pallets:we,extrinsic:ct,type:a});var V=require("scale-ts");var Ce=()=>{throw new Error("Unsupported metadata version!")},w=(0,V.createCodec)(Ce,Ce),Se=(0,V.Struct)({magicNumber:V.u32,metadata:(0,V.Enum)({v0:w,v1:w,v2:w,v3:w,v4:w,v5:w,v6:w,v7:w,v8:w,v9:w,v10:w,v11:w,v12:w,v13:w,v14:$})});var L=require("scale-ts");var st=(0,L.createDecoder)(e=>{let t=a.dec(e),r=Math.ceil(t/8);return{bytes:(0,L.Bytes)(r).dec(e),bitsLen:t}}),it=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),r=new Uint8Array(e.bytes.length+t.length);return r.set(t,0),r.set(e.bytes,t.length),r},Ae=(0,L.createCodec)(it,st);var z=require("scale-ts"),Ue=(0,z.enhanceCodec)(z.u8,e=>e.charCodeAt(0),String.fromCharCode);var G=require("scale-ts"),at=new TextEncoder,dt=new TextDecoder,ke=e=>(0,G.enhanceCodec)((0,G.Bytes)(e),t=>at.encode(t),t=>dt.decode(t));var S=require("scale-ts");var ve=new TextEncoder,Be=new TextDecoder,re=v(32),mt=(0,S.enhanceCodec)((0,S.Bytes)(4),ve.encode.bind(ve),Be.decode.bind(Be)),De=v(),oe=(0,S.Struct)({engine:mt,payload:De}),lt=(0,S.Enum)({other:De,postRuntime:oe,seal:oe,preRuntime:oe,runtimeUpdated:S._void},[0,4,5,6,8]),Ve=(0,S.Struct)({parentHash:re,number:a,stateRoot:re,extrinsicRoot:re,digests:(0,S.Vector)(lt)});l(h,p,module.exports);var _e=require("@polkadot-api/utils"),ne=require("@noble/hashes/blake2b"),pt={dkLen:32},ft=e=>(0,ne.blake2b)(e,pt),yt={dkLen:16},He=e=>(0,ne.blake2b)(e,yt),ce=e=>(0,_e.mergeUint8)(He(e),e);var se=e=>e;var qe=require("@polkadot-api/utils"),Ne=require("scale-ts");var _=(e,t,r,i)=>new DataView(new Uint16Array([e,t,r,i]).buffer).getBigUint64(0,!0),ie=2n**64n-1n,g=(e,t)=>e<<t&ie|e>>64n-t,m=(e,t)=>e*t&ie,u=(e,t)=>e+t&ie,x=11400714785074694791n,A=14029467366897019727n,Ie=1609587929392839161n,O=9650029242287828579n,Le=2870177450012600261n;function D(e,t=0n){let r=u(u(t,x),A),i=u(t,A),d=t,b=t-x,C=e.length,T=0,H=null;(function(){let o=0,U=o+C;if(C){if(H=new Uint8Array(32),C<32){H.set(e.subarray(0,C),T),T+=C;return}if(o<=U-32){let N=U-32;do{let k;k=_(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]),r=m(g(u(r,m(k,A)),31n),x),o+=8,k=_(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=m(g(u(i,m(k,A)),31n),x),o+=8,k=_(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=m(g(u(d,m(k,A)),31n),x),o+=8,k=_(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=m(g(u(b,m(k,A)),31n),x),o+=8}while(o<=N)}o<U&&(H.set(e.subarray(o,U),T),T=U-o)}})(),e=H||e;let c,f=0;for(C>=32?(c=g(r,1n),c=u(c,g(i,7n)),c=u(c,g(d,12n)),c=u(c,g(b,18n)),r=m(g(m(r,A),31n),x),c=c^r,c=u(m(c,x),O),i=m(g(m(i,A),31n),x),c=c^i,c=u(m(c,x),O),d=m(g(m(d,A),31n),x),c=c^d,c=u(m(c,x),O),b=m(g(m(b,A),31n),x),c=c^b,c=u(m(c,x),O)):c=u(t,Le),c=u(c,BigInt(C));f<=T-8;){let E=_(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]);E=m(g(m(E,A),31n),x),c=u(m(g(c^E,27n),x),O),f+=8}if(f+4<=T){let E=m(_(e[f+1]<<8|e[f],e[f+3]<<8|e[f+2],0,0),x);c=u(m(g(c^E,23n),A),Ie),f+=4}for(;f<T;){let E=m(_(e[f++],0,0,0),Le);c=m(g(c^E,11n),x)}let y=c>>33n;return c=m(c^y,A),y=c>>29n,c=m(c^y,Ie),y=c>>32n,c^=y,c}var X=e=>{let t=new Uint8Array(16),r=new DataView(t.buffer);return r.setBigUint64(0,D(e),!0),r.setBigUint64(8,D(e,1n),!0),t},ut=e=>{let t=new Uint8Array(32),r=new DataView(t.buffer);return r.setBigUint64(0,D(e),!0),r.setBigUint64(8,D(e,1n),!0),r.setBigUint64(16,D(e,2n),!0),r.setBigUint64(24,D(e,3n),!0),t},ae=e=>(0,qe.mergeUint8)(Ne.u64.enc(D(e)),e);var q=require("@polkadot-api/utils");var Ke=new TextEncoder,xt=e=>{let t=X(Ke.encode(e));return(r,i,...d)=>{let b=(0,q.mergeUint8)(t,X(Ke.encode(r))),C=(0,q.toHex)(b),T=d.map(y=>y[1]).map(y=>y===se?0:y===ae?8:y===ce?16:null).filter(Boolean),H=y=>{if(!y.startsWith(C))throw new Error(`key does not match this storage (${e}.${r})`);if(T.length!==d.length)throw new Error("Impossible to decode this key");if(d.length===0)return[];let E=y.slice(C.length),o=new Array(d.length);for(let U=0,N=0;U<T.length;U++){let k=d[U][0];N+=T[U],o[U]=k.dec(E.slice(N*2)),N+=k.enc(o[U]).length}return o},c=d.map(([{enc:y},E])=>o=>E(y(o)));return{enc:(...y)=>(0,q.toHex)((0,q.mergeUint8)(b,...y.map((E,o)=>c[o](E)))),dec:i,keyDecoder:H}}}; | ||
"use strict";var J=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Me=Object.prototype.hasOwnProperty;var de=(e,t)=>{for(var r in t)J(e,r,{get:t[r],enumerable:!0})},j=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Oe(t))!Me.call(e,d)&&d!==r&&J(e,d,{get:()=>t[d],enumerable:!(i=Ke(t,d))||i.enumerable});return e},p=(e,t,r)=>(j(e,t,"default"),r&&j(r,t,"default"));var Re=e=>j(J({},"__esModule",{value:!0}),e);var h={};de(h,{AccountId:()=>pe,Blake2128:()=>_e,Blake2128Concat:()=>ce,Blake2256:()=>lt,Hex:()=>v,Identity:()=>se,OpaqueCodec:()=>R,Self:()=>ye,Storage:()=>ut,Twox128:()=>X,Twox256:()=>yt,Twox64Concat:()=>ae,bitSequence:()=>ke,blockHeader:()=>De,char:()=>Ae,compactBn:()=>le,compactNumber:()=>a,fixedStr:()=>Ue,h64:()=>D,metadata:()=>Se,selfDecoder:()=>te,selfEncoder:()=>ee,v14:()=>$});module.exports=Re(h);p(h,require("scale-ts"),module.exports);var l={};de(l,{AccountId:()=>pe,Hex:()=>v,OpaqueCodec:()=>R,Self:()=>ye,bitSequence:()=>ke,blockHeader:()=>De,char:()=>Ae,compactBn:()=>le,compactNumber:()=>a,fixedStr:()=>Ue,metadata:()=>Se,selfDecoder:()=>te,selfEncoder:()=>ee,v14:()=>$});p(l,require("scale-ts"));var M=require("scale-ts"),Y=require("@noble/hashes/blake2b"),Z=require("@scure/base"),me=new TextEncoder().encode("SS58PRE"),Q=2,Pe=e=>{let t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return r=>{let i=(0,Y.blake2b)(Uint8Array.of(...me,...t,...r),{dkLen:64}).subarray(0,Q);return Z.base58.encode(Uint8Array.of(...t,...r,...i))}};function We(e,t){return r=>{let i=Z.base58.decode(r),d=i.subarray(0,i[0]&64?2:1),b=i.subarray(d.length,i.length-Q);if(b.length!==e)throw new Error("Invalid public key length");let C=i.subarray(d.length+b.length),T=(0,Y.blake2b)(Uint8Array.of(...me,...d,...b),{dkLen:64}).subarray(0,Q);if(C[0]!==T[0]||C[1]!==T[1])throw new Error("Invalid checksum");if($e(d)!=t)throw new Error("Invalid SS58 prefix");return b.slice()}}var pe=(e=42,t=32)=>(0,M.enhanceCodec)((0,M.Bytes)(t),We(t,e),Pe(e)),$e=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)};var F=require("scale-ts"),a=F.compact,le=F.compact;var fe=require("scale-ts"),ee=e=>{let t=r=>{let i=e();return t=i,i(r)};return r=>t(r)},te=e=>{let t=r=>{let i=e(),d=i;return t=i,d(r)};return r=>t(r)},ye=e=>(0,fe.createCodec)(ee(()=>e().enc),te(()=>e().dec));var I=require("scale-ts");var ue=(e,t=a.dec)=>(0,I.createDecoder)(r=>{let i=t(r),d=(0,I.Bytes)(i).dec(r),b;return{length:i,inner:()=>b=b||e(d)}}),xe=(e,t=a.enc)=>r=>{let i=t(r.length),d=new Uint8Array(i.length+r.length);return d.set(i,0),d.set(e(r.inner()),i.length),d},R=(e,t=a)=>(0,I.createCodec)(xe(e.enc,t.enc),ue(e.dec,t.dec));R.enc=xe;R.dec=ue;var B=require("scale-ts");var n=require("scale-ts"),be=(0,n.Option)(n.str),P=(0,n.Vector)(n.str),ze=(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}),ge=(0,n.Vector)((0,n.Struct)({name:be,type:a,typeName:be,docs:P})),Ge=(0,n.Struct)({len:n.u32,type:a}),Xe=(0,n.Struct)({bitStoreType:a,bitOrderType:a}),je=(0,n.Vector)((0,n.Struct)({name:n.str,fields:ge,index:n.u8,docs:P})),Je=(0,n.Enum)({composite:ge,variant:je,sequence:a,array:Ge,tuple:(0,n.Vector)(a),primitive:ze,compact:a,bitSequence:Xe,historicMetaCompat:n.str}),Qe=(0,n.Struct)({name:n.str,type:(0,n.Option)(a)}),Ye=(0,n.Vector)(Qe),Ze=(0,n.Struct)({id:a,path:P,params:Ye,def:Je,docs:P}),he=(0,n.Vector)(Ze);var W=require("@polkadot-api/utils"),K=require("scale-ts"),Te=e=>{let t=K.Bytes.enc(e);return r=>t((0,W.fromHex)(r))},Ee=e=>{let t=K.Bytes.dec(e);return r=>(0,W.toHex)(t(r))},v=e=>(0,K.createCodec)(Te(e),Ee(e));v.enc=Te;v.dec=Ee;var s=require("scale-ts"),Fe=(0,s.Enum)({Blake2128:s._void,Blake2256:s._void,Blake2128Concat:s._void,Twox128:s._void,Twox256:s._void,Twox64Concat:s._void,Identity:s._void}),et=(0,s.Vector)(Fe),tt=(0,s.Struct)({hashers:et,key:a,value:a}),rt=(0,s.Struct)({name:s.str,modifier:s.u8,type:(0,s.Enum)({plain:a,map:tt}),fallback:v(),docs:(0,s.Vector)(s.str)}),ot=(0,s.Option)((0,s.Struct)({prefix:s.str,items:(0,s.Vector)(rt)})),we=(0,s.Vector)((0,s.Struct)({name:s.str,storage:ot,calls:(0,s.Option)(a),events:(0,s.Option)(a),constants:(0,s.Vector)((0,s.Struct)({name:s.str,type:a,value:v(),docs:(0,s.Vector)(s.str)})),errors:(0,s.Option)(a),index:s.u8}));var nt=(0,B.Struct)({type:a,version:B.u8,signedExtensions:(0,B.Vector)((0,B.Struct)({identifier:B.str,type:a,additionalSigned:a}))}),$=(0,B.Struct)({lookup:he,pallets:we,extrinsic:nt,type:a});var V=require("scale-ts");var Ce=()=>{throw new Error("Unsupported metadata version!")},w=(0,V.createCodec)(Ce,Ce),Se=(0,V.Struct)({magicNumber:V.u32,metadata:(0,V.Enum)({v0:w,v1:w,v2:w,v3:w,v4:w,v5:w,v6:w,v7:w,v8:w,v9:w,v10:w,v11:w,v12:w,v13:w,v14:$})});var L=require("scale-ts");var ct=(0,L.createDecoder)(e=>{let t=a.dec(e),r=Math.ceil(t/8);return{bytes:(0,L.Bytes)(r).dec(e),bitsLen:t}}),st=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),r=new Uint8Array(e.bytes.length+t.length);return r.set(t,0),r.set(e.bytes,t.length),r},ke=(0,L.createCodec)(st,ct);var z=require("scale-ts"),Ae=(0,z.enhanceCodec)(z.u8,e=>e.charCodeAt(0),String.fromCharCode);var G=require("scale-ts"),it=new TextEncoder,at=new TextDecoder,Ue=e=>(0,G.enhanceCodec)((0,G.Bytes)(e),t=>it.encode(t),t=>at.decode(t));var S=require("scale-ts");var ve=new TextEncoder,Be=new TextDecoder,dt=(0,S.enhanceCodec)((0,S.Bytes)(4),ve.encode.bind(ve),Be.decode.bind(Be)),re=(0,S.Struct)({engine:dt,payload:v()}),mt=(0,S.Enum)({consensus:re,seal:re,preRuntime:re,runtimeUpdated:S._void},[4,5,6,8]),oe=v(32),De=(0,S.Struct)({parentHash:oe,number:a,stateRoot:oe,extrinsicRoot:oe,digests:(0,S.Vector)(mt)});p(h,l,module.exports);var Ve=require("@polkadot-api/utils"),ne=require("@noble/hashes/blake2b"),pt={dkLen:32},lt=e=>(0,ne.blake2b)(e,pt),ft={dkLen:16},_e=e=>(0,ne.blake2b)(e,ft),ce=e=>(0,Ve.mergeUint8)(_e(e),e);var se=e=>e;var Le=require("@polkadot-api/utils"),qe=require("scale-ts");var _=(e,t,r,i)=>new DataView(new Uint16Array([e,t,r,i]).buffer).getBigUint64(0,!0),ie=2n**64n-1n,g=(e,t)=>e<<t&ie|e>>64n-t,m=(e,t)=>e*t&ie,u=(e,t)=>e+t&ie,x=11400714785074694791n,k=14029467366897019727n,He=1609587929392839161n,O=9650029242287828579n,Ie=2870177450012600261n;function D(e,t=0n){let r=u(u(t,x),k),i=u(t,k),d=t,b=t-x,C=e.length,T=0,H=null;(function(){let o=0,A=o+C;if(C){if(H=new Uint8Array(32),C<32){H.set(e.subarray(0,C),T),T+=C;return}if(o<=A-32){let N=A-32;do{let U;U=_(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]),r=m(g(u(r,m(U,k)),31n),x),o+=8,U=_(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=m(g(u(i,m(U,k)),31n),x),o+=8,U=_(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=m(g(u(d,m(U,k)),31n),x),o+=8,U=_(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=m(g(u(b,m(U,k)),31n),x),o+=8}while(o<=N)}o<A&&(H.set(e.subarray(o,A),T),T=A-o)}})(),e=H||e;let c,f=0;for(C>=32?(c=g(r,1n),c=u(c,g(i,7n)),c=u(c,g(d,12n)),c=u(c,g(b,18n)),r=m(g(m(r,k),31n),x),c=c^r,c=u(m(c,x),O),i=m(g(m(i,k),31n),x),c=c^i,c=u(m(c,x),O),d=m(g(m(d,k),31n),x),c=c^d,c=u(m(c,x),O),b=m(g(m(b,k),31n),x),c=c^b,c=u(m(c,x),O)):c=u(t,Ie),c=u(c,BigInt(C));f<=T-8;){let E=_(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]);E=m(g(m(E,k),31n),x),c=u(m(g(c^E,27n),x),O),f+=8}if(f+4<=T){let E=m(_(e[f+1]<<8|e[f],e[f+3]<<8|e[f+2],0,0),x);c=u(m(g(c^E,23n),k),He),f+=4}for(;f<T;){let E=m(_(e[f++],0,0,0),Ie);c=m(g(c^E,11n),x)}let y=c>>33n;return c=m(c^y,k),y=c>>29n,c=m(c^y,He),y=c>>32n,c^=y,c}var X=e=>{let t=new Uint8Array(16),r=new DataView(t.buffer);return r.setBigUint64(0,D(e),!0),r.setBigUint64(8,D(e,1n),!0),t},yt=e=>{let t=new Uint8Array(32),r=new DataView(t.buffer);return r.setBigUint64(0,D(e),!0),r.setBigUint64(8,D(e,1n),!0),r.setBigUint64(16,D(e,2n),!0),r.setBigUint64(24,D(e,3n),!0),t},ae=e=>(0,Le.mergeUint8)(qe.u64.enc(D(e)),e);var q=require("@polkadot-api/utils");var Ne=new TextEncoder,ut=e=>{let t=X(Ne.encode(e));return(r,i,...d)=>{let b=(0,q.mergeUint8)(t,X(Ne.encode(r))),C=(0,q.toHex)(b),T=d.map(y=>y[1]).map(y=>y===se?0:y===ae?8:y===ce?16:null).filter(Boolean),H=y=>{if(!y.startsWith(C))throw new Error(`key does not match this storage (${e}.${r})`);if(T.length!==d.length)throw new Error("Impossible to decode this key");if(d.length===0)return[];let E=y.slice(C.length),o=new Array(d.length);for(let A=0,N=0;A<T.length;A++){let U=d[A][0];N+=T[A],o[A]=U.dec(E.slice(N*2)),N+=U.enc(o[A]).length}return o},c=d.map(([{enc:y},E])=>o=>E(y(o)));return{enc:(...y)=>(0,q.toHex)((0,q.mergeUint8)(b,...y.map((E,o)=>c[o](E)))),dec:i,keyDecoder:H}}}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@polkadot-api/substrate-bindings", | ||
"version": "0.0.1-b90f9f566f52c20be81648b575b91e8a49f70890.1.0", | ||
"version": "0.0.1-bba5c3894709259dfac43265c0a6efd6d9f12ddf.1.0", | ||
"author": "Josep M Sobrepere (https://github.com/josepot)", | ||
@@ -46,3 +46,3 @@ "repository": { | ||
"scale-ts": "^1.4.3", | ||
"@polkadot-api/utils": "0.0.1-b90f9f566f52c20be81648b575b91e8a49f70890.1.0" | ||
"@polkadot-api/utils": "0.0.1-bba5c3894709259dfac43265c0a6efd6d9f12ddf.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
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
225418
2735