dbpunk-labs / db3.js Goto Github PK
View Code? Open in Web Editor NEWDB3 Network Javascript API
Home Page: https://dbpunk-labs.github.io/db3.js/
License: Apache License 2.0
DB3 Network Javascript API
Home Page: https://dbpunk-labs.github.io/db3.js/
License: Apache License 2.0
Implement IDBFactory and IDBRequest's onsuccess、onerror method
interface IDBFactoryOptions {
sign(target: Uint8Array): Promise<[Uint8Array, Uint8Array]>;
nonce(): number;
}
interface IDBFactory {
/**
* Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.
*
* Throws a "DataError" DOMException if either input is not a valid key.
*/
// cmp(first: any, second: any): number;
databases(): Promise<IDBDatabaseInfo[]>;
/** Attempts to delete the named database. If the database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request is successful request's result will be null. */
deleteDatabase(name: string): IDBOpenDBRequest;
/** Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection. */
open(name: string, options: IDBFactoryOptions, version?: number): IDBOpenDBRequest;
}
Test case
https://github.com/web-platform-tests/wpt/tree/master/IndexedDB
All idbfactory-*.html files in the repo
DB3 interface dependencies
dbpunk-labs/db3#233 aim at removing session_status
from db3 proto.
We need to update the related API and proto usage in db3.js
Hi,
I'm wondering if there is an example that uses a MetaMask wallet?
https://github.com/lxdao-official/fairsharing
yarn dev and visit the browser
const docs = await getDocs(collectionRef, and(where("name", "==", "Bill"), where("age", "==", 42)))
Right now the only way to use DB3 server side is through a wallet that reads a mnemonic. Mnemonics give access to all of the user's accounts which is not very good for security. In ethers for example, to initiate a wallet you only need a private key.
So I suggest having it as an option for a provider. It could be used somehow like this:
const DB3 = DB3EOAWallet(process.env.PK)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.