@polkadot-api/substrate-bindings 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1088,61 +1088,4 @@ declare const Storage: (pallet: string) => <T, A extends EncoderWithHash<any>[]>
1088
1088
  keyDecoder: (value: string) => { [K_1 in keyof A]: A[K_1] extends EncoderWithHash<infer V_1> ? V_1 : unknown; };
1089
1089
  };
1090
1090
 
1091
- type PlainDescriptor<T> = number & {
1092
- _type?: T;
1093
- };
1094
- type AssetDescriptor<T> = string & {
1095
- _type?: T;
1096
- };
1097
- type StorageDescriptor<Args extends Array<any>, T, Optional extends true | false> = number & {
1098
- _type: T;
1099
- _args: Args;
1100
- _optional: Optional;
1101
- };
1102
- type TxDescriptor<Args extends {} | undefined> = number & {
1103
- ___: Args;
1104
- };
1105
- type RuntimeDescriptor<Args extends Array<any>, T> = number & {
1106
- __: [Args, T];
1107
- };
1108
- type Descriptors = {
1109
- pallets: Record<string, [
1110
- Record<string, StorageDescriptor<any, any, any>>,
1111
- Record<string, TxDescriptor<any>>,
1112
- Record<string, PlainDescriptor<any>>,
1113
- Record<string, PlainDescriptor<any>>,
1114
- Record<string, PlainDescriptor<any>>
1115
- ]>;
1116
- apis: Record<string, Record<string, RuntimeDescriptor<any, any>>>;
1117
- asset: AssetDescriptor<any>;
1118
- checksums: Promise<string[]>;
1119
- };
1120
- type PickDescriptors<Idx extends 0 | 1 | 2 | 3 | 4, T extends Descriptors["pallets"]> = {
1121
- [K in keyof T]: T[K][Idx];
1122
- };
1123
- type ExtractStorage<T extends Record<string, Record<string, StorageDescriptor<any, any, any>>>> = {
1124
- [K in keyof T]: {
1125
- [KK in keyof T[K]]: T[K][KK] extends StorageDescriptor<infer Key, infer Value, infer Optional> ? {
1126
- KeyArgs: Key;
1127
- Value: Value;
1128
- IsOptional: Optional;
1129
- } : unknown;
1130
- };
1131
- };
1132
- type ExtractTx<T extends Record<string, Record<string, TxDescriptor<any>>>> = {
1133
- [K in keyof T]: {
1134
- [KK in keyof T[K]]: T[K][KK] extends TxDescriptor<infer Args> ? Args : unknown;
1135
- };
1136
- };
1137
- type ExtractPlain<T extends Record<string, Record<string, PlainDescriptor<any>>>> = {
1138
- [K in keyof T]: {
1139
- [KK in keyof T[K]]: T[K][KK] extends PlainDescriptor<infer Value> ? Value : unknown;
1140
- };
1141
- };
1142
- type QueryFromDescriptors<T extends Descriptors> = ExtractStorage<PickDescriptors<0, T["pallets"]>>;
1143
- type TxFromDescriptors<T extends Descriptors> = ExtractTx<PickDescriptors<1, T["pallets"]>>;
1144
- type EventsFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<2, T["pallets"]>>;
1145
- type ErrorsFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<3, T["pallets"]>>;
1146
- type ConstFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<4, T["pallets"]>>;
1147
-
1148
- export { AccountId, type AssetDescriptor, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type EncoderWithHash, Enum, type EnumVariant, 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 };
1091
+ export { AccountId, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type EncoderWithHash, Enum, type EnumVariant, type ExtractEnumValue, FixedSizeBinary, type GetEnum, Hex, type HexString, Identity, type SS58AddressInfo, type SS58String, Self, Storage, Twox128, Twox256, Twox64Concat, 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 };
package/dist/index.d.ts CHANGED
@@ -1088,61 +1088,4 @@ declare const Storage: (pallet: string) => <T, A extends EncoderWithHash<any>[]>
1088
1088
  keyDecoder: (value: string) => { [K_1 in keyof A]: A[K_1] extends EncoderWithHash<infer V_1> ? V_1 : unknown; };
