Winding Tree Off Chain Data Adapter - In memory

Very simple in-memory key-value storage that can be used in
Winding Tree wt-js-libs.
Installation
npm install @windingtree/off-chain-adapter-in-memory
git clone https://github.com/windingtree/off-chain-adapter-in-memory
nvm install
npm install
Usage
import { WtJsLibs } from '@windingtree/wt-js-libs';
import InMemoryAdapter from '@windingtree/off-chain-adapter-in-memory';
const libs = WtJsLibs.createInstance({
onChainDataOptions: {
provider: 'http://localhost:8545',
},
offChainDataOptions: {
adapters: {
'in-memory': {
options: {
}
create: (options) => {
return new InMemoryAdapter(options);
},
},
},
},
});
const index = await libs.getWTIndex('hotels', '0x...');
const hotel = await index.getHotel('0x...');
const hotelDescriptionUrl = await (await hotel.dataIndex).ref;
const hotelDescription = await (await hotel.dataIndex).contents.description;
const hotelName = await hotelDescription.contents.name;