Get definition address

Generate address from a definition (or smart contract).

Example

const { getChash160 } = require('obyte/lib/utils');
const definition = ['and', [
["address", "TMWNLXR42CKIP4A774BQGNVBZAPHY7GH"],
["in data feed", [["BVVJ2K7ENPZZ3VYZFWQWK7ISPCATFIW3"], "timestamp", ">", 1525593731872]]
]];
const address = getChash160(definition);
console.log(address);

Returns

ETARZZW2G3R3KT4UZKMQUXMWKRZMY7RQ

Learn more