1089
1089
  };
1090
1090
 
1091
- type PlainDescriptor<T> = number & {
1092
- _type?: T;
1093
- };
1094
- type AssetDescriptor<T> = string & {
1095
- _type?: T;
1096
- };
1097
- type StorageDescriptor<Args extends Array<any>, T, Optional extends true | false> = number & {
1098
- _type: T;
1099
- _args: Args;
1100
- _optional: Optional;
1101
- };
1102
- type TxDescriptor<Args extends {} | undefined> = number & {
1103
- ___: Args;
1104
- };
1105
- type RuntimeDescriptor<Args extends Array<any>, T> = number & {
1106
- __: [Args, T];
1107
- };
1108
- type Descriptors = {
1109
- pallets: Record<string, [
1110
- Record<string, StorageDescriptor<any, any, any>>,
1111
- Record<string, TxDescriptor<any>>,
1112
- Record<string, PlainDescriptor<any>>,
1113
- Record<string, PlainDescriptor<any>>,
1114
- Record<string, PlainDescriptor<any>>
1115
- ]>;
1116
- apis: Record<string, Record<string, RuntimeDescriptor<any, any>>>;
1117
- asset: AssetDescriptor<any>;
1118
- checksums: Promise<string[]>;
1119
- };
1120
- type PickDescriptors<Idx extends 0 | 1 | 2 | 3 | 4, T extends Descriptors["pallets"]> = {
1121
- [K in keyof T]: T[K][Idx];
1122
- };
1123
- type ExtractStorage<T extends Record<string, Record<string, StorageDescriptor<any, any, any>>>> = {
1124
- [K in keyof T]: {
1125
- [KK in keyof T[K]]: T[K][KK] extends StorageDescriptor<infer Key, infer Value, infer Optional> ? {
1126
- KeyArgs: Key;
1127
- Value: Value;
1128
- IsOptional: Optional;
1129
- } : unknown;
1130
- };
1131
- };
1132
- type ExtractTx<T extends Record<string, Record<string, TxDescriptor<any>>>> = {
1133
- [K in keyof T]: {
1134
- [KK in keyof T[K]]: T[K][KK] extends TxDescriptor<infer Args> ? Args : unknown;
1135
- };
1136
- };
1137
- type ExtractPlain<T extends Record<string, Record<string, PlainDescriptor<any>>>> = {
1138
- [K in keyof T]: {
1139
- [KK in keyof T[K]]: T[K][KK] extends PlainDescriptor<infer Value> ? Value : unknown;
1140
- };
1141
- };
1142
- type QueryFromDescriptors<T extends Descriptors> = ExtractStorage<PickDescriptors<0, T["pallets"]>>;
1143
- type TxFromDescriptors<T extends Descriptors> = ExtractTx<PickDescriptors<1, T["pallets"]>>;
1144
- type EventsFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<2, T["pallets"]>>;
1145
- type ErrorsFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<3, T["pallets"]>>;
1146
- type ConstFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<4, T["pallets"]>>;
1147
-
1148
- export { AccountId, type AssetDescriptor, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type EncoderWithHash, Enum, type EnumVariant, 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 };
1091
+ export { AccountId, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type EncoderWithHash, Enum, type EnumVariant, type ExtractEnumValue, FixedSizeBinary, type GetEnum, Hex, type HexString, Identity, type SS58AddressInfo, type SS58String, Self, Storage, Twox128, Twox256, Twox64Concat, 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 };
@@ -1088,61 +1088,4 @@ declare const Storage: (pallet: string) => <T, A extends EncoderWithHash<any>[]>
1088
1088
  keyDecoder: (value: string) => { [K_1 in keyof A]: A[K_1] extends EncoderWithHash<infer V_1> ? V_1 : unknown; };
1089
1089
  };
1090
1090
 
