Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @taquito/michel-codec

Index

References

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

References

BytesLiteral

Re-exports BytesLiteral

Context

Re-exports Context

Contract

Re-exports Contract

ContractOptions

Re-exports ContractOptions

Expr

Re-exports Expr

FormatOptions

Re-exports FormatOptions

InstructionTrace

Re-exports InstructionTrace

IntLiteral

Re-exports IntLiteral

JSONParseError

Re-exports JSONParseError

List

Re-exports List

MacroError

Re-exports MacroError

MichelineParseError

Re-exports MichelineParseError

MichelsonCode

Re-exports MichelsonCode

MichelsonComparableType

Re-exports MichelsonComparableType

MichelsonContract

Re-exports MichelsonContract

MichelsonContractCode

Re-exports MichelsonContractCode

MichelsonContractParameter

Re-exports MichelsonContractParameter

MichelsonContractSection

Re-exports MichelsonContractSection

MichelsonContractStorage

Re-exports MichelsonContractStorage

MichelsonData

Re-exports MichelsonData

MichelsonDataId

Re-exports MichelsonDataId

MichelsonError

Re-exports MichelsonError

MichelsonInstruction

Re-exports MichelsonInstruction

MichelsonInstructionError

Re-exports MichelsonInstructionError

MichelsonMapElt

Re-exports MichelsonMapElt

MichelsonNoArgInstruction

Re-exports MichelsonNoArgInstruction

MichelsonPassableType

Re-exports MichelsonPassableType

MichelsonPushableType

Re-exports MichelsonPushableType

MichelsonSerializableType

Re-exports MichelsonSerializableType

MichelsonSimpleComparableType

Re-exports MichelsonSimpleComparableType

MichelsonStackType

Re-exports MichelsonStackType

MichelsonStorableType

Re-exports MichelsonStorableType

MichelsonType

Re-exports MichelsonType

MichelsonTypeAddress

Re-exports MichelsonTypeAddress

MichelsonTypeBigMap

Re-exports MichelsonTypeBigMap

MichelsonTypeBool

Re-exports MichelsonTypeBool

MichelsonTypeBytes

Re-exports MichelsonTypeBytes

MichelsonTypeChainID

Re-exports MichelsonTypeChainID

MichelsonTypeContract

Re-exports MichelsonTypeContract

MichelsonTypeError

Re-exports MichelsonTypeError

MichelsonTypeFailed

Re-exports MichelsonTypeFailed

MichelsonTypeInt

Re-exports MichelsonTypeInt

MichelsonTypeKey

Re-exports MichelsonTypeKey

MichelsonTypeKeyHash

Re-exports MichelsonTypeKeyHash

MichelsonTypeLambda

Re-exports MichelsonTypeLambda

MichelsonTypeList

Re-exports MichelsonTypeList

MichelsonTypeMap

Re-exports MichelsonTypeMap

MichelsonTypeMutez

Re-exports MichelsonTypeMutez

MichelsonTypeNat

Re-exports MichelsonTypeNat

MichelsonTypeOperation

Re-exports MichelsonTypeOperation

MichelsonTypeOption

Re-exports MichelsonTypeOption

MichelsonTypeOr

Re-exports MichelsonTypeOr

MichelsonTypePair

Re-exports MichelsonTypePair

MichelsonTypeSet

Re-exports MichelsonTypeSet

MichelsonTypeSignature

Re-exports MichelsonTypeSignature

MichelsonTypeString

Re-exports MichelsonTypeString

MichelsonTypeTimestamp

Re-exports MichelsonTypeTimestamp

MichelsonTypeUnit

Re-exports MichelsonTypeUnit

MichelsonValidationError

Re-exports MichelsonValidationError

Node

Re-exports Node

Parser

Re-exports Parser

ParserOptions

Re-exports ParserOptions

Prim

Re-exports Prim

SourceReference

Re-exports SourceReference

StringLiteral

Re-exports StringLiteral

assertContractValid

Re-exports assertContractValid

assertDataValid

Re-exports assertDataValid

assertMichelsonComparableType

Re-exports assertMichelsonComparableType

assertMichelsonContract

Re-exports assertMichelsonContract

assertMichelsonData

Re-exports assertMichelsonData

assertMichelsonInstruction

Re-exports assertMichelsonInstruction

assertMichelsonPassableType

