Methods
getLibp2pInject(wrtcopt) → {Object}
helper to get any additional parameters to pass to libp2p
this is usually used for setting the WebRTC-Star transport
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
wrtc |
Object |
<optional> |
WebRTC implementation confirming to the interface at https://github.com/substack/get-browser-rtc/ |
Returns:
- Type
- Object
mapDates()
Map a bill's time into JS Date instance
Helper function, so that it can be optimized
- Source:
runAndCatchAllErrors()
utility to catch all errors -- throws and promise rejections
Type Definitions
Bill
A bill
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
amount |
number | Amount, in decimals (e.g. HK$100.23 is 10023) | |
currency |
string | ISO 4217 currency code (e.g. CNY for Renmibi) | |
time |
Date | The time | |
name |
string | user who paid (e.g. Isaac) | |
comment |
string |
<nullable> |
optional comment -- downstream applications please handle this carefully |
_id |
string | unique ID for the bill |
- Source:
CloudyOptions
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
ipfsOrOptions |
IPFS | Object |
<optional> |
ready-ed IPFS instance OR an object which will be passed to the IPFS constructor |
orbitDbOptions |
Object |
<optional> |
options to pass to OrbitDB constructor |
orbitDbStorage |
string |
<optional> |
directory for OrbitDB |
ipfsStorage |
string |
<optional> |
directory for IPFS |
namespace |
string |
<optional> <nullable> |
database address for syncing devices. falsy for new Cloudy database |
deviceId |
string |
<optional> |
unique device ID -- should be SAME each time user invokes the app |
storeDefaults |
Object |
<optional> |
default options for stores |
wrtc |
Object |
<optional> |
WebRTC implementation following the interface at https://github.com/substack/get-browser-rtc/blob/master/index.js |
Document
Type:
- *
DocumentStore
Cloudy Docstore Interface
See https://github.com/orbitdb/orbit-db-docstore
Type:
- *
IPFS
Type:
- *
OrbitDB
OrbitDB class https://github.com/orbitdb/orbit-db
Type:
- *
Properties:
Name | Type | Description |
---|---|---|
events |
EventEmitter | events: replicated, replicate, replicate.progress, load, load.progress, ready, write |
OrbitDBAddress
Type:
- *
- Source: