/pluto-encrypted

Contains an Atala Prism Wallet SDK Pluto implementation using Dexie and Dexie Encrypted.

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Pluto-encrypted

Pluto Encrypted is a secure storage wrapper for IndexDB and AtalaPrism (Pluto)

This package is compatible with Atala Prism Wallet SDK vile:atala-prism-wallet-sdk-3.1.0.tgz

Coverage

Statements Branches Functions Lines
Statements Branches Functions Lines

Documentation

SDK Reference

How to use

We currently provide 2 database storages, one IndexDB and one InMemory storage. In order to use this package, you must first install the database and pass a storage engine.

npm i @pluto-encrypted/database --save
npm i @pluto-encrypted/inmemory --save
# or npm i @pluto-encrypted/indexdb --save
# or npm i @pluto-encrypted/leveldb --save

InMemory

import InMemory from "@pluto-encrypted/inmemory";
import { Database } from "@pluto-encrypted/database";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
    {
        name: `my-db`,
        encryptionKey: defaultPassword,
        storage: InMemory,
    }
);

IndexDB

import IndexDB from "@pluto-encrypted/indexdb";
import { Database } from "@pluto-encrypted/database";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
    {
        name: `my-db`,
        encryptionKey: defaultPassword,
        storage: IndexDB,
    }
);

LevelDB

import { createLevelDBStorage } from "@pluto-encrypted/leveldb";
import { Database } from "@pluto-encrypted/database";
//default password must be 32 bytes long
const defaultPassword = new Uint8Array(32).fill(1);
const database = db = await Database.createEncrypted(
    {
        name: `my-db`,
        encryptionKey: defaultPassword,
        storage: createLevelDBStorage({ 
            dbName: "demo", path: "./demo" 
        }),
    }
);