Re-exports assertMichelsonPassableType

assertMichelsonPushableType

Re-exports assertMichelsonPushableType

assertMichelsonSerializableType

Re-exports assertMichelsonSerializableType

assertMichelsonStorableType

Re-exports assertMichelsonStorableType

assertMichelsonType

Re-exports assertMichelsonType

assertTypeAnnotationsValid

Re-exports assertTypeAnnotationsValid

assertTypesEqual

Re-exports assertTypesEqual

contractEntryPoint

Re-exports contractEntryPoint

contractEntryPoints

Re-exports contractEntryPoints

contractSection

Re-exports contractSection

dummyContract

Re-exports dummyContract

emitMicheline

Re-exports emitMicheline

formatError

Re-exports formatError

formatStack

Re-exports formatStack

functionType

Re-exports functionType

instructionIDs

Re-exports instructionIDs

isContractValid

Re-exports isContractValid

isDataValid

Re-exports isDataValid

isMichelsonCode

Re-exports isMichelsonCode

isMichelsonData

Re-exports isMichelsonData

isMichelsonError

Re-exports isMichelsonError

isMichelsonScript

Re-exports isMichelsonScript

isMichelsonType

Re-exports isMichelsonType

isTypeAnnotationsValid

Re-exports isTypeAnnotationsValid

isTypeEqual

Re-exports isTypeEqual

sourceReference

Re-exports sourceReference

traceDumpFunc

Re-exports traceDumpFunc

Type aliases

Expr

Expr: Prim | StringLiteral | IntLiteral | BytesLiteral | ExprList

An AST node representing valid Michelson expression. Directly corresponds to JSON-encoded Michelson node

List

List<T>: T[] & Node

Type parameters

MichelsonCode

MichelsonCode: InstructionList | MichelsonInstruction

MichelsonComparableType

MichelsonContract

MichelsonContractCode

MichelsonContractCode: SectionPrim<"code", [List<MichelsonCode>]>

MichelsonContractParameter

MichelsonContractParameter: SectionPrim<"parameter", [MichelsonPassableType]>

MichelsonContractSection

MichelsonContractSection<T>: T extends "parameter" ? MichelsonContractParameter : T extends "storage" ? MichelsonContractStorage : MichelsonContractCode

Type parameters

  • T: MichelsonSectionId

MichelsonContractStorage

MichelsonContractStorage: SectionPrim<"storage", [MichelsonStorableType]>

MichelsonData

MichelsonData<T>: T extends MichelsonTypeInt | MichelsonTypeNat | MichelsonTypeMutez ? IntLiteral : T extends MichelsonTypeString | MichelsonTypeKeyHash | MichelsonTypeAddress | MichelsonTypeKey | MichelsonTypeSignature ? StringLiteral : T extends MichelsonTypeBytes | MichelsonTypeChainID ? BytesLiteral : T extends MichelsonTypeTimestamp ? IntLiteral | StringLiteral : T extends MichelsonTypeUnit ? Data0<"Unit"> : T extends MichelsonTypeBool ? Data0<"True" | "False"> : T extends MichelsonTypeOption<infer A> ? Data0<"None"> | DataX<"Some", [MichelsonData<A>]> : T extends MichelsonTypeList<infer A> ? DataList<A> : T extends MichelsonTypePair<infer A1, infer A2> ? DataX<"Pair", [MichelsonData<A1>, MichelsonData<A2>]> : T extends MichelsonTypeOr<infer A1, infer A2> ? DataX<"Left", [MichelsonData<A1>]> | DataX<"Right", [MichelsonData<A2>]> : T extends MichelsonTypeLambda ? MichelsonCode : T extends MichelsonTypeSet<infer A> ? DataList<A> : T extends MichelsonTypeMap<infer A1, infer A2> ? EltList<A1, A2> : T extends MichelsonTypeBigMap<infer A1, infer A2> ? EltList<A1, A2> : never

Type parameters

MichelsonDataId

MichelsonDataId: "Unit" | "True" | "False" | "None" | "Pair" | "Left" | "Right" | "Some"

MichelsonInstruction

