UNPKG

@aeternity/aepp-sdk

Version:

SDK for the æternity blockchain

14 lines (13 loc) 991 B
import { Encoded } from '../../../utils/encoder.js'; /** * Map of prefix to ID tag constant * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type} * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102} * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168} */ export declare const idTagToEncoding: readonly [Encoded.Encoding.AccountAddress, Encoded.Encoding.Name, Encoded.Encoding.Commitment, Encoded.Encoding.OracleAddress, Encoded.Encoding.ContractAddress, Encoded.Encoding.Channel]; export type AddressEncodings = (typeof idTagToEncoding)[number]; export default function genAddressField<Encoding extends AddressEncodings>(...encodings: Encoding[]): { serialize: (value: Encoded.Generic<Encoding>) => Buffer; deserialize: (value: Buffer) => Encoded.Generic<Encoding>; };