@zlattice/lattice-js
Version:
Lattice blockchain TypeScript SDK with dual module support (CJS + ESM)
73 lines • 2.78 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.VotingRules = exports.ContractLifecyclePeriods = exports.ProposalStates = exports.ProposalTypes = exports.Curves = exports.TransactionTypeCodeRecord = exports.TransactionTypes = exports.ZERO_ADDRESS = exports.ZERO_HASH = exports.SM2P256V1_SIGNATURE_LENGTH = exports.SM2P256V1_SIGNATURE_REMARK = exports.HEX_PREFIX = exports.ADDRESS_BYTES_LENGTH = exports.ADDRESS_VERSION = exports.ADDRESS_TITLE = void 0;
// The prefix of zltc address
exports.ADDRESS_TITLE = "zltc";
// The version of zltc address
exports.ADDRESS_VERSION = 1;
// The length of the address bytes
exports.ADDRESS_BYTES_LENGTH = 20;
// The prefix of hex string
exports.HEX_PREFIX = "0x";
// The remark of sm2p256v1 signature, hex string
exports.SM2P256V1_SIGNATURE_REMARK = "01";
// The length of the sm2p256v1 signature
exports.SM2P256V1_SIGNATURE_LENGTH = 97;
// The zero hash
exports.ZERO_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000";
// The zero address
exports.ZERO_ADDRESS = "zltc_QLbz7JHiBTspS962RLKV8GndWFwjA5K66";
// The types of the transaction
exports.TransactionTypes = {
Genesis: "genesis", // 创世纪交易
Create: "create", // 创建交易
Send: "send", // 发送交易
Receive: "receive", // 接收交易
DeployContract: "contract", // 部署合约交易
CallContract: "execute", // 调用合约交易
UpgradeContract: "update" // 升级合约交易
};
exports.TransactionTypeCodeRecord = {
[exports.TransactionTypes.Genesis]: 0,
[exports.TransactionTypes.Create]: 1,
[exports.TransactionTypes.Send]: 2,
[exports.TransactionTypes.Receive]: 3,
[exports.TransactionTypes.DeployContract]: 4,
[exports.TransactionTypes.CallContract]: 5,
[exports.TransactionTypes.UpgradeContract]: 6
};
// The curve of the key pair
exports.Curves = {
Secp256k1: "Secp256k1",
Sm2p256v1: "Sm2p256v1"
};
exports.ProposalTypes = {
None: 0,
ContractInnerManagement: 1, // 合约内部管理
ContractLifecycle: 2, // 合约生命周期
ModifyChainConfiguration: 3, // 修改链配置
ChainByChain: 4 // 以链建链
};
exports.ProposalStates = {
None: 0,
Initiated: 1, // 提案正在进行投票
Succeeded: 2, // 提案投票通过
Failed: 3, // 提案投票未通过
Expired: 4, // 提案投票已过期
Error: 5, // 提案执行错误
Cancelled: 6, // 提案已取消
NotStarted: 7 // 提案未开始
};
exports.ContractLifecyclePeriods = {
Deploy: 0,
Upgrade: 1,
Revoke: 2,
Freeze: 3,
Unfreeze: 4
};
exports.VotingRules = {
None: 0, // 不需要投票
Dictatorship: 1, // 盟主一票制
Consensus: 2 // 共识投票
};
//# sourceMappingURL=constants.js.map