Get definition address
Generate address from a definition (or smart contract).

Example

1
const { getChash160 } = require('obyte/lib/utils');
2
3
const definition = ['and', [
4
["address", "TMWNLXR42CKIP4A774BQGNVBZAPHY7GH"],
5
["in data feed", [["BVVJ2K7ENPZZ3VYZFWQWK7ISPCATFIW3"], "timestamp", ">", 1525593731872]]
6
]];
7
8
const address = getChash160(definition);
9
console.log(address);
Copied!

Returns

1
ETARZZW2G3R3KT4UZKMQUXMWKRZMY7RQ
Copied!

Learn more

Last modified 2yr ago
Copy link