ss58_registry/
lib.rs

1// Copyright (C) 2021 Parity Technologies (UK) Ltd.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// 	http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15#![cfg_attr(not(feature = "std"), no_std)]
16#![warn(missing_docs)]
17#![deny(unsafe_code)]
18
19//! Enumerations of well-known SS58 account types and tokens used in the Polkadot ecosystem.
20use core::convert::TryFrom;
21mod address_format;
22mod error;
23mod registry;
24#[cfg(test)]
25mod tests;
26mod token;
27
28pub use address_format::{from_address_format, Ss58AddressFormat};
29pub use error::ParseError;
30pub use registry::{from_known_address_format, Ss58AddressFormatRegistry, TokenRegistry};
31pub use token::{Token, TokenAmount};
32
33#[cfg(feature = "std")]
34use registry::PREFIX_TO_INDEX;
35use registry::{ALL_SS58_ADDRESS_FORMATS, ALL_SS58_ADDRESS_FORMAT_NAMES};