UNPKG

@zlattice/lattice-js

Version:

Lattice blockchain TypeScript SDK with dual module support (CJS + ESM)

132 lines 3.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PeekabooContract = void 0; const types_1 = require("./types.js"); class PeekabooContract { constructor() { this.iface = peekaboo.getLatticeInterface(); } async togglePayloadVisibility(hash, isVisible) { const method = isVisible ? "delPayload" : "addPayload"; // delPayload 删除隐藏记录, addPayload 添加隐藏记录 return await this.iface.encodeFunctionData(method, [hash]); } async toggleCodeVisibility(hash, isVisible) { const method = isVisible ? "delCode" : "addCode"; // delCode 删除隐藏记录, addCode 添加隐藏记录 return await this.iface.encodeFunctionData(method, [hash]); } async toggleHashVisibility(hash, isVisible) { const method = isVisible ? "delHash" : "addHash"; // delHash 删除隐藏记录, addHash 添加隐藏记录 return await this.iface.encodeFunctionData(method, [hash]); } } exports.PeekabooContract = PeekabooContract; /** * Peekaboo contract */ const peekaboo = new types_1.BuiltinContract("区块隐藏合约", "zltc_a8Nx2gcs2XHye7MKVWykdanumqDkWXqRH", `[ { "inputs": [ { "internalType": "bytes32", "name": "_hash", "type": "bytes32" } ], "name": "addCode", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "_hash", "type": "bytes32" } ], "name": "addHash", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "_hash", "type": "bytes32" } ], "name": "addPayload", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32[]", "name": "_hash", "type": "bytes32[]" } ], "name": "batchAddPayload", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32[]", "name": "_hash", "type": "bytes32[]" } ], "name": "batchDelPayload", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "_hash", "type": "bytes32" } ], "name": "delCode", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "_hash", "type": "bytes32" } ], "name": "delHash", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "_hash", "type": "bytes32" } ], "name": "delPayload", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ]`); //# sourceMappingURL=peekaboo.js.map