Allow salt in contract deploy (#2849)
* Allow salt in contract deploy * Mark deprecated * Shorten * Cleanups * Additional cleanups * Cleanups * Explicit Bytes to decodeEvent * Adjust method creation * Allow null salt
This commit is contained in:
@@ -30,132 +30,14 @@ export enum TypeDefInfo {
|
||||
Null
|
||||
}
|
||||
|
||||
export interface TypeDefExtEnumDiscriminant {
|
||||
discriminant: number;
|
||||
}
|
||||
|
||||
export interface TypeDefExtStructAlias {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface TypeDef {
|
||||
alias?: Map<string, string>;
|
||||
info: TypeDefInfo;
|
||||
index?: number;
|
||||
displayName?: string;
|
||||
ext?: TypeDefExtEnumDiscriminant; // add additional here as required
|
||||
length?: number;
|
||||
name?: string;
|
||||
namespace?: string;
|
||||
sub?: TypeDef | TypeDef[];
|
||||
type: string;
|
||||
}
|
||||
|
||||
export type TypeIndex = number;
|
||||
|
||||
export type StringIndex = number;
|
||||
|
||||
export enum MetaTypeInfo {
|
||||
BuiltinPlain,
|
||||
BuiltinTuple,
|
||||
BuiltinVec,
|
||||
BuiltinVecFixed,
|
||||
Enum,
|
||||
ClikeEnum,
|
||||
Struct,
|
||||
TupleStruct,
|
||||
Null,
|
||||
}
|
||||
|
||||
export type MetaTypeIdPrimitive = string;
|
||||
|
||||
export type MetaTypeIdTuple = TypeIndex[];
|
||||
|
||||
export interface MetaTypeIdCustom {
|
||||
'custom.name': StringIndex;
|
||||
'custom.namespace'?: StringIndex[];
|
||||
'custom.params'?: TypeIndex[];
|
||||
}
|
||||
|
||||
export interface MetaTypeIdVec {
|
||||
'slice.type': TypeIndex;
|
||||
}
|
||||
|
||||
export interface MetaTypeIdVecFixed {
|
||||
'array.len': number;
|
||||
'array.type': TypeIndex;
|
||||
}
|
||||
|
||||
export type MetaTypeId = MetaTypeIdPrimitive | MetaTypeIdTuple | MetaTypeIdVec | MetaTypeIdVecFixed | MetaTypeIdCustom;
|
||||
// MetaTypeIdPrimitive | MetaTypeIdTuple | MetaTypeIdArray | MetaTypeIdCustom;
|
||||
// export type MetaTypeId = Record<string, any>;
|
||||
|
||||
export interface MetaTypeDefClikeEnumVariant {
|
||||
name: StringIndex;
|
||||
discriminant: number;
|
||||
}
|
||||
|
||||
export interface MetaTypeDefClikeEnum {
|
||||
'clike_enum.variants': MetaTypeDefClikeEnumVariant[];
|
||||
}
|
||||
|
||||
export type MetaTypeDefBuiltIn = 'builtin';
|
||||
|
||||
export interface MetaTypeDefEnumVariantUnit {
|
||||
'unit_variant.name': StringIndex;
|
||||
}
|
||||
|
||||
export interface MetaTypeDefEnumVariantTupleStruct {
|
||||
'tuple_struct_variant.name': StringIndex;
|
||||
'tuple_struct_variant.types': TypeIndex[];
|
||||
}
|
||||
|
||||
export interface MetaTypeDefStructField {
|
||||
name: StringIndex;
|
||||
type: TypeIndex;
|
||||
}
|
||||
|
||||
export interface MetaTypeDefEnumVariantStruct {
|
||||
'struct_variant.name': StringIndex;
|
||||
'struct_variant.fields': MetaTypeDefStructField[];
|
||||
}
|
||||
|
||||
export type MetaTypeDefEnumVariant = MetaTypeDefEnumVariantUnit | MetaTypeDefEnumVariantTupleStruct | MetaTypeDefEnumVariantStruct;
|
||||
|
||||
export interface MetaTypeDefEnum {
|
||||
'enum.variants': MetaTypeDefEnumVariant[];
|
||||
}
|
||||
|
||||
export type MetaTypeDefUnionField = MetaTypeDefStructField;
|
||||
|
||||
export interface MetaTypeDefStruct {
|
||||
'struct.fields': MetaTypeDefStructField[];
|
||||
}
|
||||
|
||||
export interface MetaTypeDefTupleStruct {
|
||||
'tuple_struct.types': TypeIndex[];
|
||||
}
|
||||
|
||||
export interface MetaTypeDefUnion {
|
||||
'union.fields': MetaTypeDefUnionField[];
|
||||
}
|
||||
|
||||
export type MetaTypeDef = MetaTypeDefBuiltIn | MetaTypeDefClikeEnum | MetaTypeDefEnum | MetaTypeDefStruct | MetaTypeDefTupleStruct | MetaTypeDefUnion;
|
||||
|
||||
export interface MetaType {
|
||||
def: MetaTypeDef;
|
||||
id: MetaTypeId | null;
|
||||
}
|
||||
|
||||
export enum MetaRegistryItem {
|
||||
String,
|
||||
Type,
|
||||
TypeDef
|
||||
}
|
||||
|
||||
export interface MetaRegistryJson {
|
||||
registry: {
|
||||
strings: string[];
|
||||
types: MetaType[];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export interface Codec {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
export type CodecArg = Codec | BN | boolean | string | Uint8Array | boolean | number | string | undefined | CodecArgArray | { [index: string]: CodecArg };
|
||||
export type CodecArg = Codec | BigInt | BN | boolean | string | Uint8Array | boolean | number | string | undefined | CodecArgArray | { [index: string]: CodecArg };
|
||||
|
||||
// We cannot inline this into CodecArg, TS throws up when building docs
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
|
||||
Reference in New Issue
Block a user