@polkadot-api/substrate-bindings
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -152,2 +152,617 @@ import * as scale_ts from 'scale-ts'; | ||
declare const metadata: Codec<{ | ||
magicNumber: number; | ||
metadata: { | ||
tag: "v0"; | ||
value: unknown; | ||
} | { | ||
tag: "v1"; | ||
value: unknown; | ||
} | { | ||
tag: "v2"; | ||
value: unknown; | ||
} | { | ||
tag: "v3"; | ||
value: unknown; | ||
} | { | ||
tag: "v4"; | ||
value: unknown; | ||
} | { | ||
tag: "v5"; | ||
value: unknown; | ||
} | { | ||
tag: "v6"; | ||
value: unknown; | ||
} | { | ||
tag: "v7"; | ||
value: unknown; | ||
} | { | ||
tag: "v8"; | ||
value: unknown; | ||
} | { | ||
tag: "v9"; | ||
value: unknown; | ||
} | { | ||
tag: "v10"; | ||
value: unknown; | ||
} | { | ||
tag: "v11"; | ||
value: unknown; | ||
} | { | ||
tag: "v12"; | ||
value: unknown; | ||
} | { | ||
tag: "v13"; | ||
value: unknown; | ||
} | { | ||
tag: "v14"; | ||
value: { | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
}[]; | ||
extrinsic: { | ||
type: number; | ||
version: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
}; | ||
} | { | ||
tag: "v15"; | ||
value: { | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
}[]; | ||
extrinsic: { | ||
version: number; | ||
address: number; | ||
call: number; | ||
signature: number; | ||
extra: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
outerEnums: { | ||
call: number; | ||
event: number; | ||
error: number; | ||
}; | ||
custom: [string, { | ||
type: number; | ||
value: HexString; | ||
}][]; | ||
}; | ||
}; | ||
}>; | ||
declare const extrinsic$1: scale_ts.Codec<{ | ||
type: number; | ||
version: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}>; | ||
type V14Extrinsic = CodecType<typeof extrinsic$1>; | ||
declare const v14: scale_ts.Codec<{ | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
}[]; | ||
extrinsic: { | ||
type: number; | ||
version: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
}>; | ||
type V14 = CodecType<typeof v14>; | ||
declare const lookup: scale_ts.Codec<{ | ||
@@ -370,2 +985,3 @@ id: number; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
@@ -423,3 +1039,2 @@ storage: { | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
@@ -464,246 +1079,2 @@ extrinsic: { | ||
declare const metadata: Codec<{ | ||
magicNumber: number; | ||
metadata: { | ||
tag: "v0"; | ||
value: unknown; | ||
} | { | ||
tag: "v1"; | ||
value: unknown; | ||
} | { | ||
tag: "v2"; | ||
value: unknown; | ||
} | { | ||
tag: "v3"; | ||
value: unknown; | ||
} | { | ||
tag: "v4"; | ||
value: unknown; | ||
} | { | ||
tag: "v5"; | ||
value: unknown; | ||
} | { | ||
tag: "v6"; | ||
value: unknown; | ||
} | { | ||
tag: "v7"; | ||
value: unknown; | ||
} | { | ||
tag: "v8"; | ||
value: unknown; | ||
} | { | ||
tag: "v9"; | ||
value: unknown; | ||
} | { | ||
tag: "v10"; | ||
value: unknown; | ||
} | { | ||
tag: "v11"; | ||
value: unknown; | ||
} | { | ||
tag: "v12"; | ||
value: unknown; | ||
} | { | ||
tag: "v13"; | ||
value: unknown; | ||
} | { | ||
tag: "v14"; | ||
value: unknown; | ||
} | { | ||
tag: "v15"; | ||
value: { | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
extrinsic: { | ||
version: number; | ||
address: number; | ||
call: number; | ||
signature: number; | ||
extra: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
outerEnums: { | ||
call: number; | ||
event: number; | ||
error: number; | ||
}; | ||
custom: [string, { | ||
type: number; | ||
value: HexString; | ||
}][]; | ||
}; | ||
}; | ||
}>; | ||
declare const Blake2256: (encoded: Uint8Array) => Uint8Array; | ||
@@ -792,2 +1163,2 @@ declare const Blake2128: (encoded: Uint8Array) => Uint8Array; | ||
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 }; | ||
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 V14, type V14Extrinsic, type V14Lookup, type V15, type V15Extrinsic, Variant, _Enum, bitSequence, blockHeader, char, compactBn, compactNumber, ethAccount, fixedStr, fromBufferToBase58, getSs58AddressInfo, h64, metadata, selfDecoder, selfEncoder, v14, v15 }; |
@@ -103,2 +103,3 @@ "use strict"; | ||
u8: () => import_scale_ts8.u8, | ||
v14: () => v14, | ||
v15: () => v15 | ||
@@ -265,3 +266,3 @@ }); | ||
import_scale_ts5.u8, | ||
(str5) => str5.charCodeAt(0), | ||
(str8) => str8.charCodeAt(0), | ||
String.fromCharCode | ||
@@ -291,3 +292,3 @@ ); | ||
(0, import_scale_ts7.Bytes)(nBytes), | ||
(str5) => textEncoder2.encode(str5), | ||
(str8) => textEncoder2.encode(str8), | ||
(bytes) => textDecoder2.decode(bytes) | ||
@@ -429,51 +430,59 @@ ); | ||
// src/codecs/metadata/v15/v15.ts | ||
var import_scale_ts14 = require("scale-ts"); | ||
// src/codecs/metadata/metadata.ts | ||
var import_scale_ts18 = require("scale-ts"); | ||
// src/codecs/metadata/v15/lookup.ts | ||
// src/codecs/metadata/v15.ts | ||
var import_scale_ts16 = require("scale-ts"); | ||
// src/codecs/metadata/lookup.ts | ||
var import_scale_ts13 = require("scale-ts"); | ||
// src/codecs/metadata/docs.ts | ||
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 docs = (0, import_scale_ts12.Vector)(import_scale_ts12.str); | ||
// src/codecs/metadata/lookup.ts | ||
var oStr = (0, import_scale_ts13.Option)(import_scale_ts13.str); | ||
var primitive = (0, import_scale_ts13.Enum)({ | ||
bool: import_scale_ts13._void, | ||
char: import_scale_ts13._void, | ||
str: import_scale_ts13._void, | ||
u8: import_scale_ts13._void, | ||
u16: import_scale_ts13._void, | ||
u32: import_scale_ts13._void, | ||
u64: import_scale_ts13._void, | ||
u128: import_scale_ts13._void, | ||
u256: import_scale_ts13._void, | ||
i8: import_scale_ts13._void, | ||
i16: import_scale_ts13._void, | ||
i32: import_scale_ts13._void, | ||
i64: import_scale_ts13._void, | ||
i128: import_scale_ts13._void, | ||
i256: import_scale_ts13._void | ||
}); | ||
var fields = (0, import_scale_ts12.Vector)( | ||
(0, import_scale_ts12.Struct)({ | ||
var fields = (0, import_scale_ts13.Vector)( | ||
(0, import_scale_ts13.Struct)({ | ||
name: oStr, | ||
type: compactNumber, | ||
typeName: oStr, | ||
docs: strs | ||
docs | ||
}) | ||
); | ||
var arr = (0, import_scale_ts12.Struct)({ | ||
len: import_scale_ts12.u32, | ||
var arr = (0, import_scale_ts13.Struct)({ | ||
len: import_scale_ts13.u32, | ||
type: compactNumber | ||
}); | ||
var bitSequence2 = (0, import_scale_ts12.Struct)({ | ||
var bitSequence2 = (0, import_scale_ts13.Struct)({ | ||
bitStoreType: compactNumber, | ||
bitOrderType: compactNumber | ||
}); | ||
var variant = (0, import_scale_ts12.Vector)( | ||
(0, import_scale_ts12.Struct)({ | ||
name: import_scale_ts12.str, | ||
var variant = (0, import_scale_ts13.Vector)( | ||
(0, import_scale_ts13.Struct)({ | ||
name: import_scale_ts13.str, | ||
fields, | ||
index: import_scale_ts12.u8, | ||
docs: strs | ||
index: import_scale_ts13.u8, | ||
docs | ||
}) | ||
); | ||
var def = (0, import_scale_ts12.Enum)({ | ||
var def = (0, import_scale_ts13.Enum)({ | ||
composite: fields, | ||
@@ -483,3 +492,3 @@ variant, | ||
array: arr, | ||
tuple: (0, import_scale_ts12.Vector)(compactNumber), | ||
tuple: (0, import_scale_ts13.Vector)(compactNumber), | ||
primitive, | ||
@@ -489,29 +498,29 @@ compact: compactNumber, | ||
}); | ||
var param = (0, import_scale_ts12.Struct)({ | ||
name: import_scale_ts12.str, | ||
type: (0, import_scale_ts12.Option)(compactNumber) | ||
var param = (0, import_scale_ts13.Struct)({ | ||
name: import_scale_ts13.str, | ||
type: (0, import_scale_ts13.Option)(compactNumber) | ||
}); | ||
var params = (0, import_scale_ts12.Vector)(param); | ||
var entry = (0, import_scale_ts12.Struct)({ | ||
var params = (0, import_scale_ts13.Vector)(param); | ||
var entry = (0, import_scale_ts13.Struct)({ | ||
id: compactNumber, | ||
path: strs, | ||
path: docs, | ||
params, | ||
def, | ||
docs: strs | ||
docs | ||
}); | ||
var lookup = (0, import_scale_ts12.Vector)(entry); | ||
var lookup = (0, import_scale_ts13.Vector)(entry); | ||
// src/codecs/metadata/v15/pallets.ts | ||
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 | ||
// src/codecs/metadata/pallets.ts | ||
var import_scale_ts14 = require("scale-ts"); | ||
var hashType = (0, import_scale_ts14.Enum)({ | ||
Blake2128: import_scale_ts14._void, | ||
Blake2256: import_scale_ts14._void, | ||
Blake2128Concat: import_scale_ts14._void, | ||
Twox128: import_scale_ts14._void, | ||
Twox256: import_scale_ts14._void, | ||
Twox64Concat: import_scale_ts14._void, | ||
Identity: import_scale_ts14._void | ||
}); | ||
var hashers = (0, import_scale_ts13.Vector)(hashType); | ||
var storageMap = (0, import_scale_ts13.Struct)({ | ||
var hashers = (0, import_scale_ts14.Vector)(hashType); | ||
var storageMap = (0, import_scale_ts14.Struct)({ | ||
hashers, | ||
@@ -521,6 +530,6 @@ key: compactNumber, | ||
}); | ||
var storageItem = (0, import_scale_ts13.Struct)({ | ||
name: import_scale_ts13.str, | ||
modifier: import_scale_ts13.u8, | ||
type: (0, import_scale_ts13.Enum)({ | ||
var storageItem = (0, import_scale_ts14.Struct)({ | ||
name: import_scale_ts14.str, | ||
modifier: import_scale_ts14.u8, | ||
type: (0, import_scale_ts14.Enum)({ | ||
plain: compactNumber, | ||
@@ -530,40 +539,41 @@ map: storageMap | ||
fallback: Hex(), | ||
docs: (0, import_scale_ts13.Vector)(import_scale_ts13.str) | ||
docs | ||
}); | ||
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 storage = (0, import_scale_ts14.Option)( | ||
(0, import_scale_ts14.Struct)({ | ||
prefix: import_scale_ts14.str, | ||
items: (0, import_scale_ts14.Vector)(storageItem) | ||
}) | ||
); | ||
var pallets = (0, import_scale_ts13.Vector)( | ||
(0, import_scale_ts13.Struct)({ | ||
name: import_scale_ts13.str, | ||
storage, | ||
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_ts13.Vector)(import_scale_ts13.str) | ||
}) | ||
), | ||
errors: (0, import_scale_ts13.Option)(compactNumber), | ||
index: import_scale_ts13.u8, | ||
docs: (0, import_scale_ts13.Vector)(import_scale_ts13.str) | ||
}) | ||
); | ||
// src/codecs/metadata/v15/v15.ts | ||
var docs = (0, import_scale_ts14.Vector)(import_scale_ts14.str); | ||
var runtimeApi = (0, import_scale_ts14.Struct)({ | ||
var v14Pallet = { | ||
name: import_scale_ts14.str, | ||
methods: (0, import_scale_ts14.Vector)( | ||
storage, | ||
calls: (0, import_scale_ts14.Option)(compactNumber), | ||
events: (0, import_scale_ts14.Option)(compactNumber), | ||
constants: (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, | ||
value: Hex(), | ||
docs | ||
}) | ||
), | ||
errors: (0, import_scale_ts14.Option)(compactNumber), | ||
index: import_scale_ts14.u8 | ||
}; | ||
var v15Pallet = { | ||
...v14Pallet, | ||
docs | ||
}; | ||
// src/codecs/metadata/runtime-api.ts | ||
var import_scale_ts15 = require("scale-ts"); | ||
var runtimeApi = (0, import_scale_ts15.Struct)({ | ||
name: import_scale_ts15.str, | ||
methods: (0, import_scale_ts15.Vector)( | ||
(0, import_scale_ts15.Struct)({ | ||
name: import_scale_ts15.str, | ||
inputs: (0, import_scale_ts15.Vector)( | ||
(0, import_scale_ts15.Struct)({ | ||
name: import_scale_ts15.str, | ||
type: compactNumber | ||
@@ -578,4 +588,6 @@ }) | ||
}); | ||
var extrinsic = (0, import_scale_ts14.Struct)({ | ||
version: import_scale_ts14.u8, | ||
// src/codecs/metadata/v15.ts | ||
var extrinsic = (0, import_scale_ts16.Struct)({ | ||
version: import_scale_ts16.u8, | ||
address: compactNumber, | ||
@@ -585,5 +597,5 @@ call: compactNumber, | ||
extra: compactNumber, | ||
signedExtensions: (0, import_scale_ts14.Vector)( | ||
(0, import_scale_ts14.Struct)({ | ||
identifier: import_scale_ts14.str, | ||
signedExtensions: (0, import_scale_ts16.Vector)( | ||
(0, import_scale_ts16.Struct)({ | ||
identifier: import_scale_ts16.str, | ||
type: compactNumber, | ||
@@ -594,9 +606,9 @@ additionalSigned: compactNumber | ||
}); | ||
var v15 = (0, import_scale_ts14.Struct)({ | ||
var v15 = (0, import_scale_ts16.Struct)({ | ||
lookup, | ||
pallets, | ||
pallets: (0, import_scale_ts16.Vector)((0, import_scale_ts16.Struct)(v15Pallet)), | ||
extrinsic, | ||
type: compactNumber, | ||
apis: (0, import_scale_ts14.Vector)(runtimeApi), | ||
outerEnums: (0, import_scale_ts14.Struct)({ | ||
apis: (0, import_scale_ts16.Vector)(runtimeApi), | ||
outerEnums: (0, import_scale_ts16.Struct)({ | ||
call: compactNumber, | ||
@@ -606,17 +618,42 @@ event: compactNumber, | ||
}), | ||
custom: (0, import_scale_ts14.Vector)((0, import_scale_ts14.Tuple)(import_scale_ts14.str, (0, import_scale_ts14.Struct)({ type: compactNumber, value: Hex() }))) | ||
custom: (0, import_scale_ts16.Vector)((0, import_scale_ts16.Tuple)(import_scale_ts16.str, (0, import_scale_ts16.Struct)({ type: compactNumber, value: Hex() }))) | ||
}); | ||
// src/codecs/metadata/v14.ts | ||
var import_scale_ts17 = require("scale-ts"); | ||
var empty = new Uint8Array(); | ||
var Always = (value) => (0, import_scale_ts17.createCodec)( | ||
() => empty, | ||
() => value | ||
); | ||
var extrinsic2 = (0, import_scale_ts17.Struct)({ | ||
type: compactNumber, | ||
version: import_scale_ts17.u8, | ||
signedExtensions: (0, import_scale_ts17.Vector)( | ||
(0, import_scale_ts17.Struct)({ | ||
identifier: import_scale_ts17.str, | ||
type: compactNumber, | ||
additionalSigned: compactNumber | ||
}) | ||
) | ||
}); | ||
var v14 = (0, import_scale_ts17.Struct)({ | ||
lookup, | ||
pallets: (0, import_scale_ts17.Vector)((0, import_scale_ts17.Struct)({ ...v14Pallet, docs: Always([]) })), | ||
extrinsic: extrinsic2, | ||
type: compactNumber, | ||
apis: Always([]) | ||
}); | ||
// src/codecs/metadata/metadata.ts | ||
var import_scale_ts15 = require("scale-ts"); | ||
var unsupportedFn = () => { | ||
throw new Error("Unsupported metadata version!"); | ||
}; | ||
var unsupported = (0, import_scale_ts15.createCodec)( | ||
var unsupported = (0, import_scale_ts18.createCodec)( | ||
unsupportedFn, | ||
unsupportedFn | ||
); | ||
var metadata = (0, import_scale_ts15.Struct)({ | ||
magicNumber: import_scale_ts15.u32, | ||
metadata: (0, import_scale_ts15.Enum)({ | ||
var metadata = (0, import_scale_ts18.Struct)({ | ||
magicNumber: import_scale_ts18.u32, | ||
metadata: (0, import_scale_ts18.Enum)({ | ||
v0: unsupported, | ||
@@ -636,3 +673,3 @@ v1: unsupported, | ||
v13: unsupported, | ||
v14: unsupported, | ||
v14, | ||
v15 | ||
@@ -656,3 +693,3 @@ }) | ||
var import_utils6 = require("@polkadot-api/utils"); | ||
var import_scale_ts16 = require("scale-ts"); | ||
var import_scale_ts19 = require("scale-ts"); | ||
@@ -810,3 +847,3 @@ // src/hashes/h64.ts | ||
}; | ||
var Twox64Concat = (encoded) => (0, import_utils6.mergeUint8)(import_scale_ts16.u64.enc(h64(encoded)), encoded); | ||
var Twox64Concat = (encoded) => (0, import_utils6.mergeUint8)(import_scale_ts19.u64.enc(h64(encoded)), encoded); | ||
@@ -813,0 +850,0 @@ // src/storage.ts |
@@ -152,2 +152,617 @@ import * as scale_ts from 'scale-ts'; | ||
declare const metadata: Codec<{ | ||
magicNumber: number; | ||
metadata: { | ||
tag: "v0"; | ||
value: unknown; | ||
} | { | ||
tag: "v1"; | ||
value: unknown; | ||
} | { | ||
tag: "v2"; | ||
value: unknown; | ||
} | { | ||
tag: "v3"; | ||
value: unknown; | ||
} | { | ||
tag: "v4"; | ||
value: unknown; | ||
} | { | ||
tag: "v5"; | ||
value: unknown; | ||
} | { | ||
tag: "v6"; | ||
value: unknown; | ||
} | { | ||
tag: "v7"; | ||
value: unknown; | ||
} | { | ||
tag: "v8"; | ||
value: unknown; | ||
} | { | ||
tag: "v9"; | ||
value: unknown; | ||
} | { | ||
tag: "v10"; | ||
value: unknown; | ||
} | { | ||
tag: "v11"; | ||
value: unknown; | ||
} | { | ||
tag: "v12"; | ||
value: unknown; | ||
} | { | ||
tag: "v13"; | ||
value: unknown; | ||
} | { | ||
tag: "v14"; | ||
value: { | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
}[]; | ||
extrinsic: { | ||
type: number; | ||
version: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
}; | ||
} | { | ||
tag: "v15"; | ||
value: { | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
}[]; | ||
extrinsic: { | ||
version: number; | ||
address: number; | ||
call: number; | ||
signature: number; | ||
extra: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
outerEnums: { | ||
call: number; | ||
event: number; | ||
error: number; | ||
}; | ||
custom: [string, { | ||
type: number; | ||
value: HexString; | ||
}][]; | ||
}; | ||
}; | ||
}>; | ||
declare const extrinsic$1: scale_ts.Codec<{ | ||
type: number; | ||
version: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}>; | ||
type V14Extrinsic = CodecType<typeof extrinsic$1>; | ||
declare const v14: scale_ts.Codec<{ | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
}[]; | ||
extrinsic: { | ||
type: number; | ||
version: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
}>; | ||
type V14 = CodecType<typeof v14>; | ||
declare const lookup: scale_ts.Codec<{ | ||
@@ -370,2 +985,3 @@ id: number; | ||
pallets: { | ||
docs: string[]; | ||
name: string; | ||
@@ -423,3 +1039,2 @@ storage: { | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
@@ -464,246 +1079,2 @@ extrinsic: { | ||
declare const metadata: Codec<{ | ||
magicNumber: number; | ||
metadata: { | ||
tag: "v0"; | ||
value: unknown; | ||
} | { | ||
tag: "v1"; | ||
value: unknown; | ||
} | { | ||
tag: "v2"; | ||
value: unknown; | ||
} | { | ||
tag: "v3"; | ||
value: unknown; | ||
} | { | ||
tag: "v4"; | ||
value: unknown; | ||
} | { | ||
tag: "v5"; | ||
value: unknown; | ||
} | { | ||
tag: "v6"; | ||
value: unknown; | ||
} | { | ||
tag: "v7"; | ||
value: unknown; | ||
} | { | ||
tag: "v8"; | ||
value: unknown; | ||
} | { | ||
tag: "v9"; | ||
value: unknown; | ||
} | { | ||
tag: "v10"; | ||
value: unknown; | ||
} | { | ||
tag: "v11"; | ||
value: unknown; | ||
} | { | ||
tag: "v12"; | ||
value: unknown; | ||
} | { | ||
tag: "v13"; | ||
value: unknown; | ||
} | { | ||
tag: "v14"; | ||
value: unknown; | ||
} | { | ||
tag: "v15"; | ||
value: { | ||
lookup: { | ||
id: number; | ||
path: string[]; | ||
params: { | ||
name: string; | ||
type: number | undefined; | ||
}[]; | ||
def: { | ||
tag: "composite"; | ||
value: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "variant"; | ||
value: { | ||
name: string; | ||
fields: { | ||
name: string | undefined; | ||
type: number; | ||
typeName: string | undefined; | ||
docs: string[]; | ||
}[]; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
} | { | ||
tag: "sequence"; | ||
value: number; | ||
} | { | ||
tag: "array"; | ||
value: { | ||
len: number; | ||
type: number; | ||
}; | ||
} | { | ||
tag: "tuple"; | ||
value: number[]; | ||
} | { | ||
tag: "primitive"; | ||
value: { | ||
tag: "bool"; | ||
value: undefined; | ||
} | { | ||
tag: "char"; | ||
value: undefined; | ||
} | { | ||
tag: "str"; | ||
value: undefined; | ||
} | { | ||
tag: "u8"; | ||
value: undefined; | ||
} | { | ||
tag: "u16"; | ||
value: undefined; | ||
} | { | ||
tag: "u32"; | ||
value: undefined; | ||
} | { | ||
tag: "u64"; | ||
value: undefined; | ||
} | { | ||
tag: "u128"; | ||
value: undefined; | ||
} | { | ||
tag: "u256"; | ||
value: undefined; | ||
} | { | ||
tag: "i8"; | ||
value: undefined; | ||
} | { | ||
tag: "i16"; | ||
value: undefined; | ||
} | { | ||
tag: "i32"; | ||
value: undefined; | ||
} | { | ||
tag: "i64"; | ||
value: undefined; | ||
} | { | ||
tag: "i128"; | ||
value: undefined; | ||
} | { | ||
tag: "i256"; | ||
value: undefined; | ||
}; | ||
} | { | ||
tag: "compact"; | ||
value: number; | ||
} | { | ||
tag: "bitSequence"; | ||
value: { | ||
bitStoreType: number; | ||
bitOrderType: number; | ||
}; | ||
}; | ||
docs: string[]; | ||
}[]; | ||
pallets: { | ||
name: string; | ||
storage: { | ||
prefix: string; | ||
items: { | ||
name: string; | ||
modifier: number; | ||
type: { | ||
tag: "map"; | ||
value: { | ||
hashers: ({ | ||
tag: "Blake2128"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2256"; | ||
value: undefined; | ||
} | { | ||
tag: "Blake2128Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox128"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox256"; | ||
value: undefined; | ||
} | { | ||
tag: "Twox64Concat"; | ||
value: undefined; | ||
} | { | ||
tag: "Identity"; | ||
value: undefined; | ||
})[]; | ||
key: number; | ||
value: number; | ||
}; | ||
} | { | ||
tag: "plain"; | ||
value: number; | ||
}; | ||
fallback: HexString; | ||
docs: string[]; | ||
}[]; | ||
} | undefined; | ||
calls: number | undefined; | ||
events: number | undefined; | ||
constants: { | ||
name: string; | ||
type: number; | ||
value: HexString; | ||
docs: string[]; | ||
}[]; | ||
errors: number | undefined; | ||
index: number; | ||
docs: string[]; | ||
}[]; | ||
extrinsic: { | ||
version: number; | ||
address: number; | ||
call: number; | ||
signature: number; | ||
extra: number; | ||
signedExtensions: { | ||
identifier: string; | ||
type: number; | ||
additionalSigned: number; | ||
}[]; | ||
}; | ||
type: number; | ||
apis: { | ||
name: string; | ||
methods: { | ||
name: string; | ||
inputs: { | ||
name: string; | ||
type: number; | ||
}[]; | ||
output: number; | ||
docs: string[]; | ||
}[]; | ||
docs: string[]; | ||
}[]; | ||
outerEnums: { | ||
call: number; | ||
event: number; | ||
error: number; | ||
}; | ||
custom: [string, { | ||
type: number; | ||
value: HexString; | ||
}][]; | ||
}; | ||
}; | ||
}>; | ||
declare const Blake2256: (encoded: Uint8Array) => Uint8Array; | ||
@@ -792,2 +1163,2 @@ declare const Blake2128: (encoded: Uint8Array) => Uint8Array; | ||
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 }; | ||
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 V14, type V14Extrinsic, type V14Lookup, type V15, type V15Extrinsic, Variant, _Enum, bitSequence, blockHeader, char, compactBn, compactNumber, ethAccount, fixedStr, fromBufferToBase58, getSs58AddressInfo, h64, metadata, selfDecoder, selfEncoder, v14, v15 }; |
@@ -1,2 +0,2 @@ | ||
"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}}}; | ||
"use strict";var J=Object.defineProperty;var nt=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var ct=Object.prototype.hasOwnProperty;var st=(e,t,r)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var it=(e,t)=>{for(var r in t)J(e,r,{get:t[r],enumerable:!0})},at=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of ot(t))!ct.call(e,d)&&d!==r&&J(e,d,{get:()=>t[d],enumerable:!(a=nt(t,d))||a.enumerable});return e};var dt=e=>at(J({},"__esModule",{value:!0}),e);var Q=(e,t,r)=>(st(e,typeof t!="symbol"?t+"":t,r),r),Ue=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var B=(e,t,r)=>(Ue(e,t,"read from private field"),r?r.call(e):t.get(e)),Y=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Z=(e,t,r,a)=>(Ue(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r);var Qt={};it(Qt,{AccountId:()=>ut,Bin:()=>le,Binary:()=>W,Blake2128:()=>Qe,Blake2128Concat:()=>ke,Blake2256:()=>Gt,Bytes:()=>n.Bytes,Enum:()=>ge,FixedSizeBinary:()=>pe,Hex:()=>U,Identity:()=>Ae,Option:()=>n.Option,Result:()=>n.Result,Self:()=>St,Storage:()=>Jt,Struct:()=>n.Struct,Tuple:()=>n.Tuple,Twox128:()=>ie,Twox256:()=>zt,Twox64Concat:()=>Ce,Variant:()=>X,Vector:()=>n.Vector,_Enum:()=>kt,_void:()=>n._void,bitSequence:()=>Tt,blockHeader:()=>Vt,bool:()=>n.bool,char:()=>ht,compact:()=>n.compact,compactBn:()=>ft,compactNumber:()=>c,createCodec:()=>n.createCodec,createDecoder:()=>n.createDecoder,enhanceCodec:()=>n.enhanceCodec,enhanceDecoder:()=>n.enhanceDecoder,enhanceEncoder:()=>n.enhanceEncoder,ethAccount:()=>wt,fixedStr:()=>vt,fromBufferToBase58:()=>ue,getSs58AddressInfo:()=>ye,h64:()=>K,i128:()=>n.i128,i16:()=>n.i16,i256:()=>n.i256,i32:()=>n.i32,i64:()=>n.i64,i8:()=>n.i8,metadata:()=>ze,selfDecoder:()=>Ie,selfEncoder:()=>Le,str:()=>n.str,u128:()=>n.u128,u16:()=>n.u16,u256:()=>n.u256,u32:()=>n.u32,u64:()=>n.u64,u8:()=>n.u8,v14:()=>ve,v15:()=>Ee});module.exports=dt(Qt);var ee=require("scale-ts");var de=require("@scure/base"),me=require("@noble/hashes/blake2b"),Ve=new TextEncoder().encode("SS58PRE"),ae=2,ye=e=>{try{let t=de.base58.decode(e),r=t.subarray(0,t[0]&64?2:1),a=t.subarray(r.length,t.length-ae),d=t.subarray(r.length+a.length),T=(0,me.blake2b)(Uint8Array.of(...Ve,...r,...a),{dkLen:64}).subarray(0,ae);return d[0]===T[0]&&d[1]===T[1]?{isValid:!0,ss58Format:mt(r),publicKey:a.slice()}:{isValid:!1}}catch{return{isValid:!1}}},mt=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)},ue=e=>{let t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return r=>{let a=(0,me.blake2b)(Uint8Array.of(...Ve,...t,...r),{dkLen:64}).subarray(0,ae);return de.base58.encode(Uint8Array.of(...t,...r,...a))}};function yt(e,t){return r=>{let a=ye(r);if(!a.isValid)throw new Error("Invalid checksum");let{publicKey:d}=a;if(d.length!==e)throw new Error("Invalid public key length");return d}}var ut=(e=42,t=32)=>(0,ee.enhanceCodec)((0,ee.Bytes)(t),yt(t,e),ue(e));var j=require("scale-ts"),te=require("@polkadot-api/utils");var pt=new TextEncoder,lt=new TextDecoder,O,I,R,q=class q{constructor(t){Y(this,O,void 0);Y(this,I,null);Y(this,R,null);Q(this,"asText",()=>B(this,R)===null?Z(this,R,lt.decode(B(this,O))):B(this,R));Q(this,"asHex",()=>B(this,I)===null?Z(this,I,(0,te.toHex)(B(this,O))):B(this,I));Q(this,"asBytes",()=>B(this,O));Z(this,O,t)}static fromText(t){return new q(pt.encode(t))}static fromHex(t){return new q((0,te.fromHex)(t))}static fromBytes(t){return new q(t)}};O=new WeakMap,I=new WeakMap,R=new WeakMap;var W=q,pe=class e extends W{constructor(t){super(t)}static fromArray(t){return new e(new Uint8Array(t))}},Ke=e=>{let t=j.Bytes.enc(e);return r=>t(r.asBytes())},Be=e=>{let t=j.Bytes.dec(e);return r=>W.fromBytes(t(r))},le=e=>(0,j.createCodec)(Ke(e),Be(e));le.enc=Ke;le.dec=Be;var _=require("scale-ts");var fe=require("scale-ts"),c=fe.compact,ft=fe.compact;var xt=(0,_.createDecoder)(e=>{let t=c.dec(e),r=Math.ceil(t/8);return{bytes:(0,_.Bytes)(r).dec(e),bitsLen:t}}),gt=e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);let t=c.enc(e.bitsLen),r=new Uint8Array(e.bytes.length+t.length);return r.set(t,0),r.set(e.bytes,t.length),r},Tt=(0,_.createCodec)(gt,xt);var re=require("scale-ts"),ht=(0,re.enhanceCodec)(re.u8,e=>e.charCodeAt(0),String.fromCharCode);var ne=require("@polkadot-api/utils"),F=require("scale-ts"),De=e=>{let t=F.Bytes.enc(e);return r=>t((0,ne.fromHex)(r))},Oe=e=>{let t=F.Bytes.dec(e);return r=>(0,ne.toHex)(t(r))},U=e=>(0,F.createCodec)(De(e),Oe(e));U.enc=De;U.dec=Oe;var oe=require("scale-ts"),bt=new TextEncoder,Et=new TextDecoder,vt=e=>(0,oe.enhanceCodec)((0,oe.Bytes)(e),t=>bt.encode(t),t=>Et.decode(t));var n=require("scale-ts");var He=require("scale-ts"),Le=e=>{let t=r=>{let a=e();return t=a,a(r)};return r=>t(r)},Ie=e=>{let t=r=>{let a=e(),d=a;return t=a,d(r)};return r=>t(r)},St=e=>(0,He.createCodec)(Le(()=>e().enc),Ie(()=>e().dec));var G=require("scale-ts"),xe=require("@polkadot-api/utils"),kt=new Proxy({},{get(e,t){return r=>ge(t,r)}}),ge=(e,t)=>({as:r=>{if(r!==e)throw new Error(`Enum.as(${r}) used with actual type ${e}`);return t},is:r=>r===e,type:e,value:t}),Re=(...e)=>{let t=G.Enum.enc(...e);return r=>t({tag:r.type,value:r.value})},_e=(...e)=>{let t=G.Enum.dec(...e);return r=>{let{tag:a,value:d}=t(r);return ge(a,d)}},X=(e,...t)=>(0,G.createCodec)(Re((0,xe.mapObject)(e,([r])=>r),...t),_e((0,xe.mapObject)(e,([,r])=>r),...t));X.enc=Re;X.dec=_e;var N=require("@polkadot-api/utils"),P=require("scale-ts"),Pe=require("@noble/hashes/sha3"),Ne=e=>{let t=e.slice(2),r=(0,N.toHex)((0,Pe.keccak_256)(t)).slice(2),a=new Array(40);for(let d=0;d<40;d++){let T=parseInt(r[d],16),h=t[d];a[d]=T>7?h.toUpperCase():h}return`0x${a.join("")}`},At=(0,P.Bytes)(20)[1],wt=(0,P.createCodec)(e=>{let t=(0,N.fromHex)(e);if(t.length!==20)throw new Error(`Invalid length found on EthAddress(${e})`);let r=(0,N.toHex)(t);if(e===r||e===r.toUpperCase())return t;if(Ne(r)!==e)throw new Error(`Invalid checksum found on EthAddress(${e})`);return t},(0,P.createDecoder)(e=>Ne((0,N.toHex)(At(e)))));var Me=new TextEncoder,$e=new TextDecoder,Ct=(0,n.enhanceCodec)((0,n.Bytes)(4),Me.encode.bind(Me),$e.decode.bind($e)),Te=(0,n.Struct)({engine:Ct,payload:U()}),Ut=X({consensus:Te,seal:Te,preRuntime:Te,runtimeUpdated:n._void},[4,5,6,8]),he=U(32),Vt=(0,n.Struct)({parentHash:he,number:c,stateRoot:he,extrinsicRoot:he,digests:(0,n.Vector)(Ut)});var D=require("scale-ts");var p=require("scale-ts");var i=require("scale-ts");var ce=require("scale-ts"),A=(0,ce.Vector)(ce.str);var qe=(0,i.Option)(i.str),Kt=(0,i.Enum)({bool:i._void,char:i._void,str:i._void,u8:i._void,u16:i._void,u32:i._void,u64:i._void,u128:i._void,u256:i._void,i8:i._void,i16:i._void,i32:i._void,i64:i._void,i128:i._void,i256:i._void}),We=(0,i.Vector)((0,i.Struct)({name:qe,type:c,typeName:qe,docs:A})),Bt=(0,i.Struct)({len:i.u32,type:c}),Dt=(0,i.Struct)({bitStoreType:c,bitOrderType:c}),Ot=(0,i.Vector)((0,i.Struct)({name:i.str,fields:We,index:i.u8,docs:A})),Ht=(0,i.Enum)({composite:We,variant:Ot,sequence:c,array:Bt,tuple:(0,i.Vector)(c),primitive:Kt,compact:c,bitSequence:Dt}),Lt=(0,i.Struct)({name:i.str,type:(0,i.Option)(c)}),It=(0,i.Vector)(Lt),Rt=(0,i.Struct)({id:c,path:A,params:It,def:Ht,docs:A}),se=(0,i.Vector)(Rt);var m=require("scale-ts");var _t=(0,m.Enum)({Blake2128:m._void,Blake2256:m._void,Blake2128Concat:m._void,Twox128:m._void,Twox256:m._void,Twox64Concat:m._void,Identity:m._void}),Nt=(0,m.Vector)(_t),Pt=(0,m.Struct)({hashers:Nt,key:c,value:c}),Mt=(0,m.Struct)({name:m.str,modifier:m.u8,type:(0,m.Enum)({plain:c,map:Pt}),fallback:U(),docs:A}),$t=(0,m.Option)((0,m.Struct)({prefix:m.str,items:(0,m.Vector)(Mt)})),be={name:m.str,storage:$t,calls:(0,m.Option)(c),events:(0,m.Option)(c),constants:(0,m.Vector)((0,m.Struct)({name:m.str,type:c,value:U(),docs:A})),errors:(0,m.Option)(c),index:m.u8},je={...be,docs:A};var V=require("scale-ts");var Fe=(0,V.Struct)({name:V.str,methods:(0,V.Vector)((0,V.Struct)({name:V.str,inputs:(0,V.Vector)((0,V.Struct)({name:V.str,type:c})),output:c,docs:A})),docs:A});var qt=(0,p.Struct)({version:p.u8,address:c,call:c,signature:c,extra:c,signedExtensions:(0,p.Vector)((0,p.Struct)({identifier:p.str,type:c,additionalSigned:c}))}),Ee=(0,p.Struct)({lookup:se,pallets:(0,p.Vector)((0,p.Struct)(je)),extrinsic:qt,type:c,apis:(0,p.Vector)(Fe),outerEnums:(0,p.Struct)({call:c,event:c,error:c}),custom:(0,p.Vector)((0,p.Tuple)(p.str,(0,p.Struct)({type:c,value:U()})))});var E=require("scale-ts");var Wt=new Uint8Array,Ge=e=>(0,E.createCodec)(()=>Wt,()=>e),jt=(0,E.Struct)({type:c,version:E.u8,signedExtensions:(0,E.Vector)((0,E.Struct)({identifier:E.str,type:c,additionalSigned:c}))}),ve=(0,E.Struct)({lookup:se,pallets:(0,E.Vector)((0,E.Struct)({...be,docs:Ge([])})),extrinsic:jt,type:c,apis:Ge([])});var Xe=()=>{throw new Error("Unsupported metadata version!")},v=(0,D.createCodec)(Xe,Xe),ze=(0,D.Struct)({magicNumber:D.u32,metadata:(0,D.Enum)({v0:v,v1:v,v2:v,v3:v,v4:v,v5:v,v6:v,v7:v,v8:v,v9:v,v10:v,v11:v,v12:v,v13:v,v14:ve,v15:Ee})});var Je=require("@polkadot-api/utils"),Se=require("@noble/hashes/blake2b"),Ft={dkLen:32},Gt=e=>(0,Se.blake2b)(e,Ft),Xt={dkLen:16},Qe=e=>(0,Se.blake2b)(e,Xt),ke=e=>(0,Je.mergeUint8)(Qe(e),e);var Ae=e=>e;var et=require("@polkadot-api/utils"),tt=require("scale-ts");var H=(e,t,r,a)=>new DataView(new Uint16Array([e,t,r,a]).buffer).getBigUint64(0,!0),we=2n**64n-1n,g=(e,t)=>e<<t&we|e>>64n-t,y=(e,t)=>e*t&we,f=(e,t)=>e+t&we,x=11400714785074694791n,S=14029467366897019727n,Ye=1609587929392839161n,z=9650029242287828579n,Ze=2870177450012600261n;function K(e,t=0n){let r=f(f(t,x),S),a=f(t,S),d=t,T=t-x,h=e.length,w=0,L=null;(function(){let o=0,k=o+h;if(h){if(L=new Uint8Array(32),h<32){L.set(e.subarray(0,h),w),w+=h;return}if(o<=k-32){let $=k-32;do{let C;C=H(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=y(g(f(r,y(C,S)),31n),x),o+=8,C=H(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=y(g(f(a,y(C,S)),31n),x),o+=8,C=H(e[o+1]<<8|e[o],e[o+3]<<8|e[o+2],e[o+5]<<8|e[o+4],e[o+7]<<8|e[o+6]),d=y(g(f(d,y(C,S)),31n),x),o+=8,C=H(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=y(g(f(T,y(C,S)),31n),x),o+=8}while(o<=$)}o<k&&(L.set(e.subarray(o,k),w),w=k-o)}})(),e=L||e;let s,u=0;for(h>=32?(s=g(r,1n),s=f(s,g(a,7n)),s=f(s,g(d,12n)),s=f(s,g(T,18n)),r=y(g(y(r,S),31n),x),s=s^r,s=f(y(s,x),z),a=y(g(y(a,S),31n),x),s=s^a,s=f(y(s,x),z),d=y(g(y(d,S),31n),x),s=s^d,s=f(y(s,x),z),T=y(g(y(T,S),31n),x),s=s^T,s=f(y(s,x),z)):s=f(t,Ze),s=f(s,BigInt(h));u<=w-8;){let b=H(e[u+1]<<8|e[u],e[u+3]<<8|e[u+2],e[u+5]<<8|e[u+4],e[u+7]<<8|e[u+6]);b=y(g(y(b,S),31n),x),s=f(y(g(s^b,27n),x),z),u+=8}if(u+4<=w){let b=y(H(e[u+1]<<8|e[u],e[u+3]<<8|e[u+2],0,0),x);s=f(y(g(s^b,23n),S),Ye),u+=4}for(;u<w;){let b=y(H(e[u++],0,0,0),Ze);s=y(g(s^b,11n),x)}let l=s>>33n;return s=y(s^l,S),l=s>>29n,s=y(s^l,Ye),l=s>>32n,s^=l,s}var ie=e=>{let t=new Uint8Array(16),r=new DataView(t.buffer);return r.setBigUint64(0,K(e),!0),r.setBigUint64(8,K(e,1n),!0),t},zt=e=>{let t=new Uint8Array(32),r=new DataView(t.buffer);return r.setBigUint64(0,K(e),!0),r.setBigUint64(8,K(e,1n),!0),r.setBigUint64(16,K(e,2n),!0),r.setBigUint64(24,K(e,3n),!0),t},Ce=e=>(0,et.mergeUint8)(tt.u64.enc(K(e)),e);var M=require("@polkadot-api/utils");var rt=new TextEncoder,Jt=e=>{let t=ie(rt.encode(e));return(r,a,...d)=>{let T=(0,M.mergeUint8)(t,ie(rt.encode(r))),h=(0,M.toHex)(T),w=d.map(l=>l[1]).map(l=>l===Ae?0:l===Ce?8:l===ke?16:null).filter(Boolean),L=l=>{if(!l.startsWith(h))throw new Error(`key does not match this storage (${e}.${r})`);if(w.length!==d.length)throw new Error("Impossible to decode this key");if(d.length===0)return[];let b=l.slice(h.length),o=new Array(d.length);for(let k=0,$=0;k<w.length;k++){let C=d[k][0];$+=w[k],o[k]=C.dec(b.slice($*2)),$+=C.enc(o[k]).length}return o},s=d.map(([{enc:l},b])=>o=>b(l(o)));return{enc:(...l)=>(0,M.toHex)((0,M.mergeUint8)(T,...l.map((b,o)=>s[o](b)))),dec:a,keyDecoder:L}}}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@polkadot-api/substrate-bindings", | ||
"version": "0.1.0", | ||
"version": "0.2.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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
319910
4047
0