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
603
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 to 0.1.0

4

dist/index.d.ts

@@ -120,2 +120,4 @@ import * as scale_ts from 'scale-ts';

declare const ethAccount: scale_ts.Codec<string>;
declare const blockHeader: Codec<{

@@ -787,2 +789,2 @@ parentHash: HexString;

export { AccountId, type AssetDescriptor, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type Discriminant, type EncoderWithHash, Enum, type ErrorsFromDescriptors, type EventsFromDescriptors, type ExtractEnumValue, FixedSizeBinary, type GetEnum, Hex, type HexString, Identity, type PlainDescriptor, type QueryFromDescriptors, type RuntimeDescriptor, type SS58AddressInfo, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14Lookup, type V15, type V15Extrinsic, Variant, _Enum, bitSequence, blockHeader, char, compactBn, compactNumber, fixedStr, fromBufferToBase58, getSs58AddressInfo, h64, metadata, selfDecoder, selfEncoder, v15 };
export { AccountId, type AssetDescriptor, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type Discriminant, type EncoderWithHash, Enum, type ErrorsFromDescriptors, type EventsFromDescriptors, type ExtractEnumValue, FixedSizeBinary, type GetEnum, Hex, type HexString, Identity, type PlainDescriptor, type QueryFromDescriptors, type RuntimeDescriptor, type SS58AddressInfo, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14Lookup, type V15, type V15Extrinsic, Variant, _Enum, bitSequence, blockHeader, char, compactBn, compactNumber, ethAccount, fixedStr, fromBufferToBase58, getSs58AddressInfo, h64, metadata, selfDecoder, selfEncoder, v15 };

@@ -82,2 +82,3 @@ "use strict";

enhanceEncoder: () => import_scale_ts8.enhanceEncoder,
ethAccount: () => ethAccount,
fixedStr: () => fixedStr,

@@ -365,2 +366,33 @@ fromBufferToBase58: () => fromBufferToBase58,

// src/codecs/scale/ethAccount.ts
var import_utils4 = require("@polkadot-api/utils");
var import_scale_ts11 = require("scale-ts");
var import_sha3 = require("@noble/hashes/sha3");
var getFormattedAddress = (hexAddress) => {
const nonChecksum = hexAddress.slice(2);
const hashedAddress = (0, import_utils4.toHex)((0, import_sha3.keccak_256)(nonChecksum)).slice(2);
const result = new Array(40);
for (let i = 0; i < 40; i++) {
const checksumVal = parseInt(hashedAddress[i], 16);
const char2 = nonChecksum[i];
result[i] = checksumVal > 7 ? char2.toUpperCase() : char2;
}
return `0x${result.join("")}`;
};
var bytes20Dec = (0, import_scale_ts11.Bytes)(20)[1];
var ethAccount = (0, import_scale_ts11.createCodec)(
(input) => {
const bytes = (0, import_utils4.fromHex)(input);
if (bytes.length !== 20)
throw new Error(`Invalid length found on EthAddress(${input})`);
const hexAddress = (0, import_utils4.toHex)(bytes);
if (input === hexAddress || input === hexAddress.toUpperCase())
return bytes;
if (getFormattedAddress(hexAddress) !== input)
throw new Error(`Invalid checksum found on EthAddress(${input})`);
return bytes;
},
(0, import_scale_ts11.createDecoder)((bytes) => getFormattedAddress((0, import_utils4.toHex)(bytes20Dec(bytes))))
);
// src/codecs/blockHeader.ts

@@ -397,27 +429,27 @@ var textEncoder3 = new TextEncoder();

// src/codecs/metadata/v15/v15.ts
var import_scale_ts13 = require("scale-ts");
var import_scale_ts14 = require("scale-ts");
// src/codecs/metadata/v15/lookup.ts
var import_scale_ts11 = require("scale-ts");
var oStr = (0, import_scale_ts11.Option)(import_scale_ts11.str);
var strs = (0, import_scale_ts11.Vector)(import_scale_ts11.str);
var primitive = (0, import_scale_ts11.Enum)({
bool: import_scale_ts11._void,
char: import_scale_ts11._void,
str: import_scale_ts11._void,
u8: import_scale_ts11._void,
u16: import_scale_ts11._void,
u32: import_scale_ts11._void,
u64: import_scale_ts11._void,
u128: import_scale_ts11._void,
u256: import_scale_ts11._void,
i8: import_scale_ts11._void,
i16: import_scale_ts11._void,
i32: import_scale_ts11._void,
i64: import_scale_ts11._void,
i128: import_scale_ts11._void,
i256: import_scale_ts11._void
var import_scale_ts12 = require("scale-ts");
var oStr = (0, import_scale_ts12.Option)(import_scale_ts12.str);
var strs = (0, import_scale_ts12.Vector)(import_scale_ts12.str);
var primitive = (0, import_scale_ts12.Enum)({
bool: import_scale_ts12._void,
char: import_scale_ts12._void,
str: import_scale_ts12._void,
u8: import_scale_ts12._void,
u16: import_scale_ts12._void,
u32: import_scale_ts12._void,
u64: import_scale_ts12._void,
u128: import_scale_ts12._void,
u256: import_scale_ts12._void,
i8: import_scale_ts12._void,
i16: import_scale_ts12._void,
i32: import_scale_ts12._void,
i64: import_scale_ts12._void,
i128: import_scale_ts12._void,
i256: import_scale_ts12._void
});
var fields = (0, import_scale_ts11.Vector)(
(0, import_scale_ts11.Struct)({
var fields = (0, import_scale_ts12.Vector)(
(0, import_scale_ts12.Struct)({
name: oStr,

@@ -429,19 +461,19 @@ type: compactNumber,

);
var arr = (0, import_scale_ts11.Struct)({
len: import_scale_ts11.u32,
var arr = (0, import_scale_ts12.Struct)({
len: import_scale_ts12.u32,
type: compactNumber
});
var bitSequence2 = (0, import_scale_ts11.Struct)({
var bitSequence2 = (0, import_scale_ts12.Struct)({
bitStoreType: compactNumber,
bitOrderType: compactNumber
});
var variant = (0, import_scale_ts11.Vector)(
(0, import_scale_ts11.Struct)({
name: import_scale_ts11.str,
var variant = (0, import_scale_ts12.Vector)(
(0, import_scale_ts12.Struct)({
name: import_scale_ts12.str,
fields,
index: import_scale_ts11.u8,
index: import_scale_ts12.u8,
docs: strs
})
);
var def = (0, import_scale_ts11.Enum)({
var def = (0, import_scale_ts12.Enum)({
composite: fields,

@@ -451,3 +483,3 @@ variant,

array: arr,
tuple: (0, import_scale_ts11.Vector)(compactNumber),
tuple: (0, import_scale_ts12.Vector)(compactNumber),
primitive,

@@ -457,8 +489,8 @@ compact: compactNumber,

});
var param = (0, import_scale_ts11.Struct)({
name: import_scale_ts11.str,
type: (0, import_scale_ts11.Option)(compactNumber)
var param = (0, import_scale_ts12.Struct)({
name: import_scale_ts12.str,
type: (0, import_scale_ts12.Option)(compactNumber)
});
var params = (0, import_scale_ts11.Vector)(param);
var entry = (0, import_scale_ts11.Struct)({
var params = (0, import_scale_ts12.Vector)(param);
var entry = (0, import_scale_ts12.Struct)({
id: compactNumber,

@@ -470,17 +502,17 @@ path: strs,

});
var lookup = (0, import_scale_ts11.Vector)(entry);
var lookup = (0, import_scale_ts12.Vector)(entry);
// src/codecs/metadata/v15/pallets.ts
var import_scale_ts12 = require("scale-ts");
var hashType = (0, import_scale_ts12.Enum)({
Blake2128: import_scale_ts12._void,
Blake2256: import_scale_ts12._void,
Blake2128Concat: import_scale_ts12._void,
Twox128: import_scale_ts12._void,
Twox256: import_scale_ts12._void,
Twox64Concat: import_scale_ts12._void,
Identity: import_scale_ts12._void
var import_scale_ts13 = require("scale-ts");
var hashType = (0, import_scale_ts13.Enum)({
Blake2128: import_scale_ts13._void,
Blake2256: import_scale_ts13._void,
Blake2128Concat: import_scale_ts13._void,
Twox128: import_scale_ts13._void,
Twox256: import_scale_ts13._void,
Twox64Concat: import_scale_ts13._void,
Identity: import_scale_ts13._void
});
var hashers = (0, import_scale_ts12.Vector)(hashType);
var storageMap = (0, import_scale_ts12.Struct)({
var hashers = (0, import_scale_ts13.Vector)(hashType);
var storageMap = (0, import_scale_ts13.Struct)({
hashers,

@@ -490,6 +522,6 @@ key: compactNumber,

});
var storageItem = (0, import_scale_ts12.Struct)({
name: import_scale_ts12.str,
modifier: import_scale_ts12.u8,
type: (0, import_scale_ts12.Enum)({
var storageItem = (0, import_scale_ts13.Struct)({
name: import_scale_ts13.str,
modifier: import_scale_ts13.u8,
type: (0, import_scale_ts13.Enum)({
plain: compactNumber,

@@ -499,27 +531,27 @@ map: storageMap

fallback: Hex(),
docs: (0, import_scale_ts12.Vector)(import_scale_ts12.str)
docs: (0, import_scale_ts13.Vector)(import_scale_ts13.str)
});
var storage = (0, import_scale_ts12.Option)(
(0, import_scale_ts12.Struct)({
prefix: import_scale_ts12.str,
items: (0, import_scale_ts12.Vector)(storageItem)
var storage = (0, import_scale_ts13.Option)(
(0, import_scale_ts13.Struct)({
prefix: import_scale_ts13.str,
items: (0, import_scale_ts13.Vector)(storageItem)
})
);
var pallets = (0, import_scale_ts12.Vector)(
(0, import_scale_ts12.Struct)({
name: import_scale_ts12.str,
var pallets = (0, import_scale_ts13.Vector)(
(0, import_scale_ts13.Struct)({
name: import_scale_ts13.str,
storage,
calls: (0, import_scale_ts12.Option)(compactNumber),
events: (0, import_scale_ts12.Option)(compactNumber),
constants: (0, import_scale_ts12.Vector)(
(0, import_scale_ts12.Struct)({
name: import_scale_ts12.str,
calls: (0, import_scale_ts13.Option)(compactNumber),
events: (0, import_scale_ts13.Option)(compactNumber),
constants: (0, import_scale_ts13.Vector)(
(0, import_scale_ts13.Struct)({
name: import_scale_ts13.str,
type: compactNumber,
value: Hex(),
docs: (0, import_scale_ts12.Vector)(import_scale_ts12.str)
docs: (0, import_scale_ts13.Vector)(import_scale_ts13.str)
})
),
errors: (0, import_scale_ts12.Option)(compactNumber),
index: import_scale_ts12.u8,
docs: (0, import_scale_ts12.Vector)(import_scale_ts12.str)
errors: (0, import_scale_ts13.Option)(compactNumber),
index: import_scale_ts13.u8,
docs: (0, import_scale_ts13.Vector)(import_scale_ts13.str)
})

@@ -529,11 +561,11 @@ );

// src/codecs/metadata/v15/v15.ts
var docs = (0, import_scale_ts13.Vector)(import_scale_ts13.str);
var runtimeApi = (0, import_scale_ts13.Struct)({
name: import_scale_ts13.str,
methods: (0, import_scale_ts13.Vector)(
(0, import_scale_ts13.Struct)({
name: import_scale_ts13.str,
inputs: (0, import_scale_ts13.Vector)(
(0, import_scale_ts13.Struct)({
name: import_scale_ts13.str,
var docs = (0, import_scale_ts14.Vector)(import_scale_ts14.str);
var runtimeApi = (0, import_scale_ts14.Struct)({
name: import_scale_ts14.str,
methods: (0, import_scale_ts14.Vector)(
(0, import_scale_ts14.Struct)({
name: import_scale_ts14.str,
inputs: (0, import_scale_ts14.Vector)(
(0, import_scale_ts14.Struct)({
name: import_scale_ts14.str,
type: compactNumber

@@ -548,4 +580,4 @@ })

});
var extrinsic = (0, import_scale_ts13.Struct)({
version: import_scale_ts13.u8,
var extrinsic = (0, import_scale_ts14.Struct)({
version: import_scale_ts14.u8,
address: compactNumber,

@@ -555,5 +587,5 @@ call: compactNumber,

extra: compactNumber,
signedExtensions: (0, import_scale_ts13.Vector)(
(0, import_scale_ts13.Struct)({
identifier: import_scale_ts13.str,
signedExtensions: (0, import_scale_ts14.Vector)(
(0, import_scale_ts14.Struct)({
identifier: import_scale_ts14.str,
type: compactNumber,

@@ -564,3 +596,3 @@ additionalSigned: compactNumber

});
var v15 = (0, import_scale_ts13.Struct)({
var v15 = (0, import_scale_ts14.Struct)({
lookup,

@@ -570,4 +602,4 @@ pallets,

type: compactNumber,
apis: (0, import_scale_ts13.Vector)(runtimeApi),
outerEnums: (0, import_scale_ts13.Struct)({
apis: (0, import_scale_ts14.Vector)(runtimeApi),
outerEnums: (0, import_scale_ts14.Struct)({
call: compactNumber,

@@ -577,17 +609,17 @@ event: compactNumber,

}),
custom: (0, import_scale_ts13.Vector)((0, import_scale_ts13.Tuple)(import_scale_ts13.str, (0, import_scale_ts13.Struct)({ type: compactNumber, value: Hex() })))
custom: (0, import_scale_ts14.Vector)((0, import_scale_ts14.Tuple)(import_scale_ts14.str, (0, import_scale_ts14.Struct)({ type: compactNumber, value: Hex() })))
});
// src/codecs/metadata/metadata.ts
var import_scale_ts14 = require("scale-ts");
var import_scale_ts15 = require("scale-ts");
var unsupportedFn = () => {
throw new Error("Unsupported metadata version!");
};
var unsupported = (0, import_scale_ts14.createCodec)(
var unsupported = (0, import_scale_ts15.createCodec)(
unsupportedFn,
unsupportedFn
);
var metadata = (0, import_scale_ts14.Struct)({
magicNumber: import_scale_ts14.u32,
metadata: (0, import_scale_ts14.Enum)({
var metadata = (0, import_scale_ts15.Struct)({
magicNumber: import_scale_ts15.u32,
metadata: (0, import_scale_ts15.Enum)({
v0: unsupported,

@@ -613,3 +645,3 @@ v1: unsupported,

// src/hashes/blake2.ts
var import_utils4 = require("@polkadot-api/utils");
var import_utils5 = require("@polkadot-api/utils");
var import_blake2b2 = require("@noble/hashes/blake2b");

@@ -620,3 +652,3 @@ var len32 = { dkLen: 32 };

var Blake2128 = (encoded) => (0, import_blake2b2.blake2b)(encoded, len16);
var Blake2128Concat = (encoded) => (0, import_utils4.mergeUint8)(Blake2128(encoded), encoded);
var Blake2128Concat = (encoded) => (0, import_utils5.mergeUint8)(Blake2128(encoded), encoded);

@@ -627,4 +659,4 @@ // src/hashes/identity.ts

// src/hashes/twoX.ts
var import_utils5 = require("@polkadot-api/utils");
var import_scale_ts15 = require("scale-ts");
var import_utils6 = require("@polkadot-api/utils");
var import_scale_ts16 = require("scale-ts");

@@ -782,6 +814,6 @@ // src/hashes/h64.ts

};
var Twox64Concat = (encoded) => (0, import_utils5.mergeUint8)(import_scale_ts15.u64.enc(h64(encoded)), encoded);
var Twox64Concat = (encoded) => (0, import_utils6.mergeUint8)(import_scale_ts16.u64.enc(h64(encoded)), encoded);
// src/storage.ts
var import_utils6 = require("@polkadot-api/utils");
var import_utils7 = require("@polkadot-api/utils");
var textEncoder4 = new TextEncoder();

@@ -791,7 +823,7 @@ var Storage = (pallet) => {

return (name, dec3, ...encoders) => {
const palletItemEncoded = (0, import_utils6.mergeUint8)(
const palletItemEncoded = (0, import_utils7.mergeUint8)(
palledEncoded,
Twox128(textEncoder4.encode(name))
);
const palletItemEncodedHex = (0, import_utils6.toHex)(palletItemEncoded);
const palletItemEncodedHex = (0, import_utils7.toHex)(palletItemEncoded);
const bytesToSkip = encoders.map((e) => e[1]).map((x) => {

@@ -826,4 +858,4 @@ if (x === Identity)

);
const enc3 = (...args) => (0, import_utils6.toHex)(
(0, import_utils6.mergeUint8)(palletItemEncoded, ...args.map((val, idx) => fns[idx](val)))
const enc3 = (...args) => (0, import_utils7.toHex)(
(0, import_utils7.mergeUint8)(palletItemEncoded, ...args.map((val, idx) => fns[idx](val)))
);

@@ -830,0 +862,0 @@ return {

@@ -120,2 +120,4 @@ import * as scale_ts from 'scale-ts';

declare const ethAccount: scale_ts.Codec<string>;
declare const blockHeader: Codec<{

@@ -787,2 +789,2 @@ parentHash: HexString;

export { AccountId, type AssetDescriptor, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type Discriminant, type EncoderWithHash, Enum, type ErrorsFromDescriptors, type EventsFromDescriptors, type ExtractEnumValue, FixedSizeBinary, type GetEnum, Hex, type HexString, Identity, type PlainDescriptor, type QueryFromDescriptors, type RuntimeDescriptor, type SS58AddressInfo, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14Lookup, type V15, type V15Extrinsic, Variant, _Enum, bitSequence, blockHeader, char, compactBn, compactNumber, fixedStr, fromBufferToBase58, getSs58AddressInfo, h64, metadata, selfDecoder, selfEncoder, v15 };
export { AccountId, type AssetDescriptor, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type Discriminant, type EncoderWithHash, Enum, type ErrorsFromDescriptors, type EventsFromDescriptors, type ExtractEnumValue, FixedSizeBinary, type GetEnum, Hex, type HexString, Identity, type PlainDescriptor, type QueryFromDescriptors, type RuntimeDescriptor, type SS58AddressInfo, type SS58String, Self, Storage, type StorageDescriptor, Twox128, Twox256, Twox64Concat, type TxDescriptor, type TxFromDescriptors, type V14Lookup, type V15, type V15Extrinsic, Variant, _Enum, bitSequence, blockHeader, char, compactBn, compactNumber, ethAccount, fixedStr, fromBufferToBase58, getSs58AddressInfo, h64, metadata, selfDecoder, selfEncoder, v15 };

@@ -1,2 +0,2 @@

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

@@ -5,0 +5,0 @@ "repository": {

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