### Table of Contents - [constructor](#constructor) - [get](#get) - [set](#set) - [delete](#delete) - [flush](#flush) - [emptyTreeState](#emptytreestate) - [ArrayConstructor](#arrayconstructor) - [getMerkleLink](#getmerklelink) ## constructor [index.js:17-24](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L17-L24 "Source code on GitHub") **Parameters** - `opts` - `opts.root` {object} a merkle root to a radix tree. If none, RadixTree will create an new root. - `opts.db` {object} a level db instance alternitly `opts.graph` can be used - `opts.graph` {object} an instance of [ipld-graph-builder](https://github.com/ipld/js-ipld-graph-builder) alternitvly `opts.dag` can be used - `opts.dag` {object} an instance if [ipfs.dag](https://github.com/ipfs/js-ipfs#dag). If there is no `opts.graph` this will be used to create a new graph instance. ## get [index.js:111-115](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L111-L115 "Source code on GitHub") gets a value given a key **Parameters** - `key` **any** Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## set [index.js:122-158](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L122-L158 "Source code on GitHub") stores a value at a given key **Parameters** - `key` **any** - `value` Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## delete [index.js:165-217](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L165-L217 "Source code on GitHub") deletes a value at a given key **Parameters** - `key` **any** Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## flush [index.js:223-225](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L223-L225 "Source code on GitHub") creates a merkle root for the current tree and stores the data perstantly Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## emptyTreeState [index.js:29-31](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L29-L31 "Source code on GitHub") returns the state of an empty tree ## ArrayConstructor [index.js:37-39](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L37-L39 "Source code on GitHub") returns an Uint1Array constructir which is used to repersent keys Returns **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## getMerkleLink [index.js:46-48](https://github.com/dfinity/js-dfinity-radix-tree/blob/878e413eb6f1500a2c9f5c2fbe58014339f7652b/index.js#L46-L48 "Source code on GitHub") returns a merkle link for some given data **Parameters** - `data` **[Buffer](https://nodejs.org/api/buffer.html)** the data which you would like to hash Returns **[Buffer](https://nodejs.org/api/buffer.html)**