### Table of Contents - [constructor](#constructor) - [getSubTree](#getsubtree) - [get](#get) - [set](#set) - [delete](#delete) - [done](#done) - [flush](#flush) - [emptyTreeState](#emptytreestate) - [ArrayConstructor](#arrayconstructor) - [getMerkleLink](#getmerklelink) ## constructor [index.js:17-26](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L17-L26 "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. ## getSubTree [index.js:33-38](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L33-L38 "Source code on GitHub") creates a new instance of RadixTree that is the subTree of the given key **Parameters** - `key` **any** - `decode` Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** resolve to the new instance of RadixTree ## get [index.js:45-50](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L45-L50 "Source code on GitHub") gets a value given a key **Parameters** - `key` **any** - `decode` Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## set [index.js:113-116](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L113-L116 "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:161-164](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L161-L164 "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)** ## done [index.js:223-229](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L223-L229 "Source code on GitHub") returns a promise that resolve when the tree is done with all of its writes Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## flush [index.js:245-248](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L245-L248 "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:278-280](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L278-L280 "Source code on GitHub") returns the state of an empty tree ## ArrayConstructor [index.js:286-288](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L286-L288 "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:295-297](https://github.com/dfinity/js-dfinity-radix-tree/blob/f9661bdacce6cf38306dfab66da860f6e2e9c4be/index.js#L295-L297 "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)**