Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@polkadot-api/substrate-bindings

Package Overview
Dependencies
Maintainers
2
Versions
604
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot-api/substrate-bindings - npm Package Compare versions

Comparing version 0.0.1-7044f981dfc89d2304ead2c14585c63607022aeb.1.0 to 0.0.1-73561a45e2aa759be26426e04bf0bced5bf71c6a.1.0

5

./dist/index.js

@@ -585,8 +585,9 @@ "use strict";

var import_utils4 = require("@polkadot-api/utils");
var textEncoder2 = new TextEncoder();
var Storage = (pallet) => {
const palledEncoded = Twox128((0, import_utils4.utf16StrToUtf8Bytes)(pallet));
const palledEncoded = Twox128(textEncoder2.encode(pallet));
return (name, dec2, ...encoders) => {
const palletItemEncoded = (0, import_utils4.mergeUint8)(
palledEncoded,
Twox128((0, import_utils4.utf16StrToUtf8Bytes)(name))
Twox128(textEncoder2.encode(name))
);

@@ -593,0 +594,0 @@ const palletItemEncodedHex = (0, import_utils4.toHex)(palletItemEncoded);

6

dist/index.d.ts

@@ -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 };

@@ -585,8 +585,9 @@ "use strict";

var import_utils4 = require("@polkadot-api/utils");
var textEncoder2 = new TextEncoder();
var Storage = (pallet) => {
const palledEncoded = Twox128((0, import_utils4.utf16StrToUtf8Bytes)(pallet));
const palledEncoded = Twox128(textEncoder2.encode(pallet));
return (name, dec2, ...encoders) => {
const palletItemEncoded = (0, import_utils4.mergeUint8)(
palledEncoded,
Twox128((0, import_utils4.utf16StrToUtf8Bytes)(name))
Twox128(textEncoder2.encode(name))
);

@@ -593,0 +594,0 @@ const palletItemEncodedHex = (0, import_utils4.toHex)(palletItemEncoded);

@@ -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 Ve=Object.getOwnPropertyNames;var _e=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 Ve(r))!_e.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 He=e=>X(J({},"__esModule",{value:!0}),e);var T={};ae(T,{AccountId:()=>de,Blake2128:()=>we,Blake2128Concat:()=>oe,Blake2256:()=>nr,Hex:()=>V,Identity:()=>ne,OpaqueCodec:()=>O,Self:()=>me,Storage:()=>ar,Twox128:()=>G,Twox256:()=>cr,Twox64Concat:()=>ce,bitSequence:()=>be,char:()=>he,compactBn:()=>pe,compactNumber:()=>d,createCommonDescriptor:()=>ir,fixedStr:()=>ve,getDescriptorCreator:()=>dr,getPalletCreator:()=>pr,h64:()=>k,metadata:()=>Te,selfDecoder:()=>re,selfEncoder:()=>ee,v14:()=>$});module.exports=He(T);m(T,require("scale-ts"),module.exports);var l={};ae(l,{AccountId:()=>de,Hex:()=>V,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,Ie=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 Le(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),f=(0,Y.blake2b)(Uint8Array.of(...ie,...a,...y),{dkLen:64}).subarray(0,Q);if(x[0]!==f[0]||x[1]!==f[1])throw new Error("Invalid checksum");if(We(a)!=r)throw new Error("Invalid SS58 prefix");return y.slice()}}var de=(e=42,r=32)=>(0,K.enhanceCodec)((0,K.Bytes)(r),Le(r,e),Ie(e)),We=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 B=require("scale-ts");var ye=(e,r=d.dec)=>(0,B.createDecoder)(t=>{let i=r(t),a=(0,B.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,B.createCodec)(le(e.enc,r.enc),ye(e.dec,r.dec));O.enc=le;O.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}),ge=(0,n.Vector)((0,n.Struct)({name:xe,type:d,typeName:xe,docs:M})),Ke=(0,n.Struct)({len:n.u32,type:d}),Oe=(0,n.Struct)({bitStoreType:d,bitOrderType:d}),Me=(0,n.Vector)((0,n.Struct)({name:n.str,fields:ge,index:n.u8,docs:M})),Re=(0,n.Enum)({composite:ge,variant:Me,sequence:d,array:Ke,tuple:(0,n.Vector)(d),primitive:qe,compact:d,bitSequence:Oe,historicMetaCompat:n.str}),$e=(0,n.Struct)({name:n.str,type:(0,n.Option)(d)}),ze=(0,n.Vector)($e),je=(0,n.Struct)({id:d,path:M,params:ze,def:Re,docs:M}),fe=(0,n.Vector)(je);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))},V=e=>(0,W.createCodec)(ue(e),Ce(e));V.enc=ue;V.dec=Ce;var c=require("scale-ts"),Ge=(0,c.Enum)({Blake2128:c._void,Blake2256:c._void,Blake2128Concat:c._void,Twox128:c._void,Twox256:c._void,Twox64Concat:c._void,Identity:c._void}),Xe=(0,c.Vector)(Ge),Je=(0,c.Struct)({hashers:Xe,key:d,value:d}),Qe=(0,c.Struct)({name:c.str,modifier:c.u8,type:(0,c.Enum)({plain:d,map:Je}),fallback:(0,c.Vector)(c.u8),docs:(0,c.Vector)(c.str)}),Ye=(0,c.Option)((0,c.Struct)({prefix:c.str,items:(0,c.Vector)(Qe)})),De=(0,c.Vector)((0,c.Struct)({name:c.str,storage:Ye,calls:(0,c.Option)(d),events:(0,c.Option)(d),constants:(0,c.Vector)((0,c.Struct)({name:c.str,type:d,value:V(),docs:(0,c.Vector)(c.str)})),errors:(0,c.Option)(d),index:c.u8}));var Ze=(0,S.Struct)({type:d,version:S.u8,signedExtensions:(0,S.Vector)((0,S.Struct)({identifier:S.str,type:d,additionalSigned:d}))}),$=(0,S.Struct)({lookup:fe,pallets:De,extrinsic:Ze,type:d});var P=require("scale-ts");var Ee=()=>{throw new Error("Unsupported metadata version!")},h=(0,P.createCodec)(Ee,Ee),Te=(0,P.Struct)({magicNumber:P.u32,metadata:(0,P.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 _=require("scale-ts");var Fe=(0,_.createDecoder)(e=>{let r=d.dec(e),t=Math.ceil(r/8);return{bytes:(0,_.Bytes)(t).dec(e),bitsLen:r}}),er=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,_.createCodec)(er,Fe);var z=require("scale-ts"),he=(0,z.enhanceCodec)(z.u8,e=>e.charCodeAt(0),String.fromCharCode);var j=require("scale-ts"),rr=new TextEncoder,tr=new TextDecoder,ve=e=>(0,j.enhanceCodec)((0,j.Bytes)(e),r=>rr.encode(r),r=>tr.decode(r));m(T,l,module.exports);var Ae=require("@polkadot-api/utils"),te=require("@noble/hashes/blake2b"),or={dkLen:32},nr=e=>(0,te.blake2b)(e,or),sr={dkLen:16},we=e=>(0,te.blake2b)(e,sr),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,p=(e,r)=>e*r&se,C=(e,r)=>e+r&se,D=11400714785074694791n,v=14029467366897019727n,Se=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,f=0,U=null;(function(){let o=0,A=o+x;if(x){if(U=new Uint8Array(32),x<32){U.set(e.subarray(0,x),f),f+=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=p(E(C(t,p(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=p(E(C(i,p(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=p(E(C(a,p(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=p(E(C(y,p(w,v)),31n),D),o+=8}while(o<=I)}o<A&&(U.set(e.subarray(o,A),f),f=A-o)}})(),e=U||e;let s,g=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));g<=f-8;){let b=N(e[g+1]<<8|e[g],e[g+3]<<8|e[g+2],e[g+5]<<8|e[g+4],e[g+7]<<8|e[g+6]);b=p(E(p(b,v),31n),D),s=C(p(E(s^b,27n),D),q),g+=8}if(g+4<=f){let b=p(N(e[g+1]<<8|e[g],e[g+3]<<8|e[g+2],0,0),D);s=C(p(E(s^b,23n),v),Se),g+=4}for(;g<f;){let b=p(N(e[g++],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,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},cr=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 H=require("@polkadot-api/utils");var Ne=new TextEncoder,ar=e=>{let r=G(Ne.encode(e));return(t,i,...a)=>{let y=(0,H.mergeUint8)(r,G(Ne.encode(t))),x=(0,H.toHex)(y),f=a.map(u=>u[1]).map(u=>u===ne?0:u===ce?8:u===oe?16:null).filter(Boolean),U=u=>{if(!u.startsWith(x))throw new Error(`key does not match this storage (${e}.${t})`);if(f.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<f.length;A++){let w=a[A][0];I+=f[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,H.toHex)((0,H.mergeUint8)(y,...u.map((b,o)=>s[o](b)))),dec:i,keyDecoder:U}}};var ir=(e,r,t)=>({checksum:e,pallet:r,name:t}),dr=(e,r,t,i,a)=>({type:e,props:{checksum:r,pallet:t,name:i},codecs:a}),pr=e=>({getPayloadDescriptor:(a,y,x,f)=>({type:a,props:{checksum:y,pallet:e,name:x},codecs:f}),getStorageDescriptor:(a,y,x)=>({type:"storage",props:{checksum:a,pallet:e,name:y},codecs:x}),getTxDescriptor:(a,y,x,f,U)=>({type:"tx",props:{checksum:a,pallet:e,name:y},codecs:U,events:x,errors:f})});
//# sourceMappingURL=index.js.map
{
"name": "@polkadot-api/substrate-bindings",
"version": "0.0.1-7044f981dfc89d2304ead2c14585c63607022aeb.1.0",
"version": "0.0.1-73561a45e2aa759be26426e04bf0bced5bf71c6a.1.0",
"author": "Josep M Sobrepere (https://github.com/josepot)",

@@ -46,3 +46,3 @@ "repository": {

"scale-ts": "^1.4.0",
"@polkadot-api/utils": "0.0.1-7044f981dfc89d2304ead2c14585c63607022aeb.1.0"
"@polkadot-api/utils": "0.0.1-73561a45e2aa759be26426e04bf0bced5bf71c6a.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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc