Codec registry for portable types from metadata

Hierarchy (view full)

Constructors

  • Parameters

    • metadata: {
          apis: {
              docs: string[];
              methods: {
                  docs: string[];
                  inputs: {
                      name: string;
                      typeId: number;
                  }[];
                  name: string;
                  output: number;
              }[];
              name: string;
          }[];
          custom: {
              map: ReadonlyMap<string, {
                  typeId: number;
                  value: `0x${string}`;
              }>;
          };
          extrinsic: {
              addressTypeId: number;
              callTypeId: number;
              extraTypeId: number;
              signatureTypeId: number;
              signedExtensions: {
                  additionalSigned: number;
                  ident: string;
                  typeId: number;
              }[];
              version: number;
          };
          outerEnums: {
              callEnumTypeId: number;
              errorEnumTypeId: number;
              eventEnumTypeId: number;
          };
          pallets: {
              calls: undefined | number;
              constants: {
                  docs: string[];
                  name: string;
                  typeId: number;
                  value: `0x${string}`;
              }[];
              docs: string[];
              error: undefined | number;
              event: undefined | number;
              index: number;
              name: string;
              storage: undefined | {
                  entries: {
                      default: `0x${string}`;
                      docs: string[];
                      modifier: string;
                      name: string;
                      storageType: {
                          type: "Plain";
                          value: {
                              valueTypeId: number;
                          };
                      } | {
                          type: "Map";
                          value: {
                              hashers: (...)[];
                              keyTypeId: number;
                              valueTypeId: number;
                          };
                      };
                  }[];
                  prefix: string;
              };
          }[];
          runtimeType: number;
          types: {
              docs: string[];
              id: number;
              params: {
                  name: string;
                  typeId: undefined | number;
              }[];
              path: string[];
              typeDef:
                  | {
                      type: "Struct";
                      value: {
                          fields: Field[];
                      };
                  }
                  | {
                      type: "Enum";
                      value: {
                          members: {
                              docs: string[];
                              fields: Field[];
                              index: number;
                              name: string;
                          }[];
                      };
                  }
                  | {
                      type: "Sequence";
                      value: {
                          typeParam: number;
                      };
                  }
                  | {
                      type: "SizedVec";
                      value: {
                          len: number;
                          typeParam: number;
                      };
                  }
                  | {
                      type: "Tuple";
                      value: {
                          fields: number[];
                      };
                  }
                  | {
                      type: "Primitive";
                      value: {
                          kind:
                              | "bool"
                              | "char"
                              | "str"
                              | "u8"
                              | "u16"
                              | "u32"
                              | "u64"
                              | "u128"
                              | "u256"
                              | "i8"
                              | "i16"
                              | "i32"
                              | "i64"
                              | "i128"
                              | "i256";
                      };
                  }
                  | {
                      type: "Compact";
                      value: {
                          typeParam: number;
                      };
                  }
                  | {
                      type: "BitSequence";
                      value: {
                          bitOrderType: number;
                          bitStoreType: number;
                      };
                  };
          }[];
      }
      • apis: {
            docs: string[];
            methods: {
                docs: string[];
                inputs: {
                    name: string;
                    typeId: number;
                }[];
                name: string;
                output: number;
            }[];
            name: string;
        }[]
      • custom: {
            map: ReadonlyMap<string, {
                typeId: number;
                value: `0x${string}`;
            }>;
        }
        • map: ReadonlyMap<string, {
              typeId: number;
              value: `0x${string}`;
          }>
      • extrinsic: {
            addressTypeId: number;
            callTypeId: number;
            extraTypeId: number;
            signatureTypeId: number;
            signedExtensions: {
                additionalSigned: number;
                ident: string;
                typeId: number;
            }[];
            version: number;
        }
        • addressTypeId: number
        • callTypeId: number
        • extraTypeId: number
        • signatureTypeId: number
        • signedExtensions: {
              additionalSigned: number;
              ident: string;
              typeId: number;
          }[]
        • version: number
      • outerEnums: {
            callEnumTypeId: number;
            errorEnumTypeId: number;
            eventEnumTypeId: number;
        }
        • callEnumTypeId: number
        • errorEnumTypeId: number
        • eventEnumTypeId: number
      • pallets: {
            calls: undefined | number;
            constants: {
                docs: string[];
                name: string;
                typeId: number;
                value: `0x${string}`;
            }[];
            docs: string[];
            error: undefined | number;
            event: undefined | number;
            index: number;
            name: string;
            storage: undefined | {
                entries: {
                    default: `0x${string}`;
                    docs: string[];
                    modifier: string;
                    name: string;
                    storageType: {
                        type: "Plain";
                        value: {
                            valueTypeId: number;
                        };
                    } | {
                        type: "Map";
                        value: {
                            hashers: (...)[];
                            keyTypeId: number;
                            valueTypeId: number;
                        };
                    };
                }[];
                prefix: string;
            };
        }[]
      • runtimeType: number
      • types: {
            docs: string[];
            id: number;
            params: {
                name: string;
                typeId: undefined | number;
            }[];
            path: string[];
            typeDef:
                | {
                    type: "Struct";
                    value: {
                        fields: Field[];
                    };
                }
                | {
                    type: "Enum";
                    value: {
                        members: {
                            docs: string[];
                            fields: Field[];
                            index: number;
                            name: string;
                        }[];
                    };
                }
                | {
                    type: "Sequence";
                    value: {
                        typeParam: number;
                    };
                }
                | {
                    type: "SizedVec";
                    value: {
                        len: number;
                        typeParam: number;
                    };
                }
                | {
                    type: "Tuple";
                    value: {
                        fields: number[];
                    };
                }
                | {
                    type: "Primitive";
                    value: {
                        kind:
                            | "bool"
                            | "char"
                            | "str"
                            | "u8"
                            | "u16"
                            | "u32"
                            | "u64"
                            | "u128"
                            | "u256"
                            | "i8"
                            | "i16"
                            | "i32"
                            | "i64"
                            | "i128"
                            | "i256";
                    };
                }
                | {
                    type: "Compact";
                    value: {
                        typeParam: number;
                    };
                }
                | {
                    type: "BitSequence";
                    value: {
                        bitOrderType: number;
                        bitStoreType: number;
                    };
                };
        }[]
    • Optionalhasher: HashFn

    Returns PortableRegistry

Properties

types: Record<number, {
    docs: string[];
    id: number;
    params: {
        name: string;
        typeId: undefined | number;
    }[];
    path: string[];
    typeDef:
        | {
            type: "Struct";
            value: {
                fields: Field[];
            };
        }
        | {
            type: "Enum";
            value: {
                members: {
                    docs: string[];
                    fields: Field[];
                    index: number;
                    name: string;
                }[];
            };
        }
        | {
            type: "Sequence";
            value: {
                typeParam: number;
            };
        }
        | {
            type: "SizedVec";
            value: {
                len: number;
                typeParam: number;
            };
        }
        | {
            type: "Tuple";
            value: {
                fields: number[];
            };
        }
        | {
            type: "Primitive";
            value: {
                kind:
                    | "bool"
                    | "char"
                    | "str"
                    | "u8"
                    | "u16"
                    | "u32"
                    | "u64"
                    | "u128"
                    | "u256"
                    | "i8"
                    | "i16"
                    | "i32"
                    | "i64"
                    | "i128"
                    | "i256";
            };
        }
        | {
            type: "Compact";
            value: {
                typeParam: number;
            };
        }
        | {
            type: "BitSequence";
            value: {
                bitOrderType: number;
                bitStoreType: number;
            };
        };
}>

Accessors

  • get metadata(): {
        apis: {
            docs: string[];
            methods: {
                docs: string[];
                inputs: {
                    name: string;
                    typeId: number;
                }[];
                name: string;
                output: number;
            }[];
            name: string;
        }[];
        custom: {
            map: ReadonlyMap<string, {
                typeId: number;
                value: `0x${string}`;
            }>;
        };
        extrinsic: {
            addressTypeId: number;
            callTypeId: number;
            extraTypeId: number;
            signatureTypeId: number;
            signedExtensions: {
                additionalSigned: number;
                ident: string;
                typeId: number;
            }[];
            version: number;
        };
        outerEnums: {
            callEnumTypeId: number;
            errorEnumTypeId: number;
            eventEnumTypeId: number;
        };
        pallets: {
            calls: undefined | number;
            constants: {
                docs: string[];
                name: string;
                typeId: number;
                value: `0x${string}`;
            }[];
            docs: string[];
            error: undefined | number;
            event: undefined | number;
            index: number;
            name: string;
            storage: undefined | {
                entries: {
                    default: `0x${string}`;
                    docs: string[];
                    modifier: string;
                    name: string;
                    storageType: {
                        type: "Plain";
                        value: {
                            valueTypeId: number;
                        };
                    } | {
                        type: "Map";
                        value: {
                            hashers: (...)[];
                            keyTypeId: number;
                            valueTypeId: number;
                        };
                    };
                }[];
                prefix: string;
            };
        }[];
        runtimeType: number;
        types: {
            docs: string[];
            id: number;
            params: {
                name: string;
                typeId: undefined | number;
            }[];
            path: string[];
            typeDef:
                | {
                    type: "Struct";
                    value: {
                        fields: Field[];
                    };
                }
                | {
                    type: "Enum";
                    value: {
                        members: {
                            docs: string[];
                            fields: Field[];
                            index: number;
                            name: string;
                        }[];
                    };
                }
                | {
                    type: "Sequence";
                    value: {
                        typeParam: number;
                    };
                }
                | {
                    type: "SizedVec";
                    value: {
                        len: number;
                        typeParam: number;
                    };
                }
                | {
                    type: "Tuple";
                    value: {
                        fields: number[];
                    };
                }
                | {
                    type: "Primitive";
                    value: {
                        kind:
                            | "bool"
                            | "char"
                            | "str"
                            | "u8"
                            | "u16"
                            | "u32"
                            | "u64"
                            | "u128"
                            | "u256"
                            | "i8"
                            | "i16"
                            | "i32"
                            | "i64"
                            | "i128"
                            | "i256";
                    };
                }
                | {
                    type: "Compact";
                    value: {
                        typeParam: number;
                    };
                }
                | {
                    type: "BitSequence";
                    value: {
                        bitOrderType: number;
                        bitStoreType: number;
                    };
                };
        }[];
    }
  • Returns {
        apis: {
            docs: string[];
            methods: {
                docs: string[];
                inputs: {
                    name: string;
                    typeId: number;
                }[];
                name: string;
                output: number;
            }[];
            name: string;
        }[];
        custom: {
            map: ReadonlyMap<string, {
                typeId: number;
                value: `0x${string}`;
            }>;
        };
        extrinsic: {
            addressTypeId: number;
            callTypeId: number;
            extraTypeId: number;
            signatureTypeId: number;
            signedExtensions: {
                additionalSigned: number;
                ident: string;
                typeId: number;
            }[];
            version: number;
        };
        outerEnums: {
            callEnumTypeId: number;
            errorEnumTypeId: number;
            eventEnumTypeId: number;
        };
        pallets: {
            calls: undefined | number;
            constants: {
                docs: string[];
                name: string;
                typeId: number;
                value: `0x${string}`;
            }[];
            docs: string[];
            error: undefined | number;
            event: undefined | number;
            index: number;
            name: string;
            storage: undefined | {
                entries: {
                    default: `0x${string}`;
                    docs: string[];
                    modifier: string;
                    name: string;
                    storageType: {
                        type: "Plain";
                        value: {
                            valueTypeId: number;
                        };
                    } | {
                        type: "Map";
                        value: {
                            hashers: (...)[];
                            keyTypeId: number;
                            valueTypeId: number;
                        };
                    };
                }[];
                prefix: string;
            };
        }[];
        runtimeType: number;
        types: {
            docs: string[];
            id: number;
            params: {
                name: string;
                typeId: undefined | number;
            }[];
            path: string[];
            typeDef:
                | {
                    type: "Struct";
                    value: {
                        fields: Field[];
                    };
                }
                | {
                    type: "Enum";
                    value: {
                        members: {
                            docs: string[];
                            fields: Field[];
                            index: number;
                            name: string;
                        }[];
                    };
                }
                | {
                    type: "Sequence";
                    value: {
                        typeParam: number;
                    };
                }
                | {
                    type: "SizedVec";
                    value: {
                        len: number;
                        typeParam: number;
                    };
                }
                | {
                    type: "Tuple";
                    value: {
                        fields: number[];
                    };
                }
                | {
                    type: "Primitive";
                    value: {
                        kind:
                            | "bool"
                            | "char"
                            | "str"
                            | "u8"
                            | "u16"
                            | "u32"
                            | "u64"
                            | "u128"
                            | "u256"
                            | "i8"
                            | "i16"
                            | "i32"
                            | "i64"
                            | "i128"
                            | "i256";
                    };
                }
                | {
                    type: "Compact";
                    value: {
                        typeParam: number;
                    };
                }
                | {
                    type: "BitSequence";
                    value: {
                        bitOrderType: number;
                        bitStoreType: number;
                    };
                };
        }[];
    }

    • apis: {
          docs: string[];
          methods: {
              docs: string[];
              inputs: {
                  name: string;
                  typeId: number;
              }[];
              name: string;
              output: number;
          }[];
          name: string;
      }[]
    • custom: {
          map: ReadonlyMap<string, {
              typeId: number;
              value: `0x${string}`;
          }>;
      }
      • map: ReadonlyMap<string, {
            typeId: number;
            value: `0x${string}`;
        }>
    • extrinsic: {
          addressTypeId: number;
          callTypeId: number;
          extraTypeId: number;
          signatureTypeId: number;
          signedExtensions: {
              additionalSigned: number;
              ident: string;
              typeId: number;
          }[];
          version: number;
      }
      • addressTypeId: number
      • callTypeId: number
      • extraTypeId: number
      • signatureTypeId: number
      • signedExtensions: {
            additionalSigned: number;
            ident: string;
            typeId: number;
        }[]
      • version: number
    • outerEnums: {
          callEnumTypeId: number;
          errorEnumTypeId: number;
          eventEnumTypeId: number;
      }
      • callEnumTypeId: number
      • errorEnumTypeId: number
      • eventEnumTypeId: number
    • pallets: {
          calls: undefined | number;
          constants: {
              docs: string[];
              name: string;
              typeId: number;
              value: `0x${string}`;
          }[];
          docs: string[];
          error: undefined | number;
          event: undefined | number;
          index: number;
          name: string;
          storage: undefined | {
              entries: {
                  default: `0x${string}`;
                  docs: string[];
                  modifier: string;
                  name: string;
                  storageType: {
                      type: "Plain";
                      value: {
                          valueTypeId: number;
                      };
                  } | {
                      type: "Map";
                      value: {
                          hashers: (...)[];
                          keyTypeId: number;
                          valueTypeId: number;
                      };
                  };
              }[];
              prefix: string;
          };
      }[]
    • runtimeType: number
    • types: {
          docs: string[];
          id: number;
          params: {
              name: string;
              typeId: undefined | number;
          }[];
          path: string[];
          typeDef:
              | {
                  type: "Struct";
                  value: {
                      fields: Field[];
                  };
              }
              | {
                  type: "Enum";
                  value: {
                      members: {
                          docs: string[];
                          fields: Field[];
                          index: number;
                          name: string;
                      }[];
                  };
              }
              | {
                  type: "Sequence";
                  value: {
                      typeParam: number;
                  };
              }
              | {
                  type: "SizedVec";
                  value: {
                      len: number;
                      typeParam: number;
                  };
              }
              | {
                  type: "Tuple";
                  value: {
                      fields: number[];
                  };
              }
              | {
                  type: "Primitive";
                  value: {
                      kind:
                          | "bool"
                          | "char"
                          | "str"
                          | "u8"
                          | "u16"
                          | "u32"
                          | "u64"
                          | "u128"
                          | "u256"
                          | "i8"
                          | "i16"
                          | "i32"
                          | "i64"
                          | "i128"
                          | "i256";
                  };
              }
              | {
                  type: "Compact";
                  value: {
                      typeParam: number;
                  };
              }
              | {
                  type: "BitSequence";
                  value: {
                      bitOrderType: number;
                      bitStoreType: number;
                  };
              };
      }[]

