UNPKG

@metamask/keyring-api

Version:
44 lines 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TrxEoaAccountStruct = exports.TrxMethod = exports.TrxAddressStruct = void 0; const keyring_utils_1 = require("@metamask/keyring-utils"); const superstruct_1 = require("@metamask/superstruct"); const utils_1 = require("@metamask/utils"); const api_1 = require("../api/index.cjs"); /** * TRON addresses are Base58-encoded strings that are exactly 34 characters long * and start with the letter 'T'. */ exports.TrxAddressStruct = (0, utils_1.definePattern)('TrxAddress', /^T[1-9A-HJ-NP-Za-km-z]{33}$/iu); /** * Supported TRON methods. */ var TrxMethod; (function (TrxMethod) { TrxMethod["SignMessage"] = "signMessage"; TrxMethod["SignTransaction"] = "signTransaction"; // @deprecated Use `SignMessage` instead. TrxMethod["SignMessageV2"] = "signMessageV2"; // @deprecated Not supported anymore. TrxMethod["VerifyMessageV2"] = "verifyMessageV2"; })(TrxMethod || (exports.TrxMethod = TrxMethod = {})); exports.TrxEoaAccountStruct = (0, keyring_utils_1.object)({ ...api_1.KeyringAccountStruct.schema, /** * Account address. */ address: exports.TrxAddressStruct, /** * Account type. */ type: (0, superstruct_1.literal)(`${api_1.TrxAccountType.Eoa}`), /** * Account supported scopes (CAIP-2 chain IDs). */ scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)(api_1.CaipChainIdStruct)), /** * Account supported methods. */ methods: (0, superstruct_1.array)((0, superstruct_1.enums)(Object.values(TrxMethod))), }); //# sourceMappingURL=types.cjs.map