UNPKG

@taquito/utils

Version:

converts michelson data and types into convenient JS/TS objects

120 lines (119 loc) 4.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prefixLength = exports.prefix = exports.Prefix = void 0; // ref https://gitlab.com/tezos/tezos/-/blob/master/src/lib_crypto/base58.ml var Prefix; (function (Prefix) { Prefix["TZ1"] = "tz1"; Prefix["TZ2"] = "tz2"; Prefix["TZ3"] = "tz3"; Prefix["TZ4"] = "tz4"; Prefix["KT"] = "KT"; Prefix["KT1"] = "KT1"; Prefix["EDSK"] = "edsk"; Prefix["EDSK2"] = "edsk2"; Prefix["SPSK"] = "spsk"; Prefix["P2SK"] = "p2sk"; Prefix["BLSK"] = "BLsk"; Prefix["EDPK"] = "edpk"; Prefix["SPPK"] = "sppk"; Prefix["P2PK"] = "p2pk"; Prefix["BLPK"] = "BLpk"; Prefix["EDESK"] = "edesk"; Prefix["SPESK"] = "spesk"; Prefix["P2ESK"] = "p2esk"; Prefix["BLESK"] = "BLesk"; Prefix["EDSIG"] = "edsig"; Prefix["SPSIG"] = "spsig"; Prefix["P2SIG"] = "p2sig"; Prefix["BLSIG"] = "BLsig"; Prefix["SIG"] = "sig"; Prefix["NET"] = "Net"; Prefix["NCE"] = "nce"; Prefix["B"] = "B"; Prefix["O"] = "o"; Prefix["LO"] = "Lo"; Prefix["LLO"] = "LLo"; Prefix["P"] = "P"; Prefix["CO"] = "Co"; Prefix["ID"] = "id"; Prefix["EXPR"] = "expr"; Prefix["TZ"] = "TZ"; Prefix["VH"] = "vh"; Prefix["SASK"] = "sask"; Prefix["ZET1"] = "zet1"; Prefix["SR1"] = "sr1"; Prefix["SRC1"] = "src1"; Prefix["SH"] = "sh"; })(Prefix || (exports.Prefix = Prefix = {})); exports.prefix = { [Prefix.TZ1]: new Uint8Array([6, 161, 159]), [Prefix.TZ2]: new Uint8Array([6, 161, 161]), [Prefix.TZ3]: new Uint8Array([6, 161, 164]), [Prefix.TZ4]: new Uint8Array([6, 161, 166]), [Prefix.KT]: new Uint8Array([2, 90, 121]), [Prefix.KT1]: new Uint8Array([2, 90, 121]), [Prefix.EDSK]: new Uint8Array([43, 246, 78, 7]), [Prefix.EDSK2]: new Uint8Array([13, 15, 58, 7]), [Prefix.SPSK]: new Uint8Array([17, 162, 224, 201]), [Prefix.P2SK]: new Uint8Array([16, 81, 238, 189]), [Prefix.BLSK]: new Uint8Array([3, 150, 192, 40]), [Prefix.EDPK]: new Uint8Array([13, 15, 37, 217]), [Prefix.SPPK]: new Uint8Array([3, 254, 226, 86]), [Prefix.P2PK]: new Uint8Array([3, 178, 139, 127]), [Prefix.BLPK]: new Uint8Array([6, 149, 135, 204]), [Prefix.EDESK]: new Uint8Array([7, 90, 60, 179, 41]), [Prefix.SPESK]: new Uint8Array([0x09, 0xed, 0xf1, 0xae, 0x96]), [Prefix.P2ESK]: new Uint8Array([0x09, 0x30, 0x39, 0x73, 0xab]), [Prefix.BLESK]: new Uint8Array([2, 5, 30, 53, 25]), [Prefix.EDSIG]: new Uint8Array([9, 245, 205, 134, 18]), [Prefix.SPSIG]: new Uint8Array([13, 115, 101, 19, 63]), [Prefix.P2SIG]: new Uint8Array([54, 240, 44, 52]), [Prefix.BLSIG]: new Uint8Array([40, 171, 64, 207]), [Prefix.SIG]: new Uint8Array([4, 130, 43]), [Prefix.NET]: new Uint8Array([87, 82, 0]), [Prefix.NCE]: new Uint8Array([69, 220, 169]), [Prefix.B]: new Uint8Array([1, 52]), [Prefix.O]: new Uint8Array([5, 116]), [Prefix.LO]: new Uint8Array([133, 233]), [Prefix.LLO]: new Uint8Array([29, 159, 109]), [Prefix.P]: new Uint8Array([2, 170]), [Prefix.CO]: new Uint8Array([79, 179]), [Prefix.ID]: new Uint8Array([153, 103]), [Prefix.EXPR]: new Uint8Array([13, 44, 64, 27]), // Legacy prefix [Prefix.TZ]: new Uint8Array([2, 90, 121]), [Prefix.VH]: new Uint8Array([1, 106, 242]), [Prefix.SASK]: new Uint8Array([11, 237, 20, 92]), [Prefix.ZET1]: new Uint8Array([18, 71, 40, 223]), [Prefix.SR1]: new Uint8Array([6, 124, 117]), [Prefix.SRC1]: new Uint8Array([17, 165, 134, 138]), [Prefix.SH]: new Uint8Array([2, 116, 180]), }; exports.prefixLength = { [Prefix.TZ1]: 20, [Prefix.TZ2]: 20, [Prefix.TZ3]: 20, [Prefix.TZ4]: 20, [Prefix.KT]: 20, [Prefix.KT1]: 20, [Prefix.EDPK]: 32, [Prefix.SPPK]: 33, [Prefix.P2PK]: 33, [Prefix.BLPK]: 48, [Prefix.EDSIG]: 64, [Prefix.SPSIG]: 64, [Prefix.P2SIG]: 64, [Prefix.BLSIG]: 96, [Prefix.SIG]: 64, [Prefix.NET]: 4, [Prefix.B]: 32, [Prefix.P]: 32, [Prefix.O]: 32, [Prefix.VH]: 32, [Prefix.SASK]: 169, [Prefix.ZET1]: 43, [Prefix.SR1]: 20, [Prefix.SRC1]: 32, [Prefix.SH]: 48, };