Methods

  • Parameters

    • errorInfo:
          | {
              type: "CannotLookup";
          }
          | {
              error: `0x${string}`;
              index: number;
          }
          | {
              type: "Other";
          }
          | {
              type: "BadOrigin";
          }
          | {
              type: "Module";
              value: {
                  error: `0x${string}`;
                  index: number;
              };
          }
          | {
              type: "ConsumerRemaining";
          }
          | {
              type: "NoProviders";
          }
          | {
              type: "TooManyConsumers";
          }
          | {
              type: "Token";
              value:
                  | "FundsUnavailable"
                  | "OnlyProvider"
                  | "BelowMinimum"
                  | "CannotCreate"
                  | "UnknownAsset"
                  | "Frozen"
                  | "Unsupported"
                  | "CannotCreateHold"
                  | "NotExpendable"
                  | "Blocked";
          }
          | {
              type: "Arithmetic";
              value: "Underflow" | "Overflow" | "DivisionByZero";
          }
          | {
              type: "Transactional";
              value: "LimitReached" | "NoLayer";
          }
          | {
              type: "Exhausted";
          }
          | {
              type: "Corruption";
          }
          | {
              type: "Unavailable";
          }
          | {
              type: "RootNotAllowed";
          }

    Returns undefined | PalletErrorMetadataLatest

  • Parameters

    • typeId: number

    Returns {
        docs: string[];
        id: number;
        params: {
            name: string;
            typeId: undefined | number;
        }[];
        path: string[];
        typeDef:
            | {
                type: "Struct";
                value: {
                    fields: Field[];
                };
            }
            | {
                type: "Enum";
                value: {
                    members: {
                        docs: string[];
                        fields: Field[];
                        index: number;
                        name: string;
                    }[];
                };
            }
            | {
                type: "Sequence";
                value: {
                    typeParam: number;
                };
            }
            | {
                type: "SizedVec";
                value: {
                    len: number;
                    typeParam: number;
                };
            }
            | {
                type: "Tuple";
                value: {
                    fields: number[];
                };
            }
            | {
                type: "Primitive";
                value: {
                    kind:
                        | "bool"
                        | "char"
                        | "str"
                        | "u8"
                        | "u16"
                        | "u32"
                        | "u64"
                        | "u128"
                        | "u256"
                        | "i8"
                        | "i16"
                        | "i32"
                        | "i64"
                        | "i128"
                        | "i256";
                };
            }
            | {
                type: "Compact";
                value: {
                    typeParam: number;
                };
            }
            | {
                type: "BitSequence";
                value: {
                    bitOrderType: number;
                    bitStoreType: number;
                };
            };
    }

    • docs: string[]
    • id: number
    • params: {
          name: string;
          typeId: undefined | number;
      }[]
    • path: string[]
    • typeDef:
          | {
              type: "Struct";
              value: {
                  fields: Field[];
              };
          }
          | {
              type: "Enum";
              value: {
                  members: {
                      docs: string[];
                      fields: Field[];
                      index: number;
                      name: string;
                  }[];
              };
          }
          | {
              type: "Sequence";
              value: {
                  typeParam: number;
              };
          }
          | {
              type: "SizedVec";
              value: {
                  len: number;
                  typeParam: number;
              };
          }
          | {
              type: "Tuple";
              value: {
                  fields: number[];
              };
          }
          | {
              type: "Primitive";
              value: {
                  kind:
                      | "bool"
                      | "char"
                      | "str"
                      | "u8"
                      | "u16"
                      | "u32"
                      | "u64"
                      | "u128"
                      | "u256"
                      | "i8"
                      | "i16"
                      | "i32"
                      | "i64"
                      | "i128"
                      | "i256";
              };
          }
          | {
              type: "Compact";
              value: {
                  typeParam: number;
              };
          }
          | {
              type: "BitSequence";
              value: {
                  bitOrderType: number;
                  bitStoreType: number;
              };
          }