MichelsonInstruction: MichelsonNoArgInstruction | InstrX<"DIG" | "DUG", [IntLiteral]> | InstrX<"NONE" | "LEFT" | "RIGHT" | "NIL" | "CAST", [MichelsonType]> | InstrX<"IF_NONE" | "IF_LEFT" | "IF_CONS" | "IF", [MichelsonCode, MichelsonCode]> | InstrX<"MAP" | "ITER" | "LOOP" | "LOOP_LEFT" | "DIP", [MichelsonCode]> | InstrX<"UNPACK", [MichelsonSerializableType]> | InstrX<"CONTRACT", [MichelsonPassableType]> | InstrX<"CREATE_CONTRACT", [MichelsonContract]> | InstrX<"PUSH", [MichelsonPushableType, MichelsonData]> | InstrX<"EMPTY_SET", [MichelsonComparableType]> | InstrX<"EMPTY_MAP", [MichelsonComparableType, MichelsonType]> | InstrX<"EMPTY_BIG_MAP", [MichelsonComparableType, MichelsonSerializableType]> | InstrX<"LAMBDA", [MichelsonType, MichelsonType, MichelsonCode]> | InstrX<"DIP", [IntLiteral, MichelsonCode] | [MichelsonCode]> | InstrPrim<"DROP", [IntLiteral]>

MichelsonMapElt

MichelsonMapElt<T1, T2>: ReqArgs<Prim<"Elt", [T1, T2]>>

Type parameters

MichelsonNoArgInstruction

MichelsonNoArgInstruction: Instr0<MichelsonNoArgInstructionID>

MichelsonPassableType

MichelsonPushableType

MichelsonSerializableType

MichelsonSimpleComparableType

MichelsonStackType

MichelsonStackType: MichelsonType[] | MichelsonTypeFailed

MichelsonStorableType

MichelsonType

MichelsonType<T>: T extends "int" ? MichelsonTypeInt : T extends "nat" ? MichelsonTypeNat : T extends "string" ? MichelsonTypeString : T extends "bytes" ? MichelsonTypeBytes : T extends "mutez" ? MichelsonTypeMutez : T extends "bool" ? MichelsonTypeBool : T extends "key_hash" ? MichelsonTypeKeyHash : T extends "timestamp" ? MichelsonTypeTimestamp : T extends "address" ? MichelsonTypeAddress : T extends "key" ? MichelsonTypeKey : T extends "unit" ? MichelsonTypeUnit : T extends "signature" ? MichelsonTypeSignature : T extends "operation" ? MichelsonTypeOperation : T extends "chain_id" ? MichelsonTypeChainID : T extends "option" ? MichelsonTypeOption : T extends "list" ? MichelsonTypeList : T extends "contract" ? MichelsonTypeContract : T extends "pair" ? MichelsonTypePair : T extends "or" ? MichelsonTypeOr : T extends "lambda" ? MichelsonTypeLambda : T extends "set" ? MichelsonTypeSet : T extends "map" ? MichelsonTypeMap : MichelsonTypeBigMap

Type parameters

  • T: MichelsonTypeID = MichelsonTypeID

MichelsonTypeAddress

MichelsonTypeAddress: Type0<"address">

MichelsonTypeBool

MichelsonTypeBool: Type0<"bool">

MichelsonTypeBytes

MichelsonTypeBytes: Type0<"bytes">

MichelsonTypeChainID

MichelsonTypeChainID: Type0<"chain_id">

MichelsonTypeInt

MichelsonTypeInt: Type0<"int">

MichelsonTypeKey

MichelsonTypeKey: Type0<"key">

MichelsonTypeKeyHash

MichelsonTypeKeyHash: Type0<"key_hash">

MichelsonTypeMutez

MichelsonTypeMutez: Type0<"mutez">

MichelsonTypeNat

MichelsonTypeNat: Type0<"nat">

MichelsonTypeOperation

MichelsonTypeOperation: Type0<"operation">

MichelsonTypeSignature

MichelsonTypeSignature: Type0<"signature">

MichelsonTypeString

MichelsonTypeString: Type0<"string">

MichelsonTypeTimestamp

MichelsonTypeTimestamp: Type0<"timestamp">

MichelsonTypeUnit

MichelsonTypeUnit: Type0<"unit">

NoAnnots

NoAnnots<T>: OmitProp<T, "annots">

Type parameters

NoArgs

NoArgs<T>: OmitProp<T, "args">

Type parameters

Nullable

Nullable<T>: {}

Type parameters

  • T

Type declaration

ReqArgs

ReqArgs<T>: RequiredProp<T, "args">

Type parameters

