### Table of Contents - [constructor](#constructor) - [get](#get) - [set](#set) - [delete](#delete) - [flush](#flush) - [ArrayConstructor](#arrayconstructor) - [toTypedArray](#totypedarray) ## constructor [index.js:20-23](https://github.com/wanderer/merkle-radix-tree/blob/c05ecac437698d9d42b13f01e4931e3d7469affe/index.js#L20-L23 "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.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:112-116](https://github.com/wanderer/merkle-radix-tree/blob/c05ecac437698d9d42b13f01e4931e3d7469affe/index.js#L112-L116 "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:123-166](https://github.com/wanderer/merkle-radix-tree/blob/c05ecac437698d9d42b13f01e4931e3d7469affe/index.js#L123-L166 "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:173-224](https://github.com/wanderer/merkle-radix-tree/blob/c05ecac437698d9d42b13f01e4931e3d7469affe/index.js#L173-L224 "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:230-232](https://github.com/wanderer/merkle-radix-tree/blob/c05ecac437698d9d42b13f01e4931e3d7469affe/index.js#L230-L232 "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)** ## ArrayConstructor [index.js:29-31](https://github.com/wanderer/merkle-radix-tree/blob/c05ecac437698d9d42b13f01e4931e3d7469affe/index.js#L29-L31 "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)** ## toTypedArray [index.js:38-40](https://github.com/wanderer/merkle-radix-tree/blob/c05ecac437698d9d42b13f01e4931e3d7469affe/index.js#L38-L40 "Source code on GitHub") converts a TypedArray or Buffer to an Uint1Array **Parameters** - `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the array to convert Returns **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**