1091
- type PlainDescriptor<T> = number & {
1092
- _type?: T;
1093
- };
1094
- type AssetDescriptor<T> = string & {
1095
- _type?: T;
1096
- };
1097
- type StorageDescriptor<Args extends Array<any>, T, Optional extends true | false> = number & {
1098
- _type: T;
1099
- _args: Args;
1100
- _optional: Optional;
1101
- };
1102
- type TxDescriptor<Args extends {} | undefined> = number & {
1103
- ___: Args;
1104
- };
1105
- type RuntimeDescriptor<Args extends Array<any>, T> = number & {
1106
- __: [Args, T];
1107
- };
1108
- type Descriptors = {
1109
- pallets: Record<string, [
1110
- Record<string, StorageDescriptor<any, any, any>>,
1111
- Record<string, TxDescriptor<any>>,
1112
- Record<string, PlainDescriptor<any>>,
1113
- Record<string, PlainDescriptor<any>>,
1114
- Record<string, PlainDescriptor<any>>
1115
- ]>;
1116
- apis: Record<string, Record<string, RuntimeDescriptor<any, any>>>;
1117
- asset: AssetDescriptor<any>;
1118
- checksums: Promise<string[]>;
1119
- };
1120
- type PickDescriptors<Idx extends 0 | 1 | 2 | 3 | 4, T extends Descriptors["pallets"]> = {
1121
- [K in keyof T]: T[K][Idx];
1122
- };
1123
- type ExtractStorage<T extends Record<string, Record<string, StorageDescriptor<any, any, any>>>> = {
1124
- [K in keyof T]: {
1125
- [KK in keyof T[K]]: T[K][KK] extends StorageDescriptor<infer Key, infer Value, infer Optional> ? {
1126
- KeyArgs: Key;
1127
- Value: Value;
1128
- IsOptional: Optional;
1129
- } : unknown;
1130
- };
1131
- };
1132
- type ExtractTx<T extends Record<string, Record<string, TxDescriptor<any>>>> = {
1133
- [K in keyof T]: {
1134
- [KK in keyof T[K]]: T[K][KK] extends TxDescriptor<infer Args> ? Args : unknown;
1135
- };
1136
- };
1137
- type ExtractPlain<T extends Record<string, Record<string, PlainDescriptor<any>>>> = {
1138
- [K in keyof T]: {
1139
- [KK in keyof T[K]]: T[K][KK] extends PlainDescriptor<infer Value> ? Value : unknown;
1140
- };
1141
- };
1142
- type QueryFromDescriptors<T extends Descriptors> = ExtractStorage<PickDescriptors<0, T["pallets"]>>;
1143
- type TxFromDescriptors<T extends Descriptors> = ExtractTx<PickDescriptors<1, T["pallets"]>>;
1144
- type EventsFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<2, T["pallets"]>>;
1145
- type ErrorsFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<3, T["pallets"]>>;
1146
- type ConstFromDescriptors<T extends Descriptors> = ExtractPlain<PickDescriptors<4, T["pallets"]>>;
1147
-
1148
- export { AccountId, type AssetDescriptor, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type ConstFromDescriptors, type Descriptors, type EncoderWithHash, Enum, type EnumVariant, 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 };
1091
+ export { AccountId, Bin, Binary, type BitSequence, Blake2128, Blake2128Concat, Blake2256, type BlockHeader, type EncoderWithHash, Enum, type EnumVariant, type ExtractEnumValue, FixedSizeBinary, type GetEnum, Hex, type HexString, Identity, type SS58AddressInfo, type SS58String, Self, Storage, Twox128, Twox256, Twox64Concat, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polkadot-api/substrate-bindings",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "author": "Josep M Sobrepere (https://github.com/josepot)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,16 +34,11 @@
34
34
  "files": [
35
35
  "dist"
36
36
  ],
37
- "prettier": {
38
- "printWidth": 80,
39
- "semi": false,
40
- "trailingComma": "all"
41
- },
42
37
  "dependencies": {
43
38
  "@noble/hashes": "^1.3.1",
44
39
  "@scure/base": "^1.1.1",
45
40
  "scale-ts": "^1.6.0",
46
- "@polkadot-api/utils": "0.0.1"
41
+ "@polkadot-api/utils": "0.1.0"
47
42
  },
48
43
  "devDependencies": {
49
44
  "bigint-conversion": "^2.4.1",