SourceReference

SourceReference: { first: number; last: number; macro?: Expr }

Type declaration

  • first: number
  • last: number
  • Optional macro?: Expr

TezosIDPrefix

TezosIDPrefix: [number, number[]]

TezosIDType

TezosIDType: "BlockHash" | "OperationHash" | "OperationListHash" | "OperationListListHash" | "ProtocolHash" | "ContextHash" | "ED25519PublicKeyHash" | "SECP256K1PublicKeyHash" | "P256PublicKeyHash" | "ContractHash" | "CryptoboxPublicKeyHash" | "ED25519Seed" | "ED25519PublicKey" | "SECP256K1SecretKey" | "P256SecretKey" | "ED25519EncryptedSeed" | "SECP256K1EncryptedSecretKey" | "P256EncryptedSecretKey" | "SECP256K1PublicKey" | "P256PublicKey" | "SECP256K1Scalar" | "SECP256K1Element" | "ED25519SecretKey" | "ED25519Signature" | "SECP256K1Signature" | "P256Signature" | "GenericSignature" | "ChainID"

TokenType

TokenType: "(" | ")" | "{" | "}" | ";" | Literal

Tuple

Tuple<N, T>: N extends 1 ? [T] : N extends 2 ? [T, T] : N extends 3 ? [T, T, T] : N extends 4 ? [T, T, T, T] : never

Type parameters

  • N: number

  • T

Variables

Const dummyContract

dummyContract: Contract = new Contract([{ prim: "parameter", args: [{ prim: "unit" }] },{ prim: "storage", args: [{ prim: "unit" }] },{prim: "code", args: [[{ prim: "CAR" },{ prim: "NIL", args: [{ prim: "operation" }] },{ prim: "PAIR" },]]},])

Const instructionIDs

instructionIDs: Record<MichelsonInstruction["prim"], true> = Object.assign({}, noArgInstructionIDs, {"DROP": true, "DIG": true, "DUG": true, "NONE": true, "LEFT": true, "RIGHT": true, "NIL": true, "UNPACK": true, "CONTRACT": true, "CAST": true,"IF_NONE": true, "IF_LEFT": true, "IF_CONS": true, "IF": true, "MAP": true, "ITER": true, "LOOP": true, "LOOP_LEFT": true, "DIP": true,"CREATE_CONTRACT": true, "PUSH": true, "EMPTY_SET": true, "EMPTY_MAP": true, "EMPTY_BIG_MAP": true, "LAMBDA": true,} as const)

Const sourceReference

sourceReference: unique symbol = Symbol("source_reference")

Functions

assertContractValid

assertDataValid

assertMichelsonComparableType

  • assertMichelsonComparableType(ex: Expr): ex is MichelsonComparableType

assertMichelsonContract

  • assertMichelsonContract(ex: Expr): ex is MichelsonContract
  • Checks if the node is a valid Michelson smart contract source containing all required and valid properties such as parameter, storage and code. This is a type guard function which either returns true of throws an exception.

    Parameters

    • ex: Expr

      An AST node

    Returns ex is MichelsonContract

assertMichelsonData

  • assertMichelsonData(ex: Expr): ex is MichelsonData

assertMichelsonInstruction

  • assertMichelsonInstruction(ex: Expr): ex is MichelsonCode

assertMichelsonPassableType

  • assertMichelsonPassableType(ex: Expr): ex is MichelsonPassableType

assertMichelsonPushableType

  • assertMichelsonPushableType(ex: Expr): ex is MichelsonPushableType

assertMichelsonSerializableType

  • assertMichelsonSerializableType(ex: Expr): ex is MichelsonSerializableType

assertMichelsonStorableType

  • assertMichelsonStorableType(ex: Expr): ex is MichelsonStorableType

assertMichelsonType

  • assertMichelsonType(ex: Expr): ex is MichelsonType

assertTypeAnnotationsValid

  • assertTypeAnnotationsValid(t: MichelsonType, field?: boolean): void

assertTypesEqual

  • assertTypesEqual<T1, T2>(a: T1, b: T2, field?: boolean): void

checkTezosID

compareBytes

  • compareBytes(a: number[] | Uint8Array, b: number[] | Uint8Array): number

contractEntryPoint

contractEntryPoints

contractSection

decodeBase58

  • decodeBase58(src: string): number[]

decodeBase58Check

  • decodeBase58Check(src: string): number[]

emitMicheline

expandMacros

formatError

formatStack

functionType

isContractValid

isDataValid

isDecimal

  • isDecimal(x: string): boolean

isMichelsonCode

  • isMichelsonCode(ex: Expr): ex is MichelsonCode[]

isMichelsonData

  • isMichelsonData(ex: Expr): ex is MichelsonData

isMichelsonError

  • isMichelsonError<T>(err: any): err is MichelsonError<T>

isMichelsonScript

  • isMichelsonScript(ex: Expr): ex is MichelsonContract

isMichelsonType

  • isMichelsonType(ex: Expr): ex is MichelsonType

isNatural

  • isNatural(x: string): boolean

isTypeAnnotationsValid

  • isTypeAnnotationsValid(t: MichelsonType, field?: boolean): boolean

isTypeEqual

  • isTypeEqual<T1, T2>(a: T1, b: T2, field?: boolean): boolean

parseBytes

  • parseBytes(s: string): number[] | null

scan

  • scan(src: string, scanComments?: boolean): Generator<Token, void>

traceDumpFunc

  • traceDumpFunc(blocks: boolean, cb: (s: string) => void): (v: InstructionTrace) => void

unpackAnnotations

Object literals

Const tezosPrefix

tezosPrefix: object

BlockHash

BlockHash: [number, number[]] = [32, [1, 52]]

ChainID

ChainID: [number, number[]] = [4, [87, 82, 0]]

ContextHash

ContextHash: [number, number[]] = [32, [79, 199]]

ContractHash

ContractHash: [number, number[]] = [20, [2, 90, 121]]

CryptoboxPublicKeyHash

CryptoboxPublicKeyHash: [number, number[]] = [16, [153, 103]]

ED25519EncryptedSeed

ED25519EncryptedSeed: [number, number[]] = [56, [7, 90, 60, 179, 41]]

ED25519PublicKey

ED25519PublicKey: [number, number[]] = [32, [13, 15, 37, 217]]

ED25519PublicKeyHash

ED25519PublicKeyHash: [number, number[]] = [20, [6, 161, 159]]

ED25519SecretKey

ED25519SecretKey: [number, number[]] = [64, [43, 246, 78, 7]]

ED25519Seed

ED25519Seed: [number, number[]] = [32, [13, 15, 58, 7]]

ED25519Signature

ED25519Signature: [number, number[]] = [64, [9, 245, 205, 134, 18]]

GenericSignature

GenericSignature: [number, number[]] = [64, [4, 130, 43]]

OperationHash

OperationHash: [number, number[]] = [32, [5, 116]]

OperationListHash

OperationListHash: [number, number[]] = [32, [133, 233]]

OperationListListHash

OperationListListHash: [number, number[]] = [32, [29, 159, 109]]

P256EncryptedSecretKey

P256EncryptedSecretKey: [number, number[]] = [56, [9, 48, 57, 115, 171]]

P256PublicKey

P256PublicKey: [number, number[]] = [33, [3, 178, 139, 127]]

P256PublicKeyHash

P256PublicKeyHash: [number, number[]] = [20, [6, 161, 164]]

P256SecretKey

P256SecretKey: [number, number[]] = [32, [16, 81, 238, 189]]

P256Signature

P256Signature: [number, number[]] = [64, [54, 240, 44, 52]]

ProtocolHash

ProtocolHash: [number, number[]] = [32, [2, 170]]

SECP256K1Element

SECP256K1Element: [number, number[]] = [33, [5, 92, 0]]

SECP256K1EncryptedSecretKey

SECP256K1EncryptedSecretKey: [number, number[]] = [56, [9, 237, 241, 174, 150]]

SECP256K1PublicKey

SECP256K1PublicKey: [number, number[]] = [33, [3, 254, 226, 86]]

SECP256K1PublicKeyHash

SECP256K1PublicKeyHash: [number, number[]] = [20, [6, 161, 161]]

SECP256K1Scalar

SECP256K1Scalar: [number, number[]] = [33, [38, 248, 136]]

SECP256K1SecretKey

SECP256K1SecretKey: [number, number[]] = [32, [17, 162, 224, 201]]

SECP256K1Signature

SECP256K1Signature: [number, number[]] = [64, [13, 115, 101, 19, 63]]

Generated using TypeDoc